40 #include <pcl/memory.h>
41 #include <pcl/pcl_macros.h>
42 #include <pcl/common/eigen.h>
53 template <
typename real,
int dimension>
58 using MatrixType = Eigen::Matrix<real, dimension, dimension>;
120 #include <pcl/common/impl/vector_average.hpp>
void reset()
Reset the object to work with a new data set.
VectorAverage()
Constructor - dimension gives the size of the vectors to work with.
const MatrixType & getCovariance() const
Get the covariance matrix of the added vectors.
#define PCL_MAKE_ALIGNED_OPERATOR_NEW
Macro to signal a class requires a custom allocator.
void doPCA(VectorType &eigen_values, VectorType &eigen_vector1, VectorType &eigen_vector2, VectorType &eigen_vector3) const
Do Principal component analysis.
Eigen::Matrix< real, dimension, 1 > VectorType
unsigned int getNoOfSamples()
Get the number of added vectors.
real getAccumulatedWeight() const
Get the summed up weight of all added vectors.
void getEigenVector1(VectorType &eigen_vector1) const
Get the eigenvector corresponding to the smallest eigenvalue.
const VectorType & getMean() const
Get the mean of the added vectors.
unsigned int noOfSamples_
Eigen::Matrix< real, dimension, dimension > MatrixType
void add(const VectorType &sample, real weight=1.0)
Add a new sample.
Calculates the weighted average and the covariance matrix.