Ask Your Question

ne'mi's profile - activity

2013-08-17 12:45:47 -0600 received badge  Teacher (source)
2013-07-10 03:39:11 -0600 answered a question Convert old haarcascade file to new cascade classifier format

Hi, I came across a similar problem in my work yesterday. I've sketched up my solution below. I have to warn you though, it's not been tested yet, but it should compile and hopefully work :). Give it a try ;)

class MyCascadeClassifier : public cv::CascadeClassifier {
public:
    MyCascadeClassifier(const cv::FileNode &node) {
            oldCascade = cv::Ptr<CvHaarClassifierCascade>((CvHaarClassifierCascade*)node.readObj());
    }
};

Now you can use MyCascadeClassifier instead of CascadeClassifier. Node must contain the node that looks like this:

<haarcascade_frontalface_alt type_id="opencv-haar-classifier">
...