Skip to content

Instantly share code, notes, and snippets.

@yushulx
Created July 10, 2020 06:35
Show Gist options
  • Save yushulx/c1c3e87b314901ec518263f2f09cc72b to your computer and use it in GitHub Desktop.
Save yushulx/c1c3e87b314901ec518263f2f09cc72b to your computer and use it in GitHub Desktop.
import cv2
cap = cv2.VideoCapture(0)
while True:
ret, frame = cap.read()
cv2.imshow("Webcam", frame)
if cv2.waitKey(1) & 0xFF == 27: # use ESC to quit
break
cap.release()
cv2.destroyAllWindows()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment