Last active
October 7, 2021 15:09
-
-
Save flyboy74/1dfe4052548445e9329dd2e36a38496f to your computer and use it in GitHub Desktop.
Capture images from webcam stream
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 | |
capture = cv2.VideoCapture(0) | |
capture.set(3, 320) #set width of frame | |
capture.set(4, 200) #set hieght of frame | |
capture.set(5, 20) #set FPS | |
capture.set(10, 20) #set brightness | |
successful = True | |
while successful: | |
successful, image = capture.read() | |
cv2.imshow("preview", image) | |
key = cv2.waitKey(1) & 0xFF | |
if key == ord("q"): | |
break |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment