加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

c – OpenCV 2.42 FeatureDetector FREAK

发布时间:2020-12-16 05:19:31 所属栏目:百科 来源:网络整理
导读:我想在OpenCV 2.4.2中尝试新的FREAK. 我试图使用特征检测器的通用接口构造FREAK,但是当然不起作用.我应该如何修改代码以获得结果? #include stdio.h#include iostream#include opencvcxcore.h#include opencv2nonfreefeatures2d.hpp#include opencvhigh
我想在OpenCV 2.4.2中尝试新的FREAK.

我试图使用特征检测器的通用接口构造FREAK,但是当然不起作用.我应该如何修改代码以获得结果?

#include <stdio.h>
#include <iostream>
#include <opencvcxcore.h>
#include <opencv2nonfreefeatures2d.hpp>
#include <opencvhighgui.h>
#include <opencv2features2dfeatures2d.hpp>
#include <vector>

using namespace std;
using namespace cv;

int main(){
    Mat mat1;
    mat1 = imread("Testimg06.jpg",0);
    vector<KeyPoint> P1;
    Ptr<FeatureDetector> freakdes;
    Ptr<DescriptorExtractor> descriptorExtractor; 
    freakdes = FeatureDetector::create("FREAK"); 

    freakdes->detect(mat1,P1);

    Mat keypoint_img;

    drawKeypoints( mat1,P1,keypoint_img,Scalar::all(-1),DrawMatchesFlags::DEFAULT );
     imshow("Keypoints 1",keypoint_img );
    cvWaitKey(0);

}

解决方法

FREAK只是描述符.没有相应的特征检测器.

所以您需要将其与其中一个可用的检测器:FAST,ORB,SIFT,SURF,MSER或使用goodFeaturesToTrack功能相结合.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读