make sure filter2D does not use uninitialized buffers (thanks to flkleber for the patch)

pull/13383/head
Vadim Pisarevsky 14 years ago
parent 4b2f9e78fc
commit 0556c5ede2
  1. 7
      modules/imgproc/src/templmatch.cpp

@ -166,6 +166,7 @@ void crossCorr( const Mat& img, const Mat& templ, Mat& corr,
for( k = 0; k < cn; k++ )
{
Mat src = src0;
dftImg = Scalar::all(0);
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),
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 );
Mat dftTempl1(dftTempl, Rect(0, tcn > 1 ? k*dftsize.height : 0,
dftsize.width, dftsize.height));

Loading…
Cancel
Save