基本的に私は持っています:
BruteForceMatcher<L2<float>>().knnMatch(descriptor1,descriptor2,matches,2);
良い一致のみを取得するには、すべての「一致」ベクトルを解析し、次のように距離を確認します。
if( (matches[i][0].distance / matches[i][1].distance) < ratio ){
//> Good match!
}
しかし、どういうmatches[i][0].distance
意味ですか?との間の距離matches[i][0]
?
私の推測
私が推測できることについては、最初の一致とNNとの間のユークリアン距離を計算し、次のようなしきい値でフィルター処理する方が論理的に聞こえます。
//> 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
}
}