Created
March 28, 2018 17:40
-
-
Save NickShargan/2198086a30b384d2d89758c65713b285 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import cv2 | |
video_path = "./vid.mp4" | |
cap = cv2.VideoCapture(video_path) | |
if not cap.isOpened(): | |
print("error opening video stream") | |
while (cap.isOpened()): | |
ret, frame = cap.read() | |
if ret: | |
cv2.imshow('frame', frame) | |
if cv2.waitKey(30) & 0xFF == ord('q'): | |
break | |
else: | |
break | |
cv2.destroyAllWindows() | |
cap.release() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment