Set cv::NORM_L2SQR for bruteforce NN with float descriptors, installing rtabmap-console

This commit is contained in:
Mathieu Labbe
2014-12-04 11:47:25 -05:00
parent fb4006170c
commit 4b8176a0ba
3 changed files with 39 additions and 8 deletions

View File

@@ -456,7 +456,7 @@ std::list<int> VWDictionary::addNewWords(const cv::Mat & descriptors,
else if(_strategy == kNNBruteForce)
{
bruteForce = true;
cv::BFMatcher matcher(type==CV_8U?cv::NORM_HAMMING:cv::NORM_L2);
cv::BFMatcher matcher(type==CV_8U?cv::NORM_HAMMING:cv::NORM_L2SQR);
matcher.knnMatch(descriptors, _dataTree, matches, k);
}
else if(_strategy == kNNBruteForceGPU)
@@ -671,7 +671,7 @@ std::vector<int> VWDictionary::findNN(const std::list<VisualWord *> & vws) const
else if(_strategy == kNNBruteForce)
{
bruteForce = true;
cv::BFMatcher matcher(type==CV_8U?cv::NORM_HAMMING:cv::NORM_L2);
cv::BFMatcher matcher(type==CV_8U?cv::NORM_HAMMING:cv::NORM_L2SQR);
matcher.knnMatch(query, _dataTree, matches, k);
}
else if(_strategy == kNNBruteForceGPU)