bool
QOpenCamWidget::grabCapture(int source)
{
- capture = cvCaptureFromCAM(0);
+ capture = cvCreateCameraCapture(0);
if (!capture)
{
qDebug() << "QOpenCamWidget::grabCapture(" << source << ") failed";
return false;
}
+ cvSetCaptureProperty( capture, CV_CAP_PROP_FRAME_WIDTH, 960 );
+ cvSetCaptureProperty( capture, CV_CAP_PROP_FRAME_HEIGHT, 720 );
+
cvGrabFrame(capture); // Grab a single frame, do resizing based on it.
IplImage *image = cvRetrieveFrame(capture);
QSize t_size = QSize(image->width,image->height);