OpenCV3.0 图像匹配问题
初学OpenCV,用的是3.0版本,在学习图像特征点匹配时发现:
1.原来版本中获取特征点使用的是:
#include <opencv2/nonfree/nonfree.hpp>
int minHessian = 4;
SurfFeatureDetector detector( minHessian );
vector<KeyPoint> keyPoint1;
detector.detect( srcImage1, keyPoint1 );
但3.0中并没有这个头文件,所有没法使用SurfFeatureDetector 类
更改使用:
int minHessian = 40;
vector<KeyPoint> keypoints;
Ptr<FeatureDetector> dector = FastFeatureDetector::create(minHessian);
dector->detect(g_srcImage,keypoints);
这样貌似是可以的,但貌似算子不能超过40
但是在计算特征向量跟向量匹配的时候,原来版本给出的方法是:
#include <opencv2/features2d/features2d.hpp" >
#include<opencv2/legacy/legacy.hpp>
SurfDescriptorExtractor extractor;
Mat descriptors1, descriptors2;
extractor.compute( srcImage1, keyPoint1, descriptors1 );
BruteForceMatcher< L2<float> > matcher;
vector< DMatch > matches;
matcher.match( descriptors1, descriptors2, matches );
同样的,SDK中没有头文件legacy.hpp也没有提供相应的lib库链接,SurfDescriptorExtractor 跟BruteForceMatcher都无法调用
仿照特征点的方法做了如下更改:
Mat descriptor1,descriptor2;
DescriptorExtractor ectrcator;
ectrcator.compute(g_srcImage,keypoints_jugg1,descriptor1);
ectrcator.compute(g_dstImage,keypoints_jugg2,descriptor2);
BFMatcher matcher(NORM_L2);
vector<DMatch> matches;
matcher.match(descriptor1, descriptor2,matches);
但是运行报错,提示The function/feature is not implement() int cv::Feature2D::detectAndCompure
所有请教下3.0版本下如何正确进行图像特征点匹配操作?
1.原来版本中获取特征点使用的是:
#include <opencv2/nonfree/nonfree.hpp>
int minHessian = 4;
SurfFeatureDetector detector( minHessian );
vector<KeyPoint> keyPoint1;
detector.detect( srcImage1, keyPoint1 );
但3.0中并没有这个头文件,所有没法使用SurfFeatureDetector 类
更改使用:
int minHessian = 40;
vector<KeyPoint> keypoints;
Ptr<FeatureDetector> dector = FastFeatureDetector::create(minHessian);
dector->detect(g_srcImage,keypoints);
这样貌似是可以的,但貌似算子不能超过40
但是在计算特征向量跟向量匹配的时候,原来版本给出的方法是:
#include <opencv2/features2d/features2d.hpp" >
#include<opencv2/legacy/legacy.hpp>
SurfDescriptorExtractor extractor;
Mat descriptors1, descriptors2;
extractor.compute( srcImage1, keyPoint1, descriptors1 );
BruteForceMatcher< L2<float> > matcher;
vector< DMatch > matches;
matcher.match( descriptors1, descriptors2, matches );
同样的,SDK中没有头文件legacy.hpp也没有提供相应的lib库链接,SurfDescriptorExtractor 跟BruteForceMatcher都无法调用
仿照特征点的方法做了如下更改:
Mat descriptor1,descriptor2;
DescriptorExtractor ectrcator;
ectrcator.compute(g_srcImage,keypoints_jugg1,descriptor1);
ectrcator.compute(g_dstImage,keypoints_jugg2,descriptor2);
BFMatcher matcher(NORM_L2);
vector<DMatch> matches;
matcher.match(descriptor1, descriptor2,matches);
但是运行报错,提示The function/feature is not implement() int cv::Feature2D::detectAndCompure
所有请教下3.0版本下如何正确进行图像特征点匹配操作?
...全文
相关推荐
基于opencv的图像匹配
基于opencv的图像匹配程序,可达到亚象素
OpenCV总结3——图像拼接Stitching
之前折腾过一段时间配准发现自己写的一点都不准,最近需要进行图像的拼接,偶然的机会查到了opencv原来有拼接的库,发现opencv处理配准之外还做了许多的操作,就这个机会查找了相关的资料,同时也研究了以下他的源代码,做一个简单的总结。 Stitching 因为OpenCV已经将算法进行了高度的封装,所以用起来跟OpenGL类似,遵循了一条管线进行处理。 上图是OpenCV官方网站中提供的流程图。 从这个图中我们也能看出这是一个很复杂的过程,源代码中提到了七个部分: Features Finding an
OpenCV3.0实现SIFT特征提取+RANSAC剔除误匹配点
OpenCV3.0实现SIFT特征提取+RANSAC剔除误匹配点,首先进行提取SIFT特征点。然后再通过RANSAC剔除误匹配点
opencv_python-3.3.0+contrib-cp36-cp36m-win_amd64.whl
适用版本:python 3.6 win64。解决问题:sift不能创建的问题。其他地方30积分,这里只需要5积分。绝对能解决问题。
opencv3.0+contrib
github下载的源码,用vs2013编译的。加入了contrib模块,可以使用surf、sift等。 配置方式和官网的opencv3.0稍有不同,可以查一下相关教程。有什么问题可以留在评论区


