Skip to content

Instantly share code, notes, and snippets.

@bkrmendy
Created July 20, 2017 17:41
Show Gist options
  • Save bkrmendy/454df09af7583c1028680f458eebb421 to your computer and use it in GitHub Desktop.
Save bkrmendy/454df09af7583c1028680f458eebb421 to your computer and use it in GitHub Desktop.
openCV2 webcam project template
import cv2
import numpy as np
cap = cv2.VideoCapture(0)
while True:
_, frame = cap.read()
# interesting stuff here
cv2.imshow('CAMERA', frame)
key = cv2.waitKey(1) & 0xFF
if key == 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