52 int sizeof_param,
int sizeof_model);
55 int _estimate(
void* params,
int param_c,
56 int support_limit,
int max_rounds,
59 int _refine(
void* params,
int param_c,
60 int support_limit,
int max_rounds,
61 void* model,
char *inlier_mask = NULL);
63 virtual void _doEstimate(
void** params,
int param_c,
void* model) {};
64 virtual bool _doSupports(
void* param,
void* model) {
return false; };
72 int _estimate(
int param_c,
73 int support_limit,
int max_rounds,
76 int _refine(
int param_c,
77 int support_limit,
int max_rounds,
78 void* model,
char *inlier_mask = NULL);
80 virtual void _doEstimate(
int* params,
int param_c,
void* model) {};
81 virtual bool _doSupports(
int param,
void* model) {
return false; };
98 int estimateRequiredRounds(
float success_propability,
99 float inlier_percentage);
170 template <
typename MODEL,
typename PARAMETER>
183 virtual void doEstimate(PARAMETER** params,
int param_c, MODEL* model) = 0;
196 virtual bool doSupports(PARAMETER*
param, MODEL* model) = 0;
202 doEstimate((PARAMETER**)params, param_c, (MODEL*)model);
209 return doSupports((PARAMETER*)param, (MODEL*)model);
226 :
RansacImpl(min_params, max_params, sizeof(PARAMETER), sizeof(MODEL)) {}
251 int support_limit,
int max_rounds,
253 return _estimate(params, param_c, support_limit, max_rounds, model);
275 int refine(PARAMETER* params,
int param_c,
276 int support_limit,
int max_rounds,
277 MODEL* model,
char *inlier_mask = NULL) {
278 return _refine(params, param_c, support_limit, max_rounds, model, inlier_mask);
342 template <
typename MODEL>
355 virtual void doEstimate(
int* params,
int param_c, MODEL* model) = 0;
368 virtual bool doSupports(
int param, MODEL* model) = 0;
374 doEstimate(params, param_c, (MODEL*)model);
381 return doSupports(param, (MODEL*)model);
398 :
RansacImpl(min_params, max_params, sizeof(MODEL)) {}
422 int support_limit,
int max_rounds,
424 return _estimate(param_c, support_limit, max_rounds, model);
446 int support_limit,
int max_rounds,
447 MODEL* model,
char *inlier_mask = NULL) {
448 return _refine(param_c, support_limit, max_rounds, model, inlier_mask);
455 #endif //__Ransac_h__
int refine(int param_c, int support_limit, int max_rounds, MODEL *model, char *inlier_mask=NULL)
Iteratively makes the estimated model better.
Implementation of a general RANdom SAmple Consensus algorithm with implicit parameters.
bool param(const std::string ¶m_name, T ¶m_val, const T &default_val)
virtual bool _doSupports(int param, void *model)
int estimate(int param_c, int support_limit, int max_rounds, MODEL *model)
Estimates a model from input data parameters.
IndexRansac(int min_params, int max_params)
Initialize the algorithm.
int refine(PARAMETER *params, int param_c, int support_limit, int max_rounds, MODEL *model, char *inlier_mask=NULL)
Iteratively makes the estimated model better.
int estimate(PARAMETER *params, int param_c, int support_limit, int max_rounds, MODEL *model)
Estimates a model from input data parameters.
virtual void _doEstimate(void **params, int param_c, void *model)
void _doEstimate(int *params, int param_c, void *model)
virtual void _doEstimate(int *params, int param_c, void *model)
Implementation of a general RANdom SAmple Consensus algorithm.
bool _doSupports(void *param, void *model)
Ransac(int min_params, int max_params)
Initialize the algorithm.
bool _doSupports(int param, void *model)
This file defines library export definitions, version numbers and build information.
Internal implementation of RANSAC. Please use Ransac or IndexRansac.
void _doEstimate(void **params, int param_c, void *model)