Point Cloud Library (PCL)
1.7.0
|
IterativeClosestPoint provides a base implementation of the Iterative Closest Point algorithm. More...
#include <pcl/registration/icp.h>
Public Types | |
typedef Registration < PointSource, PointTarget, Scalar >::PointCloudSource | PointCloudSource |
typedef PointCloudSource::Ptr | PointCloudSourcePtr |
typedef PointCloudSource::ConstPtr | PointCloudSourceConstPtr |
typedef Registration < PointSource, PointTarget, Scalar >::PointCloudTarget | PointCloudTarget |
typedef PointCloudTarget::Ptr | PointCloudTargetPtr |
typedef PointCloudTarget::ConstPtr | PointCloudTargetConstPtr |
typedef PointIndices::Ptr | PointIndicesPtr |
typedef PointIndices::ConstPtr | PointIndicesConstPtr |
typedef boost::shared_ptr < IterativeClosestPoint < PointSource, PointTarget, Scalar > > | Ptr |
typedef boost::shared_ptr < const IterativeClosestPoint < PointSource, PointTarget, Scalar > > | ConstPtr |
typedef Registration < PointSource, PointTarget, Scalar >::Matrix4 | Matrix4 |
Public Member Functions | |
IterativeClosestPoint () | |
Empty constructor. | |
virtual | ~IterativeClosestPoint () |
Empty destructor. | |
pcl::registration::DefaultConvergenceCriteria < Scalar >::Ptr | getConvergeCriteria () |
Returns a pointer to the DefaultConvergenceCriteria used by the IterativeClosestPoint class. | |
virtual void | setInputSource (const PointCloudSourceConstPtr &cloud) |
Provide a pointer to the input source (e.g., the point cloud that we want to align to the target) | |
virtual void | setInputTarget (const PointCloudTargetConstPtr &cloud) |
Provide a pointer to the input target (e.g., the point cloud that we want to align to the target) | |
void | setUseReciprocalCorrespondences (bool use_reciprocal_correspondence) |
Set whether to use reciprocal correspondence or not. | |
bool | getUseReciprocalCorrespondences () const |
Obtain whether reciprocal correspondence are used or not. | |
Public Attributes | |
pcl::registration::DefaultConvergenceCriteria < Scalar >::Ptr | convergence_criteria_ |
Protected Member Functions | |
virtual void | transformCloud (const PointCloudSource &input, PointCloudSource &output, const Matrix4 &transform) |
Apply a rigid transform to a given dataset. | |
virtual void | computeTransformation (PointCloudSource &output, const Matrix4 &guess) |
Rigid transformation computation method with initial guess. | |
Protected Attributes | |
size_t | x_idx_offset_ |
XYZ fields offset. | |
size_t | y_idx_offset_ |
size_t | z_idx_offset_ |
size_t | nx_idx_offset_ |
Normal fields offset. | |
size_t | ny_idx_offset_ |
size_t | nz_idx_offset_ |
bool | use_reciprocal_correspondence_ |
The correspondence type used for correspondence estimation. | |
bool | source_has_normals_ |
Internal check whether source dataset has normals or not. | |
bool | target_has_normals_ |
Internal check whether target dataset has normals or not. |
IterativeClosestPoint provides a base implementation of the Iterative Closest Point algorithm.
The transformation is estimated based on Singular Value Decomposition (SVD).
The algorithm has several termination criteria:
Usage example:
IterativeClosestPoint<PointXYZ, PointXYZ> icp; // Set the input source and target icp.setInputCloud (cloud_source); icp.setInputTarget (cloud_target); // Set the max correspondence distance to 5cm (e.g., correspondences with higher distances will be ignored) icp.setMaxCorrespondenceDistance (0.05); // Set the maximum number of iterations (criterion 1) icp.setMaximumIterations (50); // Set the transformation epsilon (criterion 2) icp.setTransformationEpsilon (1e-8); // Set the euclidean distance difference epsilon (criterion 3) icp.setEuclideanFitnessEpsilon (1); // Perform the alignment icp.align (cloud_source_registered); // Obtain the transformation that aligned cloud_source to cloud_source_registered Eigen::Matrix4f transformation = icp.getFinalTransformation ();
typedef boost::shared_ptr<const IterativeClosestPoint<PointSource, PointTarget, Scalar> > pcl::IterativeClosestPoint< PointSource, PointTarget, Scalar >::ConstPtr |
Reimplemented from pcl::Registration< PointSource, PointTarget, Scalar >.
Reimplemented in pcl::IterativeClosestPointWithNormals< PointSource, PointTarget, Scalar >, pcl::GeneralizedIterativeClosestPoint< PointSource, PointTarget >, and pcl::IterativeClosestPointNonLinear< PointSource, PointTarget, Scalar >.
typedef Registration<PointSource, PointTarget, Scalar>::Matrix4 pcl::IterativeClosestPoint< PointSource, PointTarget, Scalar >::Matrix4 |
typedef Registration<PointSource, PointTarget, Scalar>::PointCloudSource pcl::IterativeClosestPoint< PointSource, PointTarget, Scalar >::PointCloudSource |
typedef PointCloudSource::ConstPtr pcl::IterativeClosestPoint< PointSource, PointTarget, Scalar >::PointCloudSourceConstPtr |
Reimplemented from pcl::Registration< PointSource, PointTarget, Scalar >.
Reimplemented in pcl::GeneralizedIterativeClosestPoint< PointSource, PointTarget >.
typedef PointCloudSource::Ptr pcl::IterativeClosestPoint< PointSource, PointTarget, Scalar >::PointCloudSourcePtr |
Reimplemented from pcl::Registration< PointSource, PointTarget, Scalar >.
Reimplemented in pcl::GeneralizedIterativeClosestPoint< PointSource, PointTarget >.
typedef Registration<PointSource, PointTarget, Scalar>::PointCloudTarget pcl::IterativeClosestPoint< PointSource, PointTarget, Scalar >::PointCloudTarget |
typedef PointCloudTarget::ConstPtr pcl::IterativeClosestPoint< PointSource, PointTarget, Scalar >::PointCloudTargetConstPtr |
Reimplemented from pcl::Registration< PointSource, PointTarget, Scalar >.
Reimplemented in pcl::GeneralizedIterativeClosestPoint< PointSource, PointTarget >.
typedef PointCloudTarget::Ptr pcl::IterativeClosestPoint< PointSource, PointTarget, Scalar >::PointCloudTargetPtr |
Reimplemented from pcl::Registration< PointSource, PointTarget, Scalar >.
Reimplemented in pcl::GeneralizedIterativeClosestPoint< PointSource, PointTarget >.
typedef PointIndices::ConstPtr pcl::IterativeClosestPoint< PointSource, PointTarget, Scalar >::PointIndicesConstPtr |
Reimplemented from pcl::PCLBase< PointSource >.
Reimplemented in pcl::GeneralizedIterativeClosestPoint< PointSource, PointTarget >.
typedef PointIndices::Ptr pcl::IterativeClosestPoint< PointSource, PointTarget, Scalar >::PointIndicesPtr |
Reimplemented from pcl::PCLBase< PointSource >.
Reimplemented in pcl::GeneralizedIterativeClosestPoint< PointSource, PointTarget >.
typedef boost::shared_ptr<IterativeClosestPoint<PointSource, PointTarget, Scalar> > pcl::IterativeClosestPoint< PointSource, PointTarget, Scalar >::Ptr |
Reimplemented from pcl::Registration< PointSource, PointTarget, Scalar >.
Reimplemented in pcl::IterativeClosestPointWithNormals< PointSource, PointTarget, Scalar >, pcl::GeneralizedIterativeClosestPoint< PointSource, PointTarget >, and pcl::IterativeClosestPointNonLinear< PointSource, PointTarget, Scalar >.
pcl::IterativeClosestPoint< PointSource, PointTarget, Scalar >::IterativeClosestPoint | ( | ) | [inline] |
virtual pcl::IterativeClosestPoint< PointSource, PointTarget, Scalar >::~IterativeClosestPoint | ( | ) | [inline, virtual] |
void pcl::IterativeClosestPoint< PointSource, PointTarget, Scalar >::computeTransformation | ( | PointCloudSource & | output, |
const Matrix4 & | guess | ||
) | [protected, virtual] |
Rigid transformation computation method with initial guess.
output | the transformed input point cloud dataset using the rigid transformation found |
guess | the initial guess of the transformation to compute |
Implements pcl::Registration< PointSource, PointTarget, Scalar >.
pcl::registration::DefaultConvergenceCriteria<Scalar>::Ptr pcl::IterativeClosestPoint< PointSource, PointTarget, Scalar >::getConvergeCriteria | ( | ) | [inline] |
Returns a pointer to the DefaultConvergenceCriteria used by the IterativeClosestPoint class.
This allows to check the convergence state after the align() method as well as to configure DefaultConvergenceCriteria's parameters not available through the ICP API before the align() method is called. Please note that the align method sets max_iterations_, euclidean_fitness_epsilon_ and transformation_epsilon_ and therefore overrides the default / set values of the DefaultConvergenceCriteria instance.
[out] | Pointer | to the IterativeClosestPoint's DefaultConvergenceCriteria. |
bool pcl::IterativeClosestPoint< PointSource, PointTarget, Scalar >::getUseReciprocalCorrespondences | ( | ) | const [inline] |
virtual void pcl::IterativeClosestPoint< PointSource, PointTarget, Scalar >::setInputSource | ( | const PointCloudSourceConstPtr & | cloud | ) | [inline, virtual] |
Provide a pointer to the input source (e.g., the point cloud that we want to align to the target)
[in] | cloud | the input point cloud source |
Definition at line 178 of file icp.h.
Referenced by pcl::IterativeClosestPoint< PointSource, PointTarget >::setInputSource().
virtual void pcl::IterativeClosestPoint< PointSource, PointTarget, Scalar >::setInputTarget | ( | const PointCloudTargetConstPtr & | cloud | ) | [inline, virtual] |
Provide a pointer to the input target (e.g., the point cloud that we want to align to the target)
[in] | cloud | the input point cloud target |
Definition at line 213 of file icp.h.
Referenced by pcl::IterativeClosestPoint< PointSource, PointTarget >::setInputTarget().
void pcl::IterativeClosestPoint< PointSource, PointTarget, Scalar >::setUseReciprocalCorrespondences | ( | bool | use_reciprocal_correspondence | ) | [inline] |
void pcl::IterativeClosestPoint< PointSource, PointTarget, Scalar >::transformCloud | ( | const PointCloudSource & | input, |
PointCloudSource & | output, | ||
const Matrix4 & | transform | ||
) | [protected, virtual] |
Apply a rigid transform to a given dataset.
Here we check whether whether the dataset has surface normals in addition to XYZ, and rotate normals as well.
[in] | input | the input point cloud |
[out] | output | the resultant output point cloud |
[in] | transform | a 4x4 rigid transformation |
Reimplemented in pcl::IterativeClosestPointWithNormals< PointSource, PointTarget, Scalar >.
Definition at line 49 of file icp.hpp.
References pcl::PointCloud< PointT >::size().
pcl::registration::DefaultConvergenceCriteria<Scalar>::Ptr pcl::IterativeClosestPoint< PointSource, PointTarget, Scalar >::convergence_criteria_ |
Definition at line 134 of file icp.h.
Referenced by pcl::IterativeClosestPoint< PointSource, PointTarget >::getConvergeCriteria(), and pcl::IterativeClosestPoint< PointSource, PointTarget >::IterativeClosestPoint().
size_t pcl::IterativeClosestPoint< PointSource, PointTarget, Scalar >::nx_idx_offset_ [protected] |
Normal fields offset.
Definition at line 271 of file icp.h.
Referenced by pcl::IterativeClosestPoint< PointSource, PointTarget >::setInputSource().
size_t pcl::IterativeClosestPoint< PointSource, PointTarget, Scalar >::ny_idx_offset_ [protected] |
Definition at line 271 of file icp.h.
Referenced by pcl::IterativeClosestPoint< PointSource, PointTarget >::setInputSource().
size_t pcl::IterativeClosestPoint< PointSource, PointTarget, Scalar >::nz_idx_offset_ [protected] |
Definition at line 271 of file icp.h.
Referenced by pcl::IterativeClosestPoint< PointSource, PointTarget >::setInputSource().
bool pcl::IterativeClosestPoint< PointSource, PointTarget, Scalar >::source_has_normals_ [protected] |
Internal check whether source dataset has normals or not.
Definition at line 277 of file icp.h.
Referenced by pcl::IterativeClosestPoint< PointSource, PointTarget >::setInputSource().
bool pcl::IterativeClosestPoint< PointSource, PointTarget, Scalar >::target_has_normals_ [protected] |
Internal check whether target dataset has normals or not.
Definition at line 279 of file icp.h.
Referenced by pcl::IterativeClosestPoint< PointSource, PointTarget >::setInputTarget().
bool pcl::IterativeClosestPoint< PointSource, PointTarget, Scalar >::use_reciprocal_correspondence_ [protected] |
The correspondence type used for correspondence estimation.
Definition at line 274 of file icp.h.
Referenced by pcl::IterativeClosestPoint< PointSource, PointTarget >::getUseReciprocalCorrespondences(), and pcl::IterativeClosestPoint< PointSource, PointTarget >::setUseReciprocalCorrespondences().
size_t pcl::IterativeClosestPoint< PointSource, PointTarget, Scalar >::x_idx_offset_ [protected] |
XYZ fields offset.
Definition at line 268 of file icp.h.
Referenced by pcl::IterativeClosestPoint< PointSource, PointTarget >::setInputSource().
size_t pcl::IterativeClosestPoint< PointSource, PointTarget, Scalar >::y_idx_offset_ [protected] |
Definition at line 268 of file icp.h.
Referenced by pcl::IterativeClosestPoint< PointSource, PointTarget >::setInputSource().
size_t pcl::IterativeClosestPoint< PointSource, PointTarget, Scalar >::z_idx_offset_ [protected] |
Definition at line 268 of file icp.h.
Referenced by pcl::IterativeClosestPoint< PointSource, PointTarget >::setInputSource().