MRPT
1.9.9
|
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 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... | |
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().
|
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().
|
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().
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().
Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: c7a3bec24 Sun Mar 29 18:33:13 2020 +0200 at dom mar 29 18:50:38 CEST 2020 |