Home > Mobile >  Qt + OpenCV manipulation of the USB camera
Qt + OpenCV manipulation of the USB camera

Time:11-26

Environment: Qt5.9.8 + OpenCV3.4.2
The problem: the computer may have multiple USB camera (common recently is a laptop a built-in camera + USB camera), need for USB camera parameter Settings, and then to capture video, encounter a few questions, consult everybody:
1, how to determine the device_index of camera, so that the VideoCapture: : open (int device_index) can determine which camera right?
Check a lot of information, it seems that have a direct to find system camera information not found in the opencv function, has adopt the method of Windows system calls for camera information, test failed, I currently use is in the Qt QCameraInfo camera information available, but using QCameraInfo access to information, need to first start () camera
2, how convenient setting the parameters of the camera
Of OpenCV VideoCapture. The set () can set the parameters of the camera, can be set parameters with fully (brightness, contrast and so on can be set), Qt QCameraViewfinderSettings generally set up is resolution, frame rate, brightness, contrast... Depending on the cannot set, I currently use VideoCapture. The set () to set the
3, from the video capture, QCaptureImage will default in the desktop picture library \ \ directory to save the picture of the cut
OpenCV and QCamera can capture, but it'll QCaptureImage default in the desktop picture library \ \ directory to save a cut pictures temporarily banned the default save solution is not found, and OpenCV screenshots not the default save

Through the comparison of the above, no better method to identify camera and screenshots, are now ready to 1) the application starts with QCameraInfo available camera information 2) open a new thread, with timer, through QCameraInfo check whether there is a camera update (plug), is it available system step 3) screenshots with OpevCV
If there's a better way?
  •  Tags:  
  • Qt
  • Related