matlab - 如何结合 SURF 和 Harris 点 MATLAB

标签 matlab image-processing computer-vision feature-extraction matlab-cvst

正如我们所知,在 Matlab 中,有单独检测 Harris 或 SURF 特征的功能。然后我需要结合来自 Harris 和 SURF 的这两个特征列表,使匹配更有效。

以下是我们已知的默认程序

points_image_Harris =detectHarrisFeatures(image );
[feature_image_Harris, validpoints_image_Harris] = extractFeatures(image,  points_image_Harris ); 
indexPairs_Harris = matchFeatures(feature_template_Harris,feature_image_Harris);

但我想在进行匹配之前合并两个点列表:像这样:

points_image_Harris =detectHarrisFeatures(image );
points_image_SURF =detectSURFFeatures(image );
Points = points_image_Harris  + points_image_SURF 

然后使用点列表进行特征提取和匹配。 这个怎么做?如果他们有两种不同的类型? cornerPoints 和 SURFPoints !

我需要从 SURF 和 Harris 生成的两个特征,作为以下输出:

enter image description here

我不知道这种组合是否可行,也不知道是否有任何想法可以从两者中获得匹配的特征。

其实我想检测这些特征,然后我想从帧中获取这些像素的位置,然后计算 X 和 Y 位置之间的差异。

我也不知道如何从 SURF 和 Harris 匹配中获取特征坐标位置??

最佳答案

使用 detectHarrisFeaturesdetectSURFFeatures本质上返回一个结构,其中每个字段都包含有关在图像中检测到的兴趣点的相关信息。为了提供一个可重现的示例,让我们使用图像处理工具箱中的 cameraman.tif 图像。让我们也使用带有默认参数的两个特征检测框架:

>> im = imread('cameraman.tif');
>> harrisPoints = detectHarrisFeatures(im);
>> surfPoints = detectSURFFeatures(im);

当我们显示 harrisPoints 时,这就是我们得到的:

harrisPoints = 

  184x1 cornerPoints array with properties:

    Location: [184x2 single]
      Metric: [184x1 single]
       Count: 184

当我们显示 surfPoints 时,这就是我们得到的:

surfPoints = 

  180x1 SURFPoints array with properties:

              Scale: [180x1 single]
    SignOfLaplacian: [180x1 int8]
        Orientation: [180x1 single]
           Location: [180x2 single]
             Metric: [180x1 single]
              Count: 180

因此,harrisPointssurfPoints 都有一个名为 Location 的字段,其中包含您想要的要素的空间坐标。这将是一个 N x 2 矩阵,其中每一行都为您提供一个特征点的位置。第一列是 x 或水平坐标,第二列是 y 或垂直坐标。原点在图像的左上角,向下移动时y坐标为正。

因此,如果您想将两个特征点组合在一起,访问两个对象的 Location 字段并将它们连接在一起成为一个矩阵:

>> Points = [harrisPoints.Location; surfPoints.Location];

Points 现在应该包含一个矩阵,其中每一行都为您提供一个特征点。


我想做一个小小的说明,Harris 角点检测器只是一种兴趣点检测算法。提供给您的只是图像中有趣点的位置。 SURF 既是检测又是描述 框架,您不仅可以在其中获取兴趣点,还可以获得每个兴趣点的良好稳健描述,您可以使用该描述在其他兴趣点之间执行匹配图片。因此,如果您想将 Harris 和 SURF 结合在一起,那是不可能的,因为 Harris 不支持描述兴趣点。

关于matlab - 如何结合 SURF 和 Harris 点 MATLAB,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30437961/

相关文章:

arrays - 在matlab中读取字符数组行

matlab - 倍频程/Matlab : Difference between e^(-1*z) and exp(-1*z)

debugging - 调试时如何在matlab中记录日志?

python - 在 Python 中使用 Pillow 从图像裁剪区域

android - 了解 ImageProcessing 代码

ios - GPUImageHistogramFilter 用于提供零数据的静止图像

computer-vision - 我将如何实现用于视觉跟踪的粒子过滤器?

python-2.7 - cv2.min的功能

linux - 如何告诉 mex 链接到/usr/lib 中的 libstdc++.so.6 而不是 MATLAB 目录中的那个?

machine-learning - 检测图像中的对象所需的时间与训练图像之间有什么关系?