A gaussian distribution for 3D points.
Also a method for bayesian fusion is provided.
Definition at line 46 of file CPointPDFGaussian.h.
#include <mrpt/poses/CPointPDFGaussian.h>
Public Member Functions | |
CPointPDFGaussian () | |
Default constructor. | |
CPointPDFGaussian (const CPoint3D &init_Mean) | |
Constructor. | |
CPointPDFGaussian (const CPoint3D &init_Mean, const CMatrixDouble33 &init_Cov) | |
Constructor. | |
void | getMean (CPoint3D &p) const |
Returns an estimate of the point, (the mean, or mathematical expectation of the PDF) | |
void | getCovarianceAndMean (CMatrixDouble33 &cov, CPoint3D &mean_point) const |
Returns an estimate of the point covariance matrix (3x3 cov matrix) and the mean, both at once. | |
void | copyFrom (const CPointPDF &o) |
Copy operator, translating if necesary (for example, between particles and gaussian representations) | |
void | saveToTextFile (const std::string &file) const |
Save PDF's particles to a text file, containing the 2D pose in the first line, then the covariance matrix in next 3 lines. | |
void | changeCoordinatesReference (const CPose3D &newReferenceBase) |
This can be used to convert a PDF from local coordinates to global, providing the point (newReferenceBase) from which "to project" the current pdf. | |
void | bayesianFusion (const CPointPDFGaussian &p1, const CPointPDFGaussian &p2) |
Bayesian fusion of two points gauss. | |
double | productIntegralWith (const CPointPDFGaussian &p) const |
Computes the "correspondence likelihood" of this PDF with another one: This is implemented as the integral from -inf to +inf of the product of both PDF. | |
double | productIntegralWith2D (const CPointPDFGaussian &p) const |
Computes the "correspondence likelihood" of this PDF with another one: This is implemented as the integral from -inf to +inf of the product of both PDF. | |
double | productIntegralNormalizedWith (const CPointPDFGaussian &p) const |
Computes the "correspondence likelihood" of this PDF with another one: This is implemented as the integral from -inf to +inf of the product of both PDF. | |
double | productIntegralNormalizedWith2D (const CPointPDFGaussian &p) const |
Computes the "correspondence likelihood" of this PDF with another one: This is implemented as the integral from -inf to +inf of the product of both PDF. | |
void | drawSingleSample (CPoint3D &outSample) const |
Draw a sample from the pdf. | |
void | bayesianFusion (const CPointPDF &p1, const CPointPDF &p2, const double &minMahalanobisDistToDrop=0) |
Bayesian fusion of two point distributions (product of two distributions->new distribution), then save the result in this object (WARNING: See implementing classes to see classes that can and cannot be mixtured!) | |
double | mahalanobisDistanceTo (const CPointPDFGaussian &other, bool only_2D=false) const |
Returns the Mahalanobis distance from this PDF to another PDF, that is, it's evaluation at (0,0,0) | |
Public Attributes | |
CPoint3D | mean |
The mean value. | |
CMatrixDouble33 | cov |
The 3x3 covariance matrix. | |
RTTI stuff | |
typedef CPointPDFGaussianPtr | SmartPtr |
static mrpt::utils::CLASSINIT | _init_CPointPDFGaussian |
static mrpt::utils::TRuntimeClassId | classCPointPDFGaussian |
static const mrpt::utils::TRuntimeClassId * | classinfo |
static const mrpt::utils::TRuntimeClassId * | _GetBaseClass () |
virtual const mrpt::utils::TRuntimeClassId * | GetRuntimeClass () const |
Returns information about the class of an object in runtime. | |
virtual mrpt::utils::CObject * | duplicate () const |
Returns a copy of the object, indepently of its class. | |
static mrpt::utils::CObject * | CreateObject () |
static CPointPDFGaussianPtr | Create () |
A typedef for the associated smart pointer
Definition at line 49 of file CPointPDFGaussian.h.
mrpt::poses::CPointPDFGaussian::CPointPDFGaussian | ( | ) |
Default constructor.
mrpt::poses::CPointPDFGaussian::CPointPDFGaussian | ( | const CPoint3D & | init_Mean | ) |
Constructor.
mrpt::poses::CPointPDFGaussian::CPointPDFGaussian | ( | const CPoint3D & | init_Mean, |
const CMatrixDouble33 & | init_Cov | ||
) |
Constructor.
static const mrpt::utils::TRuntimeClassId* mrpt::poses::CPointPDFGaussian::_GetBaseClass | ( | ) | [static, protected] |
Reimplemented from mrpt::poses::CPointPDF.
void mrpt::poses::CPointPDFGaussian::bayesianFusion | ( | const CPointPDFGaussian & | p1, |
const CPointPDFGaussian & | p2 | ||
) |
Bayesian fusion of two points gauss.
distributions, then save the result in this object. The process is as follows:
S = (S1-1 + S2-1)-1; x = S * ( S1-1*x1 + S2-1*x2 );
void mrpt::poses::CPointPDFGaussian::bayesianFusion | ( | const CPointPDF & | p1, |
const CPointPDF & | p2, | ||
const double & | minMahalanobisDistToDrop = 0 |
||
) | [virtual] |
Bayesian fusion of two point distributions (product of two distributions->new distribution), then save the result in this object (WARNING: See implementing classes to see classes that can and cannot be mixtured!)
p1 | The first distribution to fuse |
p2 | The second distribution to fuse |
minMahalanobisDistToDrop | If set to different of 0, the result of very separate Gaussian modes (that will result in negligible components) in SOGs will be dropped to reduce the number of modes in the output. |
Implements mrpt::poses::CPointPDF.
void mrpt::poses::CPointPDFGaussian::changeCoordinatesReference | ( | const CPose3D & | newReferenceBase | ) | [virtual] |
This can be used to convert a PDF from local coordinates to global, providing the point (newReferenceBase) from which "to project" the current pdf.
Result PDF substituted the currently stored one in the object. Both the mean value and the covariance matrix are updated correctly.
Implements mrpt::utils::CProbabilityDensityFunction< CPoint3D, 3 >.
void mrpt::poses::CPointPDFGaussian::copyFrom | ( | const CPointPDF & | o | ) | [virtual] |
Copy operator, translating if necesary (for example, between particles and gaussian representations)
Implements mrpt::poses::CPointPDF.
static CPointPDFGaussianPtr mrpt::poses::CPointPDFGaussian::Create | ( | ) | [static] |
static mrpt::utils::CObject* mrpt::poses::CPointPDFGaussian::CreateObject | ( | ) | [static] |
void mrpt::poses::CPointPDFGaussian::drawSingleSample | ( | CPoint3D & | outSample | ) | const [virtual] |
Draw a sample from the pdf.
Implements mrpt::utils::CProbabilityDensityFunction< CPoint3D, 3 >.
virtual mrpt::utils::CObject* mrpt::poses::CPointPDFGaussian::duplicate | ( | ) | const [virtual] |
Returns a copy of the object, indepently of its class.
Implements mrpt::utils::CObject.
void mrpt::poses::CPointPDFGaussian::getCovarianceAndMean | ( | CMatrixDouble33 & | cov, |
CPoint3D & | mean_point | ||
) | const |
Returns an estimate of the point covariance matrix (3x3 cov matrix) and the mean, both at once.
void mrpt::poses::CPointPDFGaussian::getMean | ( | CPoint3D & | p | ) | const [virtual] |
Returns an estimate of the point, (the mean, or mathematical expectation of the PDF)
Implements mrpt::utils::CProbabilityDensityFunction< CPoint3D, 3 >.
virtual const mrpt::utils::TRuntimeClassId* mrpt::poses::CPointPDFGaussian::GetRuntimeClass | ( | ) | const [virtual] |
Returns information about the class of an object in runtime.
Reimplemented from mrpt::poses::CPointPDF.
double mrpt::poses::CPointPDFGaussian::mahalanobisDistanceTo | ( | const CPointPDFGaussian & | other, |
bool | only_2D = false |
||
) | const |
Returns the Mahalanobis distance from this PDF to another PDF, that is, it's evaluation at (0,0,0)
double mrpt::poses::CPointPDFGaussian::productIntegralNormalizedWith | ( | const CPointPDFGaussian & | p | ) | const |
Computes the "correspondence likelihood" of this PDF with another one: This is implemented as the integral from -inf to +inf of the product of both PDF.
The resulting number is in the range [0,1] Note that the resulting value is in fact
, with being the square Mahalanobis distance between the two pdfs.
std::exception | On errors like covariance matrix with null determinant, etc... |
double mrpt::poses::CPointPDFGaussian::productIntegralNormalizedWith2D | ( | const CPointPDFGaussian & | p | ) | const |
Computes the "correspondence likelihood" of this PDF with another one: This is implemented as the integral from -inf to +inf of the product of both PDF.
The resulting number is in the range [0,1]. This versions ignores the "z" coordinate.
Note that the resulting value is in fact
, with being the square Mahalanobis distance between the two pdfs.
std::exception | On errors like covariance matrix with null determinant, etc... |
double mrpt::poses::CPointPDFGaussian::productIntegralWith | ( | const CPointPDFGaussian & | p | ) | const |
Computes the "correspondence likelihood" of this PDF with another one: This is implemented as the integral from -inf to +inf of the product of both PDF.
The resulting number is >=0.
std::exception | On errors like covariance matrix with null determinant, etc... |
double mrpt::poses::CPointPDFGaussian::productIntegralWith2D | ( | const CPointPDFGaussian & | p | ) | const |
Computes the "correspondence likelihood" of this PDF with another one: This is implemented as the integral from -inf to +inf of the product of both PDF.
The resulting number is >=0. NOTE: This version ignores the "z" coordinates!!
std::exception | On errors like covariance matrix with null determinant, etc... |
void mrpt::poses::CPointPDFGaussian::saveToTextFile | ( | const std::string & | file | ) | const [virtual] |
Save PDF's particles to a text file, containing the 2D pose in the first line, then the covariance matrix in next 3 lines.
Implements mrpt::utils::CProbabilityDensityFunction< CPoint3D, 3 >.
mrpt::utils::CLASSINIT mrpt::poses::CPointPDFGaussian::_init_CPointPDFGaussian [static, protected] |
Definition at line 49 of file CPointPDFGaussian.h.
Definition at line 49 of file CPointPDFGaussian.h.
Definition at line 49 of file CPointPDFGaussian.h.
The 3x3 covariance matrix.
Definition at line 70 of file CPointPDFGaussian.h.
Referenced by mrpt::slam::CLandmark::getPose().
The mean value.
Definition at line 66 of file CPointPDFGaussian.h.
Referenced by mrpt::slam::CLandmark::getPose().
Page generated by Doxygen 1.7.3 for MRPT 0.9.4 SVN:exported at Tue Jan 25 21:56:31 UTC 2011 |