Skip to content

Commit 72e4bdb

Browse files
committed
Fix bug: clean up the camera by adding .release()
1 parent abc7430 commit 72e4bdb

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

modules/optflow/samples/motempl.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,4 +92,6 @@ def draw_motion_comp(vis, rect, angle, color):
9292
prev_frame = frame.copy()
9393
if 0xFF & cv.waitKey(5) == 27:
9494
break
95+
# cleanup the camera and close any open windows
96+
cam.release()
9597
cv.destroyAllWindows()

0 commit comments

Comments
 (0)