Cascade Classifier Tutorial Error
Hey everyone,
I just copied past the code from the Cascade classifier tutorial , And I always get this error
OpenCV Error: Assertion failed (0 <= roi.x && 0 <= roi.width && roi.x + roi.widt h <= m.cols && 0 <= roi.y && 0 <= roi.height && roi.y + roi.height <= m.rows) in cv::Mat::Mat, file C:\build\master_winpack-build-win64-vc14\opencv\modules\core \src\matrix.cpp, line 522
platform: windows 7, visual studio 2013.
Any help please ?
Sincerely, Omar K. Aly
Actually that error tells you that the image is not loaded correctly because no pixel info was found. Check the paths to the data you are loading please.
What data? ... you mean the xml files ? its in the same folder as the code and by debugging its loaded correctly.
/** Global variables */ String face_cascade_name = "haarcascade_frontalface_alt.xml"; String eyes_cascade_name = "haarcascade_eye_tree_eyeglasses.xml"; CascadeClassifier face_cascade; CascadeClassifier eyes_cascade;
if (!face_cascade.load(face_cascade_name)){ printf("--(!)Error loading face cascade\n"); return -1; }; if (!eyes_cascade.load(eyes_cascade_name)){ printf("--(!)Error loading eyes cascade\n"); return -1; };
the if conditions aren't returning any errors
if you have the line below
try
I tried both capture.open(0) and capture(1) because I have to web cams one internal and other external and both give the same error and after debbuging I found the faces.size() vector is something very huge like 112-15 digits number