Skip to content

Instantly share code, notes, and snippets.

@bha159
Created February 5, 2018 00:38
Show Gist options
  • Save bha159/4c4a880d5f0cc0727325c2fadf3fec90 to your computer and use it in GitHub Desktop.
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.
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