Point Cloud Library (PCL)  1.3.1
Public Types | Public Member Functions
pcl::PCA Class Reference

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

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").


Member Enumeration Documentation

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

pcl::PCA::PCA ( bool  basis_only = false) [inline]

Default Constructor.

Parameters:
basis_onlyflag to compute only the PCA basis

Definition at line 73 of file pca.h.

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

Constructor with direct computation.

Parameters:
Xinput m*n matrix (ie n vectors of R(m))
basis_onlyflag to compute only the PCA basis

Definition at line 80 of file pca.h.

pcl::PCA::PCA ( PCA const &  pca_) [inline]

Copy Constructor.

Parameters:
pca_PCA object

Definition at line 89 of file pca.h.


Member Function Documentation

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

Compute PCA using the batch algorithm.

Parameters:
cloudinput point cloud

Definition at line 8 of file pca.hpp.

Eigen::MatrixXf& pcl::PCA::getCoefficients ( ) [inline]

Coefficients accessor.

Definition at line 138 of file pca.h.

Eigen::VectorXf& pcl::PCA::getEigenValues ( ) [inline]

Eigen Values accessor.

Definition at line 129 of file pca.h.

Eigen::MatrixXf& pcl::PCA::getEigenVectors ( ) [inline]

Eigen Vectors accessor.

Definition at line 120 of file pca.h.

Eigen::Vector4f& pcl::PCA::getMean ( ) [inline]

Mean accessor.

Definition at line 111 of file pca.h.

PCA& pcl::PCA::operator= ( PCA const &  pca) [inline]

Assignment operator.

Parameters:
pcaPCA object

Definition at line 100 of file pca.h.

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

Project point on the eigenspace.

Parameters:
inputpoint from original dataset
projectionthe point in eigen vectors space

Definition at line 98 of file pca.hpp.

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

Reconstruct point from its projection.

Parameters:
projectionpoint from eigenvector space
inputreconstructed point

Definition at line 107 of file pca.hpp.

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

update PCA with a new point

Parameters:
inputinput point
flagupdate flag

Definition at line 31 of file pca.hpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines