I cant access my webcam Opencv 2.4.3
Here is my code
#include <highgui.h>
#include <cv.h>
int main(int argc,char** argv)
{
IplImage* frame;
CvCapture* capture = cvCreateCameraCapture(-1);
cvNamedWindow("Example 2",CV_WINDOW_AUTOSIZE);
while(1)
{
frame = cvQueryFrame(capture);
if(!frame)
{
printf("Error");
break;
}
cvShowImage("Example 2",frame);
char c = cvWaitKey(33);
if(c==27)
break;
}
cvReleaseCapture(&capture);
cvDestroyWindow("Example 2");
}
It shows the message "error". I am using opencv2.4.3 in Ubuntu 12.10 and my ide is Eclipse.
run
lsusb
andls /dev/video*
use <pre> tag to format you question