(self, src=0, name="WebcamVideoStream")
| 4 | |
| 5 | class WebcamVideoStream: |
| 6 | def __init__(self, src=0, name="WebcamVideoStream"): |
| 7 | # initialize the video camera stream and read the first frame |
| 8 | # from the stream |
| 9 | self.stream = cv2.VideoCapture(src) |
| 10 | (self.grabbed, self.frame) = self.stream.read() |
| 11 | |
| 12 | # initialize the thread name |
| 13 | self.name = name |
| 14 | |
| 15 | # initialize the variable used to indicate if the thread should |
| 16 | # be stopped |
| 17 | self.stopped = False |
| 18 | |
| 19 | def start(self): |
| 20 | # start the thread to read frames from the video stream |