Point Cloud Library (PCL)
1.7.0
|
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 |
![]() | |
typedef pcl::PointCloud< PointT > | PointCloud |
typedef PointCloud::Ptr | PointCloudPtr |
typedef PointCloud::ConstPtr | PointCloudConstPtr |
typedef boost::shared_ptr < PointIndices > | PointIndicesPtr |
typedef boost::shared_ptr < PointIndices const > | PointIndicesConstPtr |
Public Member Functions | |
PCA (bool basis_only=false) | |
Default Constructor. More... | |
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. More... | |
PCA (PCA const &pca) | |
Copy Constructor. More... | |
PCA & | operator= (PCA const &pca) |
Assignment operator. More... | |
void | setInputCloud (const PointCloudConstPtr &cloud) |
Provide a pointer to the input dataset. More... | |
Eigen::Vector4f & | getMean () |
Mean accessor. More... | |
Eigen::Matrix3f & | getEigenVectors () |
Eigen Vectors accessor. More... | |
Eigen::Vector3f & | getEigenValues () |
Eigen Values accessor. More... | |
Eigen::MatrixXf & | getCoefficients () |
Coefficients accessor. More... | |
void | update (const PointT &input, FLAG flag=preserve) |
update PCA with a new point More... | |
void | project (const PointT &input, PointT &projection) |
Project point on the eigenspace. More... | |
void | project (const PointCloud &input, PointCloud &projection) |
Project cloud on the eigenspace. More... | |
void | reconstruct (const PointT &projection, PointT &input) |
Reconstruct point from its projection. More... | |
void | reconstruct (const PointCloud &projection, PointCloud &input) |
Reconstruct cloud from its projection. More... | |
![]() | |
PCLBase () | |
Empty constructor. More... | |
PCLBase (const PCLBase &base) | |
Copy constructor. More... | |
virtual | ~PCLBase () |
Destructor. More... | |
PointCloudConstPtr const | getInputCloud () |
Get a pointer to the input point cloud dataset. More... | |
virtual void | setIndices (const IndicesPtr &indices) |
Provide a pointer to the vector of indices that represents the input data. More... | |
virtual void | setIndices (const IndicesConstPtr &indices) |
Provide a pointer to the vector of indices that represents the input data. More... | |
virtual void | setIndices (const PointIndicesConstPtr &indices) |
Provide a pointer to the vector of indices that represents the input data. More... | |
virtual void | setIndices (size_t row_start, size_t col_start, size_t nb_rows, size_t nb_cols) |
Set the indices for the points laying within an interest region of the point cloud. More... | |
IndicesPtr const | getIndices () |
Get a pointer to the vector of indices used. More... | |
const PointT & | operator[] (size_t pos) |
Override PointCloud operator[] to shorten code. More... | |
Additional Inherited Members | |
![]() | |
bool | initCompute () |
This method should get called before starting the actual computation. More... | |
bool | deinitCompute () |
This method should get called after finishing the actual computation. More... | |
![]() | |
PointCloudConstPtr | input_ |
The input point cloud dataset. More... | |
IndicesPtr | indices_ |
A pointer to the vector of point indices to use. More... | |
bool | use_indices_ |
Set to true if point indices are used. More... | |
bool | fake_indices_ |
If no set of indices are given, we construct a set of fake indices that mimic the input PointCloud. More... | |
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").
typedef pcl::PCLBase<PointT> pcl::PCA< PointT >::Base |
typedef Base::PointCloud pcl::PCA< PointT >::PointCloud |
typedef Base::PointCloudConstPtr pcl::PCA< PointT >::PointCloudConstPtr |
typedef Base::PointCloudPtr pcl::PCA< PointT >::PointCloudPtr |
typedef Base::PointIndicesConstPtr pcl::PCA< PointT >::PointIndicesConstPtr |
typedef Base::PointIndicesPtr pcl::PCA< PointT >::PointIndicesPtr |
enum pcl::PCA::FLAG |
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.
|
inline |
Project point on the eigenspace.
[in] | input | point from original dataset |
[out] | projection | the point in eigen vectors space |
InitFailedException |
|
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< T >::is_dense, pcl::PointCloud< T >::push_back(), pcl::PointCloud< T >::resize(), and pcl::PointCloud< T >::size().
|
inline |
Reconstruct point from its projection.
[in] | projection | point from eigenvector space |
[out] | input | reconstructed point |
InitFailedException |
|
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< T >::is_dense, pcl::PointCloud< T >::push_back(), pcl::PointCloud< T >::resize(), and pcl::PointCloud< T >::size().
|
inlinevirtual |
Provide a pointer to the input dataset.
cloud | the const boost shared pointer to a PointCloud message |
Reimplemented from pcl::PCLBase< PointT >.
Definition at line 134 of file pca.h.
References pcl::PCLBase< PointT >::setInputCloud().
|
inline |
update PCA with a new point
[in] | input | input point |
[in] | flag | update flag |
InitFailedException |