Qt capture QCamera too dark

I used opencv camera support to capture images in Qt, since Qt5.2 now has QCamera and QCameraImageCapture, I am porting it with great code simplification.

But the captured image is too dark, and the frame opened by QCameraViewfinder has the correct brightness. Alas, QWidget :: grab () does not work in QCameraViewfinder.

Also, the camera demo code behaves the same way (the “Exposure Compensation” change does not affect the captured image).

Any hint of this problem? I am working on 64 bit Ubuntu with a USB webcam.

+3
source share
1 answer

, Qt - QCameraXXX QMediaBindableInterface...

.

https://qt-project.org/doc/qt-5.1/qtmultimedia/qcameraimagecapture.html#details

camera = new QCamera;

viewfinder = new QCameraViewfinder();
viewfinder->show();

camera->setViewfinder(viewfinder);

imageCapture = new QCameraImageCapture(camera);

camera->setCaptureMode(QCamera::CaptureStillImage);
camera->start();
//on half pressed shutter button
camera->searchAndLock();

//on shutter button pressed
imageCapture->capture();

//on shutter button released
camera->unlock();

, , imageCaptured, QImage .

https://qt-project.org/doc/qt-5.1/qtmultimedia/qcameraimagecapture.html#imageCaptured

, .

0

All Articles