Public Types | Public Member Functions | Private Member Functions | Private Attributes
pcl::PCA< PointT > Class Template Reference

#include <pca.h>

Inheritance diagram for pcl::PCA< PointT >:
Inheritance graph
[legend]

List of all members.

Public Types

typedef pcl::PCLBase< PointTBase
enum  FLAG { increase, preserve }
typedef Base::PointCloud PointCloud
typedef Base::PointCloudConstPtr PointCloudConstPtr
typedef Base::PointCloudPtr PointCloudPtr
typedef Base::PointIndicesConstPtr PointIndicesConstPtr
typedef Base::PointIndicesPtr PointIndicesPtr

Public Member Functions

Eigen::MatrixXf & getCoefficients ()
Eigen::Vector3f & getEigenValues ()
Eigen::Matrix3f & getEigenVectors ()
Eigen::Vector4f & getMean ()
 Mean accessor.
PCAoperator= (PCA const &pca)
 PCA (bool basis_only=false)
 Default Constructor.
 PCA (PCA const &pca)
 PCL_DEPRECATED (PCA(const pcl::PointCloud< PointT > &X, bool basis_only=false),"Use PCA (bool basis_only); setInputCloud (X.makeShared ()); instead")
 Constructor with direct computation X input m*n matrix (ie n vectors of R(m)) basis_only flag to compute only the PCA basis.
void project (const PointT &input, PointT &projection)
void project (const PointCloud &input, PointCloud &projection)
void reconstruct (const PointT &projection, PointT &input)
void reconstruct (const PointCloud &projection, PointCloud &input)
void setInputCloud (const PointCloudConstPtr &cloud)
 Provide a pointer to the input dataset.
void update (const PointT &input, FLAG flag=preserve)

Private Member Functions

bool initCompute ()
 This method should get called before starting the actual computation.

Private Attributes

bool basis_only_
Eigen::MatrixXf coefficients_
bool compute_done_
Eigen::Vector3f eigenvalues_
Eigen::Matrix3f eigenvectors_
Eigen::Vector4f mean_

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

Author:
Nizar Sallem

Definition at line 60 of file pca.h.


Member Typedef Documentation

template<typename PointT>
typedef pcl::PCLBase<PointT> pcl::PCA< PointT >::Base

Definition at line 63 of file pca.h.

template<typename PointT>
typedef Base::PointCloud pcl::PCA< PointT >::PointCloud

Reimplemented from pcl::PCLBase< PointT >.

Definition at line 64 of file pca.h.

template<typename PointT>
typedef Base::PointCloudConstPtr pcl::PCA< PointT >::PointCloudConstPtr

Reimplemented from pcl::PCLBase< PointT >.

Definition at line 66 of file pca.h.

template<typename PointT>
typedef Base::PointCloudPtr pcl::PCA< PointT >::PointCloudPtr

Reimplemented from pcl::PCLBase< PointT >.

Definition at line 65 of file pca.h.

template<typename PointT>
typedef Base::PointIndicesConstPtr pcl::PCA< PointT >::PointIndicesConstPtr

Reimplemented from pcl::PCLBase< PointT >.

Definition at line 68 of file pca.h.

template<typename PointT>
typedef Base::PointIndicesPtr pcl::PCA< PointT >::PointIndicesPtr

Reimplemented from pcl::PCLBase< PointT >.

Definition at line 67 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 76 of file pca.h.


Constructor & Destructor Documentation

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

Default Constructor.

Parameters:
basis_onlyflag to compute only the PCA basis

Definition at line 87 of file pca.h.

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

Copy Constructor

Parameters:
[in]pcaPCA object

Definition at line 107 of file pca.h.


Member Function Documentation

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

Coefficients accessor

Exceptions:
InitFailedException

Definition at line 186 of file pca.h.

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

Eigen Values accessor

Exceptions:
InitFailedException

Definition at line 172 of file pca.h.

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

Eigen Vectors accessor

Exceptions:
InitFailedException

Definition at line 158 of file pca.h.

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

Mean accessor.

Exceptions:
InitFailedException

Definition at line 144 of file pca.h.

template<typename PointT >
bool pcl::PCA< PointT >::initCompute ( ) [inline, private]

This method should get called before starting the actual computation.

Internally, initCompute() does the following:

  • checks if an input dataset is given, and returns false otherwise
  • checks whether a set of input indices has been given. Returns true if yes.
  • if no input indices have been given, a fake set is created, which will be used until:
    • either a new set is given via setIndices(), or
    • a new cloud is given that has a different set of points. This will trigger an update on the set of fake indices

Reimplemented from pcl::PCLBase< PointT >.

Definition at line 64 of file pca.hpp.

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

Assignment operator

Parameters:
[in]pcaPCA object

Definition at line 121 of file pca.h.

template<typename PointT>
pcl::PCA< PointT >::PCL_DEPRECATED ( PCA< PointT >(const pcl::PointCloud< PointT > &X, bool basis_only=false)  ,
"Use PCA< PointT > (bool basis_only); setInputCloud (X.makeShared ()); instead"   
)

Constructor with direct computation X input m*n matrix (ie n vectors of R(m)) basis_only flag to compute only the PCA basis.

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

Project point on the eigenspace.

Parameters:
[in]inputpoint from original dataset
[out]projectionthe point in eigen vectors space
Exceptions:
InitFailedException

Definition at line 175 of file pca.hpp.

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

Project cloud on the eigenspace.

Parameters:
[in]inputcloud from original dataset
[out]projectionthe cloud in eigen vectors space
Exceptions:
InitFailedException

Definition at line 188 of file pca.hpp.

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

Reconstruct point from its projection

Parameters:
[in]projectionpoint from eigenvector space
[out]inputreconstructed point
Exceptions:
InitFailedException

Definition at line 217 of file pca.hpp.

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

Reconstruct cloud from its projection

Parameters:
[in]projectioncloud from eigenvector space
[out]inputreconstructed cloud
Exceptions:
InitFailedException

Definition at line 230 of file pca.hpp.

template<typename PointT>
void pcl::PCA< PointT >::setInputCloud ( const PointCloudConstPtr cloud) [inline, virtual]

Provide a pointer to the input dataset.

Parameters:
cloudthe const boost shared pointer to a PointCloud message

Reimplemented from pcl::PCLBase< PointT >.

Definition at line 134 of file pca.h.

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

update PCA with a new point

Parameters:
[in]inputinput point
[in]flagupdate flag
Exceptions:
InitFailedException

Definition at line 105 of file pca.hpp.


Member Data Documentation

template<typename PointT>
bool pcl::PCA< PointT >::basis_only_ [private]

Definition at line 241 of file pca.h.

template<typename PointT>
Eigen::MatrixXf pcl::PCA< PointT >::coefficients_ [private]

Definition at line 243 of file pca.h.

template<typename PointT>
bool pcl::PCA< PointT >::compute_done_ [private]

Definition at line 240 of file pca.h.

template<typename PointT>
Eigen::Vector3f pcl::PCA< PointT >::eigenvalues_ [private]

Definition at line 245 of file pca.h.

template<typename PointT>
Eigen::Matrix3f pcl::PCA< PointT >::eigenvectors_ [private]

Definition at line 242 of file pca.h.

template<typename PointT>
Eigen::Vector4f pcl::PCA< PointT >::mean_ [private]

Definition at line 244 of file pca.h.


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


pcl
Author(s): Open Perception
autogenerated on Mon Oct 6 2014 03:19:48