VWDictionary: changed miniflann to flann directly so version 1.8 can be used. Added parameter "Kp/IncrementalFlann"

This commit is contained in:
matlabbe
2015-09-09 00:58:45 -04:00
parent 5dcbb66a6d
commit c107436e85
12 changed files with 471 additions and 98 deletions

View File

@@ -205,6 +205,7 @@ class RTABMAP_EXP Parameters
// KeypointMemory (Keypoint-based)
RTABMAP_PARAM_COND(Kp, NNStrategy, int, RTABMAP_NONFREE, 1, 3, "kNNFlannNaive=0, kNNFlannKdTree=1, kNNFlannLSH=2, kNNBruteForce=3, kNNBruteForceGPU=4");
RTABMAP_PARAM(Kp, IncrementalDictionary, bool, true, "");
RTABMAP_PARAM(Kp, IncrementalFlann, bool, false, "When using FLANN based strategy, add/remove points to its index without always rebuilding the index (the index is built only when the dictionary doubles in size).");
RTABMAP_PARAM(Kp, MaxDepth, float, 0.0, "Filter extracted keypoints by depth (0=inf)");
RTABMAP_PARAM(Kp, WordsPerImage, int, 400, "");
RTABMAP_PARAM(Kp, BadSignRatio, float, 0.2, "Bad signature ratio (less than Ratio x AverageWordsPerImage = bad).");

View File

@@ -41,6 +41,7 @@ namespace rtabmap
class DBDriver;
class VisualWord;
class FlannIndex;
class RTABMAP_EXP VWDictionary
{
@@ -97,14 +98,16 @@ protected:
private:
bool _incrementalDictionary;
bool _incrementalFlann;
float _nndrRatio;
std::string _dictionaryPath; // a pre-computed dictionary (.txt)
bool _newWordsComparedTogether;
int _lastWordId;
cv::flann::Index * _flannIndex;
FlannIndex * _flannIndex;
cv::Mat _dataTree;
NNStrategy _strategy;
std::map<int ,int> _mapIndexId;
std::map<int ,int> _mapIdIndex;
std::map<int, VisualWord*> _unusedWords; //<id,VisualWord*>, note that these words stay in _visualWords
std::set<int> _notIndexedWords; // Words that are not indexed in the dictionary
std::set<int> _removedIndexedWords; // Words not anymore in the dictionary but still indexed in the dictionary