Hi, I have an OAK-D Pro. I noticed that sometimes the autofocus fails to give a good focus (ie it tries to focus it, but the image ends up pretty blur); the subject was 30 cm away from camera in a fairly well lit environment.

Ideally, we hope we don't have to ask the user to adjust the focus on their own although we have implemented autofocus segment from rgb camera control code in documentation. Any suggestions?

  • erik replied to this.
    23 days later

    Hi erik ,

    According to get_lens_position function in depth-driven focus demo, an object at 15 cm from and parallel to the camera, the lensPos was calculated to be around 146. I found that the image is quite blurry; manually tuning lensPos to 161, the image looks much clearer. May I know how did we come to the equation in the demo?

    Hi @glitchyordis,

    The equation is second order polynomial approximation for the discrete points that were measured empirically (but is seemingly different for different cameras).
    Ideally, you should set your own function based on what looks good to you. Pro tip: chatgpt does polyfits really well.

    Let me know if you have any more questions 🙂
    Jaka