Good day, I'm desperate.
Initially intended to do a QT application that uses a webcam, then after a google search I found the opencv.
But the opencv only has given me problems. Already missed 5 days this
3 days only, to integrate in QTCREATOR, i.e. I started with the opencv 2.3 but as not managed to integrate there found a site explaining how to integrate the opencv 2.2 in qtcreator
I used this site:
http://www.barbato.us/2011/03/18/usi...-in-windows-2/
Exceeded the pace of integration. I investigated using the webcam and found the following code:
QMessageBox msgBox;
CvCapture* capture = NULL;
if ((capture = cvCreateCameraCapture( -1 )) == NULL)
{
msgBox.setText( "Cannot open initialize webcam!\n" );
msgBox.exec();
return ;
}
cvNamedWindow("mywindow", CV_WINDOW_AUTOSIZE);
cvQueryFrame(capture); // Sometimes needed to get correct data
while (1)
{
IplImage* frame = cvQueryFrame(capture); // check return
{
msgBox.setText( "ERROR: cvQueryFrame failed\n");
msgBox.exec();
break;
}
cvShowImage("mywindow", frame); // Do not release the frame!
int key = cvWaitKey(10);
if (key == 0x1b)
break;
}
cvReleaseCapture(&capture);
cvDestroyWindow("mywindow");
The problem with the above code is that it appears only a gray screen, and has exprimentei almost everything I found on the internet. AND
still made a guest appearance a gray screen, and the more serious is that the gray screen appears only once, that is, when I run the program for the second time gives me "cannot open initialize webcam". And the first time that work appears "ERROR: cvQueryFrame failed"
My webcam is working well, as I experienced with SKYPE and MSN. And already tried -1. .2 in cvCreateCameraCapture (or cvCaptureFromCAM) and nothing.
I don't know if installed correctly the opencv 2.2 in qtcreator but I think Yes, but the opencv does not work go to DIRECTSHOW .... I chose the opencv for the program can function
on any Windows operating system regardless if it is xp, vista, 7
I use Qt Creator 2.2.1
Qt 4.7.4
Opencv2.2.0
Windows 7, but i want to work in XP AND VISTA
Bookmarks