I am working on an application that requires the discovery of an OpenCV object using the cascading Haar classifier. I am using OpenCV 2.3.1 with VS2010 on a 64 bit Windows machine. I compiled and built OpenCV myself and did not use any precompiled binaries.
First, I wanted to start interfering with the facesetect.cpp example that is included in OpenCV. I built it without errors, but when I try to run it, it will not open the XML file of the cascading classifier (the CascadeClassifier.load () function returns false). I did not change anything from the source code of the sample.
I am using an xml file that is distributed with OpenCV, so the problem is not with the xml file. I also made sure that the application can access and read the file using simple fopen.
I believe (but not sure) that the problem is that the cascading classifier is of the "old" type. But the OpenCV documentation specifically implies that the new CascadeClassifier object can open both "old" and "new" cascading classifiers.
Here's the link: http://opencv.itseez.com/modules/objdetect/doc/cascade_classification.html#cascadeclassifier-load
I even tried using the pre-compiled OpenCV2.2 binary and it works fine with this xml. And then I tried to compile the source code of example 2.2, and again it could not load xml.
I know that I can try to use the old CvHaarClassifierCascade object, but I prefer to use the latest version of OpenCV and its objects.
Does anyone know what I'm doing wrong?
source share