Currently, I have this working example:
import cv
capture = cv.CaptureFromCAM(0)
cv.NamedWindow('image')
while True:
frame = cv.QueryFrame(capture)
cv.ShowImage('image', frame)
k = cv.WaitKey(10)
if k % 256 == 27:
break
cv.DestroyWindow('image');
But, the resource is not properly release. This post suggests using del(capture)
but, in this other recommends using cvReleaseCapute
(but I can't find that function ).
Which is the correct way to release the capture?
This is my opencv version:
In [4]: from cv2 import __version__
In [5]: __version__
Out[5]: '$Rev: 4557 $'