2012-03-29 113 views
2

我想提取FAST功能,基于从检测器继承,也可以交换了Features2D + Homography to find a known object如何从图像中提取FAST特征?

SurfFeatureDetector detector(minHessian); 

    std::vector<KeyPoint> keypoints_object, keypoints_scene; 

    detector.detect(img_object, keypoints_object); 
    detector.detect(img_scene, keypoints_scene); 

    //-- Step 2: Calculate descriptors (feature vectors) 
    SurfDescriptorExtractor extractor; 

的类SurfFeatureDetector和FastFeatureDetector。但我找不到SurfDescriptorExtractor的匹配类,我希望找到类似FastDescriptorExtractor的类,但是像这样的类不可用。看起来很奇怪的是,如果我只将检测器更改为FastFeatureDetector,该示例似乎可以正常工作。

我的问题是:上述顺序应该如何适用于快速功能?

回答

8

据我所知,OpenCV中没有FAST特征提取器。 与SURF不同,SURF可用于特征检测和特征向量计算,FAST主要用于检测特征点。得到特征点后,您需要使用其他特征提取器来生成特征向量并进行匹配。 或者,如果您担心速度问题,在OpenCV 2.3中引入了ORB功能,实际上它使用多尺度FAST(加上一些Harris角点测量)作为其检测器。用法与SURF类似:

OrbFeatureDetector detector(n_features); 

OrbDescriptorExtractor extractor(patch_size); 

您需要将示例中的匹配器更改为某个基于汉明距离的匹配器。希望这可以帮助。

+0

谢谢,请您加上参考文献 – stacker 2012-03-30 05:54:17

+0

以下是原文:http://www.willowgarage.com/sites/default/files/orb_final.pdf。这里是ORB功能的文档:http://opencv.itseez.com/modules/features2d/doc/feature_detection_and_description.html#orb – cxyzs7 2012-03-31 03:47:43

+1

根据示例代码替换的行是'// FlannBasedMatcher匹配器;'更改为' BruteForceMatcher 匹配器;' – stacker 2012-04-03 06:15:18