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> const VectorType & getMean() const
Get the mean of the added vectors.
Defines functions, macros and traits for allocating and using memory.
real getAccumulatedWeight() const
Get the summed up weight of all added vectors.
void reset()
Reset the object to work with a new data set.
VectorAverage()
Constructor - dimension gives the size of the vectors to work with.
#define PCL_MAKE_ALIGNED_OPERATOR_NEW
Macro to signal a class requires a custom allocator.
Eigen::Matrix< real, dimension, 1 > VectorType
unsigned int getNoOfSamples()
Get the number of added vectors.
void doPCA(VectorType &eigen_values, VectorType &eigen_vector1, VectorType &eigen_vector2, VectorType &eigen_vector3) const
Do Principal component analysis.
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.
Defines all the PCL and non-PCL macros used.
const MatrixType & getCovariance() const
Get the covariance matrix of the added vectors.
void getEigenVector1(VectorType &eigen_vector1) const
Get the eigenvector corresponding to the smallest eigenvalue.