我正在尝试使用icp算法来对齐2个RGBD云,但是函数align导致了分段错误,我不知道为什么以及如何修复这个错误,如果有人能帮助我,我将不胜感激
这是我正在尝试做的一个例子。
pcl::IterativeClosestPoint<pcl::PointXYZ, pcl::PointXYZ> icp;
vector<int>index;
pcl::removeNaNFromPointCloud(*cloud_in,*cloud_in,index);
pcl::removeNaNFromPointCloud(*cloud_out,*cloud_out,index);
icp.setInputCloud(cloud_in);
icp.setInputTarget(cloud_out);
pcl::PointCloud<pcl::PointXYZ> Final;
icp.align(Final);发布于 2018-06-04 04:29:11
我也有同样的问题。在我的例子中,输入点云是一个有序的点云(分辨率为48x64),包含NaN。即使我应用了pcl::removeNaNFromPointCloud,NaN值仍然存在。我通过在处理之前将有序的输入点云转换为无序的点云(Nx3)解决了这个问题。
如果您的cloud_in也是有序点云,请尝试先将其转换为无序点云,如下所示:
cloud_in->width = cloud_in->width * cloud_in->height;
cloud_in->height = 1;
cloud_in->is_dense = false;
cloud_in->points.resize (cloud_in->width * cloud_in->height);
// Then remove NaNs and apply ICP https://stackoverflow.com/questions/47233474
复制相似问题