git-svn-id: https://dilbert.hig.no/svn/student/020535/qopencamwidget/trunk@185
07accd87-1e0b-0410-939d-
c05d8a058e03
bool
QOpenCamWidget::grabCapture(int source)
{
bool
QOpenCamWidget::grabCapture(int source)
{
- capture = cvCaptureFromCAM(0);
+ capture = cvCreateCameraCapture(0);
if (!capture)
{
qDebug() << "QOpenCamWidget::grabCapture(" << source << ") failed";
return false;
}
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);
cvGrabFrame(capture); // Grab a single frame, do resizing based on it.
IplImage *image = cvRetrieveFrame(capture);
QSize t_size = QSize(image->width,image->height);