Point Cloud Library (PCL)  1.3.1
Public Member Functions
pcl::VectorAverage Class Reference

Calculates the weighted average and the covariance matrix. More...

#include <pcl/common/vector_average.h>

List of all members.

Public Member Functions

 VectorAverage ()
 Constructor - dimension gives the size of the vectors to work with.
 ~VectorAverage ()
 Destructor.
void reset ()
 Reset the object to work with a new data set.
const Eigen::Matrix< real,
dimension, 1 > & 
getMean () const
 Get the mean of the added vectors.
const Eigen::Matrix< real,
dimension, dimension > & 
getCovariance () const
 Get the covariance matrix of the added vectors.
real getAccumulatedWeight () const
 Get the summed up weight of all added vectors.
unsigned int getNoOfSamples ()
 Get the number of added vectors.
void add (const Eigen::Matrix< real, dimension, 1 > &sample, real weight=1.0)
 Add a new sample.
void doPCA (Eigen::Matrix< real, dimension, 1 > &eigen_values, Eigen::Matrix< real, dimension, 1 > &eigen_vector1, Eigen::Matrix< real, dimension, 1 > &eigen_vector2, Eigen::Matrix< real, dimension, 1 > &eigen_vector3) const
 Do Principal component analysis.
void doPCA (Eigen::Matrix< real, dimension, 1 > &eigen_values) const
 Do Principal component analysis.
void getEigenVector1 (Eigen::Matrix< real, dimension, 1 > &eigen_vector1) const
 Get the eigenvector corresponding to the smallest eigenvalue.
template<>
void doPCA (Eigen::Matrix< float, 3, 1 > &eigen_values, Eigen::Matrix< float, 3, 1 > &eigen_vector1, Eigen::Matrix< float, 3, 1 > &eigen_vector2, Eigen::Matrix< float, 3, 1 > &eigen_vector3) const
template<>
void doPCA (Eigen::Matrix< float, 3, 1 > &eigen_values) const
template<>
void getEigenVector1 (Eigen::Matrix< float, 3, 1 > &eigen_vector1) const
template<>
void doPCA (Eigen::Matrix< double, 3, 1 > &eigen_values, Eigen::Matrix< double, 3, 1 > &eigen_vector1, Eigen::Matrix< double, 3, 1 > &eigen_vector2, Eigen::Matrix< double, 3, 1 > &eigen_vector3) const
template<>
void doPCA (Eigen::Matrix< double, 3, 1 > &eigen_values) const
template<>
void getEigenVector1 (Eigen::Matrix< double, 3, 1 > &eigen_vector1) const

Detailed Description

Calculates the weighted average and the covariance matrix.

A class to calculate the weighted average and the covariance matrix of a set of vectors with given weights. The original data is not saved. Mean and covariance are calculated iteratively.

Author:
Bastian Steder

Constructor & Destructor Documentation

pcl::VectorAverage::VectorAverage ( )

Constructor - dimension gives the size of the vectors to work with.

Definition at line 38 of file vector_average.hpp.

pcl::VectorAverage::~VectorAverage ( ) [inline]

Destructor.

Definition at line 59 of file vector_average.h.


Member Function Documentation

void pcl::VectorAverage::add ( const Eigen::Matrix< real, dimension, 1 > &  sample,
real  weight = 1.0 
) [inline]

Add a new sample.

Definition at line 53 of file vector_average.hpp.

void pcl::VectorAverage::doPCA ( Eigen::Matrix< real, dimension, 1 > &  eigen_values,
Eigen::Matrix< real, dimension, 1 > &  eigen_vector1,
Eigen::Matrix< real, dimension, 1 > &  eigen_vector2,
Eigen::Matrix< real, dimension, 1 > &  eigen_vector3 
) const [inline]

Do Principal component analysis.

Definition at line 74 of file vector_average.hpp.

void pcl::VectorAverage::doPCA ( Eigen::Matrix< real, dimension, 1 > &  eigen_values) const [inline]

Do Principal component analysis.

Definition at line 98 of file vector_average.hpp.

template<>
void pcl::VectorAverage< float, 3 >::doPCA ( Eigen::Matrix< float, 3, 1 > &  eigen_values,
Eigen::Matrix< float, 3, 1 > &  eigen_vector1,
Eigen::Matrix< float, 3, 1 > &  eigen_vector2,
Eigen::Matrix< float, 3, 1 > &  eigen_vector3 
) const [inline]

Definition at line 137 of file vector_average.hpp.

template<>
void pcl::VectorAverage< float, 3 >::doPCA ( Eigen::Matrix< float, 3, 1 > &  eigen_values) const [inline]

Definition at line 148 of file vector_average.hpp.

template<>
void pcl::VectorAverage< double, 3 >::doPCA ( Eigen::Matrix< double, 3, 1 > &  eigen_values,
Eigen::Matrix< double, 3, 1 > &  eigen_vector1,
Eigen::Matrix< double, 3, 1 > &  eigen_vector2,
Eigen::Matrix< double, 3, 1 > &  eigen_vector3 
) const [inline]

Definition at line 167 of file vector_average.hpp.

template<>
void pcl::VectorAverage< double, 3 >::doPCA ( Eigen::Matrix< double, 3, 1 > &  eigen_values) const [inline]

Definition at line 178 of file vector_average.hpp.

real pcl::VectorAverage::getAccumulatedWeight ( ) const [inline]

Get the summed up weight of all added vectors.

Definition at line 76 of file vector_average.h.

const Eigen::Matrix<real, dimension, dimension>& pcl::VectorAverage::getCovariance ( ) const [inline]

Get the covariance matrix of the added vectors.

Definition at line 72 of file vector_average.h.

void pcl::VectorAverage::getEigenVector1 ( Eigen::Matrix< real, dimension, 1 > &  eigen_vector1) const [inline]

Get the eigenvector corresponding to the smallest eigenvalue.

Definition at line 111 of file vector_average.hpp.

template<>
void pcl::VectorAverage< float, 3 >::getEigenVector1 ( Eigen::Matrix< float, 3, 1 > &  eigen_vector1) const [inline]

Definition at line 154 of file vector_average.hpp.

template<>
void pcl::VectorAverage< double, 3 >::getEigenVector1 ( Eigen::Matrix< double, 3, 1 > &  eigen_vector1) const [inline]

Definition at line 184 of file vector_average.hpp.

const Eigen::Matrix<real, dimension, 1>& pcl::VectorAverage::getMean ( ) const [inline]

Get the mean of the added vectors.

Definition at line 68 of file vector_average.h.

unsigned int pcl::VectorAverage::getNoOfSamples ( ) [inline]

Get the number of added vectors.

Definition at line 80 of file vector_average.h.

void pcl::VectorAverage::reset ( ) [inline]

Reset the object to work with a new data set.

Definition at line 44 of file vector_average.hpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines