]> git.defcon.no Git - qopencamwidget/blobdiff - qopencamwidget.cpp
Adjusted default resolution. Hardcoded atm, should make it soft..
[qopencamwidget] / qopencamwidget.cpp
index 539b4d52bec5d481042a62832c6c28210154946d..eb5e6768d333c06a208725bb8d815c693cbd088c 100644 (file)
@@ -136,12 +136,15 @@ QOpenCamWidget::paintEvent ( QPaintEvent * event )
 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);