均匀下采样(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
*/
先划分体素,然后在每个体素中选取一个离体素的几何中心最近的点。
体素下采样(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
*/
先划分体素,然后计算每个体素的质心坐标,每个体素仅保留质心点。
若downsample_all_data_ == false
则直接计算每个体素中所有点云的XYZ均值,得到的点云仅有XYZ变量。
若downsample_all_data_ == true
则使用pcl::CentroidPoint<PointT>
实现每个体素中所有点云的XYZRGB的均值计算。
pcl::CentroidPoint<PointT>
中的pcl::detail::Accumulators<PointT>::type
无法识别除XYZRGB以外的自定义类型。也因为如此,PCL中实现的体素下采样无法保留除颜色以外的其他点云特征。