获取PCL样本共识的异常值

时间:2014-06-10 04:17:18

标签: c++ point-cloud-library

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

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

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

但我不确定inlier列表是否可以保证排序,即使它似乎是以这种方式创建的?

当然,在PCL中有一种本地方式可以做到这一点吗?

1 个答案:

答案 0 :(得分:3)

你几乎肯定想要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);