From: 020535 <020535@07accd87-1e0b-0410-939d-c05d8a058e03> Date: Sat, 17 Oct 2009 12:16:53 +0000 (+0000) Subject: Adjusted default resolution. Hardcoded atm, should make it soft.. X-Git-Url: https://git.defcon.no/?p=qopencamwidget;a=commitdiff_plain;h=09aa01e1a1976499d363718fc5635f0de1cbdf95 Adjusted default resolution. Hardcoded atm, should make it soft.. git-svn-id: https://dilbert.hig.no/svn/student/020535/qopencamwidget/trunk@185 07accd87-1e0b-0410-939d-c05d8a058e03 --- diff --git a/qopencamwidget.cpp b/qopencamwidget.cpp index 539b4d5..eb5e676 100644 --- a/qopencamwidget.cpp +++ b/qopencamwidget.cpp @@ -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);