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"> ...
2 | No.2 Revision |
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 = 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"> ...
3 | No.3 Revision |
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">