From aeff09e0bcd5e44455497eea0e317f3c788c746f Mon Sep 17 00:00:00 2001 From: Sanjeev Kumar Bharadwaj <34452724+Quanta-of-solitude@users.noreply.github.com> Date: Fri, 15 Jan 2021 23:25:53 +0530 Subject: [PATCH] camera release In some hardware, the camera isn't released. Especially when working with Jupyter notebook, Kernel is required to be restarted every time for a new run. Adding stream.release() solves the above issue. --- imutils/video/webcamvideostream.py | 1 + 1 file changed, 1 insertion(+) diff --git a/imutils/video/webcamvideostream.py b/imutils/video/webcamvideostream.py index dbe8751..249a6f3 100644 --- a/imutils/video/webcamvideostream.py +++ b/imutils/video/webcamvideostream.py @@ -40,3 +40,4 @@ def read(self): def stop(self): # indicate that the thread should be stopped self.stopped = True + self.stream.release() #also release the camera