c++ - 从 PCL 样本共识中获取异常值

标签 c++ point-cloud-library

我正在按照此处的示例使用 PCL 提供的 SampleConsensus 功能:http://pointclouds.org/documentation/tutorials/random_sample_consensus.php#random-sample-consensus

问题是,该实现允许通过使用 getInliers 检索 ransac 内点,然后可以使用常用函数 copyPointCloud(in, inliers) 轻松将其转移到点云中, 出)。我有兴趣查看异常值。似乎没有返回异常值列表的功能。如果内点列表已排序,那么我可以遍历点列表并检查当前内点:

for i in point cloud
   if i == currentInlier
       currentInlier++
   else
       add point cloud (i) to new outlier cloud

但我不确定内点列表是否能保证排序,即使它看起来会以这种方式创建?

在 PCL 中肯定有一种本地方法可以做到这一点吗?

最佳答案

您几乎肯定需要 pcl::ExtractIndices。它记录在这里:

http://docs.pointclouds.org/1.7.0/classpcl_1_1_extract_indices.html

你可以在这里看到它是如何使用的:

http://pointclouds.org/documentation/tutorials/extract_indices.php#extract-indices

具体参见:

pcl::ExtractIndices<pcl::PointXYZ> extract;
...
extract.setInputCloud (cloud_filtered);
extract.setIndices (inliers);
...
extract.setNegative (true);
extract.filter (*cloud_f);

关于c++ - 从 PCL 样本共识中获取异常值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24132773/

相关文章:

c++ - 通过 FS 寄存器访问衍生进程的 TIB?

java - 通过 JNI 在 C++ 中进行图形操作

opencv - 使用 Kinect 进行 3D 对象跟踪检测

c++ - 将 pcl::PointCloud 转换为 Eigen::MatrixBase

c++ - Eclipse 索引器不工作

c++ - 哪些情况会导致 clock() 返回 -1(即失败)?

c++ - 使用boost库更新具有相同名称的每个节点的XML属性值时出现的问题

c++ - 重载赋值运算符不适用于链接

python-3.x - 我们如何使用 python 从点云数据(来自 .PCD 文件)中选取 3D 点?

c++ - 在 PCL 中可视化 PointNormal 点云的法线