Created
January 24, 2021 21:52
-
-
Save ayubmetah/ad16cfa6074e4f07af3eb14d065e3d24 to your computer and use it in GitHub Desktop.
Reading Images and Videos with Python Open CV
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 cv2 as cv | |
#Reading Images | |
# img = cv.imread('photos/kids.jpg') | |
# cv.imshow('Kids', img) | |
# cv.waitKey(0) | |
#Reading Videos | |
capture = cv.VideoCapture('video.mp4') | |
while True: | |
isTrue, frame = capture.read() | |
cv.imshow('Video', frame) | |
if cv.waitKey(30) & 0xFF == ord('d'): | |
break | |
capture.release() | |
cv.destroyAllWindows() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment