sample_consensus::SACModelCircle2D Class Reference

A Sample Consensus Model class for 2D circle segmentation on the X-Y plane. More...

#include <sac_model_circle.h>

Inheritance diagram for sample_consensus::SACModelCircle2D:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual bool computeModelCoefficients (const std::vector< int > &samples)
 Check whether the given index samples can form a valid 2D circle model, compute the model coefficients from these samples and store them internally in model_coefficients_.
virtual bool doSamplesVerifyModel (const std::set< int > &indices, double threshold)
 Verify whether a subset of indices verifies the internal circle model coefficients.
virtual void getDistancesToModel (const std::vector< double > &model_coefficients, std::vector< double > &distances)
 Compute all distances from the cloud data to a given 2D circle model.
virtual int getModelType ()
 Return an unique id for this model (SACMODEL_CIRCLE2D).
virtual void getSamples (int &iterations, std::vector< int > &samples)
 Get 3 random non-collinear points as data samples and return them as point indices.
virtual void projectPoints (const std::vector< int > &inliers, const std::vector< double > &model_coefficients, sensor_msgs::PointCloud &projected_points)
 Create a new point cloud with inliers projected onto the 2D circle model.
virtual void projectPointsInPlace (const std::vector< int > &inliers, const std::vector< double > &model_coefficients)
 Project inliers (in place) onto the given 2D circle model.
virtual void refitModel (const std::vector< int > &inliers, std::vector< double > &refit_coefficients)
 Recompute the plane coefficients using the given inlier set and return them to the user.
 SACModelCircle2D ()
 Constructor for base SACModelCircle2D.
virtual void selectWithinDistance (const std::vector< double > &model_coefficients, double threshold, std::vector< int > &inliers)
 Select all the points which respect the given model coefficients as inliers.
bool testModelCoefficients (const std::vector< double > &model_coefficients)
 Test whether the given model coefficients are valid given the input point cloud data.
virtual ~SACModelCircle2D ()
 Destructor for base SACModelCircle2D.

Static Public Member Functions

static int functionToOptimize (void *p, int m, int n, const double *x, double *fvec, int iflag)
 Cost function to be minimized.

Private Attributes

const std::vector< int > * tmp_inliers_
 temporary pointer to a list of given indices for refitModel ()

Detailed Description

A Sample Consensus Model class for 2D circle segmentation on the X-Y plane.

Definition at line 46 of file sac_model_circle.h.


Constructor & Destructor Documentation

sample_consensus::SACModelCircle2D::SACModelCircle2D (  )  [inline]

Constructor for base SACModelCircle2D.

Definition at line 51 of file sac_model_circle.h.

virtual sample_consensus::SACModelCircle2D::~SACModelCircle2D (  )  [inline, virtual]

Destructor for base SACModelCircle2D.

Definition at line 55 of file sac_model_circle.h.


Member Function Documentation

bool sample_consensus::SACModelCircle2D::computeModelCoefficients ( const std::vector< int > &  samples  )  [virtual]

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

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

Implements sample_consensus::SACModel.

Definition at line 213 of file sac_model_circle.cpp.

bool sample_consensus::SACModelCircle2D::doSamplesVerifyModel ( const std::set< int > &  indices,
double  threshold 
) [virtual]

Verify whether a subset of indices verifies the internal circle model coefficients.

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

Implements sample_consensus::SACModel.

Definition at line 332 of file sac_model_circle.cpp.

int sample_consensus::SACModelCircle2D::functionToOptimize ( void *  p,
int  m,
int  n,
const double *  x,
double *  fvec,
int  iflag 
) [static]

Cost function to be minimized.

Parameters:
p a pointer to our data structure array
m the number of functions
n the number of variables
x a pointer to the variables array
fvec a pointer to the resultant functions evaluations
iflag set to -1 inside the function to terminate execution

Definition at line 310 of file sac_model_circle.cpp.

void sample_consensus::SACModelCircle2D::getDistancesToModel ( const std::vector< double > &  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 sample_consensus::SACModel.

Definition at line 151 of file sac_model_circle.cpp.

virtual int sample_consensus::SACModelCircle2D::getModelType (  )  [inline, virtual]

Return an unique id for this model (SACMODEL_CIRCLE2D).

Implements sample_consensus::SACModel.

Definition at line 81 of file sac_model_circle.h.

void sample_consensus::SACModelCircle2D::getSamples ( int &  iterations,
std::vector< int > &  samples 
) [virtual]

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!

Implements sample_consensus::SACModel.

Definition at line 49 of file sac_model_circle.cpp.

void sample_consensus::SACModelCircle2D::projectPoints ( const std::vector< int > &  inliers,
const std::vector< double > &  model_coefficients,
sensor_msgs::PointCloud &  projected_points 
) [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
Todo:
implement this.

Implements sample_consensus::SACModel.

Definition at line 177 of file sac_model_circle.cpp.

void sample_consensus::SACModelCircle2D::projectPointsInPlace ( const std::vector< int > &  inliers,
const std::vector< double > &  model_coefficients 
) [virtual]

Project inliers (in place) onto the given 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
Todo:
implement this.

Implements sample_consensus::SACModel.

Definition at line 202 of file sac_model_circle.cpp.

void sample_consensus::SACModelCircle2D::refitModel ( const std::vector< int > &  inliers,
std::vector< double > &  refit_coefficients 
) [virtual]

Recompute the plane coefficients using the given inlier set and return them to the user.

Note:
: these are the coefficients of the circle model after refinement (eg. after SVD)
Parameters:
inliers the data inliers found as supporting the model
refit_coefficients the resultant recomputed coefficients after non-linear optimization

Implements sample_consensus::SACModel.

Definition at line 251 of file sac_model_circle.cpp.

void sample_consensus::SACModelCircle2D::selectWithinDistance ( const std::vector< double > &  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 coefficients of a 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
Note:
: To get the refined inliers of a model, use: ANNpoint refined_coeff = refitModel (...); selectWithinDistance (refined_coeff, threshold);

Implements sample_consensus::SACModel.

Definition at line 117 of file sac_model_circle.cpp.

bool sample_consensus::SACModelCircle2D::testModelCoefficients ( const std::vector< double > &  model_coefficients  )  [inline, virtual]

Test whether the given model coefficients are valid given the input point cloud data.

Parameters:
model_coefficients the model coefficients that need to be tested
Todo:
implement this

Implements sample_consensus::SACModel.

Definition at line 64 of file sac_model_circle.h.


Member Data Documentation

const std::vector<int>* sample_consensus::SACModelCircle2D::tmp_inliers_ [private]

temporary pointer to a list of given indices for refitModel ()

Definition at line 85 of file sac_model_circle.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Defines


door_handle_detector
Author(s): Radu Bogdan Rusu, Marius
autogenerated on Fri Jan 11 09:42:08 2013