fixed FernDescriptorMatcher (#765)

This commit is contained in:
Maria Dimashova
2011-01-12 12:03:03 +00:00
parent 4dfbf99dd5
commit 96d88f0673
2 changed files with 15 additions and 14 deletions

View File

@@ -2151,14 +2151,14 @@ inline void BruteForceMatcher<Distance>::commonKnnMatchImpl( BruteForceMatcher<D
bestMatch.distance = std::numeric_limits<float>::max();
for( size_t iIdx = 0; iIdx < imgCount; iIdx++ )
{
if( !allDists[iIdx].empty() )
{
double minVal;
Point minLoc;
minMaxLoc( allDists[iIdx], &minVal, 0, &minLoc, 0 );
if( minVal < bestMatch.distance )
bestMatch = DMatch( qIdx, minLoc.x, (int)iIdx, (float)minVal );
}
if( !allDists[iIdx].empty() )
{
double minVal;
Point minLoc;
minMaxLoc( allDists[iIdx], &minVal, 0, &minLoc, 0 );
if( minVal < bestMatch.distance )
bestMatch = DMatch( qIdx, minLoc.x, (int)iIdx, (float)minVal );
}
}
if( bestMatch.trainIdx == -1 )
break;