pcl::registration::CorrespondenceRejectorSampleConsensus< PointT > Class Template Reference
Module registration

CorrespondenceRejectorSampleConsensus implements a correspondence rejection using Random Sample Consensus to identify inliers (and reject outliers) More...

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

Inheritance diagram for pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >:

## Public Types

typedef boost::shared_ptr< CorrespondenceRejectorSampleConsensus > | Ptr
typedef boost::shared_ptr< const CorrespondenceRejectorSampleConsensus > | ConstPtr
Public Types inherited from pcl::registration::CorrespondenceRejector
typedef boost::shared_ptr< CorrespondenceRejector > | Ptr
typedef boost::shared_ptr< const CorrespondenceRejector > | ConstPtr

## Public Member Functions

| CorrespondenceRejectorSampleConsensus ()
| Empty constructor. More...
virtual | ~CorrespondenceRejectorSampleConsensus ()
| Empty destructor. More...
void | getRemainingCorrespondences (const pcl::Correspondences &original_correspondences, pcl::Correspondences &remaining_correspondences)
| Get a list of valid correspondences after rejection from the original set of correspondences. More...
virtual void | setInputCloud (const PointCloudConstPtr &cloud)
| Provide a source point cloud dataset (must contain XYZ data!) More...
PointCloudConstPtr const | getInputCloud ()
| Get a pointer to the input point cloud dataset target. More...
virtual void | setInputSource (const PointCloudConstPtr &cloud)
| Provide a source point cloud dataset (must contain XYZ data!) More...
PointCloudConstPtr const | getInputSource ()
| Get a pointer to the input point cloud dataset target. More...
virtual void | setTargetCloud (const PointCloudConstPtr &cloud)
| Provide a target point cloud dataset (must contain XYZ data!) More...
virtual void | setInputTarget (const PointCloudConstPtr &cloud)
| Provide a target point cloud dataset (must contain XYZ data!) More...
PointCloudConstPtr const | getInputTarget ()
| Get a pointer to the input point cloud dataset target. More...
bool | requiresSourcePoints () const
| See if this rejector requires source points. More...
void | setSourcePoints (pcl::PCLPointCloud2::ConstPtr cloud2)
| Blob method for setting the source cloud. More...
bool | requiresTargetPoints () const
| See if this rejector requires a target cloud. More...
void | setTargetPoints (pcl::PCLPointCloud2::ConstPtr cloud2)
| Method for setting the target cloud. More...
void | setInlierThreshold (double threshold)
| Set the maximum distance between corresponding points. More...
double | getInlierThreshold ()
| Get the maximum distance between corresponding points. More...
void | setMaxIterations (int max_iterations)
| Set the maximum number of iterations. More...
void | setMaximumIterations (int max_iterations)
| Set the maximum number of iterations. More...
int | getMaxIterations ()
| Get the maximum number of iterations. More...
int | getMaximumIterations ()
| Get the maximum number of iterations. More...
Eigen::Matrix4f | getBestTransformation ()
| Get the best transformation after RANSAC rejection. More...
void | setRefineModel (const bool refine)
| Specify whether the model should be refined internally using the variance of the inliers. More...
bool | getRefineModel () const
| Get the internal refine parameter value as set by the user using setRefineModel. More...
void | getInliersIndices (std::vector< int > &inlier_indices)
| Get the inlier indices found by the correspondence rejector. More...
void | setSaveInliers (bool s)
| Set whether to save inliers or not. More...
bool | getSaveInliers ()
| Get whether the rejector is configured to save inliers. 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)
| Apply the rejection algorithm. More...

## Protected Attributes

double | inlier_threshold_
int | max_iterations_
PointCloudConstPtr | input_
PointCloudPtr | input_transformed_
PointCloudConstPtr | target_
Eigen::Matrix4f | best_transformation_
bool | refine_
std::vector< int > | inlier_indices_
bool | save_inliers_
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 PointT>
class pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >

CorrespondenceRejectorSampleConsensus implements a correspondence rejection using Random Sample Consensus to identify inliers (and reject outliers)

Author
  Dirk Holz

Definition at line 59 of file correspondence_rejection_sample_consensus.h.

