0

OpenCVでFERN記述子マッチャーを使用するには? 何らかのアルゴリズム (sift/surf?) によって抽出されたキーポイントを入力として取りますか、それともすべてを単独で計算しますか?

編集:
画像のデータベースに適用しようとしています

fernmatcher->add(all_images, all_keypoints);
fernmatcher->train();

合計 8MB 未満の 20 枚の画像があり、SURF を使用してキーポイントを抽出します。メモリ使用量は 2.6GB に跳ね上がり、トレーニングにかかる​​時間は誰にもわかりません...

4

1 に答える 1

1

FERN は他のマッチャーと違いはありません。FERN を Key point Descriptor Matcher として使用するためのサンプル コードを次に示します。

int octaves= 3;
int octaveLayers=2;
bool upright=false;
double hessianThreshold=0;
std::vector<KeyPoint> keypoints_1,keypoints_2;
SurfFeatureDetector detector1( hessianThreshold, octaves, octaveLayers, upright );
detector1.detect( image1, keypoints_1 );
detector1.detect( image2, keypoints_2 );
std::vector< DMatch > matches;
FernDescriptorMatcher matcher;
matcher.match(image1,keypoints_1,image2,keypoints_2,matches);
Mat img_matches;
drawMatches( templat_img, keypoints_1,tempimg, keypoints_2,matches,  img_matches,Scalar::all(-1), Scalar::all(-1),vector<char>(), DrawMatchesFlags::NOT_DRAW_SINGLE_POINTS);
imshow( "Fern Matches", img_matches);
waitKey(0);

*しかし、私の提案は、FERN と比較して高速な FAST を使用することです。また、FERN を使用してキーポイントを使用して一連の画像をトレーニングすることもできます。トレーニングされた FERN は、他のすべてと同様に分類器として使用できます。

于 2012-06-05T13:45:08.067 に答える