Public Member Functions | Protected Attributes | List of all members
sample_consensus::SAC Class Referenceabstract

#include <sac.h>

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

Public Member Functions

virtual void computeCoefficients (std::vector< double > &coefficients)
 Compute the coefficients of the model and return them. More...
 
virtual bool computeModel (int debug=0)=0
 Compute the actual model. Pure virtual. More...
 
virtual std::vector< int > getInliers ()
 Get a list of the model inliers, found after computeModel () More...
 
PointCloud getPointCloud (std::vector< int > indices)
 Return the point cloud representing a set of given indices. More...
 
std::set< int > getRandomSamples (PointCloud points, int nr_samples)
 Get a set of randomly selected indices. More...
 
std::set< int > getRandomSamples (PointCloud points, std::vector< int > indices, int nr_samples)
 Get a vector of randomly selected indices. More...
 
virtual void projectPointsToModel (const std::vector< int > &indices, const std::vector< double > &model_coefficients, PointCloud &projected_points)
 Project a set of given points (using their indices) onto the model and return their projections. More...
 
virtual void refineCoefficients (std::vector< double > &refined_coefficients)
 Use Least-Squares optimizations to refine the coefficients of the model, and return them. More...
 
virtual int removeInliers ()
 Remove the model inliers from the list of data indices. Returns the number of indices left. More...
 
 SAC ()
 Constructor for base SAC. More...
 
 SAC (SACModel *model)
 Constructor for base SAC. More...
 
virtual void setMaxIterations (int max_iterations)
 Set the maximum number of iterations. More...
 
virtual void setProbability (double probability)
 Set the desired probability of choosing at least one sample free from outliers. More...
 
virtual void setThreshold (double threshold)
 Set the threshold to model. More...
 
virtual ~SAC ()
 Destructor for base SAC. More...
 

Protected Attributes

int iterations_
 Total number of internal loop iterations that we've done so far. More...
 
int max_iterations_
 Maximum number of iterations before giving up. More...
 
double probability_
 Desired probability of choosing at least one sample free from outliers. More...
 
SACModelsac_model_
 The underlying data model used (i.e. what is it that we attempt to search for). More...
 
double threshold_
 Distance to model threshold. More...
 

Detailed Description

Definition at line 44 of file sac.h.

Constructor & Destructor Documentation

sample_consensus::SAC::SAC ( )
inline

Constructor for base SAC.

Definition at line 50 of file sac.h.

sample_consensus::SAC::SAC ( SACModel model)
inline

Constructor for base SAC.

Parameters
modela SAmple Consensus model

Definition at line 59 of file sac.h.

virtual sample_consensus::SAC::~SAC ( )
inlinevirtual

Destructor for base SAC.

Definition at line 66 of file sac.h.

Member Function Documentation

virtual void sample_consensus::SAC::computeCoefficients ( std::vector< double > &  coefficients)
inlinevirtual

Compute the coefficients of the model and return them.

Definition at line 105 of file sac.h.

virtual bool sample_consensus::SAC::computeModel ( int  debug = 0)
pure virtual

Compute the actual model. Pure virtual.

Implemented in sample_consensus::RANSAC.

virtual std::vector<int> sample_consensus::SAC::getInliers ( )
inlinevirtual

Get a list of the model inliers, found after computeModel ()

Definition at line 128 of file sac.h.

PointCloud SAC::getPointCloud ( std::vector< int >  indices)

Return the point cloud representing a set of given indices.

return the point cloud representing a set of given indices.

Parameters
indicesa set of indices that represent the data that we're interested in

Definition at line 41 of file sac.cpp.

std::set<int> sample_consensus::SAC::getRandomSamples ( PointCloud  points,
int  nr_samples 
)
inline

Get a set of randomly selected indices.

Note
Since we return a set, we do not guarantee that we'll return precisely the desired number of samples (ie. nr_samples).
Parameters
pointsthe point cloud data set to be used
nr_samplesthe desired number of point indices

Definition at line 161 of file sac.h.

std::set<int> sample_consensus::SAC::getRandomSamples ( PointCloud  points,
std::vector< int >  indices,
int  nr_samples 
)
inline

Get a vector of randomly selected indices.

Note
Since we return a set, we do not guarantee that we'll return precisely the desired number of samples (ie. nr_samples).
Parameters
pointsthe point cloud data set to be used (unused)
indicesa set of indices that represent the data that we're interested in
nr_samplesthe desired number of point indices

Definition at line 178 of file sac.h.

virtual void sample_consensus::SAC::projectPointsToModel ( const std::vector< int > &  indices,
const std::vector< double > &  model_coefficients,
PointCloud projected_points 
)
inlinevirtual

Project a set of given points (using their indices) onto the model and return their projections.

Parameters
indicesa set of indices that represent the data that we're interested in
model_coefficientsthe coefficients of the underlying model
projected_pointsthe resultant projected points

Definition at line 146 of file sac.h.

virtual void sample_consensus::SAC::refineCoefficients ( std::vector< double > &  refined_coefficients)
inlinevirtual

Use Least-Squares optimizations to refine the coefficients of the model, and return them.

Parameters
refit_coefficientsthe resultant recomputed coefficients after non-linear optimization

Definition at line 116 of file sac.h.

virtual int sample_consensus::SAC::removeInliers ( )
inlinevirtual

Remove the model inliers from the list of data indices. Returns the number of indices left.

Definition at line 123 of file sac.h.

virtual void sample_consensus::SAC::setMaxIterations ( int  max_iterations)
inlinevirtual

Set the maximum number of iterations.

Parameters
max_iterationsmaximum number of iterations

Definition at line 83 of file sac.h.

virtual void sample_consensus::SAC::setProbability ( double  probability)
inlinevirtual

Set the desired probability of choosing at least one sample free from outliers.

Parameters
probabilitythe desired probability of choosing at least one sample free from outliers

Definition at line 93 of file sac.h.

virtual void sample_consensus::SAC::setThreshold ( double  threshold)
inlinevirtual

Set the threshold to model.

Parameters
thresholddistance to model threshold

Definition at line 73 of file sac.h.

Member Data Documentation

int sample_consensus::SAC::iterations_
protected

Total number of internal loop iterations that we've done so far.

Definition at line 194 of file sac.h.

int sample_consensus::SAC::max_iterations_
protected

Maximum number of iterations before giving up.

Definition at line 197 of file sac.h.

double sample_consensus::SAC::probability_
protected

Desired probability of choosing at least one sample free from outliers.

Definition at line 191 of file sac.h.

SACModel* sample_consensus::SAC::sac_model_
protected

The underlying data model used (i.e. what is it that we attempt to search for).

Definition at line 188 of file sac.h.

double sample_consensus::SAC::threshold_
protected

Distance to model threshold.

Definition at line 200 of file sac.h.


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


semantic_point_annotator
Author(s): Radu Bogdan Rusu
autogenerated on Mon Jun 10 2019 14:29:03