18 if(captureSource.isNull() || captureSource.isEmpty()) {
19 qDebug() <<
"No capture source specified.";
24 captureSource.toInt(&intConvert);
26 int source = captureSource.toInt();
29 QByteArray ba = captureSource.toLocal8Bit();
30 const char *source = ba.data();
34 if(!capture.isOpened()) {
35 qDebug() <<
"Error initializing capture.";
43 connect(timer, SIGNAL(timeout()),
this, SLOT(captureFrame()));
49 timer->start(floor(1.0f/(
float)capture.get(CV_CAP_PROP_FPS)*1000.0f));
50 }
else if(frameRate > 0) {
51 timer->start(floor(1.0f/(
float)frameRate*1000.0f));
54 emit frameCaptured(image);
60 setFrameRate(frameRate);
66 captureSource = source;
103 timer->start(floor(1.0f/(
float)capture.get(CV_CAP_PROP_FPS)*1000.0f));
105 timer->start(floor(1.0f/(
float)frameRate*1000.0f));
111 if(frameRate == 0 && capture.isOpened()) {
118 if(frameRate == 0 && capture.isOpened()) {
127 QByteArray ba = captureSource.toLocal8Bit();
128 const char *source = ba.data();
129 image = cv::imread(source, loadFlag);
131 emit frameCaptured(image);
147 return this->capture.get(propId);
152 return this->capture.set(propId, value);
157 return capture.isOpened();
169 emit frameCaptured(image);