Ask Your Question

Kakashi's profile - activity

2012-12-14 10:10:48 -0600 received badge  Editor (source)
2012-12-14 10:09:36 -0600 asked a question 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.