[move sift.cpp] sift: avoid inplace calls of GaussianBlur

- should unlock IPP optimizations

original commit: ce7c8f2646
This commit is contained in:
Alexander Alekhin 2020-04-16 14:46:38 +00:00
parent ef5fa498d4
commit ed58b5489f

View File

@ -209,14 +209,16 @@ static Mat createInitialImage( const Mat& img, bool doubleImageSize, float sigma
#else #else
resize(gray_fpt, dbl, Size(gray_fpt.cols*2, gray_fpt.rows*2), 0, 0, INTER_LINEAR); resize(gray_fpt, dbl, Size(gray_fpt.cols*2, gray_fpt.rows*2), 0, 0, INTER_LINEAR);
#endif #endif
GaussianBlur(dbl, dbl, Size(), sig_diff, sig_diff); Mat result;
return dbl; GaussianBlur(dbl, result, Size(), sig_diff, sig_diff);
return result;
} }
else else
{ {
sig_diff = sqrtf( std::max(sigma * sigma - SIFT_INIT_SIGMA * SIFT_INIT_SIGMA, 0.01f) ); sig_diff = sqrtf( std::max(sigma * sigma - SIFT_INIT_SIGMA * SIFT_INIT_SIGMA, 0.01f) );
GaussianBlur(gray_fpt, gray_fpt, Size(), sig_diff, sig_diff); Mat result;
return gray_fpt; GaussianBlur(gray_fpt, result, Size(), sig_diff, sig_diff);
return result;
} }
} }