Quantcast
Channel: OpenCV Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 41027

main.cpp:59:1: error: ‘capture’ was not declared in this scope capture = cvCaptureFromCAM( 0 );

$
0
0
I was following a tutorial on web for an OpenCV library to detect eyes when i compile it this error appears I tried to fix it but didn't find a solution. main.cpp:59:1: error: ‘capture’ was not declared in this scope capture = cvCaptureFromCAM( 0 ); The code is long I put only the part that I think causing this error [Full code](http://pastebin.com/xUTFiuiu) Thanks #include #include #include #include #include #include #include #include "constants.h" #include "findEyeCenter.h" #include "findEyeCorner.h" /** Function Headers */ void detectAndDisplay( cv::Mat frame ); int main( ) { cv::Mat frame; if( !face_cascade.load( face_cascade_name ) ){ printf("--(!)Error loading face cascade, please change face_cascade_name in source code.\n"); return -1; }; createCornerKernels(); ellipse(skinCrCbHist, cv::Point(113, 155.6), cv::Size(23.4, 15.2), 43.0, 0.0, 360.0, cv::Scalar(255, 255, 255), -1); capture = cvCaptureFromCAM( 0 ); if( capture) { while( true ) { frame = cvQueryFrame( capture ); // mirror it imshow("Video",frame); cv::flip(frame, frame, 1); frame.copyTo(debugImage); // Apply the classifier to the frame if( !frame.empty() ) { detectAndDisplay( frame ); } else { printf(" --(!) No captured frame -- Break!"); break; } imshow(main_window_name,debugImage); int c = cv::waitKey(10); if( (char)c == 'c' ) { break; } if( (char)c == 'f' ) { imwrite("frame.png",frame); } } } releaseCornerKernels(); return 0; } }

Viewing all articles
Browse latest Browse all 41027

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>