Last active
June 15, 2023 02:59
-
-
Save hugs/fe253cd1d2f242a3ac1b5f5d89c34de9 to your computer and use it in GitHub Desktop.
Test for disabling autofocus on an Arducam 16MP camera.
This file contains 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 | |
cap = cv2.VideoCapture(0) | |
# You *must* grab at least frame before focus settings take effect. | |
# Try commenting and uncommenting the following line to test it | |
grabbed, frame = cap.read() | |
cap.set(cv2.CAP_PROP_AUTOFOCUS, 0) | |
cap.set(cv2.CAP_PROP_FOCUS, 460) | |
while True: | |
grabbed, frame = cap.read() | |
cv2.imshow('frame', frame) | |
if cv2.waitKey(1) & 0xFF == ord('q'): | |
break |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment