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;
120 "[pcl::registration::CorrespondenceEstimationBase::getInputCloud] getInputCloud is deprecated. Please use getInputSource instead.");
190 bool force_no_recompute =
false)
193 if (force_no_recompute)
218 bool force_no_recompute =
false)
221 if ( force_no_recompute )
243 double max_distance = std::numeric_limits<double>::max ()) = 0;
254 double max_distance = std::numeric_limits<double>::max ()) = 0;
296 inline const std::string&
346 template <
typename Po
intSource,
typename Po
intTarget,
typename Scalar =
float>
350 typedef boost::shared_ptr<CorrespondenceEstimation<PointSource, PointTarget, Scalar> >
Ptr;
351 typedef boost::shared_ptr<const CorrespondenceEstimation<PointSource, PointTarget, Scalar> >
ConstPtr;
396 double max_distance = std::numeric_limits<double>::max ());
407 double max_distance = std::numeric_limits<double>::max ());
412 #include <pcl/registration/impl/correspondence_estimation.hpp>
pcl::PointCloud< PointTarget > PointCloudTarget
boost::shared_ptr< KdTree< PointT > > Ptr
std::vector< pcl::Correspondence, Eigen::aligned_allocator< pcl::Correspondence > > Correspondences
boost::shared_ptr< const CorrespondenceEstimation< PointSource, PointTarget, Scalar > > ConstPtr
Abstract CorrespondenceEstimationBase class.
KdTree::PointRepresentationConstPtr PointRepresentationConstPtr
PointCloudConstPtr const getInputCloud()
Get a pointer to the input point cloud dataset.
PointCloudTarget::ConstPtr PointCloudTargetConstPtr
std::string corr_name_
The correspondence estimation method name.
virtual void determineCorrespondences(pcl::Correspondences &correspondences, double max_distance=std::numeric_limits< double >::max())=0
Determine the correspondences between input and target cloud.
boost::shared_ptr< const PointRepresentation< PointTarget > > PointRepresentationConstPtr
boost::shared_ptr< const PointRepresentation > PointRepresentationConstPtr
pcl::PointCloud< PointSource > PointCloudSource
boost::shared_ptr< const PointCloud< PointT > > ConstPtr
bool initCompute()
Internal computation initalization.
void setPointRepresentation(const PointRepresentationConstPtr &point_representation)
Provide a boost shared pointer to the PointRepresentation to be used when searching for nearest neigh...
CorrespondenceEstimationBase()
Empty constructor.
virtual ~CorrespondenceEstimationBase()
Empty destructor.
boost::shared_ptr< std::vector< int > > IndicesPtr
boost::shared_ptr< PointCloud< PointT > > Ptr
virtual void determineReciprocalCorrespondences(pcl::Correspondences &correspondences, double max_distance=std::numeric_limits< double >::max())
Determine the reciprocal correspondences between input and target cloud.
IndicesPtr indices_
A pointer to the vector of point indices to use.
KdTree::Ptr KdTreeReciprocalPtr
virtual void setInputCloud(const PointCloudConstPtr &cloud)
Provide a pointer to the input dataset.
PointCloudSource::Ptr PointCloudSourcePtr
boost::shared_ptr< CorrespondenceEstimationBase< PointSource, PointTarget, Scalar > > Ptr
pcl::search::KdTree< PointSource > KdTreeReciprocal
std::vector< pcl::PCLPointField > input_fields_
The types of input point fields available.
PointCloudTarget::Ptr PointCloudTargetPtr
PointCloudSource::ConstPtr PointCloudSourceConstPtr
PointCloudTargetConstPtr const getInputTarget()
Get a pointer to the input point cloud dataset target.
const std::string & getClassName() const
Abstract class get name method.
void getFields(const pcl::PointCloud< PointT > &cloud, std::vector< pcl::PCLPointField > &fields)
Get the list of available fields (i.e., dimension/channel)
PointCloudConstPtr input_
The input point cloud dataset.
IndicesPtr target_indices_
The target point cloud dataset indices.
PointCloudSource::Ptr PointCloudSourcePtr
boost::shared_ptr< CorrespondenceEstimation< PointSource, PointTarget, Scalar > > Ptr
boost::shared_ptr< const CorrespondenceEstimationBase< PointSource, PointTarget, Scalar > > ConstPtr
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...
pcl::search::KdTree< PointTarget >::Ptr KdTreePtr
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...
PointCloudSource::ConstPtr PointCloudSourceConstPtr
KdTreePtr getSearchMethodTarget() const
Get a pointer to the search method used to find correspondences in the target cloud.
PointCloudTarget::ConstPtr PointCloudTargetConstPtr
PointCloudTargetConstPtr target_
The input point cloud dataset target.
CorrespondenceEstimation()
Empty constructor.
PointCloudTargetPtr input_transformed_
The transformed input source point cloud dataset.
bool force_no_recompute_
A flag which, if set, means the tree operating on the target cloud will never be recomputed.
virtual ~CorrespondenceEstimation()
Empty destructor.
KdTreeReciprocalPtr tree_reciprocal_
A pointer to the spatial search object used for the source dataset.
pcl::PointCloud< PointTarget > PointCloudTarget
PCL_DEPRECATED(void setInputCloud(const PointCloudSourceConstPtr &cloud),"[pcl::registration::CorrespondenceEstimationBase::setInputCloud] setInputCloud is deprecated. Please use setInputSource instead.")
Provide a pointer to the input source (e.g., the point cloud that we want to align to the target) ...
bool force_no_recompute_reciprocal_
A flag which, if set, means the tree operating on the source cloud will never be recomputed.
CorrespondenceEstimation represents the base class for determining correspondences between target and...
KdTree::PointRepresentationConstPtr PointRepresentationConstPtr
virtual void determineReciprocalCorrespondences(pcl::Correspondences &correspondences, double max_distance=std::numeric_limits< double >::max())=0
Determine the reciprocal correspondences between input and target cloud.
PointCloudTarget::Ptr PointCloudTargetPtr
void setIndicesSource(const IndicesPtr &indices)
Provide a pointer to the vector of indices that represent the input source point cloud.
virtual void determineCorrespondences(pcl::Correspondences &correspondences, double max_distance=std::numeric_limits< double >::max())
Determine the correspondences between input and target cloud.
PointCloudSourceConstPtr const getInputSource()
Get a pointer to the input point cloud dataset target.
void setIndicesTarget(const IndicesPtr &indices)
Provide a pointer to the vector of indices that represent the input target point cloud.
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...
boost::shared_ptr< KdTree< PointT > > Ptr
virtual void setIndices(const IndicesPtr &indices)
Provide a pointer to the vector of indices that represents the input data.
bool initComputeReciprocal()
Internal computation initalization for reciprocal correspondences.
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) ...
IndicesPtr const getIndicesTarget()
Get a pointer to the vector of indices used for the target dataset.
bool source_cloud_updated_
Variable that stores whether we have a new source cloud, meaning we need to pre-process it again...
pcl::search::KdTree< PointTarget > KdTree
pcl::PointCloud< PointSource > PointCloudSource
KdTreeReciprocalPtr getSearchMethodSource() const
Get a pointer to the search method used to find correspondences in the source cloud.
IndicesPtr const getIndicesSource()
Get a pointer to the vector of indices used for the source dataset.
PointRepresentationConstPtr point_representation_
The point representation used (internal).
pcl::search::KdTree< PointTarget > KdTree
KdTreePtr tree_
A pointer to the spatial search object used for the target dataset.
bool target_cloud_updated_
Variable that stores whether we have a new target cloud, meaning we need to pre-process it again...