Main MRPT website > C++ reference for MRPT 1.9.9
List of all members | Classes | Public Member Functions | Private Member Functions
mrpt::math::ModelSearch Class Reference

Detailed Description

Model search implementations: RANSAC and genetic algorithm.

The type TModelFit is a user-supplied struct/class that implements this interface:

There are two methods provided in this class to fit a model:

For an example of usage, see "samples/model_search_test/"

See also
mrpt::math::RANSAC_Template, another RANSAC implementation where models can be matrices only.
Author
Zoltar Gaal

Definition at line 66 of file model_search.h.

#include <mrpt/math/model_search.h>

Classes

struct  TSpecies
 

Public Member Functions

template<typename TModelFit >
bool ransacSingleModel (const TModelFit &p_state, size_t p_kernelSize, const typename TModelFit::Real &p_fitnessThreshold, typename TModelFit::Model &p_bestModel, std::vector< size_t > &p_inliers)
 Run the ransac algorithm searching for a single model. More...
 
template<typename TModelFit >
bool geneticSingleModel (const TModelFit &p_state, size_t p_kernelSize, const typename TModelFit::Real &p_fitnessThreshold, size_t p_populationSize, size_t p_maxIteration, typename TModelFit::Model &p_bestModel, std::vector< size_t > &p_inliers)
 Run a generic programming version of ransac searching for a single model. More...
 

Private Member Functions

void pickRandomIndex (size_t p_size, size_t p_pick, std::vector< size_t > &p_ind)
 Select random (unique) indices from the 0..p_size sequence. More...
 
void pickRandomIndex (std::set< size_t > p_set, size_t p_pick, std::vector< size_t > &p_ind)
 Select random (unique) indices from the set. More...
 

Member Function Documentation

◆ geneticSingleModel()

template<typename TModelFit >
bool mrpt::math::ModelSearch::geneticSingleModel ( const TModelFit &  p_state,
size_t  p_kernelSize,
const typename TModelFit::Real &  p_fitnessThreshold,
size_t  p_populationSize,
size_t  p_maxIteration,
typename TModelFit::Model &  p_bestModel,
std::vector< size_t > &  p_inliers 
)

Run a generic programming version of ransac searching for a single model.

Definition at line 97 of file model_search_impl.h.

References ASSERT_, and pickRandomIndex().

◆ pickRandomIndex() [1/2]

void ModelSearch::pickRandomIndex ( size_t  p_size,
size_t  p_pick,
std::vector< size_t > &  p_ind 
)
private

Select random (unique) indices from the 0..p_size sequence.

Definition at line 21 of file model_search.cpp.

References ASSERT_, and mrpt::random::shuffle().

Referenced by geneticSingleModel(), and ransacSingleModel().

◆ pickRandomIndex() [2/2]

void ModelSearch::pickRandomIndex ( std::set< size_t >  p_set,
size_t  p_pick,
std::vector< size_t > &  p_ind 
)
private

Select random (unique) indices from the set.

The set is destroyed during pick

Definition at line 37 of file model_search.cpp.

References mrpt::random::shuffle().

◆ ransacSingleModel()

template<typename TModelFit >
bool mrpt::math::ModelSearch::ransacSingleModel ( const TModelFit &  p_state,
size_t  p_kernelSize,
const typename TModelFit::Real &  p_fitnessThreshold,
typename TModelFit::Model &  p_bestModel,
std::vector< size_t > &  p_inliers 
)

Run the ransac algorithm searching for a single model.

Definition at line 26 of file model_search_impl.h.

References ASSERT_, eps, min, and pickRandomIndex().




Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST