From 89e3e448f58ebff525888ed97f6b7f7768ab567f Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Wed, 12 Mar 2014 15:54:55 +0400 Subject: [PATCH] features2d: workaround for 'utrainDescCollection' issue (PR #2142) --- modules/features2d/src/matchers.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/features2d/src/matchers.cpp b/modules/features2d/src/matchers.cpp index 6bc925f..91ee9d9 100644 --- a/modules/features2d/src/matchers.cpp +++ b/modules/features2d/src/matchers.cpp @@ -1232,6 +1232,13 @@ void FlannBasedMatcher::train() { if( !flannIndex || mergedDescriptors.size() < addedDescCount ) { + // FIXIT: Workaround for 'utrainDescCollection' issue (PR #2142) + if (!utrainDescCollection.empty()) + { + CV_Assert(trainDescCollection.size() == 0); + for (size_t i = 0; i < utrainDescCollection.size(); ++i) + trainDescCollection.push_back(utrainDescCollection[i].getMat(ACCESS_READ)); + } mergedDescriptors.set( trainDescCollection ); flannIndex = makePtr( mergedDescriptors.getDescriptors(), *indexParams ); } -- 2.7.4