Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cap = cv2.VideoCapture(path_to_video)
- if not cap.isOpened():
- print "Failed to open video."
- exit(1)
- prev_frame = None
- while(True):
- state, frame = cap.read()
- if not state:
- break # Reached end of video
- frame = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
- if prev_frame is not None:
- matches_gms = match(prev_frame, frame)
- prev_frame = frame
- cap.release()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement