mirror of
https://github.com/introlab/rtabmap.git
synced 2026-10-07 02:27:47 +08:00
VWDictionary: use multi-core FLANN kNN search (#1760)
* VWDictionary: use multi-core FLANN kNN search * Add parameter with default 1 thread * Kp/FlannTreads plumbing to UI. Also added to performance tests for comparison. * fixing ci error * dump debug data for windows ci * Adding more dll debugging report windows ci * install vc2012 runtime explicitly * updated comment --------- Co-authored-by: matlabbe <[email protected]>
This commit is contained in:
co-authored by
matlabbe
parent
fb457255b7
commit
2fbbe19d70
@@ -101,6 +101,7 @@ VWDictionary::VWDictionary(const ParametersMap & parameters) :
|
||||
_incrementalDictionary(Parameters::defaultKpIncrementalDictionary()),
|
||||
_incrementalFlann(Parameters::defaultKpIncrementalFlann()),
|
||||
_rebalancingFactor(Parameters::defaultKpFlannRebalancingFactor()),
|
||||
_flannThreads(Parameters::defaultKpFlannThreads()),
|
||||
_byteToFloat(Parameters::defaultKpByteToFloat()),
|
||||
_nndrRatio(Parameters::defaultKpNndrRatio()),
|
||||
_newDictionaryPath(Parameters::defaultKpDictionaryPath()),
|
||||
@@ -130,6 +131,7 @@ void VWDictionary::parseParameters(const ParametersMap & parameters)
|
||||
Parameters::parse(parameters, Parameters::kKpSerializeWithChecksum(), _serializeWithChecksum);
|
||||
Parameters::parse(parameters, Parameters::kKpIncrementalFlann(), _incrementalFlann);
|
||||
Parameters::parse(parameters, Parameters::kKpFlannRebalancingFactor(), _rebalancingFactor);
|
||||
Parameters::parse(parameters, Parameters::kKpFlannThreads(), _flannThreads);
|
||||
bool byteToFloat = _byteToFloat;
|
||||
Parameters::parse(parameters, Parameters::kKpByteToFloat(), _byteToFloat);
|
||||
|
||||
@@ -1074,7 +1076,7 @@ std::list<int> VWDictionary::addNewWords(
|
||||
|
||||
if(isFlannStrategy(_strategy))
|
||||
{
|
||||
_flannIndex->knnSearch(descriptors, results, dists, k, KNN_CHECKS);
|
||||
_flannIndex->knnSearch(descriptors, results, dists, k, KNN_CHECKS, 0.0f, true, _flannThreads);
|
||||
}
|
||||
else if(_strategy == kNNBruteForce)
|
||||
{
|
||||
@@ -1396,7 +1398,7 @@ std::vector<int> VWDictionary::findNN(const cv::Mat & queryIn) const
|
||||
|
||||
if(isFlannStrategy(_strategy))
|
||||
{
|
||||
_flannIndex->knnSearch(query, results, dists, k, KNN_CHECKS);
|
||||
_flannIndex->knnSearch(query, results, dists, k, KNN_CHECKS, 0.0f, true, _flannThreads);
|
||||
}
|
||||
else if(_strategy == kNNBruteForce)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user