PCL-获取点云体素中的所有点的索引的方法

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

使用 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 
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值