(self, resolution=(320, 240), framerate=32, **kwargs)
| 6 | |
| 7 | class PiVideoStream: |
| 8 | def __init__(self, resolution=(320, 240), framerate=32, **kwargs): |
| 9 | # initialize the camera |
| 10 | self.camera = PiCamera() |
| 11 | |
| 12 | # set camera parameters |
| 13 | self.camera.resolution = resolution |
| 14 | self.camera.framerate = framerate |
| 15 | |
| 16 | # set optional camera parameters (refer to PiCamera docs) |
| 17 | for (arg, value) in kwargs.items(): |
| 18 | setattr(self.camera, arg, value) |
| 19 | |
| 20 | # initialize the stream |
| 21 | self.rawCapture = PiRGBArray(self.camera, size=resolution) |
| 22 | self.stream = self.camera.capture_continuous(self.rawCapture, |
| 23 | format="bgr", use_video_port=True) |
| 24 | |
| 25 | # initialize the frame and the variable used to indicate |
| 26 | # if the thread should be stopped |
| 27 | self.frame = None |
| 28 | self.stopped = False |
| 29 | |
| 30 | def start(self): |
| 31 | # start the thread to read frames from the video stream |
nothing calls this directly
no outgoing calls
no test coverage detected