0. 写在前面
最近集成一些常见点云滤波算法的时候接触filters模块下面的VoxelGrid和UniformSampling算法。乍一看感觉很像,于是去读了头文件中的描述才有所区分,在此进行记录。(以下PCL代码部分均为1.12.1版本)
1. 定义对比
1.1 VoxelGrid头文件定义
/** \brief VoxelGrid assembles a local 3D grid over a given PointCloud, and downsamples + filters the data.
*
* The VoxelGrid class creates a *3D voxel grid* (think about a voxel
* grid as a set of tiny 3D boxes in space) over the input point cloud data.
* Then, in each *voxel* (i.e., 3D box), all the points present will be
* approximated (i.e., *downsampled*) with their centroid. This approach is
* a bit slower than approximating them with the center of the voxel, but it
* represents the underlying surface more accurately.
*
* \author Radu B. Rusu, Bastian Steder
* \ingroup filters
*/
1.2 UniformSampling头文件定义
/** \brief @b UniformSampling assembles a local 3D grid over a given PointCloud, and downsamples + filters the data.
*
* The @b UniformSampling class creates a *3D voxel grid* (think about a voxel
* grid as a set of tiny 3D boxes in space) over the input point cloud data.
* Then, in each *voxel* (i.e., 3D box), all the points present will be
* approximated (i.e., *downsampled*) with the closest point to the center of the voxel.
*
* \author Radu Bogdan Rusu
* \ingroup filters
*/
1.3 总结
对比两个降采样方法的定义,特别是最后一句可以发现:VoxelGrid最终选取的体素内的点是计算得到的几何中心,可能并非原始点云,而UniformSampling选取的是距离体素中心最近的原始点云。