Merge pull request #17735 from pemmanuelviel:pev-fix-trees-descent
* Fix trees parsing behavior in hierarchical_clustering_index: Before, when maxCheck was reached in the first descent of a tree, time was still wasted parsing the next trees till their best leaf, just to skip the points stored there. Now we can choose either to keep this behavior, and so we skip parsing other trees after reaching maxCheck, or we choose to do one descent in each tree, even if in one tree we reach maxCheck. * Apply the same change to kdtree. As each leaf contains only 1 point (unlike hierarchical_clustering), difference is visible if trees > maxCheck * Add the new explore_all_trees parameters to miniflann * Adapt the FlannBasedMatcher read_write test to the additional search parameter * Adapt java tests to the additional parameter in SearchParams * Fix the ABI dumps failure on SearchParams interface change * Support of ctor calling another ctor of the class is only fully supported from C+11
This commit is contained in:
@@ -294,6 +294,23 @@ SavedIndexParams::SavedIndexParams(const String& _filename)
|
||||
p["filename"] = filename;
|
||||
}
|
||||
|
||||
SearchParams::SearchParams( int checks, float eps, bool sorted, bool explore_all_trees )
|
||||
{
|
||||
::cvflann::IndexParams& p = get_params(*this);
|
||||
|
||||
// how many leafs to visit when searching for neighbours (-1 for unlimited)
|
||||
p["checks"] = checks;
|
||||
// search for eps-approximate neighbours (default: 0)
|
||||
p["eps"] = eps;
|
||||
// only for radius search, require neighbours sorted by distance (default: true)
|
||||
p["sorted"] = sorted;
|
||||
// if false, search stops at the tree reaching the number of max checks (original behavior).
|
||||
// When true, we do a descent in each tree and. Like before the alternative paths
|
||||
// stored in the heap are not be processed further when max checks is reached.
|
||||
p["explore_all_trees"] = explore_all_trees;
|
||||
}
|
||||
|
||||
|
||||
SearchParams::SearchParams( int checks, float eps, bool sorted )
|
||||
{
|
||||
::cvflann::IndexParams& p = get_params(*this);
|
||||
@@ -304,6 +321,10 @@ SearchParams::SearchParams( int checks, float eps, bool sorted )
|
||||
p["eps"] = eps;
|
||||
// only for radius search, require neighbours sorted by distance (default: true)
|
||||
p["sorted"] = sorted;
|
||||
// if false, search stops at the tree reaching the number of max checks (original behavior).
|
||||
// When true, we do a descent in each tree and. Like before the alternative paths
|
||||
// stored in the heap are not be processed further when max checks is reached.
|
||||
p["explore_all_trees"] = false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user