简体   繁体   English

如何从 std::vector 创建 pcl::PointIndices<int> 在 c++ 中使用 `pcl`(点云库)?</int>

[英]How to create pcl::PointIndices from std::vector<int> with `pcl`(Point Cloud Library) in c++?

I'm using pcl in c++, apologizing for not being able to create a pcl tag.我在c++中使用pcl ,抱歉无法创建pcl标签。

I'm realizing a pipe line of point cloud segmentation with pcl .我正在使用pcl实现 pipe 点云分割线。 I want to know how to create pcl::PointIndices from a extracted indices of type std::vector<int> , so I can input it into another filter.我想知道如何从提取的std::vector<int>类型的索引创建 pcl::PointIndices ,这样我就可以将它输入到另一个过滤器中。

First filter can generate indices of type std::vector第一个过滤器可以生成 std::vector 类型的索引

// Create statistical filtering object
pcl::StatisticalOutlierRemoval<PointXYZ> sor;
CloudXYZPtr sor_filtered (new CloudXYZ);
std::vector<int> sor_inliers;

sor.setInputCloud (input);
sor.setMeanK (10);
sor.setStddevMulThresh (0.5);
sor.filter (sor_inliers);

Then, I want input this filtered incides into another filter like:然后,我想将这个过滤后的事件输入到另一个过滤器中,例如:

pcl::RadiusOutlierRemoval<PointXYZ> ror;
pcl::PointIndices::Ptr ror_indices (new pcl::PointIndices);
ror_indices->data = sor_inliers;  // #### How to do this line?
std::vector<int> ror_inliers;

//I can set it like
ror.setInputCloud(input);
ror.setIndices(ror_indices);

How to make it work?如何让它发挥作用? Thanks.谢谢。

This:这个:

ror_indices->data = sor_inliers;  // #### How to do this line?

Should be:应该:

ror_indices->indices = sor_inliers;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM