dlr::computerVision::Ransac< Problem > Class Template Reference

This class template implements the RANSAC algorithm[1]. More...

#include <ransac.h>

List of all members.

Public Types

typedef Problem ProblemType
 This typedef simply shadows template argument Problem.
typedef Problem::ModelType ResultType
 This typedef indicates the type of model that will be estimated by the RANSAC algorithm.

Public Member Functions

 Ransac (ProblemType const &problem, size_t minimumConsensusSize=0, double requiredConfidence=0.99, double inlierProbability=0.5)
 This constructor sets up the Ransac instance so that it is ready to solve the model fitting problem, but does not run the RANSAC algorithm.
virtual ~Ransac ()
 The destructor cleans up any system resources and destroys *this.
virtual ResultType getResult ()
 This member function runs the RANSAC algorithm and returns the computed model.

Protected Member Functions

void computeConsensusSet (ResultType &model, std::vector< bool > &consensusFlags)
bool estimate (ResultType &model)
bool isConverged (std::vector< bool > const &consensusFlags, std::vector< bool > &previousConsensusFlags, size_t &consensusSetSize, size_t &previousConsensusSetSize, size_t &strikes)

Protected Attributes

size_t m_minimumConsensusSize
size_t m_numberOfRandomSampleSets
ProblemType m_problem


Detailed Description

template<class Problem>
class dlr::computerVision::Ransac< Problem >

This class template implements the RANSAC algorithm[1].

The template argument, Problem, provides all of the user-supplied problem-specific code, such as model estimation and error computation. The easiest way to do make an appropriate Problem class is to derive from class RansacProblem, below. For an example, see the file test/ransacTest.cpp.

[1] M. Fischler and R. Bolles. Random Sample Consensus: A Paradigm for Model Fitting with Applications to Image Analysis and Automated Cartography. Graphics and Image Processing, 24(6):381--395, 1981.

Definition at line 52 of file ransac.h.


Member Typedef Documentation

template<class Problem>
typedef Problem dlr::computerVision::Ransac< Problem >::ProblemType

This typedef simply shadows template argument Problem.

Definition at line 58 of file ransac.h.

template<class Problem>
typedef Problem::ModelType dlr::computerVision::Ransac< Problem >::ResultType

This typedef indicates the type of model that will be estimated by the RANSAC algorithm.

Its value is controlled by the user specified RansacProblem class.

Definition at line 66 of file ransac.h.


Constructor & Destructor Documentation

template<class Problem >
dlr::computerVision::Ransac< Problem >::Ransac ( ProblemType const &  problem,
size_t  minimumConsensusSize = 0,
double  requiredConfidence = 0.99,
double  inlierProbability = 0.5 
) [inline]

This constructor sets up the Ransac instance so that it is ready to solve the model fitting problem, but does not run the RANSAC algorithm.

Parameters:
problem This argument is a class instance implementing the RansacProblem interface, which provides all of the problem-specific code.
minimumConsensusSize This argument specifies the smallest set of "agreeing" samples that should be taken as proof that the correct model has been found (and grounds for terminating the algorithm). Setting this value to zero will make the Ransac constructor compute an appropriate value using arguments requiredConfidence and inlierProbability.
requiredConfidence This argument indicates how confident we need to be that one run of the RANSAC algorithm will find the correct model. It affects the number of iterations that the RANSAC algorithm will be allowed to run, as well as the automatically computed value for minimumConsensusSize (see above).
inlierProbability This argument indicates the likelihood that any particular input value (data point, sample, whatever) is an "inlier" for the purpose of estimating a model. If you had 10 sample points, and thought that 3 of them had excessive noise, then you would supply a value of 0.7 for this argument. It affects the number of iterations that the RANSAC algorithm will be allowed to run.

Definition at line 378 of file ransac.h.

template<class Problem>
virtual dlr::computerVision::Ransac< Problem >::~Ransac (  )  [inline, virtual]

The destructor cleans up any system resources and destroys *this.

Definition at line 110 of file ransac.h.


Member Function Documentation

template<class Problem>
virtual ResultType dlr::computerVision::Ransac< Problem >::getResult (  )  [inline, virtual]

This member function runs the RANSAC algorithm and returns the computed model.

Returns:
The return value is the best model estimate returned by the RANSAC algorithm.

Definition at line 121 of file ransac.h.


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

Generated on Wed Nov 25 12:15:09 2009 for dlrComputerVision Utility Library by  doxygen 1.5.8