PointCloudLibrary (PCL) - 八叉树 - 获取 *branch* 节点内所有点的索引
PointCloudLibrary (PCL) - Octree - get indices of all points within a *branch* node
我是 PCL 的新手,我想从 pcl::octree
中的 分支 节点获取所有索引。
因此,例如,根节点应提供每个索引,每个子分支节点应提供该分支节点内所有叶节点的点的索引。
实现此目标的最佳方法是什么?
我正在使用
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)
但是,索引向量为空。
当然,我可以手动遍历所有节点,获取叶子并插入索引,但也许我在这里遗漏了一些东西..?
好的,我缺少的是 BranchContainerT
的模板参数设置为 pcl::octree::OctreeContainerPointIndices
仅 提供 您可以选择将索引存储在此一种容器。 但是 添加这些索引是您必须手动。
鉴于这只是检查每个节点的类型并从叶子收集索引并将它们添加到分支节点的问题。
我是 PCL 的新手,我想从 pcl::octree
中的 分支 节点获取所有索引。
因此,例如,根节点应提供每个索引,每个子分支节点应提供该分支节点内所有叶节点的点的索引。
实现此目标的最佳方法是什么?
我正在使用
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)
但是,索引向量为空。 当然,我可以手动遍历所有节点,获取叶子并插入索引,但也许我在这里遗漏了一些东西..?
好的,我缺少的是 BranchContainerT
的模板参数设置为 pcl::octree::OctreeContainerPointIndices
仅 提供 您可以选择将索引存储在此一种容器。 但是 添加这些索引是您必须手动。
鉴于这只是检查每个节点的类型并从叶子收集索引并将它们添加到分支节点的问题。