Principal Component analysis (PCA) class. More...
#include <pcl/common/pca.h>


Public Types | |
| enum | FLAG { increase, preserve } |
Updating method flag. More... | |
| typedef pcl::PCLBase< PointT > | Base |
| typedef Base::PointCloud | PointCloud |
| typedef Base::PointCloudPtr | PointCloudPtr |
| typedef Base::PointCloudConstPtr | PointCloudConstPtr |
| typedef Base::PointIndicesPtr | PointIndicesPtr |
| typedef Base::PointIndicesConstPtr | PointIndicesConstPtr |
Public Member Functions | |
| compute_done_ (false) | |
| basis_only_ (basis_only) | |
| eigenvectors_ () | |
| coefficients_ () | |
| mean_ () | |
| eigenvalues_ () | |
| 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. | |
| compute_done_ (pca.compute_done_) | |
| basis_only_ (pca.basis_only_) | |
| eigenvectors_ (pca.eigenvectors_) | |
| coefficients_ (pca.coefficients_) | |
| mean_ (pca.mean_) | |
| eigenvalues_ (pca.eigenvalues_) | |
| PCA & | operator= (PCA const &pca) |
| Assignment operator. | |
| void | setInputCloud (const PointCloudConstPtr &cloud) |
| Provide a pointer to the input dataset. | |
| Eigen::Vector4f & | getMean () |
| Mean accessor. | |
| Eigen::Matrix3f & | getEigenVectors () |
| Eigen Vectors accessor. | |
| Eigen::Vector3f & | getEigenValues () |
| Eigen Values accessor. | |
| Eigen::MatrixXf & | getCoefficients () |
| Coefficients accessor. | |
| void | update (const PointT &input, FLAG flag=preserve) |
| update PCA with a new point | |
| void | project (const PointT &input, PointT &projection) |
| Project point on the eigenspace. | |
| void | project (const PointCloud &input, PointCloud &projection) |
| Project cloud on the eigenspace. | |
| void | reconstruct (const PointT &projection, PointT &input) |
| Reconstruct point from its projection. | |
| void | reconstruct (const PointCloud &projection, PointCloud &input) |
| Reconstruct cloud from its projection. | |
Public Attributes | |
| __pad0__: Base () | |
| Default Constructor. | |
| __pad1__: Base (pca) | |
| Copy Constructor. | |
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 60 of file pca.h.
| typedef pcl::PCLBase<PointT> pcl::PCA< PointT >::Base |
| typedef Base::PointCloud pcl::PCA< PointT >::PointCloud |
Reimplemented from pcl::PCLBase< PointT >.
| typedef Base::PointCloudConstPtr pcl::PCA< PointT >::PointCloudConstPtr |
Reimplemented from pcl::PCLBase< PointT >.
| typedef Base::PointCloudPtr pcl::PCA< PointT >::PointCloudPtr |
Reimplemented from pcl::PCLBase< PointT >.
| typedef Base::PointIndicesConstPtr pcl::PCA< PointT >::PointIndicesConstPtr |
Reimplemented from pcl::PCLBase< PointT >.
| typedef Base::PointIndicesPtr pcl::PCA< PointT >::PointIndicesPtr |
Reimplemented from pcl::PCLBase< PointT >.
| enum pcl::PCA::FLAG |
Definition at line 94 of file pca.h.
Referenced by pcl::PCA< PointT >::getEigenValues(), pcl::PCA< PointT >::operator=(), and pcl::PCA< PointT >::update().
Coefficients accessor.
| InitFailedException |
Definition at line 186 of file pca.h.
References pcl::PCA< PointT >::coefficients_().
Eigen Values accessor.
| InitFailedException |
Definition at line 172 of file pca.h.
References pcl::PCA< PointT >::eigenvalues_().
Eigen Vectors accessor.
| InitFailedException |
Definition at line 158 of file pca.h.
References pcl::PCA< PointT >::eigenvectors_().
Mean accessor.
| InitFailedException |
Definition at line 144 of file pca.h.
References pcl::PCA< PointT >::mean_().
| PCA& pcl::PCA< PointT >::operator= | ( | PCA< PointT > const & | pca | ) | [inline] |
Assignment operator.
| [in] | pca | PCA object |
Definition at line 121 of file pca.h.
References pcl::PCA< PointT >::coefficients_(), pcl::PCA< PointT >::eigenvalues_(), pcl::PCA< PointT >::eigenvectors_(), and pcl::PCA< PointT >::mean_().
| 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.
| void pcl::PCA< PointT >::project | ( | const PointCloud & | input, | |
| PointCloud & | projection | |||
| ) | [inline] |
Project cloud on the eigenspace.
| [in] | input | cloud from original dataset |
| [out] | projection | the cloud in eigen vectors space |
| InitFailedException |
Definition at line 188 of file pca.hpp.
References pcl::PointCloud< PointT >::is_dense, pcl::PCA< PointT >::project(), pcl::PointCloud< PointT >::push_back(), pcl::PointCloud< PointT >::resize(), and pcl::PointCloud< PointT >::size().
| void pcl::PCA< PointT >::project | ( | const PointT & | input, | |
| PointT & | projection | |||
| ) | [inline] |
Project point on the eigenspace.
| [in] | input | point from original dataset |
| [out] | projection | the point in eigen vectors space |
| InitFailedException |
Definition at line 175 of file pca.hpp.
References pcl::PCA< PointT >::eigenvectors_(), and pcl::PCA< PointT >::mean_().
Referenced by pcl::PCA< PointT >::project().
| void pcl::PCA< PointT >::reconstruct | ( | const PointCloud & | projection, | |
| PointCloud & | input | |||
| ) | [inline] |
Reconstruct cloud from its projection.
| [in] | projection | cloud from eigenvector space |
| [out] | input | reconstructed cloud |
| InitFailedException |
Definition at line 230 of file pca.hpp.
References pcl::PointCloud< PointT >::is_dense, pcl::PointCloud< PointT >::push_back(), pcl::PCA< PointT >::reconstruct(), pcl::PointCloud< PointT >::resize(), and pcl::PointCloud< PointT >::size().
| void pcl::PCA< PointT >::reconstruct | ( | const PointT & | projection, | |
| PointT & | input | |||
| ) | [inline] |
Reconstruct point from its projection.
| [in] | projection | point from eigenvector space |
| [out] | input | reconstructed point |
| InitFailedException |
Definition at line 217 of file pca.hpp.
References pcl::PCA< PointT >::eigenvectors_(), and pcl::PCA< PointT >::mean_().
Referenced by pcl::PCA< PointT >::reconstruct().
| void pcl::PCA< PointT >::setInputCloud | ( | const PointCloudConstPtr & | cloud | ) | [inline] |
Provide a pointer to the input dataset.
| cloud | the const boost shared pointer to a PointCloud message |
Definition at line 134 of file pca.h.
References pcl::PCLBase< PointT >::setInputCloud().
| void pcl::PCA< PointT >::update | ( | const PointT & | input, | |
| FLAG | flag = preserve | |||
| ) | [inline] |
update PCA with a new point
| [in] | input | input point |
| [in] | flag | update flag |
| InitFailedException |
Definition at line 105 of file pca.hpp.
References pcl::PCA< PointT >::coefficients_(), pcl::PCA< PointT >::eigenvalues_(), pcl::PCA< PointT >::eigenvectors_(), pcl::PCA< PointT >::increase, pcl::PCA< PointT >::mean_(), and pcl::PCA< PointT >::preserve.