3

基本的に私は持っています:

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
 }
}
4

1 に答える 1

4

記述子- N 次元空間の点です。

match - 記述子のペアです。1 つは最初のセットから、もう 1 つは 2 番目のセットからのものです (トレーニングおよびクエリセットとも呼ばれます)。

距離-構造体L2が指す 2 つの記述子のメトリックですmatch。(メトリックのタイプを のテンプレート パラメータとして指定していますBruteForceMatcher)。

match[i][0].distance = L2(descriptor1.row(match[i][0].trainIdx),
                          descriptor2.row(match[i][0].queryIdx))

Soは、トレーニングセットのすべての記述子について、クエリknnMatchセットから最も近い 2 つの記述子を返します。次に、見つかった 2 つの記述子が互いに近いケースを除外します。

于 2012-06-24T10:00:22.487 に答える