问题
:我正在尝试使用特征JacobiSVD模块计算旋转矩阵的奇异值分解,以计算旋转矩阵的单值分解。
预期
:我应该能够将Eigen::Affine3d类型的旋转矩阵传递给svd方法,然后使用svd中的U和V生成Eigen::Affine3d类型的新旋转矩阵。
观察
svd方法不会将我的tSixDof矩阵作为可接受的参数。
问题
为什么我不能使用仿射矩阵作为输入?是否有更好的方法执行此操作?
// Resolve numerical errors in the rotation matrix by implementing the
// orthogonal procrustes problem algorithm.
void SixDof::resolveRotation()
{
//initial SixDof
SixDof tSixDof;
Eigen::Index n = tSixDof.rows();
Eigen::Index m = tSixDof.rows();
Eigen::Matrix3d U;
Eigen::Matrix3d V;
Eigen::Matrix3d R;
Eigen::JacobiSVD<Eigen::Matrix3d> svd(tSixDof.rotation()
Eigen::ComputeFullU | Eigen::ComputeFullV);
U = svd.matrixU();
V = svd.matrixV();
R = U*V.transpose();
//Resolved SixDof
tSixDof.rotation() = R;
}
六自由度类
class SixDof : public Eigen::Affine3d
{
public:
SixDof();
SixDof(const Eigen::Affine3d& aOther);
void resolveRotation();
};