Point Cloud Library (PCL)
1.9.1
|
38 #ifndef PCL_COMMON_VECTOR_AVERAGE_H
39 #define PCL_COMMON_VECTOR_AVERAGE_H
41 #include <pcl/common/eigen.h>
52 template <
typename real,
int dimension>
69 Eigen::Matrix<real, dimension, 1>&
getMean ()
const {
return mean_;}
85 add (
const Eigen::Matrix<real, dimension, 1>& sample, real weight=1.0);
89 doPCA (Eigen::Matrix<real, dimension, 1>& eigen_values, Eigen::Matrix<real, dimension, 1>& eigen_vector1,
90 Eigen::Matrix<real, dimension, 1>& eigen_vector2, Eigen::Matrix<real, dimension, 1>& eigen_vector3)
const;
94 doPCA (Eigen::Matrix<real, dimension, 1>& eigen_values)
const;
98 getEigenVector1 (Eigen::Matrix<real, dimension, 1>& eigen_vector1)
const;
100 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
110 Eigen::Matrix<real, dimension, 1>
mean_;
119 #include <pcl/common/impl/vector_average.hpp>
121 #endif // #ifndef PCL_VECTOR_AVERAGE_H
real getAccumulatedWeight() const
Get the summed up weight of all added vectors.
This file defines compatibility wrappers for low level I/O functions.
VectorAverage()
Constructor - dimension gives the size of the vectors to work with.
void add(const Eigen::Matrix< real, dimension, 1 > &sample, real weight=1.0)
Add a new sample.
~VectorAverage()
Destructor.
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 reset()
Reset the object to work with a new data set.
const Eigen::Matrix< real, dimension, dimension > & getCovariance() const
Get the covariance matrix of the added vectors.
unsigned int getNoOfSamples()
Get the number of added vectors.
VectorAverage< float, 3 > VectorAverage3f
VectorAverage< float, 4 > VectorAverage4f
const Eigen::Matrix< real, dimension, 1 > & getMean() const
Get the mean of the added vectors.
Calculates the weighted average and the covariance matrix.
Eigen::Matrix< real, dimension, dimension > covariance_
unsigned int noOfSamples_
Eigen::Matrix< real, dimension, 1 > mean_
VectorAverage< float, 2 > VectorAverage2f
void getEigenVector1(Eigen::Matrix< real, dimension, 1 > &eigen_vector1) const
Get the eigenvector corresponding to the smallest eigenvalue.