![]() |
ACloudViewer
3.9.4
A Modern Library for 3D Data Processing
|
The Normal/Gaussian statistical distribution. More...
#include <NormalDistribution.h>
Public Member Functions | |
| NormalDistribution () | |
| NormalDistribution constructor. More... | |
| NormalDistribution (ScalarType _mu, ScalarType _sigma2) | |
| NormalDistribution constructor. More... | |
| bool | computeParameters (const ScalarContainer &values) override |
| Computes the distribution parameters from a set of values. More... | |
| double | computeP (ScalarType x) const override |
| Computes the probability of x. More... | |
| double | computePfromZero (ScalarType x) const override |
| Computes the cumulative probability between 0 and x. More... | |
| double | computeP (ScalarType x1, ScalarType x2) const override |
| Computes the cumulative probability between x1 and x2. More... | |
| double | computeChi2Dist (const GenericCloud *Yk, unsigned numberOfClasses, int *histo=nullptr) override |
| Computes the Chi2 distance (related to the Chi2 Test) More... | |
| const char * | getName () const override |
| Returns distribution name. More... | |
| bool | getParameters (ScalarType &_mu, ScalarType &_sigma2) const |
| Returns the distribution parameters. More... | |
| bool | setParameters (ScalarType _mu, ScalarType _sigma2) |
| Sets the distribution parameters. More... | |
| ScalarType | getMu () const |
| Returns the distribution mean. More... | |
| ScalarType | getSigma2 () const |
| Returns the distribution variance. More... | |
| bool | computeParameters (const GenericCloud *cloud) |
| bool | computeRobustParameters (const ScalarContainer &values, double nSigma) |
Public Member Functions inherited from cloudViewer::GenericDistribution | |
| GenericDistribution () | |
| Default constructor. More... | |
| virtual | ~GenericDistribution ()=default |
| Default destructor. More... | |
| virtual bool | isValid () const |
| Indicates if the distribution parameters are valid. More... | |
Protected Member Functions | |
| virtual bool | setChi2ClassesPositions (unsigned numberOfClasses) |
| Compute each Chi2 class limits. More... | |
Protected Member Functions inherited from cloudViewer::GenericDistribution | |
| void | setValid (bool state) |
| Sets distribution current validity. More... | |
Protected Attributes | |
| ScalarType | m_mu |
| Mean. More... | |
| ScalarType | m_sigma2 |
| Variance. More... | |
| double | m_qFactor |
| Exponential quotient. More... | |
| double | m_normFactor |
| Normalization factor. More... | |
| std::vector< ScalarType > | m_chi2ClassesPositions |
| Chi2 classes limits. More... | |
| std::vector< ScalarType > | m_Pi |
| Structure used during the Chi2 distance computation. More... | |
Protected Attributes inherited from cloudViewer::GenericDistribution | |
| bool | m_isValid |
| Whether the distribution is in a valid state or not. More... | |
Additional Inherited Members | |
Public Types inherited from cloudViewer::GenericDistribution | |
| using | ScalarContainer = std::vector< ScalarType > |
| Scalar values container. More... | |
The Normal/Gaussian statistical distribution.
Implements the GenericDistribution interface.
| NormalDistribution::NormalDistribution | ( | ) |
NormalDistribution constructor.
| NormalDistribution::NormalDistribution | ( | ScalarType | _mu, |
| ScalarType | _sigma2 | ||
| ) |
NormalDistribution constructor.
Distrubtion parameters can be directly set during object construction.
| _mu | the normal distribution mean |
| _sigma2 | the normal distribution variance |
References setParameters().
|
overridevirtual |
Computes the Chi2 distance (related to the Chi2 Test)
Computes the Chi2 distance from a group of point, accordingly to a certain number of classes (see Chi2 test theory for more information). The result of projecting each point (or more precisely each scalar value associated to each point) in the different classes can be stored in an array (of the same size as the number of classes). To do so, such an array (already allocated in memory) should be passed as an argument. Warning: be sure to activate an OUTPUT scalar field on the input cloud
| Yk | a group of points |
| numberOfClasses | the number of classes for the Chi2 Test |
| histo | an array to store the values projection result (optional) |
Implements cloudViewer::GenericDistribution.
References cloudViewer::ScalarFieldTools::countScalarFieldValidValues(), cloudViewer::GenericCloud::getPointScalarValue(), m_chi2ClassesPositions, m_Pi, setChi2ClassesPositions(), cloudViewer::GenericCloud::size(), and cloudViewer::ScalarField::ValidValue().
|
overridevirtual |
Computes the probability of x.
| x | the variable |
Implements cloudViewer::GenericDistribution.
References m_mu, m_normFactor, m_qFactor, and x.
|
overridevirtual |
Computes the cumulative probability between x1 and x2.
x1 should be lower than x2
| x1 | the lower boundary |
| x2 | the upper boundary |
Implements cloudViewer::GenericDistribution.
References cloudViewer::ErrorFunction::erf(), m_mu, and m_sigma2.
| bool NormalDistribution::computeParameters | ( | const GenericCloud * | cloud | ) |
Computes the distribution parameters from a point cloud (with scalar values)
References cloudViewer::GenericCloud::getPointScalarValue(), setParameters(), cloudViewer::GenericDistribution::setValid(), cloudViewer::GenericCloud::size(), and cloudViewer::ScalarField::ValidValue().
|
overridevirtual |
Computes the distribution parameters from a set of values.
| values | a set of scalar values |
Implements cloudViewer::GenericDistribution.
References setParameters(), cloudViewer::GenericDistribution::setValid(), and cloudViewer::ScalarField::ValidValue().
Referenced by computeRobustParameters(), define_NormalDistribution(), and cloudViewer::ICPRegistrationTools::Register().
|
overridevirtual |
Computes the cumulative probability between 0 and x.
| x | the upper boundary |
Implements cloudViewer::GenericDistribution.
References cloudViewer::ErrorFunction::erf(), m_mu, m_sigma2, and x.
Referenced by setChi2ClassesPositions().
| bool NormalDistribution::computeRobustParameters | ( | const ScalarContainer & | values, |
| double | nSigma | ||
| ) |
Computes robust parameters for the distribution from an array of scalar values Specific method to compute the parameters directly from an array (vector) of scalar values, without associated points. After a first pass, only the values close enough to the mean (in terms of nSigma times the initial variance) are kept to make a second and more robust evaluation of the parameters.
| values | the scalar values |
| nSigma | the values filtering interval size ([mu -nSigma * stddev : mu + nSigma * stddev]) |
References computeParameters(), m_mu, m_sigma2, and setParameters().
Referenced by define_NormalDistribution().
|
inline |
Returns the distribution mean.
Referenced by define_NormalDistribution().
|
inlineoverridevirtual |
Returns distribution name.
Implements cloudViewer::GenericDistribution.
| bool NormalDistribution::getParameters | ( | ScalarType & | _mu, |
| ScalarType & | _sigma2 | ||
| ) | const |
Returns the distribution parameters.
| _mu | a field to transmit the distribution mean |
| _sigma2 | a field to transmit the distribution variance return the parameters validity |
References cloudViewer::GenericDistribution::isValid(), m_mu, and m_sigma2.
Referenced by cloudViewer::ICPRegistrationTools::Register(), and cloudViewer::StatisticalTestingTools::testCloudWithStatisticalModel().
|
inline |
Returns the distribution variance.
Referenced by define_NormalDistribution().
|
protectedvirtual |
Compute each Chi2 class limits.
This method is used (internally) to accelerate the Chi2 distance computation.
| numberOfClasses | the number of classes that will be used for Chi2 distance computation |
References computePfromZero(), cloudViewer::GenericDistribution::isValid(), m_chi2ClassesPositions, m_mu, m_Pi, m_sigma2, x, and y.
Referenced by computeChi2Dist().
| bool NormalDistribution::setParameters | ( | ScalarType | _mu, |
| ScalarType | _sigma2 | ||
| ) |
Sets the distribution parameters.
| _mu | the distribution mean |
| _sigma2 | the distribution variance return the parameters validity |
References cloudViewer::GenericDistribution::isValid(), m_chi2ClassesPositions, m_mu, m_normFactor, M_PI, m_Pi, m_qFactor, m_sigma2, and cloudViewer::GenericDistribution::setValid().
Referenced by computeParameters(), computeRobustParameters(), define_NormalDistribution(), NormalDistribution(), CommandStatTest::process(), and ccEntityAction::statisticalTest().
|
protected |
Chi2 classes limits.
Used internally. Stores both limits for each class in a vector (min_class_1, max_class_1, min_class_2, max_class_2, etc.).
Referenced by computeChi2Dist(), setChi2ClassesPositions(), and setParameters().
|
protected |
Mean.
Referenced by computeP(), computePfromZero(), computeRobustParameters(), getParameters(), setChi2ClassesPositions(), and setParameters().
|
protected |
Normalization factor.
Referenced by computeP(), and setParameters().
|
protected |
Structure used during the Chi2 distance computation.
Referenced by computeChi2Dist(), setChi2ClassesPositions(), and setParameters().
|
protected |
Exponential quotient.
Referenced by computeP(), and setParameters().
|
protected |
Variance.
Referenced by computeP(), computePfromZero(), computeRobustParameters(), getParameters(), setChi2ClassesPositions(), and setParameters().