41#include <pcl/pcl_base.h>
60 template <
typename Po
intT>
90 , compute_done_ (
false)
99 , compute_done_ (
pca.compute_done_)
100 , basis_only_ (
pca.basis_only_)
101 , eigenvectors_ (
pca.eigenvectors_)
102 , coefficients_ (
pca.coefficients_)
104 , eigenvalues_ (
pca.eigenvalues_)
113 eigenvectors_ =
pca.eigenvectors_;
114 coefficients_ =
pca.coefficients_;
115 eigenvalues_ =
pca.eigenvalues_;
127 compute_done_ =
false;
137 compute_done_ =
false;
147 compute_done_ =
false;
157 compute_done_ =
false;
172 compute_done_ =
false;
178 inline Eigen::Vector4f&
185 "[pcl::PCA::getMean] PCA initCompute failed");
193 inline Eigen::Matrix3f&
200 "[pcl::PCA::getEigenVectors] PCA initCompute failed");
201 return (eigenvectors_);
207 inline Eigen::Vector3f&
214 "[pcl::PCA::getEigenVectors] PCA getEigenValues failed");
215 return (eigenvalues_);
221 inline Eigen::MatrixXf&
228 "[pcl::PCA::getEigenVectors] PCA getCoefficients failed");
229 return (coefficients_);
277 Eigen::Matrix3f eigenvectors_;
278 Eigen::MatrixXf coefficients_;
279 Eigen::Vector4f mean_;
280 Eigen::Vector3f eigenvalues_;
284#include <pcl/common/impl/pca.hpp>
Iterator class for point clouds with or without given indices.
An exception thrown when init can not be performed should be used in all the PCLBase class inheritant...
Principal Component analysis (PCA) class.
typename Base::PointCloudConstPtr PointCloudConstPtr
void setInputCloud(const PointCloudConstPtr &cloud) override
Provide a pointer to the input dataset.
FLAG
Updating method flag.
@ preserve
preserve subspace dimension
@ increase
keep the new basis vectors if possible
void project(const PointT &input, PointT &projection)
Project point on the eigenspace.
void update(const PointT &input, FLAG flag=preserve)
update PCA with a new point
Eigen::Matrix3f & getEigenVectors()
Eigen Vectors accessor.
Eigen::Vector4f & getMean()
Mean accessor.
PCA & operator=(PCA const &pca)
Assignment operator.
void setIndices(std::size_t row_start, std::size_t col_start, std::size_t nb_rows, std::size_t nb_cols) override
Set the indices for the points laying within an interest region of the point cloud.
Eigen::MatrixXf & getCoefficients()
Coefficients accessor.
typename Base::PointCloudPtr PointCloudPtr
PCA(bool basis_only=false)
Default Constructor.
PCA(PCA const &pca)
Copy Constructor.
void setIndices(const PointIndicesConstPtr &indices) override
Provide a pointer to the vector of indices that represents the input data.
typename Base::PointIndicesConstPtr PointIndicesConstPtr
Eigen::Vector3f & getEigenValues()
Eigen Values accessor.
typename Base::PointCloud PointCloud
void setIndices(const IndicesConstPtr &indices) override
Provide a pointer to the vector of indices that represents the input data.
void reconstruct(const PointT &projection, PointT &input)
Reconstruct point from its projection.
void setIndices(const IndicesPtr &indices) override
Provide a pointer to the vector of indices that represents the input data.
typename Base::PointIndicesPtr PointIndicesPtr
PointCloudConstPtr input_
The input point cloud dataset.
virtual void setInputCloud(const PointCloudConstPtr &cloud)
Provide a pointer to the input dataset.
typename PointCloud::Ptr PointCloudPtr
typename PointCloud::ConstPtr PointCloudConstPtr
pcl::PointCloud< PointT > PointCloud
IndicesPtr indices_
A pointer to the vector of point indices to use.
virtual void setIndices(const IndicesPtr &indices)
Provide a pointer to the vector of indices that represents the input data.
bool initCompute()
This method should get called before starting the actual computation.
PointIndices::ConstPtr PointIndicesConstPtr
PointIndices::Ptr PointIndicesPtr
PointCloud represents the base class in PCL for storing collections of 3D points.
shared_ptr< Indices > IndicesPtr
shared_ptr< const Indices > IndicesConstPtr
Defines all the PCL and non-PCL macros used.
A point structure representing Euclidean xyz coordinates, and the RGB color.