在MATLAB和OpenCV之间提取不同的SURF特性? [英] Different SURF Features Extracted Between MATLAB and OpenCV?

查看:878
本文介绍了在MATLAB和OpenCV之间提取不同的SURF特性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在MATLAB中设计的OpenCV中实现了一个算法。我在OpenCV中为SURF特征提取器编写一个单元测试,我想将MATLAB提取的SURF特性的输出与OpenCV进行比较。

I'm implementing an algorithm in OpenCV that I've designed in MATLAB. I'm writing a unit test for the SURF feature extractor in OpenCV, and I want to compare the output of MATLAB's extracted SURF features to OpenCV.

这个问题是,使用与MATLAB和OpenCV提取器相同的参数,我得到不同数量的功能。这怎么可能?有不同的方法来实现SURF?

This issue is, using the same parameters for both MATLAB and OpenCV extractors I'm getting different numbers of features. How is this possible? Are there different ways to implement SURF?

对于MATLAB( http://www.mathworks.com/help/vision/ref/detectsurffeatures.html )我正在使用:


MetricThresh:200 < br>
NumOctaves:3

NumScaleLevels:4

SURFSize:64

For MATLAB (http://www.mathworks.com/help/vision/ref/detectsurffeatures.html) I'm using:

MetricThresh: 200
NumOctaves: 3
NumScaleLevels: 4
SURFSize: 64

对于OpenCV I 'm使用:


Hessian阈值:200

nOctaves:3

nOctaveLayers:4

extended:false

upright:true

For OpenCV I'm using:

HessianThreshold: 200
nOctaves: 3
nOctaveLayers: 4
extended: false
upright: true

这里发生了什么?有没有更好的方法来测试openCV和MATLAB是否从同一个图像生成相同的提取的SURF特征?

What's going on here? Is there a better way to test that openCV and MATLAB are producing the same extracted SURF features from the same image?

感谢您的帮助!

推荐答案

在引擎下,MATLAB使用OpenCV的一些计算机视觉功能,包括检测 SURF 功能。如果你看到 $ matlabroot / bin / $ arch 文件夹,你会发现OpenCV共享库以及网关库 ocv.dll )。

Under the hood, MATLAB uses OpenCV for some of its computer vision functions, including detecting SURF features. If you look inside the $matlabroot/bin/$arch folder, you'll find OpenCV shared libraries in addition to a gateway library ocv.dll).

事实上,两者的文档中提到了相同的参考文献,这表明算法参数在两个框架。

In fact, the same reference paper is mentioned in the documentation of both, which suggests that the algorithm parameters have the same meaning in both frameworks.


Herbert Bay,Andreas Ess,Tinne Tuytelaars,Luc Van GoolSURF:
加速稳健特性,计算机视觉和图像理解
(CVIU),Vol。 110,No. 3,pp。346--359,2008

Herbert Bay, Andreas Ess, Tinne Tuytelaars, Luc Van Gool "SURF: Speeded Up Robust Features", Computer Vision and Image Understanding (CVIU), Vol. 110, No. 3, pp. 346--359, 2008



OpenCV



OpenCV


Bay,H。和Tuytelaars,T.和Van Gool,L。SURF:Speeded Up Robust Features,第9届计算机视觉欧洲会议,2006

Bay, H. and Tuytelaars, T. and Van Gool, L. "SURF: Speeded Up Robust Features", 9th > European Conference on Computer Vision, 2006






首先,确保您在两者中使用相同的参数值,同时考虑默认值。以下是 OpenCV MATLAB 以供参考。

因此请尝试以下代码:

在MATLAB中:

>> img = [];     % some 2d grayscale image
>> pts = detectSURFFeatures(img, 'MetricThreshold',200, ...
       'NumOctaves',3, 'NumScaleLevels',4);

在C ++ OpenCV中:

In C++ OpenCV:

cv::Mat img;     // some grayscale image
cv::SURF surf(200.0, 3, 4-2, false, true);

cv::Mat mask;    // optional mask (unused here)
std::vector<cv::KeyPoint> pts;
surf(img, mask, pts);

DLLs),这可能导致与您使用的任何OpenCV版本不同的结果(最新的是现在是v2.4.6)

Other than that, MATLAB usually include an older version of OpenCV (my MATLAB R2013a ships with v2.4.2 DLLs), which could result in different results from whatever OpenCV version you are using (latest as of now is v2.4.6)

这篇关于在MATLAB和OpenCV之间提取不同的SURF特性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