From b47c9ac6434a62f7773947273e8d561bb65f0ca5 Mon Sep 17 00:00:00 2001 From: logic1988 <1988heqian@163.com> Date: Thu, 23 Aug 2018 12:48:13 +0800 Subject: [PATCH] Update aff_trans.cpp When the fullAffine parameter is set to false, the estimateRigidTransform function maybe return empty, then the _localAffineEstimate function will be called, but the bug in it will result in incorrect results. --- modules/shape/src/aff_trans.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/shape/src/aff_trans.cpp b/modules/shape/src/aff_trans.cpp index 3316f0f41f..a4490f474f 100644 --- a/modules/shape/src/aff_trans.cpp +++ b/modules/shape/src/aff_trans.cpp @@ -165,8 +165,8 @@ static Mat _localAffineEstimate(const std::vector& shape1, const std::v } else { - therow.at(0,0)=-shape1[contPt].y; - therow.at(0,1)=shape1[contPt].x; + therow.at(0,0)=shape1[contPt].y; + therow.at(0,1)=-shape1[contPt].x; therow.at(0,3)=1; therow.row(0).copyTo(matM.row(ii)); matP.at(ii,0) = shape2[contPt].y;