## Member Typedef Documentation

template<typename PointT>

typedef boost::shared_ptr<const CorrespondenceRejectorSampleConsensus> pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::ConstPtr

Definition at line 71 of file correspondence_rejection_sample_consensus.h.

template<typename PointT>

typedef boost::shared_ptr<CorrespondenceRejectorSampleConsensus> pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::Ptr

Definition at line 70 of file correspondence_rejection_sample_consensus.h.

## Constructor & Destructor Documentation

template<typename PointT>

pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::CorrespondenceRejectorSampleConsensus | ( |  | ) |

inline

Empty constructor.

Sets the inlier threshold to 5cm (0.05m), and the maximum number of iterations to 1000.

Definition at line 76 of file correspondence_rejection_sample_consensus.h.

References pcl::registration::CorrespondenceRejector::rejection_name_.

template<typename PointT>

virtual pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::~CorrespondenceRejectorSampleConsensus | ( |  | ) |

inline virtual

Empty destructor.

Definition at line 90 of file correspondence_rejection_sample_consensus.h.

References pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::getInputCloud(), pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::getRemainingCorrespondences(), and pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::setInputCloud().

## Member Function Documentation

template<typename PointT>

void pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::applyRejection | ( | pcl::Correspondences & | correspondences | ) |

inline protected virtual

Apply the rejection algorithm.

Parameters

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

Implements pcl::registration::CorrespondenceRejector.

Reimplemented in pcl::registration::CorrespondenceRejectorSampleConsensus2D< PointT >.

Definition at line 255 of file correspondence_rejection_sample_consensus.h.

References pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::getRemainingCorrespondences(), and pcl::registration::CorrespondenceRejector::input_correspondences_.

template<typename PointT>

Eigen::Matrix4f pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::getBestTransformation | ( |  | ) |

inline

Get the best transformation after RANSAC rejection.

Returns
  The homogeneous 4x4 transformation yielding the largest number of inliers.

Definition at line 214 of file correspondence_rejection_sample_consensus.h.

References pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::best_transformation_.

template<typename PointT>

void pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::getInliersIndices | ( | std::vector< int > & | inlier_indices | ) |

inline

Get the inlier indices found by the correspondence rejector.

This information is only saved if setSaveInliers(true) was called in advance.

Parameters

  [out] | inlier_indices | Indices for the inliers

Definition at line 236 of file correspondence_rejection_sample_consensus.h.

References pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::inlier_indices_.

template<typename PointT>

double pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::getInlierThreshold | ( |  | ) |

inline

Get the maximum distance between corresponding points.

Returns
  Distance threshold in the same dimension as source and target data sets.

Definition at line 182 of file correspondence_rejection_sample_consensus.h.

References pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::inlier_threshold_, and pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::setMaxIterations().

template<typename PointT >

pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::PointCloudConstPtr const pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::getInputCloud | ( |  | ) |

Get a pointer to the input point cloud dataset target.

Definition at line 55 of file correspondence_rejection_sample_consensus.hpp.

Referenced by pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::~CorrespondenceRejectorSampleConsensus().

template<typename PointT>

PointCloudConstPtr const pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::getInputSource | ( |  | ) |

inline

Get a pointer to the input point cloud dataset target.

Definition at line 123 of file correspondence_rejection_sample_consensus.h.

References pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::input_, and pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::setTargetCloud().

template<typename PointT>

PointCloudConstPtr const pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::getInputTarget | ( |  | ) |

inline

Get a pointer to the input point cloud dataset target.

Definition at line 140 of file correspondence_rejection_sample_consensus.h.

References pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::target_.

template<typename PointT>

int pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::getMaximumIterations | ( |  | ) |

inline

Get the maximum number of iterations.

Returns
  max_iterations Maximum number if iterations to run

Definition at line 208 of file correspondence_rejection_sample_consensus.h.

References pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::max_iterations_.

template<typename PointT >

int pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::getMaxIterations | ( |  | ) |

Get the maximum number of iterations.

Returns
  max_iterations Maximum number if iterations to run

Definition at line 78 of file correspondence_rejection_sample_consensus.hpp.

