Easy3D 2.5.3
PointCloudSimplification Class Reference

PointCloudSimplification provides various point cloud simplification algorithms. More...

#include <easy3d/algo/point_cloud_simplification.h>

Static Public Member Functions

static float average_space (PointCloud *cloud, KdTreeSearch *kdtree=nullptr, int k=6, bool accurate=false, int samples=10000)
 Query the average spacing of a point cloud. More...
 
static std::vector< PointCloud::Vertexgrid_simplification (PointCloud *cloud, float cell_size)
 Simplification of a point cloud using a regular grid covering the bounding box of the points. Simplification is done by keeping a representative point (chosen arbitrarily) for each cell of the grid. This is non-uniform simplification since the representative point is chosen arbitrarily. More...
 
static std::vector< PointCloud::Vertexuniform_simplification (PointCloud *cloud, float epsilon, KdTreeSearch *kdtree=nullptr)
 Uniformly downsample a point cloud based on a distance criterion. This function can also be used for removing duplicate points of a point cloud. More...
 
static std::vector< PointCloud::Vertexuniform_simplification (PointCloud *cloud, unsigned int num)
 Uniformly downsample a point cloud given the expected point number. More...
 

Detailed Description

PointCloudSimplification provides various point cloud simplification algorithms.

Member Function Documentation

◆ average_space()

float average_space ( PointCloud cloud,
KdTreeSearch kdtree = nullptr,
int  k = 6,
bool  accurate = false,
int  samples = 10000 
)
static

Query the average spacing of a point cloud.

Parameters
cloudThe point cloud.
kThe number of nearest points used.
accurateTrue to use every point to get an accurate calculation; false to obtain aa approximate measure, which uses only a subset (i.e., less than samples) of the points.
samplesUse less than this number of points for the calculation.
kdtreeA kdtree defined on this point cloud. If null, a new kdtree will be built and used.
Returns
The average space of the point cloud.

◆ grid_simplification()

std::vector< PointCloud::Vertex > grid_simplification ( PointCloud cloud,
float  cell_size 
)
static

Simplification of a point cloud using a regular grid covering the bounding box of the points. Simplification is done by keeping a representative point (chosen arbitrarily) for each cell of the grid. This is non-uniform simplification since the representative point is chosen arbitrarily.

Parameters
cloudThe point cloud.
cell_sizeThe size of the cells of the grid.
Returns
The indices of points to be deleted.

◆ uniform_simplification() [1/2]

std::vector< PointCloud::Vertex > uniform_simplification ( PointCloud cloud,
float  epsilon,
KdTreeSearch kdtree = nullptr 
)
static

Uniformly downsample a point cloud based on a distance criterion. This function can also be used for removing duplicate points of a point cloud.

Parameters
cloudThe point cloud.
epsilonThe minimum allowed distance between points. Two points with a distance smaller than this value are considered identical. After simplification, the distance of any point pair is larger than this value.
kdtreeA kdtree defined on this point cloud. If null, a new kdtree will be built and used.
Returns
The indices of points to be deleted.

◆ uniform_simplification() [2/2]

std::vector< PointCloud::Vertex > uniform_simplification ( PointCloud cloud,
unsigned int  num 
)
static

Uniformly downsample a point cloud given the expected point number.

Parameters
cloudThe point cloud.
numThe expected point number, which must be less than or equal to the original point number.
Returns
The indices of points to be deleted.

The documentation for this class was generated from the following files: