How to programmatically disable the auto-focus of a webcam?

后端 未结 3 1292
耶瑟儿~
耶瑟儿~ 2020-12-13 21:25

I am trying to do computer vision using a webcam (the model is Hercules Dualpix). I know it is not the ideal camera to use, but I have no choice here.

The problem i

3条回答
  •  感动是毒
    2020-12-13 22:05

    With the a little help of OpenCV and Python you can do this very easy:

    cap = cv2.VideoCapture(1) # my webcam cap.set(3, 1280) # set the resolution cap.set(4, 720) cap.set(cv2.CAP_PROP_AUTOFOCUS, 0) # turn the autofocus off

    I use OpenCV 3.1.0-dev, Python 2.7.5 and the Logitech HD Pro Webcam C920

提交回复
热议问题