From ec45453baabbea6f28ccf073d22109eb34bb63d1 Mon Sep 17 00:00:00 2001 From: Takahiro Horikawa Date: Tue, 4 Sep 2012 20:46:42 -0700 Subject: [PATCH] #523 Fix the problem where the MaxSize parameter in cvHaarDetectObjects does not work when the flag CV_HAAR_SCALE_IMAGE is not set. --- modules/objdetect/src/haar.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/objdetect/src/haar.cpp b/modules/objdetect/src/haar.cpp index 4ba4e7f694..bfcc2e7eef 100644 --- a/modules/objdetect/src/haar.cpp +++ b/modules/objdetect/src/haar.cpp @@ -1531,6 +1531,13 @@ cvHaarDetectObjectsForROC( const CvArr* _img, continue; } + if ( winSize.width > maxSize.width || winSize.height > maxSize.height ) + { + if( !findBiggestObject ) + break; + continue; + } + cvSetImagesForHaarClassifierCascade( cascade, sum, sqsum, tilted, factor ); cvZero( temp );