I cannot capture an image from my webcam using the following OpenCV code.
The code may display images from a local AVI file or video device. It works fine in the test.avi file.
When I use my default webcam (CvCapture * capture = cvCreateCameraCapture (0)), the program can determine the size of the image from the webcam, but just can not display the image .
/ I forgot to mention that I see that iSight is working because the LED is on /
Does anyone face the same problem?
cvNamedWindow( "Example2", CV_WINDOW_AUTOSIZE );
CvCapture* capture =cvCreateFileCapture( "C:\\test.avi" ) ;
assert( capture );
IplImage* image;
while(1) {
image = cvQueryFrame( capture );
if( !image ) break;
cvShowImage( "Example2", image );
char c = cvWaitKey(33);
if( c == 27 ) break;
}
cvReleaseCapture( &capture );
cvDestroyWindow( "Example2" );
- opencv 2.2
- Debug Library * d.lib
- Webcam isight
- Macbook OS win7 32
- VS2008
source
share