Trying to fix flann python wrapper issue

pull/4111/head
Maksim Shabunin 10 years ago
parent 424c2bddb3
commit 26d9a7cd40
  1. 25
      modules/features2d/src/matchers.cpp

@ -1022,12 +1022,27 @@ FlannBasedMatcher::FlannBasedMatcher( const Ptr<flann::IndexParams>& _indexParam
void FlannBasedMatcher::add( InputArrayOfArrays _descriptors )
{
DescriptorMatcher::add( _descriptors );
std::vector<UMat> descriptors;
_descriptors.getUMatVector(descriptors);
for( size_t i = 0; i < descriptors.size(); i++ )
if(_descriptors.isUMatVector() || _descriptors.isUMat())
{
std::vector<UMat> descriptors;
_descriptors.getUMatVector(descriptors);
for( size_t i = 0; i < descriptors.size(); i++ )
{
addedDescCount += descriptors[i].rows;
}
}
else if(_descriptors.isMatVector() || _descriptors.isMat())
{
std::vector<Mat> descriptors;
_descriptors.getMatVector(descriptors);
for( size_t i = 0; i < descriptors.size(); i++ )
{
addedDescCount += descriptors[i].rows;
}
}
else
{
addedDescCount += descriptors[i].rows;
CV_Assert( _descriptors.isUMat() || _descriptors.isUMatVector() || _descriptors.isMat() || _descriptors.isMatVector());
}
}

Loading…
Cancel
Save