点对点直播的ICP

时间:2018-06-14 21:51:52

标签: point-cloud-library point-clouds

我使用librealsense来获取pointclouds,但我正在努力在实时pointcloud上实现PCL的ICP,这意味着要在循环中运行的ICP中正确分配云。

在循环之外,我定义了从PCL进入ICP算法的目标和匹配云,以及我定义累积的云 - 我在注册过程中得到的:

pcl::PointCloud<pcl::PointXYZRGB>::Ptr target_cloud(new pcl::PointCloud<pcl::PointXYZRGB>);
pcl::PointCloud<pcl::PointXYZRGB>::Ptr matching_cloud(new pcl::PointCloud<pcl::PointXYZRGB>);
pcl::PointCloud<pcl::PointXYZRGB>::Ptr accumulated_cloud(new pcl::PointCloud<pcl::PointXYZRGB>);

然后在循环中我做:

while(1){
rs.acquire(target_cloud);
....
runICP(target_cloud, matching_cloud, pairTransform);
globalTransform = globalTransform * pairTransform;
pcl::PointCloud<pcl::PointXYZRGB> Final;
pcl::transformPointCloud (matching_cloud, Final, globalTransform);
*accumulated_cloud +=Final;
pcl::io::savePCDFileASCII("AccumulatedCloud.pcd", *accumulated_cloud);
matching_cloud=target_cloud;
}

显然错误的部分是我没有在循环中正确定义目标和匹配云之间的关系。有人可以建议在循环中正确分配云指针吗?

0 个答案:

没有答案