Fixs: After scaling back to original image, some detected ROI will outside the original image ROI
This commit is contained in:
parent
2068c4582c
commit
ef5578a7ce
@ -1141,7 +1141,7 @@ void CascadeClassifier::detectMultiScale( const Mat& image, vector<Rect>& object
|
||||
|
||||
Size windowSize( cvRound(originalWindowSize.width*factor), cvRound(originalWindowSize.height*factor) );
|
||||
Size scaledImageSize( cvRound( grayImage.cols/factor ), cvRound( grayImage.rows/factor ) );
|
||||
Size processingRectSize( scaledImageSize.width - originalWindowSize.width + 1, scaledImageSize.height - originalWindowSize.height + 1 );
|
||||
Size processingRectSize( scaledImageSize.width - originalWindowSize.width, scaledImageSize.height - originalWindowSize.height );
|
||||
|
||||
if( processingRectSize.width <= 0 || processingRectSize.height <= 0 )
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user