Merge the two KMeansIndexParams ctor on master

This commit is contained in:
Pierre-Emmanuel Viel 2020-08-09 21:56:21 +02:00
parent 565f14655c
commit 759c9522fd
2 changed files with 5 additions and 22 deletions

View File

@ -220,14 +220,8 @@ public:
int branching = 32,
int iterations = 11,
flann_centers_init_t centers_init = CENTERS_RANDOM,
float cb_index = 0.2 );
KMeansIndexParams(
int branching,
int iterations,
flann_centers_init_t centers_init,
float cb_index,
int trees );
float cb_index = 0.2,
int trees = 1);
};
@endcode
- **CompositeIndexParams** When using a parameters object of this type the index created

View File

@ -57,8 +57,9 @@ namespace cvflann
struct KMeansIndexParams : public IndexParams
{
void indexParams(int branching, int iterations,
flann_centers_init_t centers_init, float cb_index, int trees)
KMeansIndexParams(int branching = 32, int iterations = 11,
flann_centers_init_t centers_init = FLANN_CENTERS_RANDOM,
float cb_index = 0.2, int trees = 1 )
{
(*this)["algorithm"] = FLANN_INDEX_KMEANS;
// branching factor
@ -72,18 +73,6 @@ struct KMeansIndexParams : public IndexParams
// number of kmeans trees to search in
(*this)["trees"] = trees;
}
KMeansIndexParams(int branching = 32, int iterations = 11,
flann_centers_init_t centers_init = FLANN_CENTERS_RANDOM, float cb_index = 0.2 )
{
indexParams(branching, iterations, centers_init, cb_index, 1);
}
KMeansIndexParams(int branching, int iterations,
flann_centers_init_t centers_init, float cb_index, int trees)
{
indexParams(branching, iterations, centers_init, cb_index, trees);
}
};