【问题标题】:PCL Iterative Closest Point and other effects reporting empty point cloudsPCL 迭代最近点和其他效果报告空点云
【发布时间】:2019-05-11 09:17:12
【问题描述】:

我正在使用带有预构建版本的 PCL(Windows 为 1.9.1),甚至使用源代码构建一个,但我无法拥有迭代最近点 (ICP) 甚至其他过滤器(例如,正常估计)才能正常工作。 这是我的 C++ 代码:

#include <pcl/io/ply_io.h>
#include <pcl/registration/icp.h>

void test(void) 
{ 
        typedef pcl::PointXYZ              PointType; 
        typedef pcl::PointCloud<PointType> PointCloudType;

        typedef pcl::IterativeClosestPoint<PointType, PointType, float> ICPType; 

        PointCloudType::Ptr pcA(new PointCloudType()); 
        pcl::io::loadPLYFile("pointcloud00000.ply", *pcA); 
        std::cout << "pcA size: " << pcA->points.size() << std::endl; 

        PointCloudType::Ptr pcB(new PointCloudType()); 
        pcl::io::loadPLYFile("pointcloud00001.ply", *pcB); 
        std::cout << "pcB size: " << pcB->points.size() << std::endl; 

        ICPType icp; 
        icp.setInputSource(pcA); 
        icp.setInputTarget(pcB); 

        PointCloudType pcC; 
        icp.align(pcC); 
        std::cout << "pcC size: " << pcC.points.size() << std::endl; 
} 

这就是我在输出控制台中得到的:

pcA size: 19346 
pcB size: 19409 
[pcl::KdTreeFLANN::setInputCloud] Cannot create a KDTree with an empty input cloud! 
[pcl::KdTreeFLANN::setInputCloud] Cannot create a KDTree with an empty input cloud! 
[pcl::IterativeClosestPoint::computeTransformation] Not enough correspondences found. Relax your threshold parameters. 
pcC size: 19346 

使用云有一些问题,PCL 抱怨它们是空的,但正如它所写的那样,它们被填充了大约 20K 点。

你能帮帮我吗?

【问题讨论】:

  • 你最终解决了这个问题吗?
  • 好吧,我没有,只是由于项目时间安排而转移到另一个 icp 实施。

标签: c++ point-cloud-library point-clouds


【解决方案1】:

您可能必须提供一些参数才能使算法正常工作。

查看API 文档,您可以看到有一个示例提供了如何使用该算法。

IterativeClosestPoint<PointXYZ, PointXYZ> icp;
// Set the input source and target
icp.setInputCloud (cloud_source);
icp.setInputTarget (cloud_target);
// Set the max correspondence distance to 5cm (e.g., correspondences with higher distances will be ignored)
icp.setMaxCorrespondenceDistance (0.05);
// Set the maximum number of iterations (criterion 1)
icp.setMaximumIterations (50);
// Set the transformation epsilon (criterion 2)
icp.setTransformationEpsilon (1e-8);
// Set the euclidean distance difference epsilon (criterion 3)
icp.setEuclideanFitnessEpsilon (1);
// Perform the alignment
icp.align (cloud_source_registered);
// Obtain the transformation that aligned cloud_source to cloud_source_registered
Eigen::Matrix4f transformation = icp.getFinalTransformation ();

为了获得好的结果,您必须根据您的数据集相应地调整参数。

【讨论】:

  • 问题不在于 icp 设置,即使我按照您的建议复制文档,flan kdtree 会出现“空云”错误。
  • 能否提供点云数据?我可以看看,问题是
  • 您必须知道的另一点是,ICP 并不是在每个输入上都能神奇地工作。两个点云必须预先对齐,然后使用 ICP 对两个预先对齐的点云进行精细对齐。我提到你必须根据你的输入调整参数。
  • 嗨,serkan,感谢您的努力。我在这个领域相当不错
猜你喜欢
  • 2016-10-17
  • 2016-07-16
  • 1970-01-01
  • 2013-06-21
  • 2021-04-06
  • 1970-01-01
  • 1970-01-01
  • 2012-04-23
  • 2023-04-09
相关资源
最近更新 更多