I installed VS2008 and can run the "camshiftdemo and lkdemo" demo codes, which are part of the opencv library. With this done, now I'm trying to run some simple codes from the Internet to get to know OpenCV. I am just trying to display video from a webcam and I am getting the following error.
The error I am getting is:
Unhandled exception in 0x5e7e3d10 (highgui200.dll) in opencv.exe file: 0xC0000005: reading access violation location 0x719b3856.
The code I'm trying to run is:
#include <cv.h>
#include <highgui.h>
void main(int argc,char *argv[])
{
int c;
IplImage* color_img;
CvCapture* cv_cap = cvCaptureFromCAM(-1);
cvNamedWindow("Video",1);
for(;;) {
color_img = cvQueryFrame(cv_cap);
if(color_img != 0)
cvShowImage("Video", color_img);
c = cvWaitKey(10);
if(c == 27)
break;
}
cvReleaseCapture( &cv_cap );
cvDestroyWindow("Video");
}
Any help on this would be greatly appreciated.
source
share