Point Cloud Library (PCL)  1.14.1-dev
List of all members | Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
pcl::registration::CorrespondenceRejectorMedianDistance Class Reference

CorrespondenceRejectorMedianDistance implements a simple correspondence rejection method based on thresholding based on the median distance between the correspondences. More...

#include <pcl/registration/correspondence_rejection_median_distance.h>

+ Inheritance diagram for pcl::registration::CorrespondenceRejectorMedianDistance:
+ Collaboration diagram for pcl::registration::CorrespondenceRejectorMedianDistance:

Public Types

using Ptr = shared_ptr< CorrespondenceRejectorMedianDistance >
 
using ConstPtr = shared_ptr< const CorrespondenceRejectorMedianDistance >
 
- Public Types inherited from pcl::registration::CorrespondenceRejector
using Ptr = shared_ptr< CorrespondenceRejector >
 
using ConstPtr = shared_ptr< const CorrespondenceRejector >
 

Public Member Functions

 CorrespondenceRejectorMedianDistance ()
 Empty constructor. More...
 
void getRemainingCorrespondences (const pcl::Correspondences &original_correspondences, pcl::Correspondences &remaining_correspondences) override
 Get a list of valid correspondences after rejection from the original set of correspondences. More...
 
double getMedianDistance () const
 Get the median distance used for thresholding in correspondence rejection. More...
 
template<typename PointT >
void setInputSource (const typename pcl::PointCloud< PointT >::ConstPtr &cloud)
 Provide a source point cloud dataset (must contain XYZ data!), used to compute the correspondence distance. More...
 
template<typename PointT >
void setInputTarget (const typename pcl::PointCloud< PointT >::ConstPtr &target)
 Provide a target point cloud dataset (must contain XYZ data!), used to compute the correspondence distance. More...
 
bool requiresSourcePoints () const override
 See if this rejector requires source points. More...
 
void setSourcePoints (pcl::PCLPointCloud2::ConstPtr cloud2) override
 Blob method for setting the source cloud. More...
 
bool requiresTargetPoints () const override
 See if this rejector requires a target cloud. More...
 
void setTargetPoints (pcl::PCLPointCloud2::ConstPtr cloud2) override
 Method for setting the target cloud. More...
 
template<typename PointT >
void setSearchMethodTarget (const typename pcl::search::KdTree< PointT >::Ptr &tree, bool force_no_recompute=false)
 Provide a pointer to the search object used to find correspondences in the target cloud. More...
 
void setMedianFactor (double factor)
 Set the factor for correspondence rejection. More...
 
double getMedianFactor () const
 Get the factor used for thresholding in correspondence rejection. More...
 
- Public Member Functions inherited from pcl::registration::CorrespondenceRejector
 CorrespondenceRejector ()=default
 Empty constructor. More...
 
virtual ~CorrespondenceRejector ()=default
 Empty destructor. More...
 
virtual void setInputCorrespondences (const CorrespondencesConstPtr &correspondences)
 Provide a pointer to the vector of the input correspondences. More...
 
CorrespondencesConstPtr getInputCorrespondences ()
 Get a pointer to the vector of the input correspondences. More...
 
void getCorrespondences (pcl::Correspondences &correspondences)
 Run correspondence rejection. More...
 
void getRejectedQueryIndices (const pcl::Correspondences &correspondences, pcl::Indices &indices)
 Determine the indices of query points of correspondences that have been rejected, i.e., the difference between the input correspondences (set via setInputCorrespondences) and the given correspondence vector. More...
 
const std::string & getClassName () const
 Get a string representation of the name of this class. More...
 
virtual bool requiresSourceNormals () const
 See if this rejector requires source normals. More...
 
virtual void setSourceNormals (pcl::PCLPointCloud2::ConstPtr)
 Abstract method for setting the source normals. More...
 
virtual bool requiresTargetNormals () const
 See if this rejector requires target normals. More...
 
virtual void setTargetNormals (pcl::PCLPointCloud2::ConstPtr)
 Abstract method for setting the target normals. More...
 

Protected Types

using DataContainerPtr = DataContainerInterface::Ptr
 

Protected Member Functions

void applyRejection (pcl::Correspondences &correspondences) override
 Apply the rejection algorithm. More...
 

Protected Attributes

double median_distance_ {0.0}
 The median distance threshold between two correspondent points in source <-> target. More...
 
double factor_ {1.0}
 The factor for correspondence rejection. More...
 
DataContainerPtr data_container_
 A pointer to the DataContainer object containing the input and target point clouds. More...
 
- Protected Attributes inherited from pcl::registration::CorrespondenceRejector
std::string rejection_name_ {}
 The name of the rejection method. More...
 
CorrespondencesConstPtr input_correspondences_
 The input correspondences. More...
 

Detailed Description

CorrespondenceRejectorMedianDistance implements a simple correspondence rejection method based on thresholding based on the median distance between the correspondences.

