Public Types | Public Member Functions | Protected Member Functions

pcl::SampleConsensusModelRegistration< PointT > Class Template Reference
[Module sample_consensus]

SampleConsensusModelRegistration defines a model for Point-To-Point registration outlier rejection. More...

#include <pcl/sample_consensus/sac_model_registration.h>

Inheritance diagram for pcl::SampleConsensusModelRegistration< PointT >:
Inheritance graph
[legend]
Collaboration diagram for pcl::SampleConsensusModelRegistration< PointT >:
Collaboration graph
[legend]

List of all members.

Public Types

typedef SampleConsensusModel
< PointT >::PointCloud 
PointCloud
typedef SampleConsensusModel
< PointT >::PointCloudPtr 
PointCloudPtr
typedef SampleConsensusModel
< PointT >::PointCloudConstPtr 
PointCloudConstPtr
typedef boost::shared_ptr
< SampleConsensusModelRegistration
Ptr

Public Member Functions

 SampleConsensusModelRegistration (const PointCloudConstPtr &cloud)
 Constructor for base SampleConsensusModelRegistration.
 SampleConsensusModelRegistration (const PointCloudConstPtr &cloud, const std::vector< int > &indices)
 Constructor for base SampleConsensusModelRegistration.
virtual void setInputCloud (const PointCloudConstPtr &cloud)
 Provide a pointer to the input dataset.
void computeSampleDistanceThreshold (const PointCloudConstPtr &cloud)
 Computes an "optimal" sample distance threshold based on the principal directions of the input cloud.
void setInputTarget (const PointCloudConstPtr &target)
 Set the input point cloud target.
void setInputTarget (const PointCloudConstPtr &target, const std::vector< int > &indices_tgt)
 Set the input point cloud target.
bool computeModelCoefficients (const std::vector< int > &samples, Eigen::VectorXf &model_coefficients)
 Compute a 4x4 rigid transformation matrix from the samples given.
void getDistancesToModel (const Eigen::VectorXf &model_coefficients, std::vector< double > &distances)
 Compute all distances from the transformed points to their correspondences.
void selectWithinDistance (const Eigen::VectorXf &model_coefficients, double threshold, std::vector< int > &inliers)
 Select all the points which respect the given model coefficients as inliers.
void optimizeModelCoefficients (const std::vector< int > &inliers, const Eigen::VectorXf &model_coefficients, Eigen::VectorXf &optimized_coefficients)
 Recompute the 4x4 transformation using the given inlier set.
void projectPoints (const std::vector< int > &inliers, const Eigen::VectorXf &model_coefficients, PointCloud &projected_points, bool copy_data_fields=true)
 Create a new point cloud with inliers projected onto the model.
bool doSamplesVerifyModel (const std::set< int > &indices, const Eigen::VectorXf &model_coefficients, double threshold)
 Verify whether a subset of indices verifies a given set of model coefficients.
pcl::SacModel getModelType () const
 Return an unique id for this model (SACMODEL_REGISTRATION).

Protected Member Functions

bool isModelValid (const Eigen::VectorXf &model_coefficients)
 Check whether a model is valid given the user constraints.
bool isSampleGood (const std::vector< int > &samples) const
 Check if a sample of indices results in a good sample of points indices.

Detailed Description

template<typename PointT>
class pcl::SampleConsensusModelRegistration< PointT >

SampleConsensusModelRegistration defines a model for Point-To-Point registration outlier rejection.

Author:
Radu Bogdan Rusu

Definition at line 55 of file sac_model_registration.h.


Member Typedef Documentation

template<typename PointT>
typedef SampleConsensusModel<PointT>::PointCloud pcl::SampleConsensusModelRegistration< PointT >::PointCloud

Reimplemented from pcl::SampleConsensusModel< PointT >.

Definition at line 61 of file sac_model_registration.h.

Reimplemented from pcl::SampleConsensusModel< PointT >.

Definition at line 63 of file sac_model_registration.h.

template<typename PointT>
typedef SampleConsensusModel<PointT>::PointCloudPtr pcl::SampleConsensusModelRegistration< PointT >::PointCloudPtr

Reimplemented from pcl::SampleConsensusModel< PointT >.

Definition at line 62 of file sac_model_registration.h.

template<typename PointT>
typedef boost::shared_ptr<SampleConsensusModelRegistration> pcl::SampleConsensusModelRegistration< PointT >::Ptr

Reimplemented from pcl::SampleConsensusModel< PointT >.

Definition at line 65 of file sac_model_registration.h.


Constructor & Destructor Documentation

template<typename PointT>
pcl::SampleConsensusModelRegistration< PointT >::SampleConsensusModelRegistration ( const PointCloudConstPtr cloud  )  [inline]

Constructor for base SampleConsensusModelRegistration.

Parameters:
cloud the input point cloud dataset

Definition at line 70 of file sac_model_registration.h.

template<typename PointT>
pcl::SampleConsensusModelRegistration< PointT >::SampleConsensusModelRegistration ( const PointCloudConstPtr cloud,
const std::vector< int > &  indices 
) [inline]

Constructor for base SampleConsensusModelRegistration.

Parameters:
cloud the input point cloud dataset
indices a vector of point indices to be used from cloud

Definition at line 80 of file sac_model_registration.h.


Member Function Documentation

template<typename PointT >
bool pcl::SampleConsensusModelRegistration< PointT >::computeModelCoefficients ( const std::vector< int > &  samples,
Eigen::VectorXf &  model_coefficients 
) [virtual]

Compute a 4x4 rigid transformation matrix from the samples given.

