Public Types | Public Member Functions | Protected Member Functions

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

SampleConsensusModelCircle2D defines a model for 2D circle segmentation on the X-Y plane. More...

#include <pcl/sample_consensus/sac_model_circle.h>

Inheritance diagram for pcl::SampleConsensusModelCircle2D< PointT >:
Inheritance graph
[legend]
Collaboration diagram for pcl::SampleConsensusModelCircle2D< 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
< SampleConsensusModelCircle2D
Ptr

Public Member Functions

 SampleConsensusModelCircle2D (const PointCloudConstPtr &cloud)
 Constructor for base SampleConsensusModelCircle2D.
 SampleConsensusModelCircle2D (const PointCloudConstPtr &cloud, const std::vector< int > &indices)
 Constructor for base SampleConsensusModelCircle2D.
void getSamples (int &iterations, std::vector< int > &samples)
 Get 3 random non-collinear points as data samples and return them as point indices.
bool computeModelCoefficients (const std::vector< int > &samples, Eigen::VectorXf &model_coefficients)
 Check whether the given index samples can form a valid 2D circle model, compute the model coefficients from these samples and store them in model_coefficients.
void getDistancesToModel (const Eigen::VectorXf &model_coefficients, std::vector< double > &distances)
 Compute all distances from the cloud data to a given 2D circle model.
void selectWithinDistance (const Eigen::VectorXf &model_coefficients, double threshold, std::vector< int > &inliers)
 Compute all distances from the cloud data to a given 2D circle model.
void optimizeModelCoefficients (const std::vector< int > &inliers, const Eigen::VectorXf &model_coefficients, Eigen::VectorXf &optimized_coefficients)
 Recompute the 2d circle coefficients using the given inlier set and return them to the user.
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 2d circle model.
bool doSamplesVerifyModel (const std::set< int > &indices, const Eigen::VectorXf &model_coefficients, double threshold)
 Verify whether a subset of indices verifies the given 2d circle model coefficients.
pcl::SacModel getModelType () const
 Return an unique id for this model (SACMODEL_CIRCLE2D).

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::SampleConsensusModelCircle2D< PointT >

SampleConsensusModelCircle2D defines a model for 2D circle segmentation on the X-Y plane.

Author:
Radu Bogdan Rusu

Definition at line 53 of file sac_model_circle.h.


Member Typedef Documentation

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

Reimplemented from pcl::SampleConsensusModel< PointT >.

Definition at line 61 of file sac_model_circle.h.

Reimplemented from pcl::SampleConsensusModel< PointT >.

Definition at line 63 of file sac_model_circle.h.

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

Reimplemented from pcl::SampleConsensusModel< PointT >.

Definition at line 62 of file sac_model_circle.h.

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

Reimplemented from pcl::SampleConsensusModel< PointT >.

Definition at line 65 of file sac_model_circle.h.


Constructor & Destructor Documentation

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

Constructor for base SampleConsensusModelCircle2D.

Parameters:
cloud the input point cloud dataset

Definition at line 70 of file sac_model_circle.h.

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

Constructor for base SampleConsensusModelCircle2D.

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

Definition at line 76 of file sac_model_circle.h.


Member Function Documentation

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

Check whether the given index samples can form a valid 2D circle model, compute the model coefficients from these samples and store them in model_coefficients.

The circle coefficients are: x, y, R.

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

Implements pcl::SampleConsensusModel< PointT >.

Definition at line 66 of file sac_model_circle.hpp.

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

Verify whether a subset of indices verifies the given 2d circle model coefficients.

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

Implements pcl::SampleConsensusModel< PointT >.

Definition at line 318 of file sac_model_circle.hpp.

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

Compute all distances from the cloud data to a given 2D circle model.

Parameters:
model_coefficients the coefficients of a 2D circle model that we need to compute distances to
distances the resultant estimated distances

Implements pcl::SampleConsensusModel< PointT >.

Definition at line 102 of file sac_model_circle.hpp.

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

Return an unique id for this model (SACMODEL_CIRCLE2D).

Implements pcl::SampleConsensusModel< PointT >.

Definition at line 130 of file sac_model_circle.h.

template<typename PointT>
void pcl::SampleConsensusModelCircle2D< PointT >::getSamples ( int &  iterations,
std::vector< int > &  samples 
)

Get 3 random non-collinear points as data samples and return them as point indices.

Parameters:
iterations the internal number of iterations used by SAC methods
samples the resultant model samples
Note:
assumes unique points!

Reimplemented from pcl::SampleConsensusModel< PointT >.

template<typename PointT >
bool pcl::SampleConsensusModelCircle2D< PointT >::isModelValid ( const Eigen::VectorXf &  model_coefficients  )  [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 344 of file sac_model_circle.hpp.

template<typename PointT >
bool pcl::SampleConsensusModelCircle2D< 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 47 of file sac_model_circle.hpp.

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

Recompute the 2d circle coefficients using the given inlier set and return them to the user.

Note:
: these are the coefficients of the 2d circle model after refinement (eg. after SVD)
Parameters:
inliers the data inliers found as supporting the model
model_coefficients the initial guess for the optimization
optimized_coefficients the resultant recomputed coefficients after non-linear optimization

Implements pcl::SampleConsensusModel< PointT >.

Definition at line 178 of file sac_model_circle.hpp.

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

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

Parameters:
inliers the data inliers that we want to project on the 2d circle model
model_coefficients the coefficients of a 2d circle model
projected_points the resultant projected points
copy_data_fields set to true if we need to copy the other data fields
Todo:
implement this.

Implements pcl::SampleConsensusModel< PointT >.

Definition at line 251 of file sac_model_circle.hpp.

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

Compute all distances from the cloud data to a given 2D circle model.

Parameters:
model_coefficients the coefficients of a 2D circle model that we need to compute distances to
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 134 of file sac_model_circle.hpp.


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