Enable / disable autofocus on imx179 using python cv2

  1. Where did you get the camera module(s)?
    Official provider for Italy: Robotics-3D

  2. Model number of the product(s)?

  3. What hardware/platform were you working on?
    PC desktop - Win11

  4. Instructions you have followed. (link/manual/etc.)
    Focus and FPS settings in opencv python - #2 by crackwitz - Python - OpenCV

  5. Problems you were having?
    I want to enable/disable programmatically the autofocus of camera using opencv, but if I try to set autofocus property to 1 and after read back, the camera return always 0
    h_cam.set(cv2.CAP_PROP_AUTOFOCUS, 1)
    value = h_cam.get(cv2.CAP_PROP_AUTOFOCUS) <— return always 0 after a set to 1

  6. The dmesg log from your hardware?

  1. Troubleshooting attempts you’ve made?
  1. What help do you need?
    What is the correct procedure in python and cv2 to enable/disable autofocus?

You can refer to the link below: