Created
February 5, 2018 00:38
-
-
Save bha159/4c4a880d5f0cc0727325c2fadf3fec90 to your computer and use it in GitHub Desktop.
A python program that generates two real video from webcam, one in RGB format and other Greyscale.
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 | |
cap = cv2.VideoCapture(0) | |
while True: | |
ret, frame = cap.read() | |
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) | |
cv2.imshow('Vid', frame) | |
cv2.imshow('Gray', 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