Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | Protected Member Functions | List of all members
BIAS::RANSACEvaluatorInterface< SolutionType > Class Template Referenceabstract

Interface for computation of solutions and evaluation of measurements. More...

#include <MathAlgo/RANSACEvaluatorInterface.hh>

+ Inheritance diagram for BIAS::RANSACEvaluatorInterface< SolutionType >:

Public Member Functions

virtual bool GenerateSamples (const unsigned sample_index, const unsigned sample_size, const unsigned data_size, std::vector< unsigned > &which_samples)
 randomly generates the indizes of the samples used for computation of the solution. More...
 
virtual unsigned GetMinNumSamplesForSolutionComputation () const =0
 Returns the minimum required samples for computation of a solution. More...
 
virtual unsigned GetNumMeasurements () const =0
 Returns the number of available measurements. More...
 
virtual int GetSampleSolutions (const std::vector< unsigned > &which_samples, std::vector< SolutionType > &solutions)=0
 Compute solution(s) for the given set of samples. More...
 
virtual bool IsInlier (const SolutionType &solution, const unsigned data_index, double &score)=0
 Checks whether a certain sample (i.e. More...
 
virtual bool RefineSolution (const std::vector< bool > &inliers, SolutionType &solution)=0
 Refine a solution based on the inliers vector. More...
 

Protected Member Functions

bool GenerateSamplesRandom_ (const unsigned sample_index, const unsigned sample_size, const unsigned data_size, std::vector< unsigned > &which_samples)
 purely random generation of sample indizes More...
 

Detailed Description

template<class SolutionType>
class BIAS::RANSACEvaluatorInterface< SolutionType >

Interface for computation of solutions and evaluation of measurements.

This interface is used by the PreemptiveRANSAC and the COSAC classes and decouples the problem (for example Homography estimation) from the algorithm (for example PreemptiveRANSAC or Complete Sampling Consesus / COSAC).

A standard implementation for sample generation is also given.

, COSAC

Author
woelk 01/2010 (c) www.vision-n.de

Definition at line 44 of file RANSACEvaluatorInterface.hh.

Member Function Documentation

template<class SolutionType >
bool BIAS::RANSACEvaluatorInterface< SolutionType >::GenerateSamples ( const unsigned  sample_index,
const unsigned  sample_size,
const unsigned  data_size,
std::vector< unsigned > &  which_samples 
)
virtual

randomly generates the indizes of the samples used for computation of the solution.

This function can be overloaded, for example when it is of advantage when the samples span a big area (for example in the image)

Definition at line 98 of file RANSACEvaluatorInterface.hh.

template<class SolutionType >
bool BIAS::RANSACEvaluatorInterface< SolutionType >::GenerateSamplesRandom_ ( const unsigned  sample_index,
const unsigned  sample_size,
const unsigned  data_size,
std::vector< unsigned > &  which_samples 
)
protected

purely random generation of sample indizes

Definition at line 110 of file RANSACEvaluatorInterface.hh.

References BIAS::Random::GetUniformDistributedInt().

template<class SolutionType>
virtual unsigned BIAS::RANSACEvaluatorInterface< SolutionType >::GetMinNumSamplesForSolutionComputation ( ) const
pure virtual

Returns the minimum required samples for computation of a solution.

Implemented in BIAS::MeanDoubleRANSACEvaluator.

template<class SolutionType>
virtual unsigned BIAS::RANSACEvaluatorInterface< SolutionType >::GetNumMeasurements ( ) const
pure virtual

Returns the number of available measurements.

Implemented in BIAS::MeanDoubleRANSACEvaluator.

template<class SolutionType>
virtual int BIAS::RANSACEvaluatorInterface< SolutionType >::GetSampleSolutions ( const std::vector< unsigned > &  which_samples,
std::vector< SolutionType > &  solutions 
)
pure virtual

Compute solution(s) for the given set of samples.

Returns
the number of solutions found.

The which_samples array will be of length sample_size, selecting the indices to be fit to from the subclass's data array.

Implemented in BIAS::MeanDoubleRANSACEvaluator.

template<class SolutionType>
virtual bool BIAS::RANSACEvaluatorInterface< SolutionType >::IsInlier ( const SolutionType &  solution,
const unsigned  data_index,
double &  score 
)
pure virtual

Checks whether a certain sample (i.e.

data) is an inlier and computes the associated score. Good solutions result in a small score, bad solutions result in big scores. Scores may also be negative. It is often a good idea do define the score as the logarithm of some normalized distance measure.

Implemented in BIAS::MeanDoubleRANSACEvaluator.

template<class SolutionType>
virtual bool BIAS::RANSACEvaluatorInterface< SolutionType >::RefineSolution ( const std::vector< bool > &  inliers,
SolutionType &  solution 
)
pure virtual

Refine a solution based on the inliers vector.

Implemented in BIAS::MeanDoubleRANSACEvaluator.


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