Last active
August 26, 2022 13:12
-
-
Save jfjensen/cc625c562f3a86a9875bae24b23c3abb to your computer and use it in GitHub Desktop.
A little program for taking pictures with a webcam
This file contains hidden or 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 | |
from datetime import datetime | |
from imutils.video import VideoStream | |
import time | |
vs = VideoStream(src=0).start() | |
time.sleep(2.0) | |
while(True): | |
frame = vs.read() | |
cv2.imshow('frame',frame) | |
key = cv2.waitKey(1) & 0xFF | |
if key == ord('q'): | |
break | |
if key == ord('c'): | |
cv2.imwrite(f"calibrate_{datetime.now().strftime('%Y%m%d_%H%M%S')}.png", frame) | |
vs.stop() | |
cv2.destroyAllWindows() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment