MCPcopy Create free account
hub / github.com/PyImageSearch/imutils / __init__

Method __init__

imutils/video/pivideostream.py:8–28  ·  view source on GitHub ↗
(self, resolution=(320, 240), framerate=32, **kwargs)

Source from the content-addressed store, hash-verified

6
7class 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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected