MRPT  2.0.4
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 64 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 99 of file model_search_impl.h.

References ASSERT_, and pickRandomIndex().

Here is the call graph for this function:

◆ 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 20 of file model_search.cpp.

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

Referenced by geneticSingleModel(), and ransacSingleModel().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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 36 of file model_search.cpp.

References mrpt::random::shuffle().

Here is the call graph for this function:

◆ 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 28 of file model_search_impl.h.

References ASSERT_, eps, pickRandomIndex(), and mrpt::round().

Here is the call graph for this function:



Page generated by Doxygen 1.8.14 for MRPT 2.0.4 Git: 33de1d0ad Sat Jun 20 11:02:42 2020 +0200 at sáb jun 20 17:35:17 CEST 2020