41 #ifndef PCL_REGISTRATION_CORRESPONDENCE_ESTIMATION_H_ 42 #define PCL_REGISTRATION_CORRESPONDENCE_ESTIMATION_H_ 46 #include <pcl/pcl_base.h> 47 #include <pcl/common/transforms.h> 48 #include <pcl/search/kdtree.h> 49 #include <pcl/pcl_macros.h> 51 #include <pcl/registration/correspondence_types.h> 55 namespace registration
62 template <
typename Po
intSource,
typename Po
intTarget,
typename Scalar =
float>
66 typedef boost::shared_ptr<CorrespondenceEstimationBase<PointSource, PointTarget, Scalar> >
Ptr;
67 typedef boost::shared_ptr<const CorrespondenceEstimationBase<PointSource, PointTarget, Scalar> >
ConstPtr;
116 PCL_DEPRECATED (
"[pcl::registration::CorrespondenceEstimationBase::setInputCloud] setInputCloud is deprecated. Please use setInputSource instead.")
166 PCL_WARN (
"[pcl::registration::%s::setSourceNormals] This class does not require input source normals",
getClassName ().c_str ());
178 PCL_WARN (
"[pcl::registration::%s::setTargetNormals] This class does not require input target normals",
getClassName ().c_str ());
218 bool force_no_recompute =
false)
221 if (force_no_recompute)
246 bool force_no_recompute =
false)
249 if ( force_no_recompute )
271 double max_distance = std::numeric_limits<double>::max ()) = 0;
282 double max_distance = std::numeric_limits<double>::max ()) = 0;
297 virtual boost::shared_ptr< CorrespondenceEstimationBase<PointSource, PointTarget, Scalar> >
clone ()
const = 0;
327 inline const std::string&
377 template <
typename Po
intSource,
typename Po
intTarget,
typename Scalar =
float>
381 typedef boost::shared_ptr<CorrespondenceEstimation<PointSource, PointTarget, Scalar> >
Ptr;
382 typedef boost::shared_ptr<const CorrespondenceEstimation<PointSource, PointTarget, Scalar> >
ConstPtr;
427 double max_distance = std::numeric_limits<double>::max ());
438 double max_distance = std::numeric_limits<double>::max ());
442 virtual boost::shared_ptr< CorrespondenceEstimationBase<PointSource, PointTarget, Scalar> >
452 #include <pcl/registration/impl/correspondence_estimation.hpp>
KdTree::PointRepresentationConstPtr PointRepresentationConstPtr
virtual void setSourceNormals(pcl::PCLPointCloud2::ConstPtr)
Abstract method for setting the source normals.
CorrespondenceEstimationBase()
Empty constructor.
bool force_no_recompute_
A flag which, if set, means the tree operating on the target cloud will never be recomputed.
boost::shared_ptr< CorrespondenceEstimation< PointSource, PointTarget, Scalar > > Ptr
void setSearchMethodSource(const KdTreeReciprocalPtr &tree, bool force_no_recompute=false)
Provide a pointer to the search object used to find correspondences in the source cloud (usually used...
IndicesPtr const getIndicesTarget()
Get a pointer to the vector of indices used for the target dataset.
boost::shared_ptr< std::vector< int > > IndicesPtr
bool source_cloud_updated_
Variable that stores whether we have a new source cloud, meaning we need to pre-process it again.
PointCloudTargetConstPtr target_
The input point cloud dataset target.
std::string corr_name_
The correspondence estimation method name.
const std::string & getClassName() const
Abstract class get name method.
virtual void determineCorrespondences(pcl::Correspondences &correspondences, double max_distance=std::numeric_limits< double >::max())
Determine the correspondences between input and target cloud.
CorrespondenceEstimation()
Empty constructor.
pcl::search::KdTree< PointTarget >::Ptr KdTreePtr
IndicesPtr indices_
A pointer to the vector of point indices to use.
PointCloudSourceConstPtr const getInputSource()
Get a pointer to the input point cloud dataset target.
pcl::search::KdTree< PointTarget > KdTree
void setInputCloud(const PointCloudSourceConstPtr &cloud)
Provide a pointer to the input source (e.g., the point cloud that we want to align to the target)
PointRepresentationConstPtr point_representation_
The point representation used (internal).
pcl::PointCloud< PointTarget > PointCloudTarget
PointCloudSource::Ptr PointCloudSourcePtr
pcl::search::KdTree< PointTarget > KdTree
boost::shared_ptr< KdTree< PointT > > Ptr
PointCloudTarget::Ptr PointCloudTargetPtr
IndicesPtr const getIndicesSource()
Get a pointer to the vector of indices used for the source dataset.
std::vector< pcl::PCLPointField > input_fields_
The types of input point fields available.
void setPointRepresentation(const PointRepresentationConstPtr &point_representation)
Provide a boost shared pointer to the PointRepresentation to be used when searching for nearest neigh...
bool target_cloud_updated_
Variable that stores whether we have a new target cloud, meaning we need to pre-process it again.
PointCloudTarget::ConstPtr PointCloudTargetConstPtr
boost::shared_ptr< PointCloud< PointSource > > Ptr
virtual ~CorrespondenceEstimation()
Empty destructor.
PointCloudTarget::Ptr PointCloudTargetPtr
PointCloudSourceConstPtr const getInputCloud()
Get a pointer to the input point cloud dataset target.
IndicesPtr target_indices_
The target point cloud dataset indices.
PointCloudSource::Ptr PointCloudSourcePtr
bool initCompute()
Internal computation initalization.
boost::shared_ptr< KdTree< PointT, Tree > > Ptr
pcl::PointCloud< PointTarget > PointCloudTarget
PointCloudSource::ConstPtr PointCloudSourceConstPtr
PointCloudTarget::ConstPtr PointCloudTargetConstPtr
pcl::search::KdTree< PointSource > KdTreeReciprocal
virtual void determineCorrespondences(pcl::Correspondences &correspondences, double max_distance=std::numeric_limits< double >::max())=0
Determine the correspondences between input and target cloud.
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 boost::shared_ptr< CorrespondenceEstimationBase< PointSource, PointTarget, Scalar > > clone() const
Clone and cast to CorrespondenceEstimationBase.
PointCloudTargetPtr input_transformed_
The transformed input source point cloud dataset.
boost::shared_ptr< const CorrespondenceEstimation< PointSource, PointTarget, Scalar > > ConstPtr
PointCloudTargetConstPtr const getInputTarget()
Get a pointer to the input point cloud dataset target.
virtual bool requiresTargetNormals() const
See if this rejector requires target normals.
KdTreePtr tree_
A pointer to the spatial search object used for the target dataset.
std::vector< pcl::Correspondence, Eigen::aligned_allocator< pcl::Correspondence > > Correspondences
KdTree::Ptr KdTreeReciprocalPtr
boost::shared_ptr< const PointCloud< PointT > > ConstPtr
KdTreePtr getSearchMethodTarget() const
Get a pointer to the search method used to find correspondences in the target cloud.
boost::shared_ptr< ::pcl::PCLPointCloud2 const > ConstPtr
virtual boost::shared_ptr< CorrespondenceEstimationBase< PointSource, PointTarget, Scalar > > clone() const =0
Clone and cast to CorrespondenceEstimationBase.
bool initComputeReciprocal()
Internal computation initalization for reciprocal correspondences.
virtual void setIndices(const IndicesPtr &indices)
Provide a pointer to the vector of indices that represents the input data.
virtual void determineReciprocalCorrespondences(pcl::Correspondences &correspondences, double max_distance=std::numeric_limits< double >::max())=0
Determine the reciprocal correspondences between input and target cloud.
void setIndicesTarget(const IndicesPtr &indices)
Provide a pointer to the vector of indices that represent the input target point cloud.
boost::shared_ptr< const PointRepresentation > PointRepresentationConstPtr
bool force_no_recompute_reciprocal_
A flag which, if set, means the tree operating on the source cloud will never be recomputed.
KdTreeReciprocalPtr getSearchMethodSource() const
Get a pointer to the search method used to find correspondences in the source cloud.
virtual bool requiresSourceNormals() const
See if this rejector requires source normals.
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...
virtual void setInputCloud(const PointCloudConstPtr &cloud)
Provide a pointer to the input dataset.
virtual void setTargetNormals(pcl::PCLPointCloud2::ConstPtr)
Abstract method for setting the target normals.
PointCloudConstPtr input_
The input point cloud dataset.
void setSearchMethodTarget(const KdTreePtr &tree, bool force_no_recompute=false)
Provide a pointer to the search object used to find correspondences in the target cloud.
virtual void determineReciprocalCorrespondences(pcl::Correspondences &correspondences, double max_distance=std::numeric_limits< double >::max())
Determine the reciprocal correspondences between input and target cloud.
CorrespondenceEstimation represents the base class for determining correspondences between target and...
pcl::PointCloud< PointSource > PointCloudSource
KdTree::PointRepresentationConstPtr PointRepresentationConstPtr
pcl::PointCloud< PointSource > PointCloudSource
void setIndicesSource(const IndicesPtr &indices)
Provide a pointer to the vector of indices that represent the input source point cloud.
virtual ~CorrespondenceEstimationBase()
Empty destructor.
boost::shared_ptr< const CorrespondenceEstimationBase< 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)
boost::shared_ptr< const PointRepresentation< PointTarget > > PointRepresentationConstPtr
PointCloudSource::ConstPtr PointCloudSourceConstPtr
boost::shared_ptr< CorrespondenceEstimationBase< PointSource, PointTarget, Scalar > > Ptr
KdTreeReciprocalPtr tree_reciprocal_
A pointer to the spatial search object used for the source dataset.
Abstract CorrespondenceEstimationBase class.