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

Method __init__

imutils/video/videostream.py:5–23  ·  view source on GitHub ↗
(self, src=0, usePiCamera=False, resolution=(320, 240),
		framerate=32, **kwargs)

Source from the content-addressed store, hash-verified

3
4class VideoStream:
5 def __init__(self, src=0, usePiCamera=False, resolution=(320, 240),
6 framerate=32, **kwargs):
7 # check to see if the picamera module should be used
8 if usePiCamera:
9 # only import the picamera packages unless we are
10 # explicity told to do so -- this helps remove the
11 # requirement of `picamera[array]` from desktops or
12 # laptops that still want to use the `imutils` package
13 from .pivideostream import PiVideoStream
14
15 # initialize the picamera stream and allow the camera
16 # sensor to warmup
17 self.stream = PiVideoStream(resolution=resolution,
18 framerate=framerate, **kwargs)
19
20 # otherwise, we are using OpenCV so initialize the webcam
21 # stream
22 else:
23 self.stream = WebcamVideoStream(src=src)
24
25 def start(self):
26 # start the threaded video stream

Callers

nothing calls this directly

Calls 2

PiVideoStreamClass · 0.85
WebcamVideoStreamClass · 0.85

Tested by

no test coverage detected