1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 07:43:03 +04:00

address template matching sqdiff bug

This commit is contained in:
danielenricocahall
2021-04-25 22:17:07 -04:00
parent 0649a2fbdb
commit 402bce1a31
2 changed files with 93 additions and 1 deletions
+1
View File
@@ -1036,6 +1036,7 @@ static bool ipp_sqrDistance(const Mat& src, const Mat& tpl, Mat& dst)
buffer.allocate( bufSize );
status = CV_INSTRUMENT_FUN_IPP(ippiSqrDistanceNorm, src.ptr(), (int)src.step, srcRoiSize, tpl.ptr(), (int)tpl.step, tplRoiSize, dst.ptr<Ipp32f>(), (int)dst.step, funCfg, buffer);
dst = cv::max(dst, 0); // handle edge case from rounding in variance computation which can result in negative values
return status >= 0;
}