【发布时间】:2015-03-26 09:15:09
【问题描述】:
我一直在关注http://pointclouds.org/documentation/tutorials/pcl_visualizer.php#pcl-visualizer 教程,并且可以让一个简单的查看器正常工作。
我查阅了文档并找到了函数getMatrixXfMap,它从PointCloud 返回Eigen::MatrixXf。
// Get Eigen matrix
Eigen::MatrixXf M = basic_cloud_ptr->getMatrixXfMap();
cout << "(Eigen) #row :" << M.rows() << endl;
cout << "(Eigen) #col :" << M.cols() << endl;
接下来我处理M(基本上是旋转、平移和其他一些变换)。我如何有效地将M 设置为PointCloud。还是我需要一次pushback()?
【问题讨论】:
-
只要使用
Eigen::Matrix4f trans;就可以随意设置矩阵。pcl::transformPointCloud(*beforeTransCloud,*afterTransCloud,trans) -
如果我的操作不像线性变换那么简单怎么办?如何将点云检索为矩阵进行操作?
-
然后确实使用push_back,或者更有效地使用
cloud->resize,然后每点cloud->points[i].x = ...
标签: eigen point-cloud-library eigen3