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/"
Definition at line 48 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, 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, 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, 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, vector_size_t &p_ind) |
Select random (unique) indices from the set. More... | |
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, | ||
vector_size_t & | p_inliers | ||
) |
Run a generic programming version of ransac searching for a single model.
Definition at line 94 of file model_search_impl.h.
References ASSERT_, and pickRandomIndex().
|
private |
Select random (unique) indices from the 0..p_size sequence.
Definition at line 19 of file model_search.cpp.
References ASSERT_.
Referenced by geneticSingleModel(), and ransacSingleModel().
|
private |
Select random (unique) indices from the set.
The set is destroyed during pick
Definition at line 36 of file model_search.cpp.
bool mrpt::math::ModelSearch::ransacSingleModel | ( | const TModelFit & | p_state, |
size_t | p_kernelSize, | ||
const typename TModelFit::Real & | p_fitnessThreshold, | ||
typename TModelFit::Model & | p_bestModel, | ||
vector_size_t & | p_inliers | ||
) |
Run the ransac algorithm searching for a single model.
Definition at line 25 of file model_search_impl.h.
References ASSERT_, eps, min, and pickRandomIndex().
Page generated by Doxygen 1.8.14 for MRPT 1.5.9 Git: 690a4699f Wed Apr 15 19:29:53 2020 +0200 at miƩ abr 15 19:30:12 CEST 2020 |