Fixed build for 2.4.12 (miniflann interface changed)
This commit is contained in:
parent
467b82a120
commit
b3056ca3b7
@ -242,7 +242,11 @@ QMultiMap<int, int> Vocabulary::addWords(const cv::Mat & descriptorsIn, int obje
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
cv::flann::Index tmpIndex;
|
cv::flann::Index tmpIndex;
|
||||||
|
#if CV_MAJOR_VERSION == 2 and CV_MINOR_VERSION == 4 and CV_SUBMINOR_VERSION == 12
|
||||||
|
tmpIndex.build(notIndexedDescriptors_, cv::Mat(), cv::flann::LinearIndexParams(), Settings::getFlannDistanceType());
|
||||||
|
#else
|
||||||
tmpIndex.build(notIndexedDescriptors_, cv::flann::LinearIndexParams(), Settings::getFlannDistanceType());
|
tmpIndex.build(notIndexedDescriptors_, cv::flann::LinearIndexParams(), Settings::getFlannDistanceType());
|
||||||
|
#endif
|
||||||
tmpIndex.knnSearch(descriptors.row(i), tmpResults, tmpDists, notIndexedDescriptors_.rows>1?k:1, Settings::getFlannSearchParams());
|
tmpIndex.knnSearch(descriptors.row(i), tmpResults, tmpDists, notIndexedDescriptors_.rows>1?k:1, Settings::getFlannSearchParams());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -355,7 +359,11 @@ void Vocabulary::update()
|
|||||||
if(!indexedDescriptors_.empty() && !Settings::isBruteForceNearestNeighbor())
|
if(!indexedDescriptors_.empty() && !Settings::isBruteForceNearestNeighbor())
|
||||||
{
|
{
|
||||||
cv::flann::IndexParams * params = Settings::createFlannIndexParams();
|
cv::flann::IndexParams * params = Settings::createFlannIndexParams();
|
||||||
|
#if CV_MAJOR_VERSION == 2 and CV_MINOR_VERSION == 4 and CV_SUBMINOR_VERSION == 12
|
||||||
|
flannIndex_.build(indexedDescriptors_, cv::Mat(), *params, Settings::getFlannDistanceType());
|
||||||
|
#else
|
||||||
flannIndex_.build(indexedDescriptors_, *params, Settings::getFlannDistanceType());
|
flannIndex_.build(indexedDescriptors_, *params, Settings::getFlannDistanceType());
|
||||||
|
#endif
|
||||||
delete params;
|
delete params;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user