32 #include <opencv2/highgui/highgui.hpp> 33 #include <opencv2/core/core.hpp> 34 #include <opencv2/features2d/features2d.hpp> 64 return "FLANN KD-TREE";
69 case kNNBruteForceGPU:
70 return "BRUTE FORCE GPU";
80 virtual void parseParameters(
const ParametersMap & parameters);
82 virtual void update();
84 virtual std::list<int> addNewWords(
85 const cv::Mat & descriptors,
89 std::vector<int> findNN(
const std::list<VisualWord *> & vws)
const;
90 std::vector<int> findNN(
const cv::Mat & descriptors)
const;
92 void addWordRef(
int wordId,
int signatureId);
93 void removeAllWordRef(
int wordId,
int signatureId);
97 const std::map<int, VisualWord *> &
getVisualWords()
const {
return _visualWords;}
100 int getLastIndexedWordId()
const;
102 unsigned int getIndexedWordsCount()
const;
103 unsigned int getIndexMemoryUsed()
const;
104 unsigned long getMemoryUsed()
const;
108 void setIncrementalDictionary();
109 void setFixedDictionary(
const std::string & dictionaryPath);
111 void exportDictionary(
const char * fileNameReferences,
const char * fileNameDescriptors)
const;
113 void clear(
bool printWarningsIfNotEmpty =
true);
114 std::vector<VisualWord *> getUnusedWords()
const;
115 std::vector<int> getUnusedWordIds()
const;
117 void removeWords(
const std::vector<VisualWord*> & words);
118 void deleteUnusedWords();
121 static cv::Mat convertBinTo32F(
const cv::Mat & descriptorsIn,
bool byteToFloat =
true);
122 static cv::Mat convert32FToBin(
const cv::Mat & descriptorsIn,
bool byteToFloat =
true);
std::map< std::string, std::string > ParametersMap
const std::map< int, VisualWord * > & getVisualWords() const
unsigned int getUnusedWordsSize() const
bool isIncremental() const
std::map< int,int > _mapIdIndex
bool isIncrementalFlann() const
int _totalActiveReferences
void setLastWordId(int id)
bool _newWordsComparedTogether
bool _incrementalDictionary
static std::string nnStrategyName(NNStrategy strategy)
std::map< int,int > _mapIndexId
int getTotalActiveReferences() const
unsigned int getNotIndexedWordsCount() const
std::set< int > _notIndexedWords
std::map< int, VisualWord * > _unusedWords
std::string _newDictionaryPath
std::set< int > _removedIndexedWords
static const int ID_START
float getNndrRatio() const
static const int ID_INVALID
std::string _dictionaryPath
std::map< int, VisualWord * > _visualWords