Function mapping_algorithms::utils::point_cloud::voxel_downsample_point_cloud
source · pub fn voxel_downsample_point_cloud<T, const N: usize>(
points: &[Point<T, N>],
voxel_size: T,
) -> Vec<Point<T, N>>Expand description
Downsample a points cloud, returning a new point cloud, with all points within each voxel combined into their mean.
§Arguments
points: a slice ofPoint, representing the point cloud.voxel_size: a floating point number, specifying the size for each voxel, all points inside that voxel will be downsampled to their centeroid..
§Generics
§Returns
A Vec of Point representing the downsampled point cloud.
§Warnings
- Point cloud order is never guaranteed.
- When compiling for no_std, a
BTreeMapfrom thealloccrate is used in place of aHashMap.