features2d: workaround for 'utrainDescCollection' issue (PR #2142)

pull/2565/head
Alexander Alekhin 11 years ago committed by Andrey Pavlenko
parent 1d9808e5d5
commit 89e3e448f5
  1. 7
      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<flann::Index>( mergedDescriptors.getDescriptors(), *indexParams );
}

Loading…
Cancel
Save