Main MRPT website > C++ reference
MRPT logo
List of all members | Public Types | Static Public Member Functions
mrpt::math::RANSAC_Template< NUMTYPE > Class Template Reference

Detailed Description

template<typename NUMTYPE = double>
class mrpt::math::RANSAC_Template< NUMTYPE >

A generic RANSAC implementation with models as matrices.

See RANSAC_Template::execute for more info on usage.

See also
mrpt::math::ModelSearch, a more versatile RANSAC implementation where models can be anything else, not only matrices.

Definition at line 56 of file ransac.h.

#include <mrpt/math/ransac.h>

Inheritance diagram for mrpt::math::RANSAC_Template< NUMTYPE >:
Inheritance graph
[legend]

Public Types

typedef void(* TRansacFitFunctor) (const CMatrixTemplateNumeric< NUMTYPE > &allData, const mrpt::vector_size_t &useIndices, std::vector< CMatrixTemplateNumeric< NUMTYPE > > &fitModels)
 The type of the function passed to mrpt::math::ransac - See the documentation for that method for more info. More...
 
typedef void(* TRansacDistanceFunctor) (const CMatrixTemplateNumeric< NUMTYPE > &allData, const std::vector< CMatrixTemplateNumeric< NUMTYPE > > &testModels, const NUMTYPE distanceThreshold, unsigned int &out_bestModelIndex, mrpt::vector_size_t &out_inlierIndices)
 The type of the function passed to mrpt::math::ransac - See the documentation for that method for more info. More...
 
typedef bool(* TRansacDegenerateFunctor) (const CMatrixTemplateNumeric< NUMTYPE > &allData, const mrpt::vector_size_t &useIndices)
 The type of the function passed to mrpt::math::ransac - See the documentation for that method for more info. More...
 

Static Public Member Functions

static bool execute (const CMatrixTemplateNumeric< NUMTYPE > &data, TRansacFitFunctor fit_func, TRansacDistanceFunctor dist_func, TRansacDegenerateFunctor degen_func, const double distanceThreshold, const unsigned int minimumSizeSamplesToFit, mrpt::vector_size_t &out_best_inliers, CMatrixTemplateNumeric< NUMTYPE > &out_best_model, bool verbose=false, const double prob_good_sample=0.999, const size_t maxIter=2000)
 An implementation of the RANSAC algorithm for robust fitting of models to data. More...
 
static void printf_debug (const char *frmt,...)
 Sends a formated text to "debugOut" if not NULL, or to cout otherwise. More...
 

Member Typedef Documentation

◆ TRansacDegenerateFunctor

template<typename NUMTYPE = double>
typedef bool(* mrpt::math::RANSAC_Template< NUMTYPE >::TRansacDegenerateFunctor) (const CMatrixTemplateNumeric< NUMTYPE > &allData, const mrpt::vector_size_t &useIndices)

The type of the function passed to mrpt::math::ransac - See the documentation for that method for more info.

Definition at line 75 of file ransac.h.

◆ TRansacDistanceFunctor

template<typename NUMTYPE = double>
typedef void(* mrpt::math::RANSAC_Template< NUMTYPE >::TRansacDistanceFunctor) (const CMatrixTemplateNumeric< NUMTYPE > &allData, const std::vector< CMatrixTemplateNumeric< NUMTYPE > > &testModels, const NUMTYPE distanceThreshold, unsigned int &out_bestModelIndex, mrpt::vector_size_t &out_inlierIndices)

The type of the function passed to mrpt::math::ransac - See the documentation for that method for more info.

Definition at line 67 of file ransac.h.

◆ TRansacFitFunctor

template<typename NUMTYPE = double>
typedef void(* mrpt::math::RANSAC_Template< NUMTYPE >::TRansacFitFunctor) (const CMatrixTemplateNumeric< NUMTYPE > &allData, const mrpt::vector_size_t &useIndices, std::vector< CMatrixTemplateNumeric< NUMTYPE > > &fitModels)

The type of the function passed to mrpt::math::ransac - See the documentation for that method for more info.

Definition at line 61 of file ransac.h.

Member Function Documentation

◆ execute()

template<typename NUMTYPE = double>
static bool mrpt::math::RANSAC_Template< NUMTYPE >::execute ( const CMatrixTemplateNumeric< NUMTYPE > &  data,
TRansacFitFunctor  fit_func,
TRansacDistanceFunctor  dist_func,
TRansacDegenerateFunctor  degen_func,
const double  distanceThreshold,
const unsigned int  minimumSizeSamplesToFit,
mrpt::vector_size_t out_best_inliers,
CMatrixTemplateNumeric< NUMTYPE > &  out_best_model,
bool  verbose = false,
const double  prob_good_sample = 0.999,
const size_t  maxIter = 2000 
)
static

An implementation of the RANSAC algorithm for robust fitting of models to data.

Parameters
dataA DxN matrix with all the observed data. D is the dimensionality of data points and N the number of points.
Thisimplementation is highly inspired on Peter Kovesi's MATLAB scripts (http://www.csse.uwa.edu.au/~pk).
Returns
false if no good solution can be found, true on success.

◆ printf_debug()

static void mrpt::utils::CDebugOutputCapable::printf_debug ( const char *  frmt,
  ... 
)
staticinherited

Sends a formated text to "debugOut" if not NULL, or to cout otherwise.

Referenced by mrpt::math::CLevenbergMarquardtTempl< VECTORTYPE, USERPARAM >::execute().




Page generated by Doxygen 1.8.14 for MRPT 1.0.2 SVN: at lun oct 28 00:52:41 CET 2019 Hosted on:
SourceForge.net Logo