Parameters:
samples the indices found as good candidates for creating a valid model
model_coefficients the resultant model coefficients

Implements pcl::SampleConsensusModel< PointT >.

Definition at line 65 of file sac_model_registration.hpp.

template<typename PointT>
void pcl::SampleConsensusModelRegistration< PointT >::computeSampleDistanceThreshold ( const PointCloudConstPtr cloud  )  [inline]

Computes an "optimal" sample distance threshold based on the principal directions of the input cloud.

Parameters:
cloud the const boost shared pointer to a PointCloud message

Definition at line 105 of file sac_model_registration.h.

template<typename PointT>
bool pcl::SampleConsensusModelRegistration< PointT >::doSamplesVerifyModel ( const std::set< int > &  indices,
const Eigen::VectorXf &  model_coefficients,
double  threshold 
) [inline, virtual]

Verify whether a subset of indices verifies a given set of model coefficients.

Pure virtual.

Parameters:
indices the data indices that need to be tested against the model
model_coefficients the set of model coefficients
threshold a maximum admissible distance threshold for determining the inliers from the outliers

Implements pcl::SampleConsensusModel< PointT >.

Definition at line 191 of file sac_model_registration.h.

template<typename PointT >
void pcl::SampleConsensusModelRegistration< PointT >::getDistancesToModel ( const Eigen::VectorXf &  model_coefficients,
std::vector< double > &  distances 
) [virtual]

Compute all distances from the transformed points to their correspondences.

Parameters:
model_coefficients the 4x4 transformation matrix
distances the resultant estimated distances

Implements pcl::SampleConsensusModel< PointT >.

Definition at line 92 of file sac_model_registration.hpp.

template<typename PointT>
pcl::SacModel pcl::SampleConsensusModelRegistration< PointT >::getModelType (  )  const [inline, virtual]

Return an unique id for this model (SACMODEL_REGISTRATION).

Implements pcl::SampleConsensusModel< PointT >.

Definition at line 198 of file sac_model_registration.h.

template<typename PointT>
bool pcl::SampleConsensusModelRegistration< PointT >::isModelValid ( const Eigen::VectorXf &  model_coefficients  )  [inline, protected, virtual]

Check whether a model is valid given the user constraints.

Parameters:
model_coefficients the set of model coefficients

Implements pcl::SampleConsensusModel< PointT >.

Definition at line 205 of file sac_model_registration.h.

template<typename PointT >
bool pcl::SampleConsensusModelRegistration< PointT >::isSampleGood ( const std::vector< int > &  samples  )  const [protected, virtual]

Check if a sample of indices results in a good sample of points indices.

Pure virtual.

Parameters:
samples the resultant index samples

Implements pcl::SampleConsensusModel< PointT >.

Definition at line 46 of file sac_model_registration.hpp.

template<typename PointT >
void pcl::SampleConsensusModelRegistration< PointT >::optimizeModelCoefficients ( const std::vector< int > &  inliers,
const Eigen::VectorXf &  model_coefficients,
Eigen::VectorXf &  optimized_coefficients 
) [virtual]

Recompute the 4x4 transformation using the given inlier set.

Parameters:
inliers the data inliers found as supporting the model
model_coefficients the initial guess for the optimization
optimized_coefficients the resultant recomputed transformation

Implements pcl::SampleConsensusModel< PointT >.

Definition at line 169 of file sac_model_registration.hpp.

template<typename PointT>
void pcl::SampleConsensusModelRegistration< PointT >::projectPoints ( const std::vector< int > &  inliers,
const Eigen::VectorXf &  model_coefficients,
PointCloud projected_points,
bool  copy_data_fields = true 
) [inline, virtual]

Create a new point cloud with inliers projected onto the model.

Pure virtual.

Parameters:
inliers the data inliers that we want to project on the model
model_coefficients the coefficients of a model
projected_points the resultant projected points
copy_data_fields set to true (default) if we want the projected_points cloud to be an exact copy of the input dataset minus the point projections on the plane model

Implements pcl::SampleConsensusModel< PointT >.

Definition at line 185 of file sac_model_registration.h.

template<typename PointT >
void pcl::SampleConsensusModelRegistration< PointT >::selectWithinDistance ( const Eigen::VectorXf &  model_coefficients,
double  threshold,
std::vector< int > &  inliers 
) [virtual]

Select all the points which respect the given model coefficients as inliers.

Parameters:
model_coefficients the 4x4 transformation matrix
threshold a maximum admissible distance threshold for determining the inliers from the outliers
inliers the resultant model inliers

Implements pcl::SampleConsensusModel< PointT >.

Definition at line 128 of file sac_model_registration.hpp.

template<typename PointT>
virtual void pcl::SampleConsensusModelRegistration< PointT >::setInputCloud ( const PointCloudConstPtr cloud  )  [inline, virtual]

Provide a pointer to the input dataset.

Parameters:
cloud the const boost shared pointer to a PointCloud message

Definition at line 93 of file sac_model_registration.h.

template<typename PointT>
void pcl::SampleConsensusModelRegistration< PointT >::setInputTarget ( const PointCloudConstPtr target  )  [inline]

Set the input point cloud target.

Parameters:
target the input point cloud target

Definition at line 126 of file sac_model_registration.h.

template<typename PointT>
void pcl::SampleConsensusModelRegistration< PointT >::setInputTarget ( const PointCloudConstPtr target,
const std::vector< int > &  indices_tgt 
) [inline]

Set the input point cloud target.

Parameters:
target the input point cloud target
indices_tgt a vector of point indices to be used from target

Definition at line 142 of file sac_model_registration.h.


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