Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QCamera on Android and continuous focus



  • Hello.

    I set camera focus mode on Android device with.

    m_cam->focus()->setFocusMode( QCameraFocus::ContinuousFocus );
    
    m_cam->focus()->isFocusModeSupported( QCameraFocus::ContinuousFocus );
    

    Reports true.

    But I see focus on the distant object, I don't see auto focus working. The focus always the same. Maybe I missed something? What should I do to make auto focus to work on Android device?



  • Tried this:

    m_cam->focus()->setFocusMode( QCameraFocus::ContinuousFocus |
        QCameraFocus::MacroFocus );
    

    The same behavior. No focus on the objects in 0.1 - 0.5 m...



  • Looks like this doesn't work. It is necessary to invoke QCamera::searchAndLock() from time to time...



  • So, my solution is:

    m_cam->focus()->setFocusMode( QCameraFocus::MacroFocus );
    

    and I do:

    m_cam->searchAndLock();
    

    on image changes (significant changes).


Log in to reply