Basically I have:
BruteForceMatcher<L2<float>>().knnMatch(descriptor1,descriptor2,matches,2);
To get only good matches I parse all the "matches" vectors and check the distance like this:
if( (matches[i][0].distance / matches[i][1].distance) < ratio ){
//> Good match!
}
But what matches[i][0].distance
mean ? The distance between matches[i][0]
and ?
My supposition
For what I could guess it would sound more logic to me to calculate the euclian distance between the first match with it's NN, and filter it with a threshold, something like:
//> I calculate the distance between 2 nearest neighborhood and filter it based on thresold
foreach( matches : i) {
if ( euclianDistance( matches[i][0] , matches[i][1] ) < threshold ) {
//> good match
}
}