Several algorithms to compute point-clouds geometric characteristics (curvature, density, etc.)
More...
#include <GeometricalAnalysisTools.h>
|
enum | GeomCharacteristic {
Feature
, Curvature
, LocalDensity
, ApproxLocalDensity
,
Roughness
, MomentOrder1
} |
|
enum | Density { DENSITY_KNN = 1
, DENSITY_2D
, DENSITY_3D
} |
| Density measurement. More...
|
|
enum | ErrorCode {
NoError = 0
, InvalidInput = -1
, NotEnoughPoints = -2
, OctreeComputationFailed = -3
,
ProcessFailed = -4
, UnhandledCharacteristic = -5
, NotEnoughMemory = -6
, ProcessCancelledByUser = -7
} |
|
|
static ErrorCode | ComputeCharactersitic (GeomCharacteristic c, int subOption, GenericIndexedCloudPersist *cloud, PointCoordinateType kernelRadius, const CCVector3 *roughnessUpDir=nullptr, GenericProgressCallback *progressCb=nullptr, DgmOctree *inputOctree=nullptr) |
| Unified way to compute a geometric characteristic. More...
|
|
static ErrorCode | ComputeLocalDensityApprox (GenericIndexedCloudPersist *cloud, Density densityType, GenericProgressCallback *progressCb=nullptr, DgmOctree *inputOctree=nullptr) |
| Computes the local density (approximate) More...
|
|
static CCVector3 | ComputeGravityCenter (GenericCloud *theCloud) |
| Computes the gravity center of a point cloud. More...
|
|
static CCVector3 | ComputeWeightedGravityCenter (GenericCloud *theCloud, ScalarField *weights) |
| Computes the weighted gravity center of a point cloud. More...
|
|
static SquareMatrixd | ComputeCrossCovarianceMatrix (GenericCloud *P, GenericCloud *Q, const CCVector3 &pGravityCenter, const CCVector3 &qGravityCenter) |
| Computes the cross covariance matrix between two clouds (same size) More...
|
|
static SquareMatrixd | ComputeWeightedCrossCovarianceMatrix (GenericCloud *P, GenericCloud *Q, const CCVector3 &pGravityCenter, const CCVector3 &qGravityCenter, ScalarField *coupleWeights=nullptr) |
| Computes the cross covariance matrix between two clouds (same size) - weighted version. More...
|
|
static SquareMatrixd | ComputeCovarianceMatrix (GenericCloud *theCloud, const PointCoordinateType *_gravityCenter=nullptr) |
| Computes the covariance matrix of a clouds. More...
|
|
static ErrorCode | FlagDuplicatePoints (GenericIndexedCloudPersist *theCloud, double minDistanceBetweenPoints=std::numeric_limits< double >::epsilon(), GenericProgressCallback *progressCb=nullptr, DgmOctree *inputOctree=nullptr) |
| Flag duplicate points. More...
|
|
static ErrorCode | DetectSphereRobust (GenericIndexedCloudPersist *cloud, double outliersRatio, CCVector3 ¢er, PointCoordinateType &radius, double &rms, GenericProgressCallback *progressCb=nullptr, double confidence=0.99, unsigned seed=0) |
| Tries to detect a sphere in a point cloud. More...
|
|
static ErrorCode | ComputeSphereFrom4 (const CCVector3 &A, const CCVector3 &B, const CCVector3 &C, const CCVector3 &D, CCVector3 ¢er, PointCoordinateType &radius) |
| Computes the center and radius of a sphere passing through 4 points. More...
|
|
Several algorithms to compute point-clouds geometric characteristics (curvature, density, etc.)
◆ Density
Density measurement.
Enumerator |
---|
DENSITY_KNN | The number of points inside the neighborhing sphere
|
DENSITY_2D | The number of points divided by the area of the circle that has the same radius as the neighborhing sphere (2D approximation)
|
DENSITY_3D | The number of points divided by the neighborhing sphere volume (3D)
|
◆ GeomCharacteristic
◆ ComputeApproxPointsDensityInACellAtLevel()
Computes approximate point density inside a cell.
- Parameters
-
cell | structure describing the cell on which processing is applied |
additionalParameters | see method description |
nProgress | optional (normalized) progress notification (per-point) |
◆ ComputeCharactersitic()
Unified way to compute a geometric characteristic.
Once the main geometric characterstic is chosen, the subOption parameter is used to specify the actual feature / curvature type / local density computation algorithm if necessary.
- Parameters
-
c | geometric characterstic |
subOption | feature / curvature type / local density computation algorithm or nothing (0) |
cloud | cloud to compute the characteristic on |
kernelRadius | neighbouring sphere radius |
roughnessUpDir | up direction to compute signed roughness values (optional) |
progressCb | client application can get some notification of the process progress through this callback mechanism (see GenericProgressCallback) |
inputOctree | if not set as input, octree will be automatically computed. |
- Returns
- succes
◆ ComputeCovarianceMatrix()
SquareMatrixd GeometricalAnalysisTools::ComputeCovarianceMatrix |
( |
GenericCloud * |
theCloud, |
|
|
const PointCoordinateType * |
_gravityCenter = nullptr |
|
) |
| |
|
static |
Computes the covariance matrix of a clouds.
- Warning
- this method uses the cloud global iterator
- Parameters
-
theCloud | point cloud |
_gravityCenter | if available, its gravity center |
- Returns
- covariance matrix
◆ ComputeCrossCovarianceMatrix()
Computes the cross covariance matrix between two clouds (same size)
Used in the ICP algorithm between the cloud to register and the "Closest Points Set" determined from the reference cloud.
- Warning
- this method uses the clouds global iterators
- Parameters
-
P | the cloud to register |
Q | the "Closest Point Set" |
pGravityCenter | the gravity center of P |
qGravityCenter | the gravity center of Q |
- Returns
- cross covariance matrix
◆ ComputeGeomCharacteristicAtLevel()
Computes geom characteristic inside a cell.
- Parameters
-
cell | structure describing the cell on which processing is applied |
additionalParameters | see method description |
nProgress | optional (normalized) progress notification (per-point) |
◆ ComputeGravityCenter()
Computes the gravity center of a point cloud.
- Warning
- this method uses the cloud global iterator
- Parameters
-
- Returns
- gravity center
◆ ComputeLocalDensityApprox()
Computes the local density (approximate)
Old method (based only on the distance to the nearest neighbor).
- Warning
- As only one neighbor is extracted, the DENSITY_KNN type corresponds in fact to the (inverse) distance to the nearest neighbor.
-
This method assumes the input scalar field is different from the output one.
- Parameters
-
cloud | processed cloud |
densityType | the 'type' of density to compute |
progressCb | client application can get some notification of the process progress through this callback mechanism (see GenericProgressCallback) |
inputOctree | if not set as input, octree will be automatically computed. |
- Returns
- success (0) or error code (<0)
◆ ComputeSphereFrom4()
Computes the center and radius of a sphere passing through 4 points.
- Parameters
-
[in] | A | first point |
[in] | B | second point |
[in] | C | third point |
[in] | D | fourth point |
[out] | center | center of the sphere |
[out] | radius | radius of the sphere |
- Returns
- success
◆ ComputeWeightedCrossCovarianceMatrix()
Computes the cross covariance matrix between two clouds (same size) - weighted version.
Used in the ICP algorithm between the cloud to register and the "Closest Points Set" determined from the reference cloud.
- Warning
- this method uses the clouds global iterators
- Parameters
-
P | the cloud to register |
Q | the "Closest Point Set" |
pGravityCenter | the gravity center of P |
qGravityCenter | the gravity center of Q |
coupleWeights | weights for each (Pi,Qi) couple (optional) |
- Returns
- weighted cross covariance matrix
◆ ComputeWeightedGravityCenter()
Computes the weighted gravity center of a point cloud.
- Warning
- this method uses the cloud global iterator
- Parameters
-
theCloud | cloud |
weights | per point weights (only absolute values are considered) |
- Returns
- gravity center
◆ DetectSphereRobust()
GeometricalAnalysisTools::ErrorCode GeometricalAnalysisTools::DetectSphereRobust |
( |
GenericIndexedCloudPersist * |
cloud, |
|
|
double |
outliersRatio, |
|
|
CCVector3 & |
center, |
|
|
PointCoordinateType & |
radius, |
|
|
double & |
rms, |
|
|
GenericProgressCallback * |
progressCb = nullptr , |
|
|
double |
confidence = 0.99 , |
|
|
unsigned |
seed = 0 |
|
) |
| |
|
static |
Tries to detect a sphere in a point cloud.
Inspired from "Parameter Estimation Techniques: A Tutorial with Application
to Conic Fitting" by Zhengyou Zhang (Inria Technical Report 2676). More specifically the section 9.5 about Least Median of Squares.
- Parameters
-
[in] | cloud | input cloud |
[in] | outliersRatio | proportion of outliers (between 0 and 1) |
[out] | center | center of the detected sphere |
[out] | radius | radius of the detected sphere |
[out] | rms | residuals RMS for the detected sphere |
[in] | progressCb | for progress notification (optional) |
[in] | confidence | probability that the detected sphere is the right one (strictly below 1) |
[in] | seed | if different than 0, this seed will be used for random numbers generation (instead of a random one) |
- Returns
- success
◆ FlagDuplicatePoints()
Flag duplicate points.
This method only requires an output scalar field. Duplicate points will be associated to scalar value 1 (and 0 for the others).
- Parameters
-
theCloud | processed cloud |
minDistanceBetweenPoints | min distance between (output) points |
progressCb | client application can get some notification of the process progress through this callback mechanism (see GenericProgressCallback) |
inputOctree | if not set as input, octree will be automatically computed. |
- Returns
- success (0) or error code (<0)
◆ FlagDuplicatePointsInACellAtLevel()
Flags duplicate points inside a cell.
- Parameters
-
cell | structure describing the cell on which processing is applied |
additionalParameters | see method description |
nProgress | optional (normalized) progress notification (per-point) |
The documentation for this class was generated from the following files:
- GeometricalAnalysisTools.h
- GeometricalAnalysisTools.cpp