bool HaarEvaluator::setWindow( Point pt )
{
if( pt.x < 0 || pt.y < 0 ||
- pt.x + origWinSize.width >= sum.cols-2 ||
- pt.y + origWinSize.height >= sum.rows-2 )
+ pt.x + origWinSize.width >= sum.cols ||
+ pt.y + origWinSize.height >= sum.rows )
return false;
size_t pOffset = pt.y * (sum.step/sizeof(int)) + pt.x;
bool LBPEvaluator::setWindow( Point pt )
{
if( pt.x < 0 || pt.y < 0 ||
- pt.x + origWinSize.width >= sum.cols-2 ||
- pt.y + origWinSize.height >= sum.rows-2 )
+ pt.x + origWinSize.width >= sum.cols ||
+ pt.y + origWinSize.height >= sum.rows )
return false;
offset = pt.y * ((int)sum.step/sizeof(int)) + pt.x;
return true;
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, scaledImageSize.height - originalWindowSize.height );
+ Size processingRectSize( scaledImageSize.width - originalWindowSize.width + 1, scaledImageSize.height - originalWindowSize.height + 1 );
if( processingRectSize.width <= 0 || processingRectSize.height <= 0 )
break;
"Use cvSetImagesForHaarClassifierCascade" );
if( pt.x < 0 || pt.y < 0 ||
- pt.x + _cascade->real_window_size.width >= cascade->sum.width-2 ||
- pt.y + _cascade->real_window_size.height >= cascade->sum.height-2 )
+ pt.x + _cascade->real_window_size.width >= cascade->sum.width ||
+ pt.y + _cascade->real_window_size.height >= cascade->sum.height )
return -1;
p_offset = pt.y * (cascade->sum.step/sizeof(sumtype)) + pt.x;
CvSize winSize = { cvRound(winSize0.width*factor),
cvRound(winSize0.height*factor) };
CvSize sz = { cvRound( img->cols/factor ), cvRound( img->rows/factor ) };
- CvSize sz1 = { sz.width - winSize0.width, sz.height - winSize0.height };
+ CvSize sz1 = { sz.width - winSize0.width + 1, sz.height - winSize0.height + 1 };
CvRect equRect = { icv_object_win_border, icv_object_win_border,
winSize0.width - icv_object_win_border*2,