Hi, i wrote a simple script to read frames from webcam
import cv2
cv2.destroyAllWindows()
capture = cv2.VideoCapture(0,cv2.CAP_DSHOW)
while (True):
ret, frame = capture.read()
cv2.imshow('video', frame)
if cv2.waitKey(30) == 27:
break
capture.release()
cv2.destroyAllWindows()
In this document, any many other codes i have seen, these two functions have used
capture.release()
cv2.destroyAllWindows()
but when i remove these two lines, code works without any problem. So, why we need these (in python) *