pcl::registration::CorrespondenceRejectorPoly< SourceT, TargetT > Class Template Reference
Module registration

CorrespondenceRejectorPoly implements a correspondence rejection method that exploits low-level and pose-invariant geometric constraints between two point sets by forming virtual polygons of a user-specifiable cardinality on each model using the input correspondences. More...

`#include <pcl/registration/correspondence_rejection_poly.h>`

Inheritance diagram for pcl::registration::CorrespondenceRejectorPoly< SourceT, TargetT >:

## Public Types

using | Ptr = shared_ptr< CorrespondenceRejectorPoly< SourceT, TargetT > >
using | ConstPtr = shared_ptr< const CorrespondenceRejectorPoly< SourceT, TargetT > >
using | PointCloudSource = pcl::PointCloud< SourceT >
using | PointCloudSourcePtr = typename PointCloudSource::Ptr
using | PointCloudSourceConstPtr = typename PointCloudSource::ConstPtr
using | PointCloudTarget = pcl::PointCloud< TargetT >
using | PointCloudTargetPtr = typename PointCloudTarget::Ptr
using | PointCloudTargetConstPtr = typename PointCloudTarget::ConstPtr
Public Types inherited from pcl::registration::CorrespondenceRejector
using | Ptr = shared_ptr< CorrespondenceRejector >
using | ConstPtr = shared_ptr< const CorrespondenceRejector >

## Public Member Functions

