43
#ifndef OPENCV_MINIFLANN_HPP
44
#define OPENCV_MINIFLANN_HPP
48
#include "opencv2/core.hpp"
49
#include "opencv2/flann/defines.h"
58
FLANN_INDEX_TYPE_8U = CV_8U,
59
FLANN_INDEX_TYPE_8S = CV_8S,
60
FLANN_INDEX_TYPE_16U = CV_16U,
61
FLANN_INDEX_TYPE_16S = CV_16S,
62
FLANN_INDEX_TYPE_32S = CV_32S,
63
FLANN_INDEX_TYPE_32F = CV_32F,
64
FLANN_INDEX_TYPE_64F = CV_64F,
65
FLANN_INDEX_TYPE_STRING,
66
FLANN_INDEX_TYPE_BOOL,
67
FLANN_INDEX_TYPE_ALGORITHM,
68
LAST_VALUE_FLANN_INDEX_TYPE = FLANN_INDEX_TYPE_ALGORITHM
71
struct
CV_EXPORTS IndexParams
76
String getString(
const
String& key,
const
String& defaultVal=String())
const;
77
int
getInt(
const
String& key,
int
defaultVal=-1)
const;
78
double
getDouble(
const
String& key,
double
defaultVal=-1)
const;
80
void
setString(
const
String& key,
const
String& value);
81
void
setInt(
const
String& key,
int
value);
82
void
setDouble(
const
String& key,
double
value);
83
void
setFloat(
const
String& key,
float
value);
84
void
setBool(
const
String& key,
bool
value);
85
void
setAlgorithm(
int
value);
88
void
getAll(std::vector<String>& names,
89
std::vector<FlannIndexType>& types,
90
std::vector<String>& strValues,
91
std::vector<double>& numValues)
const;
96
IndexParams(
const
IndexParams &);
97
IndexParams& operator=(
const
IndexParams &);
100
struct
CV_EXPORTS KDTreeIndexParams :
public
IndexParams
102
KDTreeIndexParams(
int
trees=4);
105
struct
CV_EXPORTS LinearIndexParams :
public
IndexParams
110
struct
CV_EXPORTS CompositeIndexParams :
public
IndexParams
112
CompositeIndexParams(
int
trees = 4,
int
branching = 32,
int
iterations = 11,
113
cvflann::flann_centers_init_t centers_init = cvflann::FLANN_CENTERS_RANDOM,
float
cb_index = 0.2f );
116
struct
CV_EXPORTS AutotunedIndexParams :
public
IndexParams
118
AutotunedIndexParams(
float
target_precision = 0.8f,
float
build_weight = 0.01f,
119
float
memory_weight = 0,
float
sample_fraction = 0.1f);
122
struct
CV_EXPORTS HierarchicalClusteringIndexParams :
public
IndexParams
124
HierarchicalClusteringIndexParams(
int
branching = 32,
125
cvflann::flann_centers_init_t centers_init = cvflann::FLANN_CENTERS_RANDOM,
int
trees = 4,
int
leaf_size = 100 );
128
struct
CV_EXPORTS KMeansIndexParams :
public
IndexParams
130
KMeansIndexParams(
int
branching = 32,
int
iterations = 11,
131
cvflann::flann_centers_init_t centers_init = cvflann::FLANN_CENTERS_RANDOM,
float
cb_index = 0.2f );
134
struct
CV_EXPORTS LshIndexParams :
public
IndexParams
136
LshIndexParams(
int
table_number,
int
key_size,
int
multi_probe_level);
139
struct
CV_EXPORTS SavedIndexParams :
public
IndexParams
141
SavedIndexParams(
const
String& filename);
144
struct
CV_EXPORTS SearchParams :
public
IndexParams
146
SearchParams(
int
checks,
float
eps,
bool
sorted,
bool
explore_all_trees );
147
SearchParams(
int
checks = 32,
float
eps = 0,
bool
sorted =
true
);
150
class
CV_EXPORTS_W Index
154
CV_WRAP Index(InputArray features,
const
IndexParams& params, cvflann::flann_distance_t distType=cvflann::FLANN_DIST_L2);
157
CV_WRAP
virtual
void
build(InputArray features,
const
IndexParams& params, cvflann::flann_distance_t distType=cvflann::FLANN_DIST_L2);
158
CV_WRAP
virtual
void
knnSearch(InputArray query, OutputArray indices,
159
OutputArray dists,
int
knn,
const
SearchParams& params=SearchParams());
161
CV_WRAP
virtual
int
radiusSearch(InputArray query, OutputArray indices,
162
OutputArray dists,
double
radius,
int
maxResults,
163
const
SearchParams& params=SearchParams());
165
CV_WRAP
virtual
void
save(
const
String& filename)
const;
166
CV_WRAP
virtual
bool
load(InputArray features,
const
String& filename);
167
CV_WRAP
virtual
void
release();
168
CV_WRAP cvflann::flann_distance_t getDistance()
const;
169
CV_WRAP cvflann::flann_algorithm_t getAlgorithm()
const;
172
bool
load_(
const
String& filename);
174
cvflann::flann_distance_t distType;
175
cvflann::flann_algorithm_t algo;
"black box" representation of the file storage associated with a file on disk.
Definition:
aruco.hpp:75