mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-14 04:35:57 +08:00
Removed scaling from the umeyama when it is not requested.
This commit is contained in:
parent
088379ac2f
commit
5a3f49036b
@ -153,16 +153,21 @@ umeyama(const MatrixBase<Derived>& src, const MatrixBase<OtherDerived>& dst, boo
|
|||||||
Rt.block(0,0,m,m).noalias() = svd.matrixU() * S.asDiagonal() * svd.matrixV().transpose();
|
Rt.block(0,0,m,m).noalias() = svd.matrixU() * S.asDiagonal() * svd.matrixV().transpose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (with_scaling)
|
||||||
|
{
|
||||||
// Eq. (42)
|
// Eq. (42)
|
||||||
const Scalar c = 1/src_var * svd.singularValues().dot(S);
|
const Scalar c = 1/src_var * svd.singularValues().dot(S);
|
||||||
|
|
||||||
// Eq. (41)
|
// Eq. (41)
|
||||||
// Note that we first assign dst_mean to the destination so that there no need
|
|
||||||
// for a temporary.
|
|
||||||
Rt.col(m).head(m) = dst_mean;
|
Rt.col(m).head(m) = dst_mean;
|
||||||
Rt.col(m).head(m).noalias() -= c*Rt.topLeftCorner(m,m)*src_mean;
|
Rt.col(m).head(m).noalias() -= c*Rt.topLeftCorner(m,m)*src_mean;
|
||||||
|
Rt.block(0,0,m,m) *= c;
|
||||||
if (with_scaling) Rt.block(0,0,m,m) *= c;
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Rt.col(m).head(m) = dst_mean;
|
||||||
|
Rt.col(m).head(m).noalias() -= Rt.topLeftCorner(m,m)*src_mean;
|
||||||
|
}
|
||||||
|
|
||||||
return Rt;
|
return Rt;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user