Referenced by pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::setMaximumIterations().

template<typename PointT>

bool pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::getRefineModel | ( |  | ) | const

inline

Get the internal refine parameter value as set by the user using setRefineModel.

Definition at line 227 of file correspondence_rejection_sample_consensus.h.

References pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::refine_.

template<typename PointT >

void pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::getRemainingCorrespondences | ( | const pcl::Correspondences & | original_correspondences,
|  | pcl::Correspondences & | remaining_correspondences
| ) |  |

inline 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.

Reimplemented in pcl::registration::CorrespondenceRejectorSampleConsensus2D< PointT >.

Definition at line 85 of file correspondence_rejection_sample_consensus.hpp.

References pcl::RandomSampleConsensus< PointT >::computeModel(), pcl::SampleConsensus< PointT >::getInliers(), pcl::SampleConsensus< PointT >::getModelCoefficients(), pcl::SampleConsensus< PointT >::refineModel(), and pcl::SampleConsensus< PointT >::setMaxIterations().

Referenced by pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::applyRejection(), and pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::~CorrespondenceRejectorSampleConsensus().

template<typename PointT>

bool pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::getSaveInliers | ( |  | ) |

inline

Get whether the rejector is configured to save inliers.

Definition at line 246 of file correspondence_rejection_sample_consensus.h.

References pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::save_inliers_.

template<typename PointT>

bool pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::requiresSourcePoints | ( |  | ) | const

inline virtual

See if this rejector requires source points.

Reimplemented from pcl::registration::CorrespondenceRejector.

Definition at line 145 of file correspondence_rejection_sample_consensus.h.

template<typename PointT>

bool pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::requiresTargetPoints | ( |  | ) | const

inline virtual

See if this rejector requires a target cloud.

Reimplemented from pcl::registration::CorrespondenceRejector.

Definition at line 159 of file correspondence_rejection_sample_consensus.h.

template<typename PointT>

void pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::setInlierThreshold | ( | double | threshold | ) |

inline

Set the maximum distance between corresponding points.

Correspondences with distances below the threshold are considered as inliers.

Parameters

  [in] | threshold | Distance threshold in the same dimension as source and target data sets.

Definition at line 176 of file correspondence_rejection_sample_consensus.h.

References pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::inlier_threshold_.

template<typename PointT>

void pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::setInputCloud | ( | const PointCloudConstPtr & | cloud | ) |

virtual

Provide a source point cloud dataset (must contain XYZ data!)

Parameters

  [in] | cloud | a cloud containing XYZ data

Definition at line 47 of file correspondence_rejection_sample_consensus.hpp.

Referenced by pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::~CorrespondenceRejectorSampleConsensus().

template<typename PointT>

virtual void pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::setInputSource | ( | const PointCloudConstPtr & | cloud | ) |

inline virtual

Provide a source point cloud dataset (must contain XYZ data!)

Parameters

  [in] | cloud | a cloud containing XYZ data

Definition at line 116 of file correspondence_rejection_sample_consensus.h.

References pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::input_.

Referenced by pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::setSourcePoints().

template<typename PointT>

virtual void pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::setInputTarget | ( | const PointCloudConstPtr & | cloud | ) |

inline virtual

Provide a target point cloud dataset (must contain XYZ data!)

Parameters

  [in] | cloud | a cloud containing XYZ data

Definition at line 136 of file correspondence_rejection_sample_consensus.h.

References pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::target_.

Referenced by pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::setTargetPoints().

template<typename PointT>

void pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::setMaximumIterations | ( | int | max_iterations | ) |

inline

Set the maximum number of iterations.

Parameters

  [in] | max_iterations | Maximum number if iterations to run

Definition at line 195 of file correspondence_rejection_sample_consensus.h.

References pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::getMaxIterations(), and pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::max_iterations_.

Referenced by pcl::GeometricConsistencyGrouping< PointModelT, PointSceneT >::clusterCorrespondences(), and pcl::Hough3DGrouping< PointModelT, PointSceneT, PointModelRfT, PointSceneRfT >::clusterCorrespondences().

template<typename PointT >

void pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::setMaxIterations | ( | int | max_iterations | ) |

