![]() |
ACloudViewer
3.9.4
A Modern Library for 3D Data Processing
|
#include <StatisticalTestingTools.h>


Static Public Member Functions | |
| static double | computeAdaptativeChi2Dist (const GenericDistribution *distrib, const GenericCloud *cloud, unsigned numberOfClasses, unsigned &finalNumberOfClasses, bool noClassCompression=false, ScalarType *histoMin=nullptr, ScalarType *histoMax=nullptr, unsigned *histoValues=nullptr, double *npis=nullptr) |
| Computes the Chi2 distance on a sample of scalar values. More... | |
| static double | computeChi2Fractile (double p, int d) |
| Computes the Chi2 fractile. More... | |
| static double | computeChi2Probability (double chi2result, int d) |
| Computes the Chi2 confidence probability. More... | |
| static double | testCloudWithStatisticalModel (const GenericDistribution *distrib, GenericIndexedCloudPersist *theCloud, unsigned numberOfNeighbours, double pTrust, GenericProgressCallback *progressCb=nullptr, DgmOctree *inputOctree=nullptr) |
Static Protected Member Functions | |
| static bool | computeLocalChi2DistAtLevel (const DgmOctree::octreeCell &cell, void **additionalParameters, NormalizedProgress *nProgress=nullptr) |
| Computes (locally) the Chi2 distance inside an octree cell. More... | |
Statistical testing algorithms (Chi2 distance computation, statistic filtering, etc.)
Definition at line 24 of file StatisticalTestingTools.h.
|
static |
Computes the Chi2 distance on a sample of scalar values.
The Chi2 distance is computed between an empiric distribution generated from a set of scalar values (with a specific number of classes), and a theoretical distribution. It assures that each class of the empirical distribution is such that it respects n.pi>=5 (where n is the total number of points, and pi is the cumulative probability of the class). Therefore the number of classes can be changed by the method. If the 'noClassCompression' parameter is set to true, the above condition is not checked and distance can diverge (which should not be possible according to the Chi2 Test theory, but it can be useful for classification purposes).
| distrib | a theoretical distribution | |
| cloud | a subset of points (associated to scalar values) | |
| numberOfClasses | initial number of classes for the empirical distribution (0 for automatic determination, >1 otherwise) | |
| finalNumberOfClasses | final number of classes of the empirical distribution | |
| noClassCompression | prevent the algorithm from performing classes compression (faster but less accurate) | |
| histoMin | [optional] minimum histogram value | |
| histoMax | [optional] maximum histogram value | |
| [out] | histoValues | [optional] histogram array (its size should be equal to the initial number of classes) |
| [out] | npis | [optional] array containing the theoretical probabilities for each class (its size should be equal to the initial number of classes) |
Definition at line 43 of file StatisticalTestingTools.cpp.
References cloudViewer::utility::ceil(), CHI2_MAX, cloudViewer::GenericDistribution::computePfromZero(), cloudViewer::utility::floor(), cloudViewer::GenericCloud::getPointScalarValue(), cloudViewer::GreaterThanEpsilon(), cloudViewer::GenericDistribution::isValid(), Chi2Class::n, Chi2Class::pi, cloudViewer::GenericCloud::size(), and cloudViewer::ScalarField::ValidValue().
Referenced by computeLocalChi2DistAtLevel(), ccEntityAction::computeStatParams(), and define_StatisticalTestingTools().
|
static |
Computes the Chi2 fractile.
Returns the max Chi2 Distance for a given "confidence" probability and a given number of "degrees of liberty" (equivalent to the number of classes-1).
| p | the result "confidence" |
| d | the number of d.o.l. |
Definition at line 242 of file StatisticalTestingTools.cpp.
References Chi2Helper::critchi().
Referenced by define_StatisticalTestingTools(), and testCloudWithStatisticalModel().
|
static |
Computes the Chi2 confidence probability.
Returns the Chi2 confidence probability for a given Chi2 distance value and a given number of "degress of liberty" (equivalent to the number of classes-1).
| chi2result | the Chi2 distance |
| d | the number of d.o.l. |
Definition at line 246 of file StatisticalTestingTools.cpp.
References Chi2Helper::pochisq().
Referenced by define_StatisticalTestingTools().
|
staticprotected |
Computes (locally) the Chi2 distance inside an octree cell.
Additional parameters are:
| cell | structure describing the cell on which processing is applied |
| additionalParameters | see method description |
| nProgress | optional (normalized) progress notification (per-point) |
Definition at line 337 of file StatisticalTestingTools.cpp.
References cloudViewer::ReferenceCloud::addPointIndex(), cloudViewer::DgmOctree::NearestNeighboursSearchStruct::alreadyVisitedNeighbourhoodSize, cloudViewer::DgmOctree::NearestNeighboursSearchStruct::cellCenter, cloudViewer::DgmOctree::NearestNeighboursSearchStruct::cellPos, cloudViewer::ReferenceCloud::clear(), computeAdaptativeChi2Dist(), cloudViewer::DgmOctree::computeCellCenter(), cloudViewer::DgmOctree::findNearestNeighborsStartingFromCell(), cloudViewer::ReferenceCloud::getAssociatedCloud(), cloudViewer::DgmOctree::getCellPos(), cloudViewer::ReferenceCloud::getPoint(), cloudViewer::ReferenceCloud::getPointGlobalIndex(), cloudViewer::ReferenceCloud::getPointPersistentPtr(), cloudViewer::ReferenceCloud::getPointScalarValue(), cloudViewer::DgmOctree::NearestNeighboursSearchStruct::level, cloudViewer::DgmOctree::octreeCell::level, cloudViewer::DgmOctree::NearestNeighboursSearchStruct::minNumberOfNeighbors, NAN_VALUE, nProgress, cloudViewer::NormalizedProgress::oneStep(), cloudViewer::DgmOctree::octreeCell::parentOctree, cloudViewer::DgmOctree::octreeCell::points, cloudViewer::DgmOctree::NearestNeighboursSearchStruct::pointsInNeighbourhood, cloudViewer::DgmOctree::NearestNeighboursSearchStruct::queryPoint, cloudViewer::ReferenceCloud::reserve(), cloudViewer::ReferenceCloud::setPointScalarValue(), cloudViewer::ReferenceCloud::size(), cloudViewer::DgmOctree::octreeCell::truncatedCode, and cloudViewer::ScalarField::ValidValue().
Referenced by testCloudWithStatisticalModel().
|
static |
Classfies the point cloud in two category by locally applying a statistical (Chi2) test This algorithm is described in Daniel Girardeau-Montaut's PhD manuscript (Chapter 3. section 3.2.3). It mainly consists in determining if a point associated scalar value is part of the measurements noise (in which case the point will be considered as "unchanged") or if not (in which case the point will be considered as a trully "changed"). This determination is based on a statistical analysis (Chi2 Test) of the scalar values distribution around each point (by considering a small neighbourhood of points around each point). The classification result will depend on the Chi2 Test parameters (e.g. the number of classes - which in this case is equal to the square root of the neighbourhood size - and the confidence probability - the greater it is, the more severe the result is). WARNING : the scalar field behind the GenericIndexedCloud interface should be splet in 2, one for reading the scalar values to test (OUT - getScalarValue) and the other to save the resulting Chi2 distance (IN - setScalarValue).
| distrib | a theoretical noise distribution |
| theCloud | the point cloud to classify |
| numberOfNeighbours | the neighbourhood size for the local analysis |
| pTrust | the Chi2 Test confidence probability |
| 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 |
Definition at line 251 of file StatisticalTestingTools.cpp.
References cloudViewer::DgmOctree::build(), cloudViewer::utility::ceil(), computeChi2Fractile(), computeLocalChi2DistAtLevel(), cloudViewer::GenericCloud::enableScalarField(), cloudViewer::DgmOctree::executeFunctionForAllCellsStartingAtLevel(), cloudViewer::DgmOctree::findBestLevelForAGivenPopulationPerCell(), cloudViewer::GenericDistribution::getName(), cloudViewer::NormalDistribution::getParameters(), cloudViewer::GenericProgressCallback::isCancelRequested(), and cloudViewer::GenericDistribution::isValid().
Referenced by define_StatisticalTestingTools(), CommandStatTest::process(), and ccEntityAction::statisticalTest().