CCCoreLib 31 May 2022
CloudCompare Core algorithms
|
Several point cloud auto-segmentation algorithms (Connected Components, Front propagation, etc.) More...
#include <AutoSegmentationTools.h>
Static Public Member Functions | |
static int | labelConnectedComponents (GenericIndexedCloudPersist *theCloud, unsigned char level, bool sixConnexity=false, GenericProgressCallback *progressCb=nullptr, DgmOctree *inputOctree=nullptr) |
Labels connected components from a point cloud. More... | |
static bool | extractConnectedComponents (GenericIndexedCloudPersist *theCloud, ReferenceCloudContainer &ccc) |
Extracts connected components from a point cloud. More... | |
static bool | frontPropagationBasedSegmentation (GenericIndexedCloudPersist *theCloud, PointCoordinateType radius, ScalarType minSeedDist, unsigned char octreeLevel, ReferenceCloudContainer &theSegmentedLists, GenericProgressCallback *progressCb=nullptr, DgmOctree *inputOctree=nullptr, bool applyGaussianFilter=false, float alpha=2.0f) |
Segment a point cloud by propagating fronts constrained by values of the point cloud associated scalar field. More... | |
Several point cloud auto-segmentation algorithms (Connected Components, Front propagation, etc.)
|
static |
Extracts connected components from a point cloud.
This method shloud only be called after the connected components have been labeled (see AutoSegmentationTools::labelConnectedComponents). This implementation of the algorithm assumes that the CCs labels are stored for each point in the associated scalar field. Warning: be sure to set the labels S.F. as OUTPUT (reading)
theCloud | the point cloud to segment |
ccc | the extracted connected compenents (as a list of subsets of points) |
|
static |
Segment a point cloud by propagating fronts constrained by values of the point cloud associated scalar field.
The algorithm is described in Daniel Girardeau-Montaut's PhD manuscript (Chapter 3, section 3.3). It consists mainly in propagating a front on the surface implicitly represented by the point cloud and making this propagation dependent on the scalar values associated to each point (such as the distance information computed between the point cloud and another entity). The propgation is realized with the Fast Marching Algorithm applied on a gridded structure (the octree in this case). Warning: be sure to activate an OUTPUT scalar field on the input cloud
theCloud | the point cloud to segment |
minSeedDist | the minimum value associated to the point where to start the propagation from ("security" value) |
radius | spherical neighborhood size (or 0 for automatic size) |
octreeLevel | level of subdivision where to apply the gridding (the greater it is, the smaller and numerous the segmented parts will be) |
theSegmentedLists | the segmented parts (as a list of subsets of points) |
applyGaussianFilter | to specify if a gaussian filter should be applied after computing the scalar field gradient (to smooth the results) |
progressCb | the client application can get some notification of the process progress through this callback mechanism (see GenericProgressCallback) |
inputOctree | the cloud octree if it has already be computed |
alpha | the gaussian filter kernel size (needed only if a gaussian filtering pass is required) |
|
static |
Labels connected components from a point cloud.
The algorithm is described in Daniel Girardeau-Montaut's PhD manuscript (Chapter 3, section 3.2.4). The main parameter is the maximal distance between two points in order to consider them as belonging to the same connected component. Actually, this parameter is not expressed as is, but as the length of a cell of the octree for a given level of subdivision (this leeds to a great enhancement of the process speed). If the level is "n", then the cell size will be equal to the maximum length of the bounding box of the point cloud divided by 2^n. The greater the level "n" is, the smaller the cell size will be, and therefore the process will produce more connected components.To label the CCs, this implementation of the algorithm use the distance field (via Generic3dPoint::setDist). So be sure to store the original distance field (or to deviate the setDist process) if you don't want it to be replaced.
theCloud | the point cloud to label |
level | the level of subdivision of the octree (between 1 and MAX_OCTREE_LEVEL) |
sixConnexity | indicates if the CC's 3D connexity should be 6 (26 otherwise) |
progressCb | the client application can get some notification of the process progress through this callback mechanism (see GenericProgressCallback) |
inputOctree | the cloud octree if it has already been computed |