| CorrespondenceRejectorPoly ()
| 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...
void | setInputSource (const PointCloudSourceConstPtr &cloud)
| Provide a source point cloud dataset (must contain XYZ data!), used to compute the correspondence distance. More...
void | setInputCloud (const PointCloudSourceConstPtr &cloud)
| Provide a source point cloud dataset (must contain XYZ data!), used to compute the correspondence distance. More...
void | setInputTarget (const PointCloudTargetConstPtr &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...
void | setCardinality (int cardinality)
| Set the polygon cardinality. More...
int | getCardinality ()
| Get the polygon cardinality. More...
void | setSimilarityThreshold (float similarity_threshold)
| Set the similarity threshold in [0,1[ between edge lengths, where 1 is a perfect match. More...
float | getSimilarityThreshold ()
| Get the similarity threshold between edge lengths. More...
void | setIterations (int iterations)
| Set the number of iterations. More...
int | getIterations ()
| Get the number of iterations. More...
bool | thresholdPolygon (const pcl::Correspondences &corr, const std::vector< int > &idx)
| Polygonal rejection of a single polygon, indexed by a subset of correspondences. More...
bool | thresholdPolygon (const std::vector< int > &source_indices, const std::vector< int > &target_indices)
| Polygonal rejection of a single polygon, indexed by two point index vectors. More...
Public Member Functions inherited from pcl::registration::CorrespondenceRejector
| CorrespondenceRejector ()
| Empty constructor. More...
virtual | ~CorrespondenceRejector ()
| 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, std::vector< int > &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 Member Functions

void | applyRejection (pcl::Correspondences &correspondences) override
| Apply the rejection algorithm. More...
std::vector< int > | getUniqueRandomIndices (int n, int k)
| Get k unique random indices in range {0,...,n-1} (sampling without replacement) More...
float | computeSquaredDistance (const SourceT &p1, const TargetT &p2)
| Squared Euclidean distance between two points using the members x, y and z. More...
bool | thresholdEdgeLength (int index_query_1, int index_query_2, int index_match_1, int index_match_2, float simsq)
| Edge length similarity thresholding. More...
std::vector< int > | computeHistogram (const std::vector< float > &data, float lower, float upper, int bins)
| Compute a linear histogram. More...
int | findThresholdOtsu (const std::vector< int > &histogram)
| Find the optimal value for binary histogram thresholding using Otsu's method. More...

## Protected Attributes

PointCloudSourceConstPtr | input_
| The input point cloud dataset. More...
PointCloudTargetConstPtr | target_
| The input point cloud dataset target. More...
int | iterations_
| Number of iterations to run. More...
int | cardinality_
| The polygon cardinality used during rejection. More...
float | similarity_threshold_
| Lower edge length threshold in [0,1] used for verifying polygon similarities, where 1 is a perfect match. More...
float | similarity_threshold_squared_
| Squared value if similarity_threshold_, only for internal use. 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

### template<typename SourceT, typename TargetT>
class pcl::registration::CorrespondenceRejectorPoly< SourceT, TargetT >

CorrespondenceRejectorPoly implements a correspondence rejection method that exploits low-level and pose-invariant geometric constraints between two point sets by forming virtual polygons of a user-specifiable cardinality on each model using the input correspondences.

These polygons are then checked in a pose-invariant manner (i.e. the side lengths must be approximately equal), and rejection is performed by thresholding these edge lengths.

If you use this in academic work, please cite:

A. G. Buch, D. Kraft, J.-K. Kämäräinen, H. G. Petersen and N. Krüger. Pose Estimation using Local Structure-Specific Shape and Appearance Context. International Conference on Robotics and Automation (ICRA), 2013.

Author
  Anders Glent Buch

Definition at line 64 of file correspondence_rejection_poly.h.

## Member Typedef Documentation

## ConstPtr

template<typename SourceT , typename TargetT >

using pcl::registration::CorrespondenceRejectorPoly< SourceT, TargetT >::ConstPtr = shared_ptr<const CorrespondenceRejectorPoly<SourceT, TargetT> >

Definition at line 72 of file correspondence_rejection_poly.h.

## PointCloudSource

template<typename SourceT , typename TargetT >

using pcl::registration::CorrespondenceRejectorPoly< SourceT, TargetT >::PointCloudSource = pcl::PointCloud<SourceT>

Definition at line 74 of file correspondence_rejection_poly.h.

## PointCloudSourceConstPtr

template<typename SourceT , typename TargetT >

using pcl::registration::CorrespondenceRejectorPoly< SourceT, TargetT >::PointCloudSourceConstPtr = typename PointCloudSource::ConstPtr

Definition at line 76 of file correspondence_rejection_poly.h.

## PointCloudSourcePtr

template<typename SourceT , typename TargetT >

using pcl::registration::CorrespondenceRejectorPoly< SourceT, TargetT >::PointCloudSourcePtr = typename PointCloudSource::Ptr

Definition at line 75 of file correspondence_rejection_poly.h.

## PointCloudTarget

template<typename SourceT , typename TargetT >

using pcl::registration::CorrespondenceRejectorPoly< SourceT, TargetT >::PointCloudTarget = pcl::PointCloud<TargetT>

Definition at line 78 of file correspondence_rejection_poly.h.

## PointCloudTargetConstPtr

template<typename SourceT , typename TargetT >

using pcl::registration::CorrespondenceRejectorPoly< SourceT, TargetT >::PointCloudTargetConstPtr = typename PointCloudTarget::ConstPtr

Definition at line 80 of file correspondence_rejection_poly.h.

## PointCloudTargetPtr

template<typename SourceT , typename TargetT >

using pcl::registration::CorrespondenceRejectorPoly< SourceT, TargetT >::PointCloudTargetPtr = typename PointCloudTarget::Ptr

Definition at line 79 of file correspondence_rejection_poly.h.

## Ptr

template<typename SourceT , typename TargetT >

using pcl::registration::CorrespondenceRejectorPoly< SourceT, TargetT >::Ptr = shared_ptr<CorrespondenceRejectorPoly<SourceT, TargetT> >

Definition at line 71 of file correspondence_rejection_poly.h.

## Constructor & Destructor Documentation

## CorrespondenceRejectorPoly()

template<typename SourceT , typename TargetT >

pcl::registration::CorrespondenceRejectorPoly< SourceT, TargetT >::CorrespondenceRejectorPoly | ( |  | ) |

inline

Empty constructor.

Definition at line 83 of file correspondence_rejection_poly.h.

## Member Function Documentation

## applyRejection()

template<typename SourceT , typename TargetT >

void pcl::registration::CorrespondenceRejectorPoly< SourceT, TargetT >::applyRejection | ( | pcl::Correspondences & | correspondences | ) |

inline override protected virtual

Apply the rejection algorithm.

Parameters

  [out] | correspondences | the set of resultant correspondences.

Implements pcl::registration::CorrespondenceRejector.

Definition at line 266 of file correspondence_rejection_poly.h.

## computeHistogram()

template<typename SourceT , typename TargetT >

std::vector< int > pcl::registration::CorrespondenceRejectorPoly< SourceT, TargetT >::computeHistogram | ( | const std::vector< float > & | data,
|  | float | lower,
|  | float | upper,
|  | int | bins
| ) |  |

protected

Compute a linear histogram.

This function is equivalent to the MATLAB function histc, with the edges set as follows: lower:(upper-lower)/bins:upper

Parameters

  data | input samples
  lower | lower bound of input samples
  upper | upper bound of input samples
  bins | number of bins in output

Returns
  linear histogram

Definition at line 154 of file correspondence_rejection_poly.hpp.

## computeSquaredDistance()

template<typename SourceT , typename TargetT >

float pcl::registration::CorrespondenceRejectorPoly< SourceT, TargetT >::computeSquaredDistance | ( | const SourceT & | p1,
|  | const TargetT & | p2
| ) |  |

inline protected

Squared Euclidean distance between two points using the members x, y and z.

Parameters

  p1 | first point
  p2 | second point

Returns
  squared Euclidean distance

Definition at line 311 of file correspondence_rejection_poly.h.

## findThresholdOtsu()

template<typename SourceT , typename TargetT >

int pcl::registration::CorrespondenceRejectorPoly< SourceT, TargetT >::findThresholdOtsu | ( | const std::vector< int > & | histogram | ) |

protected

Find the optimal value for binary histogram thresholding using Otsu's method.

Parameters

  histogram | input histogram

Returns
  threshold value according to Otsu's criterion

Definition at line 173 of file correspondence_rejection_poly.hpp.

## getCardinality()

template<typename SourceT , typename TargetT >

int pcl::registration::CorrespondenceRejectorPoly< SourceT, TargetT >::getCardinality | ( |  | ) |

inline

Get the polygon cardinality.

Returns
  polygon cardinality

Definition at line 170 of file correspondence_rejection_poly.h.

## getIterations()

template<typename SourceT , typename TargetT >

int pcl::registration::CorrespondenceRejectorPoly< SourceT, TargetT >::getIterations | ( |  | ) |

inline

Get the number of iterations.

Returns
  number of iterations

Definition at line 208 of file correspondence_rejection_poly.h.

## getRemainingCorrespondences()

template<typename SourceT , typename TargetT >

void pcl::registration::CorrespondenceRejectorPoly< SourceT, TargetT >::getRemainingCorrespondences | ( | const pcl::Correspondences & | original_correspondences,
|  | pcl::Correspondences & | remaining_correspondences
| ) |  |

override virtual

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

Parameters

  [in] | original_correspondences | the set of initial correspondences given
  [out] | remaining_correspondences | the resultant filtered set of remaining correspondences

Implements pcl::registration::CorrespondenceRejector.

Definition at line 43 of file correspondence_rejection_poly.hpp.

## getSimilarityThreshold()

template<typename SourceT , typename TargetT >

float pcl::registration::CorrespondenceRejectorPoly< SourceT, TargetT >::getSimilarityThreshold | ( |  | ) |

inline

Get the similarity threshold between edge lengths.

Returns
  similarity threshold

Definition at line 190 of file correspondence_rejection_poly.h.

## getUniqueRandomIndices()

template<typename SourceT , typename TargetT >

std::vector<int> pcl::registration::CorrespondenceRejectorPoly< SourceT, TargetT >::getUniqueRandomIndices | ( | int | n,
|  | int | k
| ) |  |

inline protected

Get k unique random indices in range {0,...,n-1} (sampling without replacement)

Note
  No check is made to ensure that k <= n.

Parameters

  n | upper index range, exclusive
  k | number of unique indices to sample

Returns
  k unique random indices in range {0,...,n-1}

Definition at line 278 of file correspondence_rejection_poly.h.

## requiresSourcePoints()

template<typename SourceT , typename TargetT >

bool pcl::registration::CorrespondenceRejectorPoly< SourceT, TargetT >::requiresSourcePoints | ( |  | ) | const

inline override virtual

See if this rejector requires source points.

Reimplemented from pcl::registration::CorrespondenceRejector.

Definition at line 131 of file correspondence_rejection_poly.h.

## requiresTargetPoints()

template<typename SourceT , typename TargetT >

bool pcl::registration::CorrespondenceRejectorPoly< SourceT, TargetT >::requiresTargetPoints | ( |  | ) | const

inline override virtual

See if this rejector requires a target cloud.

Reimplemented from pcl::registration::CorrespondenceRejector.

Definition at line 145 of file correspondence_rejection_poly.h.

## setCardinality()

template<typename SourceT , typename TargetT >

void pcl::registration::CorrespondenceRejectorPoly< SourceT, TargetT >::setCardinality | ( | int | cardinality | ) |

inline

Set the polygon cardinality.

Parameters

  cardinality | polygon cardinality

Definition at line 161 of file correspondence_rejection_poly.h.

## setInputCloud()

template<typename SourceT , typename TargetT >

void pcl::registration::CorrespondenceRejectorPoly< SourceT, TargetT >::setInputCloud | ( | const PointCloudSourceConstPtr & | cloud | ) |

inline

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

Parameters

  [in] | cloud | a cloud containing XYZ data

Definition at line 113 of file correspondence_rejection_poly.h.

## setInputSource()

template<typename SourceT , typename TargetT >

void pcl::registration::CorrespondenceRejectorPoly< SourceT, TargetT >::setInputSource | ( | const PointCloudSourceConstPtr & | cloud | ) |

inline

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

Parameters

  [in] | cloud | a cloud containing XYZ data

Definition at line 104 of file correspondence_rejection_poly.h.

## setInputTarget()

template<typename SourceT , typename TargetT >

void pcl::registration::CorrespondenceRejectorPoly< SourceT, TargetT >::setInputTarget | ( | const PointCloudTargetConstPtr & | target | ) |

inline

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

Parameters

  [in] | target | a cloud containing XYZ data

Definition at line 124 of file correspondence_rejection_poly.h.

## setIterations()

template<typename SourceT , typename TargetT >

void pcl::registration::CorrespondenceRejectorPoly< SourceT, TargetT >::setIterations | ( | int | iterations | ) |

inline

Set the number of iterations.

Parameters

  iterations | number of iterations

Definition at line 199 of file correspondence_rejection_poly.h.

## setSimilarityThreshold()

template<typename SourceT , typename TargetT >

void pcl::registration::CorrespondenceRejectorPoly< SourceT, TargetT >::setSimilarityThreshold | ( | float | similarity_threshold | ) |

inline

Set the similarity threshold in [0,1[ between edge lengths, where 1 is a perfect match.

Parameters

  similarity_threshold | similarity threshold

Definition at line 180 of file correspondence_rejection_poly.h.

## setSourcePoints()

template<typename SourceT , typename TargetT >

void pcl::registration::CorrespondenceRejectorPoly< SourceT, TargetT >::setSourcePoints | ( | pcl::PCLPointCloud2::ConstPtr | cloud2 | ) |

inline override virtual

Blob method for setting the source cloud.

Reimplemented from pcl::registration::CorrespondenceRejector.

Definition at line 136 of file correspondence_rejection_poly.h.

References pcl::fromPCLPointCloud2().

## setTargetPoints()

template<typename SourceT , typename TargetT >

void pcl::registration::CorrespondenceRejectorPoly< SourceT, TargetT >::setTargetPoints | ( | pcl::PCLPointCloud2::ConstPtr | cloud2 | ) |

inline override virtual

Method for setting the target cloud.

Reimplemented from pcl::registration::CorrespondenceRejector.

Definition at line 150 of file correspondence_rejection_poly.h.

References pcl::fromPCLPointCloud2().

## thresholdEdgeLength()

template<typename SourceT , typename TargetT >

bool pcl::registration::CorrespondenceRejectorPoly< SourceT, TargetT >::thresholdEdgeLength | ( | int | index_query_1,
|  | int | index_query_2,
|  | int | index_match_1,
|  | int | index_match_2,
|  | float | simsq
| ) |  |

inline protected

Edge length similarity thresholding.

Parameters

  index_query_1 | index of first source vertex
  index_query_2 | index of second source vertex
  index_match_1 | index of first target vertex
  index_match_2 | index of second target vertex
  simsq | squared similarity threshold in [0,1]

Returns
  true if edge length ratio is larger than or equal to threshold

Definition at line 329 of file correspondence_rejection_poly.h.

## thresholdPolygon() [1/2]

template<typename SourceT , typename TargetT >

bool pcl::registration::CorrespondenceRejectorPoly< SourceT, TargetT >::thresholdPolygon | ( | const pcl::Correspondences & | corr,
|  | const std::vector< int > & | idx
| ) |  |

inline

Polygonal rejection of a single polygon, indexed by a subset of correspondences.

Parameters

  corr | all correspondences into input_ and target_
  idx | sampled indices into correspondences, must have a size equal to cardinality_

Returns
  true if all edge length ratios are larger than or equal to similarity_threshold_

Definition at line 219 of file correspondence_rejection_poly.h.

## thresholdPolygon() [2/2]

template<typename SourceT , typename TargetT >

bool pcl::registration::CorrespondenceRejectorPoly< SourceT, TargetT >::thresholdPolygon | ( | const std::vector< int > & | source_indices,
|  | const std::vector< int > & | target_indices
| ) |  |

inline

Polygonal rejection of a single polygon, indexed by two point index vectors.

Parameters

  source_indices | indices of polygon points in input_, must have a size equal to cardinality_
  target_indices | corresponding indices of polygon points in target_, must have a size equal to cardinality_

Returns
  true if all edge length ratios are larger than or equal to similarity_threshold_

Definition at line 246 of file correspondence_rejection_poly.h.

## Member Data Documentation

## cardinality_

template<typename SourceT , typename TargetT >

int pcl::registration::CorrespondenceRejectorPoly< SourceT, TargetT >::cardinality_

protected

The polygon cardinality used during rejection.

Definition at line 373 of file correspondence_rejection_poly.h.

## input_

template<typename SourceT , typename TargetT >

PointCloudSourceConstPtr pcl::registration::CorrespondenceRejectorPoly< SourceT, TargetT >::input_

protected

The input point cloud dataset.

Definition at line 364 of file correspondence_rejection_poly.h.

## iterations_

template<typename SourceT , typename TargetT >

int pcl::registration::CorrespondenceRejectorPoly< SourceT, TargetT >::iterations_

protected

Number of iterations to run.

Definition at line 370 of file correspondence_rejection_poly.h.

## similarity_threshold_

template<typename SourceT , typename TargetT >

float pcl::registration::CorrespondenceRejectorPoly< SourceT, TargetT >::similarity_threshold_

protected

Lower edge length threshold in [0,1] used for verifying polygon similarities, where 1 is a perfect match.

Definition at line 376 of file correspondence_rejection_poly.h.

## similarity_threshold_squared_

template<typename SourceT , typename TargetT >

float pcl::registration::CorrespondenceRejectorPoly< SourceT, TargetT >::similarity_threshold_squared_

protected

Squared value if similarity_threshold_, only for internal use.

Definition at line 379 of file correspondence_rejection_poly.h.

## target_

template<typename SourceT , typename TargetT >

PointCloudTargetConstPtr pcl::registration::CorrespondenceRejectorPoly< SourceT, TargetT >::target_

protected

The input point cloud dataset target.

Definition at line 367 of file correspondence_rejection_poly.h.

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

- pcl/registration/correspondence_rejection_poly.h
- pcl/registration/impl/correspondence_rejection_poly.hpp