Reputation: 127
I have the code working on gentoo x64 with opencv-2.4.5:
VideoCapture cap;
cap.set(CV_CAP_PROP_FPS , 25);
cap.open(0);
Mat frame, edged;
cap >> frame;
Canny(frame, edged, 50, 200, 5);
but it doesnt work on debian armhf with opencv 2.3.
OpenCV Error: Unsupported format or combination of formats () in cvCanny, file /build/buildd-opencv_2.3.1-11-armhf-d9JIli/opencv-2.3.1/modules/imgproc/src/canny.cpp, line 67 terminate called after throwing an instance of 'cv::Exception' what(): /build/buildd-opencv_2.3.1-11-armhf-d9JIli/opencv-2.3.1/modules/imgproc/src/canny.cpp:67: error: (-210) in function cvCanny
What's wrong?
Upvotes: 1
Views: 300
Reputation: 39816
not really an answer, but ...
you want to check, if cap.open(0) actually succeeded, either the return value, or
if ( ! cap.isOpened() ) // rrrr ;(
some webcams need a 'warmup' time, and deliver empty/invalid frames on startup, so check
if ( frame.empty() ) continue; // play it again, sam
(your error message hints at an empty frame)
Upvotes: 0