Note
If setInputCloud and setInputTarget are given, then the distances between correspondences will be estimated using the given XYZ data, and not read from the set of input correspondences.
Author
Aravindhan K Krishnan. This code is ported from libpointmatcher (https://github.com/ethz-asl/libpointmatcher)

Definition at line 61 of file correspondence_rejection_median_distance.h.

Member Typedef Documentation

◆ ConstPtr

Definition at line 68 of file correspondence_rejection_median_distance.h.

◆ DataContainerPtr

Definition at line 203 of file correspondence_rejection_median_distance.h.

◆ Ptr

Definition at line 67 of file correspondence_rejection_median_distance.h.

Constructor & Destructor Documentation

◆ CorrespondenceRejectorMedianDistance()

pcl::registration::CorrespondenceRejectorMedianDistance::CorrespondenceRejectorMedianDistance ( )
inline

Empty constructor.

Definition at line 71 of file correspondence_rejection_median_distance.h.

Member Function Documentation

◆ applyRejection()

void pcl::registration::CorrespondenceRejectorMedianDistance::applyRejection ( pcl::Correspondences correspondences)
inlineoverrideprotectedvirtual

Apply the rejection algorithm.

Parameters
[out]correspondencesthe set of resultant correspondences.

Implements pcl::registration::CorrespondenceRejector.

Definition at line 188 of file correspondence_rejection_median_distance.h.

◆ getMedianDistance()

double pcl::registration::CorrespondenceRejectorMedianDistance::getMedianDistance ( ) const
inline

Get the median distance used for thresholding in correspondence rejection.

Definition at line 88 of file correspondence_rejection_median_distance.h.

◆ getMedianFactor()

double pcl::registration::CorrespondenceRejectorMedianDistance::getMedianFactor ( ) const
inline

Get the factor used for thresholding in correspondence rejection.

Definition at line 178 of file correspondence_rejection_median_distance.h.

◆ getRemainingCorrespondences()

void pcl::registration::CorrespondenceRejectorMedianDistance::getRemainingCorrespondences ( const pcl::Correspondences original_correspondences,
pcl::Correspondences remaining_correspondences 
)
overridevirtual

Get a list of valid correspondences after rejection from the original set of correspondences.

Parameters
[in]original_correspondencesthe set of initial correspondences given
[out]remaining_correspondencesthe resultant filtered set of remaining correspondences

Implements pcl::registration::CorrespondenceRejector.

◆ requiresSourcePoints()

bool pcl::registration::CorrespondenceRejectorMedianDistance::requiresSourcePoints ( ) const
inlineoverridevirtual

See if this rejector requires source points.

Reimplemented from pcl::registration::CorrespondenceRejector.

Definition at line 121 of file correspondence_rejection_median_distance.h.

◆ requiresTargetPoints()

bool pcl::registration::CorrespondenceRejectorMedianDistance::requiresTargetPoints ( ) const
inlineoverridevirtual

See if this rejector requires a target cloud.

Reimplemented from pcl::registration::CorrespondenceRejector.

Definition at line 137 of file correspondence_rejection_median_distance.h.

◆ setInputSource()

template<typename PointT >
void pcl::registration::CorrespondenceRejectorMedianDistance::setInputSource ( const typename pcl::PointCloud< PointT >::ConstPtr cloud)
inline

Provide a source point cloud dataset (must contain XYZ data!), used to compute the correspondence distance.

Parameters
[in]clouda cloud containing XYZ data

Definition at line 99 of file correspondence_rejection_median_distance.h.

◆ setInputTarget()

template<typename PointT >
void pcl::registration::CorrespondenceRejectorMedianDistance::setInputTarget ( const typename pcl::PointCloud< PointT >::ConstPtr target)
inline

Provide a target point cloud dataset (must contain XYZ data!), used to compute the correspondence distance.

Parameters
[in]targeta cloud containing XYZ data

Definition at line 112 of file correspondence_rejection_median_distance.h.

◆ setMedianFactor()

void pcl::registration::CorrespondenceRejectorMedianDistance::setMedianFactor ( double  factor)
inline

Set the factor for correspondence rejection.

Points with distance greater than median times factor will be rejected

Parameters
[in]factorvalue

Definition at line 171 of file correspondence_rejection_median_distance.h.

◆ setSearchMethodTarget()

template<typename PointT >
void pcl::registration::CorrespondenceRejectorMedianDistance::setSearchMethodTarget ( const typename pcl::search::KdTree< PointT >::Ptr tree,
bool  force_no_recompute = false 
)
inline

Provide a pointer to the search object used to find correspondences in the target cloud.

Parameters
[in]treea pointer to the spatial search object.
[in]force_no_recomputeIf set to true, this tree will NEVER be recomputed, regardless of calls to setInputTarget. Only use if you are confident that the tree will be set correctly.

Definition at line 160 of file correspondence_rejection_median_distance.h.

◆ setSourcePoints()

void pcl::registration::CorrespondenceRejectorMedianDistance::setSourcePoints ( pcl::PCLPointCloud2::ConstPtr  cloud2)
inlineoverridevirtual

Blob method for setting the source cloud.

Reimplemented from pcl::registration::CorrespondenceRejector.

Definition at line 128 of file correspondence_rejection_median_distance.h.

References pcl::fromPCLPointCloud2().

◆ setTargetPoints()

void pcl::registration::CorrespondenceRejectorMedianDistance::setTargetPoints ( pcl::PCLPointCloud2::ConstPtr  cloud2)
inlineoverridevirtual

Method for setting the target cloud.

Reimplemented from pcl::registration::CorrespondenceRejector.

Definition at line 144 of file correspondence_rejection_median_distance.h.

References pcl::fromPCLPointCloud2().

Member Data Documentation

◆ data_container_

DataContainerPtr pcl::registration::CorrespondenceRejectorMedianDistance::data_container_
protected

A pointer to the DataContainer object containing the input and target point clouds.

Definition at line 207 of file correspondence_rejection_median_distance.h.

◆ factor_

double pcl::registration::CorrespondenceRejectorMedianDistance::factor_ {1.0}
protected

The factor for correspondence rejection.

Points with distance greater than median times factor will be rejected

Definition at line 201 of file correspondence_rejection_median_distance.h.

◆ median_distance_

double pcl::registration::CorrespondenceRejectorMedianDistance::median_distance_ {0.0}
protected

The median distance threshold between two correspondent points in source <-> target.

Definition at line 196 of file correspondence_rejection_median_distance.h.


The documentation for this class was generated from the following file: