Exposed HierarchicalClusteringIndex in OpenCV wrapper
This commit is contained in:
@@ -137,6 +137,7 @@ enum flann_distance_t
|
||||
FLANN_DIST_CS = 7,
|
||||
FLANN_DIST_KULLBACK_LEIBLER = 8,
|
||||
FLANN_DIST_KL = 8,
|
||||
FLANN_DIST_HAMMING = 9,
|
||||
|
||||
// deprecated constants, should use the FLANN_DIST_* ones instead
|
||||
EUCLIDEAN = 1,
|
||||
|
@@ -619,13 +619,13 @@ private:
|
||||
if (checks>=maxChecks) {
|
||||
if (result.full()) return;
|
||||
}
|
||||
checks += node->size;
|
||||
for (int i=0; i<node->size; ++i) {
|
||||
int index = node->indices[i];
|
||||
if (!checked[index]) {
|
||||
DistanceType dist = distance(dataset[index], vec, veclen_);
|
||||
result.addPoint(dist, index);
|
||||
checked[index] = true;
|
||||
++checks;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -100,6 +100,12 @@ struct CV_EXPORTS AutotunedIndexParams : public IndexParams
|
||||
float memory_weight = 0, float sample_fraction = 0.1);
|
||||
};
|
||||
|
||||
struct CV_EXPORTS HierarchicalClusteringIndexParams : public IndexParams
|
||||
{
|
||||
HierarchicalClusteringIndexParams(int branching = 32,
|
||||
cvflann::flann_centers_init_t centers_init = cvflann::FLANN_CENTERS_RANDOM, int trees = 4, int leaf_size = 100 );
|
||||
};
|
||||
|
||||
struct CV_EXPORTS KMeansIndexParams : public IndexParams
|
||||
{
|
||||
KMeansIndexParams(int branching = 32, int iterations = 11,
|
||||
|
Reference in New Issue
Block a user