如何将特征雅可比 SVD 与特征仿射矩阵一起使用
How to use Eigen Jacobi SVD with Eigen Affine Matrix
问题:我正在尝试使用 Eigen JacobiSVD 模块计算旋转矩阵的 SVD,以计算旋转矩阵的单值分解。
Expected :我应该能够将 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;
}
SixDof class
class SixDof : public Eigen::Affine3d
{
public:
SixDof();
SixDof(const Eigen::Affine3d& aOther);
void resolveRotation();
};
3x3 旋转矩阵不是 Affine3D 变换。来自文档:"Generic affine transformations are represented by the Transform class which internally is a (Dim+1)^2 matrix."。要执行 Procrustes 以调整嘈杂的旋转矩阵 M,您需要使用 3x3 本征矩阵(存储 M)调用 svd。
问题:我正在尝试使用 Eigen JacobiSVD 模块计算旋转矩阵的 SVD,以计算旋转矩阵的单值分解。
Expected :我应该能够将 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;
}
SixDof class
class SixDof : public Eigen::Affine3d
{
public:
SixDof();
SixDof(const Eigen::Affine3d& aOther);
void resolveRotation();
};
3x3 旋转矩阵不是 Affine3D 变换。来自文档:"Generic affine transformations are represented by the Transform class which internally is a (Dim+1)^2 matrix."。要执行 Procrustes 以调整嘈杂的旋转矩阵 M,您需要使用 3x3 本征矩阵(存储 M)调用 svd。