Set the maximum number of iterations.

Parameters

  [in] | max_iterations | Maximum number if iterations to run

Definition at line 70 of file correspondence_rejection_sample_consensus.hpp.

Referenced by pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::getInlierThreshold().

template<typename PointT>

void pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::setRefineModel | ( | const bool | refine | ) |

inline

Specify whether the model should be refined internally using the variance of the inliers.

Parameters

  [in] | refine | true if the model should be refined, false otherwise

Definition at line 220 of file correspondence_rejection_sample_consensus.h.

References pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::refine_.

template<typename PointT>

void pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::setSaveInliers | ( | bool | s | ) |

inline

Set whether to save inliers or not.

Parameters

  [in] | s | True to save inliers / False otherwise

Definition at line 242 of file correspondence_rejection_sample_consensus.h.

References pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::save_inliers_.

template<typename PointT>

void pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::setSourcePoints | ( | pcl::PCLPointCloud2::ConstPtr | cloud2 | ) |

inline virtual

Blob method for setting the source cloud.

Reimplemented from pcl::registration::CorrespondenceRejector.

Definition at line 150 of file correspondence_rejection_sample_consensus.h.

References pcl::fromPCLPointCloud2(), and pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::setInputSource().

template<typename PointT>

void pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::setTargetCloud | ( | const PointCloudConstPtr & | cloud | ) |

virtual

Provide a target point cloud dataset (must contain XYZ data!)

Parameters

  [in] | cloud | a cloud containing XYZ data

Definition at line 62 of file correspondence_rejection_sample_consensus.hpp.

Referenced by pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::getInputSource().

template<typename PointT>

void pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::setTargetPoints | ( | pcl::PCLPointCloud2::ConstPtr | cloud2 | ) |

inline virtual

Method for setting the target cloud.

Reimplemented from pcl::registration::CorrespondenceRejector.

Definition at line 164 of file correspondence_rejection_sample_consensus.h.

References pcl::fromPCLPointCloud2(), and pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::setInputTarget().

## Member Data Documentation

template<typename PointT>

Eigen::Matrix4f pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::best_transformation_

protected

Definition at line 268 of file correspondence_rejection_sample_consensus.h.

Referenced by pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::getBestTransformation().

template<typename PointT>

std::vector<int> pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::inlier_indices_

protected

Definition at line 271 of file correspondence_rejection_sample_consensus.h.

Referenced by pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::getInliersIndices().

template<typename PointT>

double pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::inlier_threshold_

protected

Definition at line 260 of file correspondence_rejection_sample_consensus.h.

Referenced by pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::getInlierThreshold(), and pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::setInlierThreshold().

template<typename PointT>

PointCloudConstPtr pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::input_

protected

Definition at line 264 of file correspondence_rejection_sample_consensus.h.

Referenced by pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::getInputSource(), and pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::setInputSource().

template<typename PointT>

PointCloudPtr pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::input_transformed_

protected

Definition at line 265 of file correspondence_rejection_sample_consensus.h.

template<typename PointT>

int pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::max_iterations_

protected

Definition at line 262 of file correspondence_rejection_sample_consensus.h.

Referenced by pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::getMaximumIterations(), and pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::setMaximumIterations().

template<typename PointT>

bool pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::refine_

protected

Definition at line 270 of file correspondence_rejection_sample_consensus.h.

Referenced by pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::getRefineModel(), and pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::setRefineModel().

template<typename PointT>

bool pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::save_inliers_

protected

Definition at line 272 of file correspondence_rejection_sample_consensus.h.

Referenced by pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::getSaveInliers(), and pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::setSaveInliers().

template<typename PointT>

PointCloudConstPtr pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::target_

protected

Definition at line 266 of file correspondence_rejection_sample_consensus.h.

Referenced by pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::getInputTarget(), and pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::setInputTarget().

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

- /build/pcl-0nnAvv/pcl-1.7.2/registration/include/pcl/registration/correspondence_rejection_sample_consensus.h
- /build/pcl-0nnAvv/pcl-1.7.2/registration/include/pcl/registration/impl/correspondence_rejection_sample_consensus.hpp