代码之家  ›  专栏  ›  技术社区  ›  Evan Gertis

如何将特征雅可比奇异值分解与特征仿射矩阵结合使用

  •  0
  • Evan Gertis  · 技术社区  · 7 年前

    问题 :我正在尝试使用特征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();
    };
    
    1 回复  |  直到 7 年前
        1
  •  1
  •   Toby Collins    7 年前

    3x3旋转矩阵不是仿射3D变换。从文档中可以看出:“泛型仿射变换由变换类表示,变换类内部是(Dim+1)^2矩阵。”。要执行调整噪声旋转矩阵M的Procrustes,需要使用3x3特征矩阵调用svd(存储M)。