使用 octree 将点云体素化之后,获取体素中所有点的方法
即OctreeContainerBase中的三个方法的介绍:
getPointIndex()、getPointIndicesVector()、getPointIndices()
这三个方法都是定义在 pcl/octree/octree_container.h 文件中,源码如下:
首先在该文件中,leafDataTVector_ 是一个存储了该体素中所有点的 vector
/** \brief Leaf node DataT vector. */
std::vector<int> leafDataTVector_;
getPointIndex() 是一个 int 类型的方法,能够将该体素中所有点的索引的最后一个返回
/** \brief Retrieve point index from container. This container stores a vector of point indices.
* \return index stored within container.
*/
int
getPointIndex ( ) const
{
return leafDataTVector_.back ();
}
getPointIndices() 方法是 void 类型的,没有返回值,使用是需要将定义好的 vector 写进函数的参数中,调用该方法时会将该体素中所有点的索引都插入到参数中的 vector
/** \brief Retrieve point indices from container. This container stores a

本文介绍如何通过OctreePointCloud的三个方法getPointIndex(), getPointIndicesVector(), 和getPointIndices()来获取体素化后的点云数据索引。这三种方法分别用于获取单个索引、索引向量引用及向量插入。
最低0.47元/天 解锁文章
1991





