make sure filter2D does not use uninitialized buffers (thanks to flkleber for the patch)
This commit is contained in:
parent
4b2f9e78fc
commit
0556c5ede2
@ -166,6 +166,7 @@ void crossCorr( const Mat& img, const Mat& templ, Mat& corr,
|
|||||||
for( k = 0; k < cn; k++ )
|
for( k = 0; k < cn; k++ )
|
||||||
{
|
{
|
||||||
Mat src = src0;
|
Mat src = src0;
|
||||||
|
dftImg = Scalar::all(0);
|
||||||
|
|
||||||
if( cn > 1 )
|
if( cn > 1 )
|
||||||
{
|
{
|
||||||
@ -181,12 +182,6 @@ void crossCorr( const Mat& img, const Mat& templ, Mat& corr,
|
|||||||
copyMakeBorder(dst1, dst, y1-y0, dst.rows-dst1.rows-(y1-y0),
|
copyMakeBorder(dst1, dst, y1-y0, dst.rows-dst1.rows-(y1-y0),
|
||||||
x1-x0, dst.cols-dst1.cols-(x1-x0), borderType);
|
x1-x0, dst.cols-dst1.cols-(x1-x0), borderType);
|
||||||
|
|
||||||
if( dftsize.width > dsz.width )
|
|
||||||
{
|
|
||||||
Mat part(dftImg, Range(0, dsz.height), Range(dsz.width, dftsize.width));
|
|
||||||
part = Scalar::all(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
dft( dftImg, dftImg, 0, dsz.height );
|
dft( dftImg, dftImg, 0, dsz.height );
|
||||||
Mat dftTempl1(dftTempl, Rect(0, tcn > 1 ? k*dftsize.height : 0,
|
Mat dftTempl1(dftTempl, Rect(0, tcn > 1 ? k*dftsize.height : 0,
|
||||||
dftsize.width, dftsize.height));
|
dftsize.width, dftsize.height));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user