Update haarfeatures.cpp

This commit is contained in:
Teng Cao 2015-12-07 19:51:30 +08:00
parent 8a36402ec0
commit efacf7b6de

View File

@ -101,12 +101,13 @@ void CvHaarEvaluator::setImage(const Mat& img, uchar clsLabel, int idx)
CvFeatureEvaluator::setImage( img, clsLabel, idx);
Mat innSum(winSize.height + 1, winSize.width + 1, sum.type(), sum.ptr<int>((int)idx));
Mat innSqSum;
if (((const CvHaarFeatureParams*)featureParams)->mode == CvHaarFeatureParams::ALL) {
Mat innTilted(winSize.height + 1, winSize.width + 1, tilted.type(), tilted.ptr<int>((int)idx));
integral(img, innSum, innSqSum, innTilted);
if (((const CvHaarFeatureParams*)featureParams)->mode == CvHaarFeatureParams::ALL)
{
Mat innTilted(winSize.height + 1, winSize.width + 1, tilted.type(), tilted.ptr<int>((int)idx));
integral(img, innSum, innSqSum, innTilted);
}
else
integral(img, innSum, innSqSum);
integral(img, innSum, innSqSum);
normfactor.ptr<float>(0)[idx] = calcNormFactor( innSum, innSqSum );
}