FernDescriptorMatch - 如何使用它?这个怎么运作?

时间:2012-06-05 08:14:19

标签: image-processing opencv machine-learning pattern-matching computer-vision

如何在OpenCV中使用FERN描述符匹配器?它是否作为一些algrithm(sift / surf?)提取的输入关键点,或者它自己计算所有内容?

编辑:
我正在尝试将它应用于图像数据库

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

有20张图片,总共小于8MB,我使用SURF提取关键点。内存使用量跃升至2.6GB,培训需要知道多长时间......

1 个答案:

答案 0 :(得分:1)

FERN与其他竞争者没有什么不同。下面是使用FERN作为关键点描述符匹配器的示例代码。

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);

* 但是我的建议是使用FAST,与FERN相比更快,FERN也可用于训练一组带关键点的图像,训练好的FERN可以像其他一样用作分类器。