Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
Public Types | Public Member Functions | List of all members
RansacModel< ModelT > Class Template Reference

Generic plug-in template base class using 'Curiously recurring template pattern' (CRTP) to allow for arbitrary RANSAC models (e.g. linear or quadratic fits). More...

#include <OpenMS/MATH/MISC/RANSACModel.h>

Public Types

typedef std::pair< double, double > DPair
 
typedef std::vector< DPair > DVec
 
typedef DVec::const_iterator DVecIt
 
typedef std::vector< double > ModelParameters
 

Public Member Functions

ModelParameters rm_fit (const DVecIt &begin, const DVecIt &end) const
 fit a model and return its parameters More...
 
double rm_rsq (const DVecIt &begin, const DVecIt &end) const
 Returns the R-squared of the data applied to the model (computed on-the-fly). More...
 
double rm_rss (const DVecIt &begin, const DVecIt &end, const ModelParameters &coefficients) const
 calculates the residual sum of squares of the input points according to the model More...
 
DVec rm_inliers (const DVecIt &begin, const DVecIt &end, const ModelParameters &coefficients, double max_threshold) const
 

Detailed Description

template<class ModelT = int>
class OpenMS::Math::RansacModel< ModelT >

Generic plug-in template base class using 'Curiously recurring template pattern' (CRTP) to allow for arbitrary RANSAC models (e.g. linear or quadratic fits).

An actual model should derive from this class using CRTP (see RansacModelLinear for an example) and implement the *_impl() functions.

Member Typedef Documentation

typedef std::pair<double, double> DPair
typedef std::vector<DPair> DVec
typedef DVec::const_iterator DVecIt
typedef std::vector<double> ModelParameters

Member Function Documentation

ModelParameters rm_fit ( const DVecIt &  begin,
const DVecIt &  end 
) const
inline

fit a model and return its parameters

DVec rm_inliers ( const DVecIt &  begin,
const DVecIt &  end,
const ModelParameters &  coefficients,
double  max_threshold 
) const
inline

calculates the squared residual of each input point vs. the model. All points with an error <= max_threshold, are accepted as inliers and returned.

double rm_rsq ( const DVecIt &  begin,
const DVecIt &  end 
) const
inline

Returns the R-squared of the data applied to the model (computed on-the-fly).

Takes as input a standard vector of a standard pair of points in a 2D space.

Parameters
beginIterator to first pair
endPast-end iterator to last pair
Returns
: R-squared value
double rm_rss ( const DVecIt &  begin,
const DVecIt &  end,
const ModelParameters &  coefficients 
) const
inline

calculates the residual sum of squares of the input points according to the model


OpenMS / TOPP release 2.0.0 Documentation generated on Tue Jan 31 2017 06:41:04 using doxygen 1.8.8