R6010 abort () called:When accessing my web cam
Hi... I try to access webcam from my system. But it throws an error "R6010 abort () called" But the same code working perfectly in my laptop I am using logitech webcam in my system. The sample code also provided here. Please Help me in this regard.
int main(int argc, char** argv) {
cvNamedWindow("Example2", CV_WINDOW_AUTOSIZE);
CvCapture* capture;
if (argc == 1) {
capture = cvCreateCameraCapture(0);
}
else {
capture = cvCreateFileCapture(argv[1]);
}
assert(capture != NULL);
IplImage* frame;
while (1) {
frame = cvQueryFrame(capture);
if (!frame) break;
cvShowImage("Example2", frame);
char c = cvWaitKey(33);
if (c == 27) break;
}
cvReleaseCapture(&capture);
cvDestroyWindow("Example2");
}
ahh, please avoid the outdated c-api
Actually i am new to opencv what are the new api's ?? i got this basic example from O'Rilly OpenCV book
ok. book is still nice, unfortunately the code never got updated.
they moved to c++ some years ago, so cv::Mat instead of IplImage, cv::VideoCapture instead of cvCreateCameraCapture, etc. have a look at the docs and the tutorials .