]> git.defcon.no Git - qopencamwidget/commitdiff
Adjusted default resolution. Hardcoded atm, should make it soft..
author020535 <020535@07accd87-1e0b-0410-939d-c05d8a058e03>
Sat, 17 Oct 2009 12:16:53 +0000 (12:16 +0000)
committer020535 <020535@07accd87-1e0b-0410-939d-c05d8a058e03>
Sat, 17 Oct 2009 12:16:53 +0000 (12:16 +0000)
git-svn-id: https://dilbert.hig.no/svn/student/020535/qopencamwidget/trunk@185 07accd87-1e0b-0410-939d-c05d8a058e03

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);