Point Cloud Library (PCL)
1.11.1-dev
|
44 #include <pcl/registration/correspondence_estimation.h>
45 #include <pcl/registration/default_convergence_criteria.h>
46 #include <pcl/registration/registration.h>
47 #include <pcl/registration/transformation_estimation_point_to_plane_lls.h>
48 #include <pcl/registration/transformation_estimation_svd.h>
49 #include <pcl/registration/transformation_estimation_symmetric_point_to_plane_lls.h>
95 template <
typename Po
intSource,
typename Po
intTarget,
typename Scalar =
float>
111 using Ptr = shared_ptr<IterativeClosestPoint<PointSource, PointTarget, Scalar>>;
113 shared_ptr<const IterativeClosestPoint<PointSource, PointTarget, Scalar>>;
158 TransformationEstimationSVD<PointSource, PointTarget, Scalar>());
209 const auto fields = pcl::getFields<PointSource>();
211 for (
const auto& field : fields) {
212 if (field.name ==
"x")
214 else if (field.name ==
"y")
216 else if (field.name ==
"z")
218 else if (field.name ==
"normal_x") {
222 else if (field.name ==
"normal_y") {
226 else if (field.name ==
"normal_z") {
242 const auto fields = pcl::getFields<PointSource>();
244 for (
const auto& field : fields) {
245 if (field.name ==
"normal_x" || field.name ==
"normal_y" ||
246 field.name ==
"normal_z") {
336 template <
typename Po
intSource,
typename Po
intTarget,
typename Scalar =
float>
355 using Ptr = shared_ptr<IterativeClosestPoint<PointSource, PointTarget, Scalar>>;
357 shared_ptr<const IterativeClosestPoint<PointSource, PointTarget, Scalar>>;
362 reg_name_ =
"IterativeClosestPointWithNormals";
386 symmetric_transformation_estimation->setEnforceSameDirectionNormals(
416 auto symmetric_transformation_estimation = dynamic_pointer_cast<
421 if (symmetric_transformation_estimation)
422 symmetric_transformation_estimation->setEnforceSameDirectionNormals(
456 #include <pcl/registration/impl/icp.hpp>
shared_ptr< IterativeClosestPoint< PointSource, PointTarget, float > > Ptr
bool use_symmetric_objective_
Type of objective function (asymmetric vs.
pcl::registration::DefaultConvergenceCriteria< Scalar >::Ptr getConvergeCriteria()
Returns a pointer to the DefaultConvergenceCriteria used by the IterativeClosestPoint class.
CorrespondencesPtr correspondences_
The set of correspondences determined at this ICP step.
void setUseReciprocalCorrespondences(bool use_reciprocal_correspondence)
Set whether to use reciprocal correspondence or not.
shared_ptr< T > make_shared(Args &&... args)
Returns a pcl::shared_ptr compliant with type T's allocation policy.
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 the input source t...
Registration represents the base registration class for general purpose, ICP-like methods.
std::size_t y_idx_offset_
DefaultConvergenceCriteria represents an instantiation of ConvergenceCriteria, and implements the fol...
IterativeClosestPoint & operator=(const IterativeClosestPoint &)=delete
double transformation_rotation_epsilon_
The maximum rotation difference between two consecutive transformations in order to consider converge...
typename PointCloudSource::Ptr PointCloudSourcePtr
virtual void transformCloud(const PointCloudSource &input, PointCloudSource &output, const Matrix4 &transform)
Apply a rigid transform to a given dataset.
IterativeClosestPointWithNormals()
Empty constructor.
IterativeClosestPoint provides a base implementation of the Iterative Closest Point algorithm.
void setUseSymmetricObjective(bool use_symmetric_objective)
Set whether to use a symmetric objective function or not.
Matrix4 transformation_
The transformation matrix estimated by the registration method.
bool use_reciprocal_correspondence_
The correspondence type used for correspondence estimation.
bool enforce_same_direction_normals_
Whether or not to negate source and/or target normals such that they point in the same direction in t...
typename Registration< PointSource, PointTarget, float >::PointCloudTarget PointCloudTarget
PointIndices::ConstPtr PointIndicesConstPtr
void setInputSource(const PointCloudSourceConstPtr &cloud) override
Provide a pointer to the input source (e.g., the point cloud that we want to align to the target)
bool getUseSymmetricObjective() const
Obtain whether a symmetric objective is used or not.
Eigen::Matrix< Scalar, 4, 4 > Matrix4
virtual void determineRequiredBlobData()
Looks at the Estimators and Rejectors and determines whether their blob-setter methods need to be cal...
typename Registration< PointSource, PointTarget, Scalar >::PointCloudSource PointCloudSource
shared_ptr< DefaultConvergenceCriteria< Scalar > > Ptr
virtual ~IterativeClosestPointWithNormals()
Empty destructor.
typename PointCloudTarget::ConstPtr PointCloudTargetConstPtr
std::size_t nx_idx_offset_
Normal fields offset.
shared_ptr< const ::pcl::PointIndices > ConstPtr
shared_ptr< IterativeClosestPoint< PointSource, PointTarget, Scalar > > Ptr
IterativeClosestPointWithNormals is a special case of IterativeClosestPoint, that uses a transformati...
shared_ptr< const IterativeClosestPoint< PointSource, PointTarget, Scalar > > ConstPtr
void setInputTarget(const PointCloudTargetConstPtr &cloud) override
Provide a pointer to the input target (e.g., the point cloud that we want to align to the target)
bool getEnforceSameDirectionNormals() const
Obtain whether source or target normals are negated on a per-point basis such that they point in the ...
void setEnforceSameDirectionNormals(bool enforce_same_direction_normals)
Set whether or not to negate source or target normals on a per-point basis such that they point in th...
virtual void transformCloud(const PointCloudSource &input, PointCloudSource &output, const Matrix4 &transform)
Apply a rigid transform to a given dataset.
pcl::registration::DefaultConvergenceCriteria< Scalar >::Ptr convergence_criteria_
typename PointCloudSource::ConstPtr PointCloudSourceConstPtr
std::size_t ny_idx_offset_
std::vector< CorrespondenceRejectorPtr > correspondence_rejectors_
The list of correspondence rejectors to use.
IterativeClosestPoint()
Empty constructor.
shared_ptr< ::pcl::PointIndices > Ptr
std::size_t z_idx_offset_
int nr_iterations_
The number of iterations the internal optimization ran for (used internally).
std::size_t nz_idx_offset_
void computeTransformation(PointCloudSource &output, const Matrix4 &guess) override
Rigid transformation computation method with initial guess.
bool need_source_blob_
Checks for whether estimators and rejectors need various data.
typename IterativeClosestPoint< PointSource, PointTarget, Scalar >::PointCloudSource PointCloudSource
~IterativeClosestPoint()
Empty destructor.
typename IterativeClosestPoint< PointSource, PointTarget, Scalar >::Matrix4 Matrix4
PointIndices::Ptr PointIndicesPtr
typename PointCloudTarget::Ptr PointCloudTargetPtr
TransformationEstimationPtr transformation_estimation_
A TransformationEstimation object, used to calculate the 4x4 rigid transformation.
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.
typename Registration< PointSource, PointTarget, float >::Matrix4 Matrix4
shared_ptr< const IterativeClosestPoint< PointSource, PointTarget, float > > ConstPtr
bool getUseReciprocalCorrespondences() const
Obtain whether reciprocal correspondence are used or not.
Defines functions, macros and traits for allocating and using memory.
std::string reg_name_
The registration method name.
typename IterativeClosestPoint< PointSource, PointTarget, Scalar >::PointCloudTarget PointCloudTarget
CorrespondenceEstimationPtr correspondence_estimation_
A CorrespondenceEstimation object, used to estimate correspondences between the source and the target...
std::size_t x_idx_offset_
XYZ fields offset.