Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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"> ...

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());
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"> ...

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">
...

...