Release webcamera stream#81
Release webcamera stream#81leonidwang wants to merge 2 commits intoPyImageSearch:masterfrom leonidwang:master
Conversation
|
Releasing the https://www.pyimagesearch.com/2018/08/13/opencv-people-counter/ |
|
Nice example on people counter! :) However, I still think WebcamVideoStream shall release camera. See the snippet below, we shall eliminate manual reference and release of vs.stream, right? In [1]: from imutils.video import WebcamVideoStream
In [2]: vs = WebcamVideoStream(src=0)
...: vs.start()
...:
...:
Out[2]: <imutils.video.webcamvideostream.WebcamVideoStream at 0x1c42477d470>
In [3]: cap = vs.stream
In [4]: vs.stop()
In [5]: cap.isOpened()
Out[5]: True
In [6]: cap.release()
In [7]: cap.isOpened()
Out[7]: False |
|
I agree that having |
Merge from upstream
Abik1111
left a comment
There was a problem hiding this comment.
Well, this technique worked for me, the previous vs.stop() didn't work!!
WebcamVideoStream initialized stream from cv2.VideoCapture but didn't release it in stop().