diff --git a/apps/traincascade/haarfeatures.cpp b/apps/traincascade/haarfeatures.cpp index db623b596..f2d18229e 100644 --- a/apps/traincascade/haarfeatures.cpp +++ b/apps/traincascade/haarfeatures.cpp @@ -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)idx)); Mat innSqSum; - if (((const CvHaarFeatureParams*)featureParams)->mode == CvHaarFeatureParams::ALL) { - Mat innTilted(winSize.height + 1, winSize.width + 1, tilted.type(), tilted.ptr((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)idx)); + integral(img, innSum, innSqSum, innTilted); } else - integral(img, innSum, innSqSum); + integral(img, innSum, innSqSum); normfactor.ptr(0)[idx] = calcNormFactor( innSum, innSqSum ); }