Main MRPT website > C++ reference
MRPT logo
Public Member Functions | Public Attributes

mrpt::poses::CPoint2DPDFGaussian Class Reference


Detailed Description

A gaussian distribution for 2D points.

Also a method for bayesian fusion is provided.

See also:
CPoint2DPDF

Definition at line 45 of file CPoint2DPDFGaussian.h.

#include <mrpt/poses/CPoint2DPDFGaussian.h>

Inheritance diagram for mrpt::poses::CPoint2DPDFGaussian:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 CPoint2DPDFGaussian ()
 Default constructor.
 CPoint2DPDFGaussian (const CPoint2D &init_Mean)
 Constructor.
 CPoint2DPDFGaussian (const CPoint2D &init_Mean, const CMatrixDouble22 &init_Cov)
 Constructor.
void getMean (CPoint2D &p) const
 Returns an estimate of the point, (the mean, or mathematical expectation of the PDF).
void getCovarianceAndMean (CMatrixDouble22 &cov, CPoint2D &mean_point) const
 Returns an estimate of the point covariance matrix (2x2 cov matrix) and the mean, both at once.
void copyFrom (const CPoint2DPDF &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 CPoint2DPDFGaussian &p1, const CPoint2DPDFGaussian &p2)
 Bayesian fusion of two points gauss.
double productIntegralWith (const CPoint2DPDFGaussian &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 CPoint2DPDFGaussian &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 (CPoint2D &outSample) const
 Draw a sample from the pdf.
void bayesianFusion (const CPoint2DPDF &p1, const CPoint2DPDF &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 CPoint2DPDFGaussian &other) const
 Returns the Mahalanobis distance from this PDF to another PDF, that is, it's evaluation at (0,0,0).

Public Attributes

CPoint2D mean
 The mean value.
CMatrixDouble22 cov
 The 2x2 covariance matrix.

RTTI stuff



typedef CPoint2DPDFGaussianPtr SmartPtr
static mrpt::utils::CLASSINIT _init_CPoint2DPDFGaussian
static mrpt::utils::TRuntimeClassId classCPoint2DPDFGaussian
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::CObjectduplicate () const
 Returns a copy of the object, indepently of its class.
static mrpt::utils::CObjectCreateObject ()
static CPoint2DPDFGaussianPtr Create ()

Member Typedef Documentation

A typedef for the associated smart pointer

Definition at line 48 of file CPoint2DPDFGaussian.h.


Constructor & Destructor Documentation

mrpt::poses::CPoint2DPDFGaussian::CPoint2DPDFGaussian (  ) 

Default constructor.

mrpt::poses::CPoint2DPDFGaussian::CPoint2DPDFGaussian ( const CPoint2D init_Mean  ) 

Constructor.

mrpt::poses::CPoint2DPDFGaussian::CPoint2DPDFGaussian ( const CPoint2D init_Mean,
const CMatrixDouble22 init_Cov 
)

Constructor.


Member Function Documentation

static const mrpt::utils::TRuntimeClassId* mrpt::poses::CPoint2DPDFGaussian::_GetBaseClass (  )  [static, protected]

Reimplemented from mrpt::poses::CPoint2DPDF.

void mrpt::poses::CPoint2DPDFGaussian::bayesianFusion ( const CPoint2DPDFGaussian p1,
const CPoint2DPDFGaussian p2 
)

Bayesian fusion of two points gauss.

distributions, then save the result in this object. The process is as follows:

  • (x1,S1): Mean and variance of the p1 distribution.
  • (x2,S2): Mean and variance of the p2 distribution.
  • (x,S): Mean and variance of the resulting distribution.

S = (S1-1 + S2-1)-1; x = S * ( S1-1*x1 + S2-1*x2 );

void mrpt::poses::CPoint2DPDFGaussian::bayesianFusion ( const CPoint2DPDF p1,
const CPoint2DPDF 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!).

Parameters:
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::CPoint2DPDF.

void mrpt::poses::CPoint2DPDFGaussian::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< CPoint2D, 2 >.

void mrpt::poses::CPoint2DPDFGaussian::copyFrom ( const CPoint2DPDF o  )  [virtual]

Copy operator, translating if necesary (for example, between particles and gaussian representations).

Implements mrpt::poses::CPoint2DPDF.

static CPoint2DPDFGaussianPtr mrpt::poses::CPoint2DPDFGaussian::Create (  )  [static]
static mrpt::utils::CObject* mrpt::poses::CPoint2DPDFGaussian::CreateObject (  )  [static]
void mrpt::poses::CPoint2DPDFGaussian::drawSingleSample ( CPoint2D outSample  )  const [virtual]

Draw a sample from the pdf.

Implements mrpt::utils::CProbabilityDensityFunction< CPoint2D, 2 >.

virtual mrpt::utils::CObject* mrpt::poses::CPoint2DPDFGaussian::duplicate (  )  const [virtual]

Returns a copy of the object, indepently of its class.

Implements mrpt::utils::CObject.

void mrpt::poses::CPoint2DPDFGaussian::getCovarianceAndMean ( CMatrixDouble22 cov,
CPoint2D mean_point 
) const [inline]

Returns an estimate of the point covariance matrix (2x2 cov matrix) and the mean, both at once.

See also:
getMean

Definition at line 80 of file CPoint2DPDFGaussian.h.

void mrpt::poses::CPoint2DPDFGaussian::getMean ( CPoint2D p  )  const [inline, virtual]

Returns an estimate of the point, (the mean, or mathematical expectation of the PDF).

Implements mrpt::utils::CProbabilityDensityFunction< CPoint2D, 2 >.

Definition at line 73 of file CPoint2DPDFGaussian.h.

virtual const mrpt::utils::TRuntimeClassId* mrpt::poses::CPoint2DPDFGaussian::GetRuntimeClass (  )  const [virtual]

Returns information about the class of an object in runtime.

Reimplemented from mrpt::poses::CPoint2DPDF.

double mrpt::poses::CPoint2DPDFGaussian::mahalanobisDistanceTo ( const CPoint2DPDFGaussian other  )  const

Returns the Mahalanobis distance from this PDF to another PDF, that is, it's evaluation at (0,0,0).

double mrpt::poses::CPoint2DPDFGaussian::productIntegralNormalizedWith ( const CPoint2DPDFGaussian 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

\[ exp( -\frac{1}{2} D^2 ) \]

, with $ D^2 $ being the square Mahalanobis distance between the two pdfs.

See also:
productIntegralWith
Exceptions:
std::exception On errors like covariance matrix with null determinant, etc...
double mrpt::poses::CPoint2DPDFGaussian::productIntegralWith ( const CPoint2DPDFGaussian 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.

See also:
productIntegralNormalizedWith
Exceptions:
std::exception On errors like covariance matrix with null determinant, etc...
void mrpt::poses::CPoint2DPDFGaussian::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< CPoint2D, 2 >.


Member Data Documentation

Definition at line 48 of file CPoint2DPDFGaussian.h.

Definition at line 48 of file CPoint2DPDFGaussian.h.

Definition at line 48 of file CPoint2DPDFGaussian.h.

The 2x2 covariance matrix.

Definition at line 69 of file CPoint2DPDFGaussian.h.

The mean value.

Definition at line 65 of file CPoint2DPDFGaussian.h.




Page generated by Doxygen 1.7.1 for MRPT 0.9.4 SVN: at Mon Jan 10 23:33:19 UTC 2011