diff --git a/ocv_template_matching.py b/ocv_template_matching.py index 7357bf7..746b410 100644 --- a/ocv_template_matching.py +++ b/ocv_template_matching.py @@ -76,7 +76,8 @@ while True: # Read a new frame ok, image = video.read() if not ok: - break + video.set(cv2.CAP_PROP_POS_FRAMES, 0) + continue # Start timer timer = cv2.getTickCount()