Commit 072a4b54 authored by Vadim Pisarevsky's avatar Vadim Pisarevsky

Merge pull request #3851 from ellbur:findTransformECC-initialize-bug

parents 9683f93a ff48387a
...@@ -67,5 +67,5 @@ PERF_TEST_P(TransformationType, findTransformECC, /*testing::ValuesIn(MotionType ...@@ -67,5 +67,5 @@ PERF_TEST_P(TransformationType, findTransformECC, /*testing::ValuesIn(MotionType
findTransformECC(templateImage, img, warpMat, transform_type, findTransformECC(templateImage, img, warpMat, transform_type,
TermCriteria(TermCriteria::COUNT+TermCriteria::EPS, 5, -1)); TermCriteria(TermCriteria::COUNT+TermCriteria::EPS, 5, -1));
} }
SANITY_CHECK(warpMat, 1e-3); SANITY_CHECK(warpMat, 3e-3);
} }
...@@ -465,6 +465,7 @@ double cv::findTransformECC(InputArray templateImage, ...@@ -465,6 +465,7 @@ double cv::findTransformECC(InputArray templateImage,
meanStdDev(templateFloat, tmpMean, tmpStd, imageMask); meanStdDev(templateFloat, tmpMean, tmpStd, imageMask);
subtract(imageWarped, imgMean, imageWarped, imageMask);//zero-mean input subtract(imageWarped, imgMean, imageWarped, imageMask);//zero-mean input
templateZM = Mat::zeros(templateZM.rows, templateZM.cols, templateZM.type());
subtract(templateFloat, tmpMean, templateZM, imageMask);//zero-mean template subtract(templateFloat, tmpMean, templateZM, imageMask);//zero-mean template
const double tmpNorm = std::sqrt(countNonZero(imageMask)*(tmpStd.val[0])*(tmpStd.val[0])); const double tmpNorm = std::sqrt(countNonZero(imageMask)*(tmpStd.val[0])*(tmpStd.val[0]));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment