45 #include <pcl/sample_consensus/ransac.h> 46 #include <pcl/sample_consensus/sac_model_registration.h> 47 #include <pcl/registration/registration.h> 48 #include <pcl/registration/transformation_estimation_svd.h> 49 #include <pcl/registration/transformation_estimation_point_to_plane_lls.h> 50 #include <pcl/registration/correspondence_estimation.h> 51 #include <pcl/registration/default_convergence_criteria.h> 93 template <
typename Po
intSource,
typename Po
intTarget,
typename Scalar =
float>
108 typedef boost::shared_ptr<IterativeClosestPoint<PointSource, PointTarget, Scalar> >
Ptr;
109 typedef boost::shared_ptr<const IterativeClosestPoint<PointSource, PointTarget, Scalar> >
ConstPtr;
180 std::vector<pcl::PCLPointField> fields;
183 for (
size_t i = 0; i < fields.size (); ++i)
186 else if (fields[i].name ==
"y")
y_idx_offset_ = fields[i].offset;
187 else if (fields[i].name ==
"z")
z_idx_offset_ = fields[i].offset;
188 else if (fields[i].name ==
"normal_x")
193 else if (fields[i].name ==
"normal_y")
198 else if (fields[i].name ==
"normal_z")
215 std::vector<pcl::PCLPointField> fields;
218 for (
size_t i = 0; i < fields.size (); ++i)
220 if (fields[i].name ==
"normal_x" || fields[i].name ==
"normal_y" || fields[i].name ==
"normal_z")
256 PointCloudSource &output,
257 const Matrix4 &transform);
295 template <
typename Po
intSource,
typename Po
intTarget,
typename Scalar =
float>
307 typedef boost::shared_ptr<IterativeClosestPoint<PointSource, PointTarget, Scalar> >
Ptr;
308 typedef boost::shared_ptr<const IterativeClosestPoint<PointSource, PointTarget, Scalar> >
ConstPtr;
313 reg_name_ =
"IterativeClosestPointWithNormals";
331 PointCloudSource &output,
332 const Matrix4 &transform);
336 #include <pcl/registration/impl/icp.hpp> 338 #endif //#ifndef PCL_ICP_H_ PointIndices::Ptr PointIndicesPtr
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) ...
PointCloudTarget::Ptr PointCloudTargetPtr
DefaultConvergenceCriteria represents an instantiation of ConvergenceCriteria, and implements the fol...
TransformationEstimationPtr transformation_estimation_
A TransformationEstimation object, used to calculate the 4x4 rigid transformation.
IterativeClosestPointWithNormals is a special case of IterativeClosestPoint, that uses a transformati...
bool target_has_normals_
Internal check whether target dataset has normals or not.
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) ...
CorrespondenceEstimationPtr correspondence_estimation_
A CorrespondenceEstimation object, used to estimate correspondences between the source and the target...
int nr_iterations_
The number of iterations the internal optimization ran for (used internally).
bool getUseReciprocalCorrespondences() const
Obtain whether reciprocal correspondence are used or not.
PointCloudTarget::ConstPtr PointCloudTargetConstPtr
CorrespondencesPtr correspondences_
The set of correspondences determined at this ICP step.
boost::shared_ptr< const IterativeClosestPoint< PointSource, PointTarget, Scalar > > ConstPtr
virtual void determineRequiredBlobData()
Looks at the Estimators and Rejectors and determines whether their blob-setter methods need to be cal...
virtual void setInputTarget(const PointCloudTargetConstPtr &cloud)
Provide a pointer to the input target (e.g., the point cloud that we want to align the input source t...
Eigen::Matrix< Scalar, 4, 4 > Matrix4
boost::shared_ptr< IterativeClosestPoint< PointSource, PointTarget, Scalar > > Ptr
boost::shared_ptr< PointCloud< PointSource > > Ptr
virtual void transformCloud(const PointCloudSource &input, PointCloudSource &output, const Matrix4 &transform)
Apply a rigid transform to a given dataset.
Registration< PointSource, PointTarget, Scalar >::PointCloudSource PointCloudSource
Matrix4 transformation_
The transformation matrix estimated by the registration method.
IterativeClosestPointWithNormals()
Empty constructor.
virtual ~IterativeClosestPoint()
Empty destructor.
PointCloudSource::ConstPtr PointCloudSourceConstPtr
boost::shared_ptr< IterativeClosestPoint< PointSource, PointTarget, Scalar > > Ptr
virtual ~IterativeClosestPointWithNormals()
Empty destructor.
boost::shared_ptr< const PointCloud< PointSource > > ConstPtr
IterativeClosestPoint provides a base implementation of the Iterative Closest Point algorithm...
Registration represents the base registration class for general purpose, ICP-like methods...
bool source_has_normals_
Internal check whether source dataset has normals or not.
boost::shared_ptr< DefaultConvergenceCriteria< Scalar > > Ptr
Registration< PointSource, PointTarget, Scalar >::Matrix4 Matrix4
boost::shared_ptr< ::pcl::PointIndices > Ptr
size_t x_idx_offset_
XYZ fields offset.
virtual void computeTransformation(PointCloudSource &output, const Matrix4 &guess)
Rigid transformation computation method with initial guess.
Registration< PointSource, PointTarget, Scalar >::PointCloudTarget PointCloudTarget
PointIndices::ConstPtr PointIndicesConstPtr
pcl::registration::DefaultConvergenceCriteria< Scalar >::Ptr getConvergeCriteria()
Returns a pointer to the DefaultConvergenceCriteria used by the IterativeClosestPoint class...
pcl::registration::DefaultConvergenceCriteria< Scalar >::Ptr convergence_criteria_
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) ...
std::string reg_name_
The registration method name.
bool need_source_blob_
Checks for whether estimators and rejectors need various data.
bool use_reciprocal_correspondence_
The correspondence type used for correspondence estimation.
void setUseReciprocalCorrespondences(bool use_reciprocal_correspondence)
Set whether to use reciprocal correspondence or not.
IterativeClosestPoint< PointSource, PointTarget, Scalar >::PointCloudTarget PointCloudTarget
IterativeClosestPoint()
Empty constructor.
CorrespondenceEstimation represents the base class for determining correspondences between target and...
IterativeClosestPoint< PointSource, PointTarget, Scalar >::PointCloudSource PointCloudSource
size_t nx_idx_offset_
Normal fields offset.
IterativeClosestPoint< PointSource, PointTarget, Scalar >::Matrix4 Matrix4
boost::shared_ptr< const IterativeClosestPoint< PointSource, PointTarget, Scalar > > ConstPtr
void getFields(const pcl::PointCloud< PointT > &cloud, std::vector< pcl::PCLPointField > &fields)
Get the list of available fields (i.e., dimension/channel)
PointCloudSource::Ptr PointCloudSourcePtr
boost::shared_ptr< ::pcl::PointIndices const > ConstPtr