openCV与eigen两种方法---旋转向量转旋转矩阵
`
#include <Eigen/Dense>
#include <opencv2/core/eigen.hpp>
#include <opencv2/opencv.hpp>
using namespace cv;
using namespace std;
int main()
{
// opencv 旋转向量
cv::Vec3d rvec(1.0, 2.0, 3.0);
cv::Mat rotation_matrix;
cv::Rodrigues(rvec, rotation_matrix);
cout << " opencv方法" << endl;
cout << " " << rotation_matrix << endl;
cout << " ------------------- " << endl;
cout << " eigen方法 旋转矩阵 " << endl;
// eigen 旋转矩阵
Eigen::Matrix3f eigen_rotation;
cv::cv2eigen(rotation_matrix, eigen_rotation);
cout << " " << eigen_rotation << endl;
return 0;
}
原文地址:https://blog.csdn.net/hgaohr1021/article/details/143933751
免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!