我是 PCL 的新手,我想从 pcl::octree
中的 branch 节点获取所有索引。
因此,例如根节点应提供每个单独的索引,每个子分支节点应提供该分支节点内所有叶节点的点的索引。
实现这一目标的最佳方式是什么?
我正在使用一个
pcl::octree::OctreePointCloudSearch<pcl::PointXYZ, pcl::octree::OctreeContainerPointIndices, pcl::octree::OctreeContainerPointIndices>
并希望 BranchContainerT
的第三个模板参数也设置为 pcl::octree::OctreeContainerPointIndices
以便能够调用类似的东西
std::vector<int> indices;
auto it = m_octree->breadth_begin();
it.getBranchContainer().getPointIndices(indices)
但是,索引 vector 是空的。 当然,我可以手动遍历所有节点,获取叶子并插入索引,但也许我在这里遗漏了一些东西......?
最佳答案
好的,我缺少的是 BranchContainerT
的模板参数设置为 pcl::octree::OctreeContainerPointIndices
仅为您提供在这种容器中存储索引的选项。 但是您必须手动添加这些索引。
鉴于这只是检查每个节点的类型并从叶子收集索引并将它们添加到分支节点的问题。
关于c++ - PointCloudLibrary (PCL) - 八叉树 - 获取 *branch* 节点内所有点的索引,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47138356/