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;
94 ,
tree_ (new
pcl::search::KdTree<PointTarget>)
125 inline PointCloudSourceConstPtr
const
139 inline PointCloudTargetConstPtr
const
152 PCL_WARN (
"[pcl::registration::%s::setSourceNormals] This class does not require input source normals",
getClassName ().c_str ());
164 PCL_WARN (
"[pcl::registration::%s::setTargetNormals] This class does not require input target normals",
getClassName ().c_str ());
204 bool force_no_recompute =
false)
207 if (force_no_recompute)
232 bool force_no_recompute =
false)
235 if ( force_no_recompute )
245 inline KdTreeReciprocalPtr
257 double max_distance = std::numeric_limits<double>::max ()) = 0;
268 double max_distance = std::numeric_limits<double>::max ()) = 0;
283 virtual boost::shared_ptr< CorrespondenceEstimationBase<PointSource, PointTarget, Scalar> >
clone ()
const = 0;
313 inline const std::string&
363 template <
typename Po
intSource,
typename Po
intTarget,
typename Scalar =
float>
367 typedef boost::shared_ptr<CorrespondenceEstimation<PointSource, PointTarget, Scalar> >
Ptr;
368 typedef boost::shared_ptr<const CorrespondenceEstimation<PointSource, PointTarget, Scalar> >
ConstPtr;
413 double max_distance = std::numeric_limits<double>::max ());
424 double max_distance = std::numeric_limits<double>::max ());
428 virtual boost::shared_ptr< CorrespondenceEstimationBase<PointSource, PointTarget, Scalar> >
438 #include <pcl/registration/impl/correspondence_estimation.hpp>
boost::shared_ptr< PointCloud< PointSource > > Ptr
KdTree::PointRepresentationConstPtr PointRepresentationConstPtr
const std::string & getClassName() const
Abstract class get name method.
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.
This file defines compatibility wrappers for low level I/O functions.
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
PointRepresentationConstPtr point_representation_
The point representation used (internal).
pcl::PointCloud< PointTarget > PointCloudTarget
PointCloudSource::Ptr PointCloudSourcePtr
virtual bool requiresTargetNormals() const
See if this rejector requires target normals.
pcl::search::KdTree< PointTarget > KdTree
boost::shared_ptr< KdTree< PointT > > Ptr
PointCloudTarget::Ptr PointCloudTargetPtr
KdTreePtr getSearchMethodTarget() const
Get a pointer to the search method used to find correspondences in the target cloud.
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.
virtual bool requiresSourceNormals() const
See if this rejector requires source normals.
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< const PointCloud< PointSource > > ConstPtr
virtual ~CorrespondenceEstimation()
Empty destructor.
PointCloudTarget::Ptr PointCloudTargetPtr
IndicesPtr target_indices_
The target point cloud dataset indices.
PointCloudSource::Ptr PointCloudSourcePtr
bool initCompute()
Internal computation initialization.
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) ...
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.
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< ::pcl::PCLPointCloud2 const > ConstPtr
virtual boost::shared_ptr< CorrespondenceEstimationBase< PointSource, PointTarget, Scalar > > clone() const =0
Clone and cast to CorrespondenceEstimationBase.
bool initComputeReciprocal()
Internal computation initialization 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
virtual boost::shared_ptr< CorrespondenceEstimationBase< PointSource, PointTarget, Scalar > > clone() const
Clone and cast to CorrespondenceEstimationBase.
bool force_no_recompute_reciprocal_
A flag which, if set, means the tree operating on the source cloud will never be recomputed.
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...
KdTreeReciprocalPtr getSearchMethodSource() const
Get a pointer to the search method used to find correspondences in the source cloud.
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.