2

OpenCV の SIFT 記述子抽出の実装を掘り下げていました。興味のあるポイントの近隣の半径を取得するための不可解なコードに出くわしました。以下は、変数名がよりわかりやすいように変更された、注釈付きのコードです。

// keep octave below 256 (255 is 1111 1111)
int octave = kpt.octave & 255;
// if octave is >= 128, ...????
octave = octave < 128 ? octave : (-128 | octave);
// 1/2^absval(octave)
float scale = octave >= 0 ? 1.0f/(1 << octave) : (float)(1 << -octave);
// multiply the point's radius by the calculated scale
float scl = kpt.size * 0.5f * scale;
// the constant sclFactor is 3 and has the following comment:
// determines the size of a single descriptor orientation histogram
float histWidth = sclFactor * scl;
// descWidth is the number of histograms on one side of the descriptor
// the long float is sqrt(2)
int radius = (int)(histWidth * 1.4142135623730951f * (descWidth + 1) * 0.5f);

これは、関心点が取得されたスケールへの変換と関係があることを理解しています (Lowe の論文を読んだことがあります) が、ドットをコードに接続することはできません。具体的には、最初の 3 行と最後の行がわかりません。

モーション用の同様のローカル ポイント記述子を作成するには、これを理解する必要があります。

4

1 に答える 1