ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
cloudViewer::AutoSegmentationTools Class Reference

#include <AutoSegmentationTools.h>

Inheritance diagram for cloudViewer::AutoSegmentationTools:
Collaboration diagram for cloudViewer::AutoSegmentationTools:

Static Public Member Functions

static int labelConnectedComponents (GenericIndexedCloudPersist *theCloud, unsigned char level, bool sixConnexity=false, cloudViewer::GenericProgressCallback *progressCb=nullptr, cloudViewer::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, ScalarType minSeedDist, PointCoordinateType radius, unsigned char octreeLevel, ReferenceCloudContainer &theSegmentedLists, cloudViewer::GenericProgressCallback *progressCb=nullptr, cloudViewer::DgmOctree *inputOctree=nullptr, bool applyGaussianFilter=false, float alpha=2.0f)
 

Detailed Description

Several point cloud auto-segmentation algorithms (Connected Components, Front propagation, etc.)

Definition at line 32 of file AutoSegmentationTools.h.

Member Function Documentation

◆ extractConnectedComponents()

bool AutoSegmentationTools::extractConnectedComponents ( GenericIndexedCloudPersist theCloud,
ReferenceCloudContainer ccc 
)
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)

Parameters
theCloudthe point cloud to segment
cccthe extracted connected compenents (as a list of subsets of points)
Returns
success

Definition at line 55 of file AutoSegmentationTools.cpp.

References cloudViewer::GenericCloud::getPointScalarValue(), cloudViewer::GenericCloud::isScalarFieldEnabled(), and cloudViewer::GenericCloud::size().

Referenced by define_AutoSegmentationTools(), qFacets::extractFacets(), and CommandExtractCCs::process().

◆ frontPropagationBasedSegmentation()

bool AutoSegmentationTools::frontPropagationBasedSegmentation ( GenericIndexedCloudPersist theCloud,
ScalarType  minSeedDist,
PointCoordinateType  radius,
unsigned char  octreeLevel,
ReferenceCloudContainer theSegmentedLists,
cloudViewer::GenericProgressCallback progressCb = nullptr,
cloudViewer::DgmOctree inputOctree = nullptr,
bool  applyGaussianFilter = false,
float  alpha = 2.0f 
)
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

Parameters
theCloudthe point cloud to segment
minSeedDistthe minimum value associated to the point where to start the propagation from ("security" value)
radiusspherical neighborhood size (or 0 for automatic size)
octreeLevellevel of subdivision where to apply the gridding (the greater it is, the smaller and numerous the segmented parts will be)
theSegmentedListsthe segmented parts (as a list of subsets of points)
applyGaussianFilterto specify if a gaussian filter should be applied after computing the scalar field gradient (to smooth the results)
progressCbthe client application can get some notification of the process progress through this callback mechanism (see GenericProgressCallback)
inputOctreethe cloud octree if it has already be computed
alphathe gaussian filter kernel size (needed only if a gaussian filtering pass is required)
Returns
success

Definition at line 109 of file AutoSegmentationTools.cpp.

References cloudViewer::ScalarFieldTools::applyScalarFieldGaussianFilter(), cloudViewer::DgmOctree::build(), cloudViewer::FastMarching::cleanLastPropagation(), cloudViewer::ScalarFieldTools::computeScalarFieldGradient(), cloudViewer::FastMarchingForPropagation::extractPropagatedPoints(), cloudViewer::GenericIndexedCloud::getPoint(), cloudViewer::GenericCloud::getPointScalarValue(), cloudViewer::DgmOctree::getTheCellPosWhichIncludesThePoint(), cloudViewer::FastMarchingForPropagation::init(), min(), NAN_VALUE, cloudViewer::DgmOctree::OCTREE_LENGTH(), octreeLevel, cloudViewer::FastMarchingForPropagation::propagate(), CCShareable::release(), cloudViewer::ScalarField::resizeSafe(), result, cloudViewer::FastMarchingForPropagation::setDetectionThreshold(), cloudViewer::GenericProgressCallback::setInfo(), cloudViewer::FastMarchingForPropagation::setJumpCoef(), cloudViewer::GenericProgressCallback::setMethodTitle(), cloudViewer::GenericCloud::setPointScalarValue(), cloudViewer::FastMarching::setSeedCell(), cloudViewer::GenericCloud::size(), cloudViewer::ReferenceCloud::size(), cloudViewer::GenericProgressCallback::start(), cloudViewer::GenericProgressCallback::stop(), cloudViewer::GenericProgressCallback::textCanBeEdited(), cloudViewer::GenericProgressCallback::update(), Tuple3Tpl< Type >::x, Tuple3Tpl< Type >::y, and Tuple3Tpl< Type >::z.

Referenced by define_AutoSegmentationTools().

◆ labelConnectedComponents()

int AutoSegmentationTools::labelConnectedComponents ( GenericIndexedCloudPersist theCloud,
unsigned char  level,
bool  sixConnexity = false,
cloudViewer::GenericProgressCallback progressCb = nullptr,
cloudViewer::DgmOctree inputOctree = nullptr 
)
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.

Parameters
theCloudthe point cloud to label
levelthe level of subdivision of the octree (between 1 and MAX_OCTREE_LEVEL)
sixConnexityindicates if the CC's 3D connexity should be 6 (26 otherwise)
progressCbthe client application can get some notification of the process progress through this callback mechanism (see GenericProgressCallback)
inputOctreethe cloud octree if it has already been computed
Returns
the number of components (>= 0) or an error code (< 0 - see DgmOctree::extractCCs)

Definition at line 22 of file AutoSegmentationTools.cpp.

References cloudViewer::DgmOctree::build(), cloudViewer::GenericCloud::enableScalarField(), cloudViewer::DgmOctree::extractCCs(), and result.

Referenced by define_AutoSegmentationTools(), and CommandExtractCCs::process().


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