From cef597361b7afa2c2d44658c02715d54820df9ed Mon Sep 17 00:00:00 2001 From: raiots Date: Fri, 2 Jun 2023 20:59:42 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=20=E6=91=84=E5=83=8F=E5=A4=B4=E6=B5=8B?= =?UTF-8?q?=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cvshot.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 cvshot.py 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')