30 #ifndef OPENCV_FLANN_PARAMS_H_
31 #define OPENCV_FLANN_PARAMS_H_
46 struct SearchParams :
public IndexParams
48 SearchParams(
int checks = 32,
float eps = 0,
bool sorted =
true )
50 init(checks,
eps, sorted,
false);
53 SearchParams(
int checks,
float eps,
bool sorted,
bool explore_all_trees )
55 init(checks,
eps, sorted, explore_all_trees);
58 void init(
int checks = 32,
float eps = 0,
bool sorted =
true,
bool explore_all_trees =
false )
61 (*this)[
"checks"] = checks;
65 (*this)[
"sorted"] = sorted;
69 (*this)[
"explore_all_trees"] = explore_all_trees;
75 T get_param(
const IndexParams& params,
const cv::String& name,
const T& default_value)
77 IndexParams::const_iterator it = params.find(name);
78 if (it != params.end()) {
80 return it->second.cast<
T>();
83 (
"FLANN '%s' param type mismatch: %s", name.
c_str(), e.
what()));
92 T get_param(
const IndexParams& params,
const cv::String& name)
94 IndexParams::const_iterator it = params.find(name);
95 if (it != params.end()) {
97 return it->second.cast<
T>();
100 (
"FLANN '%s' param type mismatch: %s", name.
c_str(), e.
what()));
108 inline void print_params(
const IndexParams& params,
std::ostream& stream)
110 IndexParams::const_iterator it;
112 for(it=params.begin(); it!=params.end(); ++it) {
113 stream << it->first <<
" : " << it->second <<
std::endl;
117 inline void print_params(
const IndexParams& params)
InputArrayOfArrays InputArrayOfArrays InputOutputArray InputOutputArray InputOutputArray InputOutputArray Size InputOutputArray InputOutputArray T
Definition: calib3d.hpp:1867
#define CV_Error_(code, args)
Call the error handler.
Definition: base.hpp:334
int CvMemStorage int double eps
Definition: imgproc_c.h:493
@ StsBadArg
function arg/param is bad
Definition: base.hpp:74