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

QCamera/QCameraFocus Windows 10 tablet



  • Hi at all,

    I bought an industrial tablet with a rear camera and I can use it by the QCamera + QAbstractVideoSurface without particular problems.
    The only thing I care about now is how to disable the auto focus functionality because is extremely slow.

    Before that I check by

    QCameraFocus::isFocusModeSupported(QCameraFocus::FocusModes mode)
    QCameraFocus::isFocusPointModeSupported(QCameraFocus::FocusPointMode mode) 
    

    ...but all types give me a false as result.
    But I'm sure, the rear camera has the auto focus functionality, I can see it during the video capture.

    I'm using QT 5.12.6 and the tablet has Windows 10 LTSB 2016.

    Follow the output of QCameraInfo "deviceName" and "description".

        foreach(QCameraInfo cam, cam_list)
            ui->textCamera->append(cam.deviceName() + " " + cam.description());
    
    @device:pnp:\\?\usb#vid_5986&pid_0546&mi_00#8&2391f56a&0&0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\global USB2.0 Camera
    

    Do you have any advice?
    Thank you.


  • Lifetime Qt Champion

    Hi,

    It might be a limitation of the Windows backend. You should check if the control itself is available.



  • Thank you @SGaist, how to do that?
    What you mean with "control" is available?

    In the meantime I trying a different approach. I'll post it.



  • As mentioned before I changed approach, I abandoned QCamera class, now I'm using VideoCapture from OpenCV.

            // turn the autofocus off
            bool ret = cap.set(CAP_PROP_AUTOFOCUS, 0); 
            if (!ret)
                qWarning() << "Error during disable auto focus";
    
            // set manual focus (0 to 255)
            ret = cap.set(CAP_PROP_FOCUS, 255);
            if (!ret)
                qWarning() << "Error during set focus to 255";
    

  • Lifetime Qt Champion

    @addebito said in QCamera/QCameraFocus Windows 10 tablet:

    Thank you @SGaist, how to do that?
    What you mean with "control" is available?

    In the meantime I trying a different approach. I'll post it.

    I meant if you can get a QCameraFocusControl but it looks like I misread your original post and you did get the control. So I think it's indeed a limitation of the backend or that it can't for some reason provide that control directly.

    Out of curiosity, what type of camera is that ?



  • @SGaist I don't know exactly.
    It's a 5Mpixels USB camera mounted on rear of an industrial tablet.


Log in to reply