Calculates the weighted average and the covariance matrix. More...
#include <vector_average.h>
Public Member Functions | |
void | add (const Eigen::Matrix< real, dimension, 1 > &sample, real weight=1.0) |
template<> | |
void | doPCA (Eigen::Matrix< double, 3, 1 > &eigen_values) 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< float, 3, 1 > &eigen_values) const |
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 |
void | doPCA (Eigen::Matrix< real, dimension, 1 > &eigen_values) const |
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 |
real | getAccumulatedWeight () const |
const Eigen::Matrix< real, dimension, dimension > & | getCovariance () const |
template<> | |
void | getEigenVector1 (Eigen::Matrix< double, 3, 1 > &eigen_vector1) const |
template<> | |
void | getEigenVector1 (Eigen::Matrix< float, 3, 1 > &eigen_vector1) const |
void | getEigenVector1 (Eigen::Matrix< real, dimension, 1 > &eigen_vector1) const |
const Eigen::Matrix< real, dimension, 1 > & | getMean () const |
unsigned int | getNoOfSamples () |
void | reset () |
VectorAverage () | |
~VectorAverage () | |
Protected Attributes | |
real | accumulatedWeight_ |
Eigen::Matrix< real, dimension, dimension > | covariance_ |
Eigen::Matrix< real, dimension, 1 > | mean_ |
unsigned int | noOfSamples_ |
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.
Definition at line 51 of file vector_average.h.
pcl::VectorAverage< real, dimension >::VectorAverage | ( | ) | [inline] |
Constructor - dimension gives the size of the vectors to work with.
Definition at line 4 of file vector_average.hpp.
pcl::VectorAverage< real, dimension >::~VectorAverage | ( | ) | [inline] |
Destructor
Definition at line 58 of file vector_average.h.
void pcl::VectorAverage< real, dimension >::add | ( | const Eigen::Matrix< real, dimension, 1 > & | sample, | |
real | weight = 1.0 | |||
) | [inline] |
Add a new sample
Definition at line 19 of file vector_average.hpp.
void pcl::VectorAverage< double, 3 >::doPCA | ( | Eigen::Matrix< double, 3, 1 > & | eigen_values | ) | const [inline] |
Definition at line 144 of file vector_average.hpp.
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 133 of file vector_average.hpp.
void pcl::VectorAverage< float, 3 >::doPCA | ( | Eigen::Matrix< float, 3, 1 > & | eigen_values | ) | const [inline] |
Definition at line 114 of file vector_average.hpp.
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 103 of file vector_average.hpp.
void pcl::VectorAverage< real, dimension >::doPCA | ( | Eigen::Matrix< real, dimension, 1 > & | eigen_values | ) | const [inline] |
Do Principal component analysis
Definition at line 64 of file vector_average.hpp.
void pcl::VectorAverage< real, dimension >::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 40 of file vector_average.hpp.
real pcl::VectorAverage< real, dimension >::getAccumulatedWeight | ( | ) | const [inline] |
Get the summed up weight of all added vectors
Definition at line 75 of file vector_average.h.
const Eigen::Matrix<real, dimension, dimension>& pcl::VectorAverage< real, dimension >::getCovariance | ( | ) | const [inline] |
Get the covariance matrix of the added vectors
Definition at line 71 of file vector_average.h.
void pcl::VectorAverage< double, 3 >::getEigenVector1 | ( | Eigen::Matrix< double, 3, 1 > & | eigen_vector1 | ) | const [inline] |
Definition at line 150 of file vector_average.hpp.
void pcl::VectorAverage< float, 3 >::getEigenVector1 | ( | Eigen::Matrix< float, 3, 1 > & | eigen_vector1 | ) | const [inline] |
Definition at line 120 of file vector_average.hpp.
void pcl::VectorAverage< real, dimension >::getEigenVector1 | ( | Eigen::Matrix< real, dimension, 1 > & | eigen_vector1 | ) | const [inline] |
Get the eigenvector corresponding to the smallest eigenvalue
Definition at line 77 of file vector_average.hpp.
const Eigen::Matrix<real, dimension, 1>& pcl::VectorAverage< real, dimension >::getMean | ( | ) | const [inline] |
Get the mean of the added vectors
Definition at line 67 of file vector_average.h.
unsigned int pcl::VectorAverage< real, dimension >::getNoOfSamples | ( | ) | [inline] |
Get the number of added vectors
Definition at line 79 of file vector_average.h.
void pcl::VectorAverage< real, dimension >::reset | ( | ) | [inline] |
Reset the object to work with a new data set
Definition at line 10 of file vector_average.hpp.
real pcl::VectorAverage< real, dimension >::accumulatedWeight_ [protected] |
Definition at line 104 of file vector_average.h.
Eigen::Matrix<real, dimension, dimension> pcl::VectorAverage< real, dimension >::covariance_ [protected] |
Definition at line 106 of file vector_average.h.
Eigen::Matrix<real, dimension, 1> pcl::VectorAverage< real, dimension >::mean_ [protected] |
Definition at line 105 of file vector_average.h.
unsigned int pcl::VectorAverage< real, dimension >::noOfSamples_ [protected] |
Definition at line 103 of file vector_average.h.