Public Types | Public Member Functions

pcl::PCA< PointT > Class Template Reference
[Module common]

Principal Component analysis (PCA) class. More...

#include <pcl/common/pca.h>

List of all members.

Public Types

enum  FLAG { increase, preserve }
 

Updating method flag.

More...

Public Member Functions

 PCA (bool basis_only=false)
 Default Constructor.
 PCA (const pcl::PointCloud< PointT > &X, bool basis_only=false)
 Constructor with direct computation.
 PCA (PCA const &pca_)
 Copy Constructor.
PCAoperator= (PCA const &pca)
 Assignment operator.
Eigen::Vector4f & getMean ()
 Mean accessor.
Eigen::MatrixXf & getEigenVectors ()
 Eigen Vectors accessor.
Eigen::VectorXf & getEigenValues ()
 Eigen Values accessor.
Eigen::MatrixXf & getCoefficients ()
 Coefficients accessor.
void compute (const pcl::PointCloud< PointT > &cloud)
 Compute PCA using the batch algorithm.
void update (const PointT &input, FLAG flag=preserve)
 update PCA with a new point
void project (const PointT &input, PointT &projection) const
 Project point on the eigenspace.
void reconstruct (const PointT &projection, PointT &input) const
 Reconstruct point from its projection.

Detailed Description

template<typename PointT>
class pcl::PCA< PointT >

Principal Component analysis (PCA) class.


Principal components are extracted by singular values decomposition on the covariance matrix of the centered input cloud. Available data after pca computation are the mean of the input data, the eigenvalues (in descending order) and corresponding eigenvectors.
Other methods allow projection in the eigenspace, reconstruction from eigenspace and update of the eigenspace with a new datum (according Matej Artec, Matjaz Jogan and Ales Leonardis: "Incremental PCA for On-line Visual Learning and Recognition").

Definition at line 56 of file pca.h.


Member Enumeration Documentation

template<typename PointT >
enum pcl::PCA::FLAG

Updating method flag.

Enumerator:
increase 

keep the new basis vectors if possible

preserve 

preserve subspace dimension

Definition at line 61 of file pca.h.


Constructor & Destructor Documentation

template<typename PointT >
pcl::PCA< PointT >::PCA ( bool  basis_only = false  )  [inline]

Default Constructor.

Parameters:
basis_only flag to compute only the PCA basis

Definition at line 73 of file pca.h.

template<typename PointT >
pcl::PCA< PointT >::PCA ( const pcl::PointCloud< PointT > &  X,
bool  basis_only = false 
) [inline]

Constructor with direct computation.

Parameters:
X input m*n matrix (ie n vectors of R(m))
basis_only flag to compute only the PCA basis

Definition at line 80 of file pca.h.

template<typename PointT >
pcl::PCA< PointT >::PCA ( PCA< PointT > const &  pca_  )  [inline]

Copy Constructor.

Parameters:
pca_ PCA object

Definition at line 89 of file pca.h.


Member Function Documentation

template<typename PointT >
void pcl::PCA< PointT >::compute ( const pcl::PointCloud< PointT > &  cloud  )  [inline]

Compute PCA using the batch algorithm.

Parameters:
cloud input point cloud

Definition at line 8 of file pca.hpp.

template<typename PointT >
Eigen::MatrixXf& pcl::PCA< PointT >::getCoefficients (  )  [inline]

Coefficients accessor.

Definition at line 138 of file pca.h.

template<typename PointT >
Eigen::VectorXf& pcl::PCA< PointT >::getEigenValues (  )  [inline]

Eigen Values accessor.

Definition at line 129 of file pca.h.

template<typename PointT >
Eigen::MatrixXf& pcl::PCA< PointT >::getEigenVectors (  )  [inline]

Eigen Vectors accessor.

Definition at line 120 of file pca.h.

template<typename PointT >
Eigen::Vector4f& pcl::PCA< PointT >::getMean (  )  [inline]

Mean accessor.

Definition at line 111 of file pca.h.

template<typename PointT >
PCA& pcl::PCA< PointT >::operator= ( PCA< PointT > const &  pca  )  [inline]

Assignment operator.

Parameters:
pca PCA object

Definition at line 100 of file pca.h.

template<typename PointT >
void pcl::PCA< PointT >::project ( const PointT &  input,
PointT &  projection 
) const [inline]

Project point on the eigenspace.

Parameters:
input point from original dataset
projection the point in eigen vectors space

Definition at line 98 of file pca.hpp.

template<typename PointT >
void pcl::PCA< PointT >::reconstruct ( const PointT &  projection,
PointT &  input 
) const [inline]

Reconstruct point from its projection.

Parameters:
projection point from eigenvector space
input reconstructed point

Definition at line 107 of file pca.hpp.

template<typename PointT >
void pcl::PCA< PointT >::update ( const PointT &  input,
FLAG  flag = preserve 
) [inline]

update PCA with a new point

Parameters:
input input point
flag update flag

Definition at line 31 of file pca.hpp.


The documentation for this class was generated from the following files: