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
std::map< int,int > _mapIdIndex
int _totalActiveReferences
void setLastWordId(int id)
float getNndrRatio() const
bool isIncrementalFlann() const
bool _newWordsComparedTogether
bool _incrementalDictionary
static std::string nnStrategyName(NNStrategy strategy)
std::map< int,int > _mapIndexId
std::set< int > _notIndexedWords
std::map< int, VisualWord * > _unusedWords
std::string _newDictionaryPath
std::set< int > _removedIndexedWords
static const int ID_START
unsigned int getNotIndexedWordsCount() const
unsigned int getUnusedWordsSize() const
static const int ID_INVALID
int getTotalActiveReferences() const
bool isIncremental() const
std::string _dictionaryPath
const std::map< int, VisualWord * > & getVisualWords() const
std::map< int, VisualWord * > _visualWords