Fixed border interpolation problem in filter2D

This commit is contained in:
Andrey Kamaev 2011-12-26 08:05:33 +00:00
parent 4cfc9dc67e
commit 320bee3bfe
3 changed files with 5 additions and 2 deletions

View File

@ -3026,8 +3026,8 @@ void cv::filter2D( InputArray _src, OutputArray _dst, int ddepth,
} }
Ptr<FilterEngine> f = createLinearFilter(src.type(), dst.type(), kernel, Ptr<FilterEngine> f = createLinearFilter(src.type(), dst.type(), kernel,
anchor, delta, borderType ); anchor, delta, borderType & ~BORDER_ISOLATED );
f->apply(src, dst); f->apply(src, dst, Rect(0,0,-1,-1), Point(), (borderType & BORDER_ISOLATED) != 0 );
} }

View File

@ -144,6 +144,7 @@ void crossCorr( const Mat& img, const Mat& templ, Mat& corr,
img0.adjustROI(roiofs.y, wholeSize.height-img.rows-roiofs.y, img0.adjustROI(roiofs.y, wholeSize.height-img.rows-roiofs.y,
roiofs.x, wholeSize.width-img.cols-roiofs.x); roiofs.x, wholeSize.width-img.cols-roiofs.x);
} }
borderType |= BORDER_ISOLATED;
// calculate correlation by blocks // calculate correlation by blocks
for( i = 0; i < tileCount; i++ ) for( i = 0; i < tileCount; i++ )

View File

@ -218,6 +218,8 @@ void cv::copyMakeBorder( InputArray _src, OutputArray _dst, int top, int bottom,
src.adjustROI(dtop, dbottom, dleft, dright); src.adjustROI(dtop, dbottom, dleft, dright);
top -= dtop; top -= dtop;
left -= dleft; left -= dleft;
bottom -= dbottom;
right -= dright;
} }
borderType &= ~BORDER_ISOLATED; borderType &= ~BORDER_ISOLATED;