diff --git a/cvshot.py b/cvshot.py new file mode 100644 index 0000000..67b2534 --- /dev/null +++ b/cvshot.py @@ -0,0 +1,18 @@ +import cv2 + +# take a photo using cv2 + +img = cv2.VideoCapture(0) + +# img.set(cv2.CAP_PROP_AUTO_EXPOSURE, 0.25) +img.set(cv2.CAP_PROP_AUTO_EXPOSURE, 3) # auto mode +img.set(cv2.CAP_PROP_AUTO_EXPOSURE, 1) # manual mode +img.set(cv2.CAP_PROP_EXPOSURE, 100) +# while True: + +ret, frame = img.read() +if ret: + cv2.imwrite('img.png', frame) + img.release() + + print('succeed')