June 2019
Intermediate to advanced
348 pages
8h 28m
English
In the preceding section, we showed you how to capture a video from a webcam using OpenCV. The Qt library also provides many facilities for playing with multimedia in its Qt Multimedia module, including ones that allow us to capture a video from a webcam. In this section, we will have a go at using these facilities to capture a video from the webcam instead of using OpenCV.
To capture a video using Qt, we can simply use an instance of the QCamera class with a QCameraViewfinder object instead of the QGraphicsSence and QGraphicsView objects. Let's see their declarations in the mainwindow.h header file:
#ifdef GAZER_USE_QT_CAMERA QCamera *camera; QCameraViewfinder *viewfinder; #endif
As you can see, the variable ...
Read now
Unlock full access