Trying to fix flann python wrapper issue

This commit is contained in:
Maksim Shabunin 2015-06-10 13:00:36 +03:00
parent 424c2bddb3
commit 26d9a7cd40

View File

@ -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())
{
addedDescCount += descriptors[i].rows;
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
{
CV_Assert( _descriptors.isUMat() || _descriptors.isUMatVector() || _descriptors.isMat() || _descriptors.isMatVector());
}
}