feat: 摄像头测试
This commit is contained in:
parent
f80c02e923
commit
cef597361b
|
@ -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')
|
Loading…
Reference in New Issue