Last active
August 12, 2020 06:03
-
-
Save palaashatri/0017e6341045f9008371d1b95761c348 to your computer and use it in GitHub Desktop.
A simple application demonstrating video capture using Webcam on OpenCV
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
# A simple program that captures video from webcam and displays it on the screen | |
import numpy as np | |
import cv2 | |
cap = cv2.VideoCapture(0) | |
while(True): | |
ret,frame = cap.read() | |
frame = cv2.resize(frame,(0,0),fx = 0.5, fy = 0.5) | |
cv2.imshow("Frame",frame) | |
ch = cv2.waitKey(1) | |
if ch & 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