Made changes concerning inserting prefiltering modes into CascadeClassifier class.

Now developers should call the method setFaceDetectionMaskGenerator() to use prefiltering mask generator
implemented for face detection.
This commit is contained in:
Leonid Beynenson 2011-10-21 14:56:37 +00:00
parent b8304ce764
commit 9f837d3486
2 changed files with 6 additions and 6 deletions

View File

@ -478,9 +478,11 @@ public:
};
void setMaskGenerator(Ptr<MaskGenerator> maskGenerator);
Ptr<MaskGenerator> getMaskGenerator();
void setFaceDetectionMaskGenerator();
protected:
Ptr<MaskGenerator> maskGenerator;
Ptr<MaskGenerator> getDefaultMaskGenerator();
};

View File

@ -787,13 +787,11 @@ Ptr<FeatureEvaluator> FeatureEvaluator::create( int featureType )
CascadeClassifier::CascadeClassifier()
{
maskGenerator=getDefaultMaskGenerator();
}
CascadeClassifier::CascadeClassifier(const string& filename)
{
load(filename);
maskGenerator=getDefaultMaskGenerator();
}
CascadeClassifier::~CascadeClassifier()
@ -872,12 +870,12 @@ Ptr<CascadeClassifier::MaskGenerator> CascadeClassifier::getMaskGenerator()
return maskGenerator;
}
Ptr<CascadeClassifier::MaskGenerator> CascadeClassifier::getDefaultMaskGenerator()
void CascadeClassifier::setFaceDetectionMaskGenerator()
{
#ifdef HAVE_TEGRA_OPTIMIZATION
return tegra::getCascadeClassifierMaskGenerator(*this);
setMaskGenerator(tegra::getCascadeClassifierMaskGenerator(*this));
#else
return Ptr<CascadeClassifier::MaskGenerator>();
setMaskGenerator(Ptr<CascadeClassifier::MaskGenerator>());
#endif
}