Created
January 24, 2018 13:46
-
-
Save wwj718/820baa92289a15618beb85ae48413889 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
# pip install opencv-python | |
# python3.6.2 | |
#!/usr/bin/env python | |
# encoding: utf-8 | |
import numpy as np | |
import cv2 | |
cap = cv2.VideoCapture('/Users/wwj/Documents/pets.mp4') | |
while(cap.isOpened()): | |
ret, frame = cap.read() | |
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) | |
cv2.imshow('frame',gray) | |
if cv2.waitKey(1) & 0xFF == ord('q'): | |
break | |
cap.release() | |
cv2.destroyAllWindows() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment