Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can i release the camera<imutils.video.webcamvideostream.WebcamVideoStream instance at 0x7f2c40e75b00>

i use this code to start the camera

from imutils.video import Videostream
vs = VideoStream(0).start()

but when i try this

vs.stop()

the camera doesn't stop and the variable vs show this value :

<imutils.video.webcamvideostream.WebcamVideoStream instance at 0x7f2c40e75b00>
like image 665
Kanzt Avatar asked Jan 02 '23 20:01

Kanzt


1 Answers

imutils actually uses cv2.VideoCapture() to initialize stream, but didn't release it in stop.

vs.stream.release() shall work.

I've created pull request in imutils github repo :) https://github.com/jrosebr1/imutils/pull/81/files

like image 165
wang yi Avatar answered Jan 05 '23 16:01

wang yi