VWDictionary: Ignore kdtree strategy when RTAB-Map is not build with OpenCV nonfree module

Updated parameter LccReextract/MaxWords=600

git-svn-id: http://rtabmap.googlecode.com/svn/trunk/rtabmap@2072 f169173b-cf89-36c8-b27e-44dbe73f0c83
This commit is contained in:
matlabbe
2014-11-22 16:44:42 +00:00
parent 374ef280f2
commit a067f1369e
2 changed files with 12 additions and 3 deletions

View File

@@ -53,7 +53,7 @@ VWDictionary::VWDictionary(const ParametersMap & parameters) :
_newWordsComparedTogether(Parameters::defaultKpNewWordsComparedTogether()),
_lastWordId(0),
_flannIndex(new cv::flann::Index()),
_strategy(kNNUndef)
_strategy(kNNBruteForce)
{
this->setNNStrategy((NNStrategy)Parameters::defaultKpNNStrategy());
this->parseParameters(parameters);
@@ -222,7 +222,16 @@ void VWDictionary::setNNStrategy(NNStrategy strategy)
strategy = kNNBruteForce;
}
_strategy = strategy;
if(RTABMAP_NONFREE == 0 && strategy == kNNFlannKdTree)
{
UWARN("KdTree (%d) nearest neighbor is not available because RTAB-Map isn't built "
"with OpenCV nonfree module (KdTree only used for SURF/SIFT features). "
"NN strategy is not modified (current=%d).", (int)kNNFlannKdTree, (int)_strategy);
}
else
{
_strategy = strategy;
}
}
}