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

This commit is contained in:
Vadim Pisarevsky 2015-03-20 09:34:04 +00:00
commit 072a4b5497
2 changed files with 2 additions and 1 deletions

View File

@ -67,5 +67,5 @@ PERF_TEST_P(TransformationType, findTransformECC, /*testing::ValuesIn(MotionType
findTransformECC(templateImage, img, warpMat, transform_type,
TermCriteria(TermCriteria::COUNT+TermCriteria::EPS, 5, -1));
}
SANITY_CHECK(warpMat, 1e-3);
SANITY_CHECK(warpMat, 3e-3);
}

View File

@ -465,6 +465,7 @@ double cv::findTransformECC(InputArray templateImage,
meanStdDev(templateFloat, tmpMean, tmpStd, imageMask);
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
const double tmpNorm = std::sqrt(countNonZero(imageMask)*(tmpStd.val[0])*(tmpStd.val[0]));