• Matlab图像处理学习笔记(七):surf特征点


    本文主要演示如何使用matlab自带的Computer Vision System Toolbox这个工具箱进行suft特征点的检测、匹配及显示。这个工具箱是matlab2012b及之后才有的一个工具箱,如果你的版本较低,建议你更新较新版本。

    转载请注明出处:http://blog.csdn.net/u010278305点击打开链接

    suft特征点是Speeded-Up Robust Features的简称,相比于sift特征点,速度更快。

    本文涉及到的知识点如下:

    1、suft特征点。

    2、matlab的Computer Vision System Toolbox工具箱。

    程序流程如下:

    1、读取图像,转为灰度图。

    2、寻找surf特征点。

    3、根据特征点计算描述向量。

    4、进行匹配。

    5、绘制匹配结果。

    matlab源代码如下:

    %function:
    %       surf特征点检测与匹配
    %注意:
    %       本例程主要演示如何用matlab自带的Computer Vision System Toolbox进行surf特征点的提取与匹配
    %date:2015-1-13
    %author:chenyanan
    %转载请注明出处:http://blog.csdn.net/u010278305
    
    %清空变量,读取图像
    clear;close all
    
    %Read the two images.
    I1= imread('images/girl.jpg');
    I1=imresize(I1,0.5);
    I1=rgb2gray(I1);
    I2= imread('images/head.jpg');
    I2=imresize(I2,0.5);
    I2=rgb2gray(I2);
    
    %Find the SURF features.寻找特征点
    points1 = detectSURFFeatures(I1);
    points2 = detectSURFFeatures(I2); 
    
    %Extract the features.计算描述向量
    [f1, vpts1] = extractFeatures(I1, points1);
    [f2, vpts2] = extractFeatures(I2, points2);
    
    %Retrieve the locations of matched points. The SURF feature vectors are already normalized.
    %进行匹配
    indexPairs = matchFeatures(f1, f2, 'Prenormalized', true) ;
    matched_pts1 = vpts1(indexPairs(:, 1));
    matched_pts2 = vpts2(indexPairs(:, 2));
    
    %Display the matching points. The data still includes several outliers, 
    %but you can see the effects of rotation and scaling on the display of matched features.
    %对匹配结果进行显示,可以看到,还有一些异常值
    figure('name','result'); showMatchedFeatures(I1,I2,matched_pts1,matched_pts2);
    legend('matched points 1','matched points 2');
    

    程序运行效果如下:


    测试原文件可在之前的笔记中找到。

    转载请注明出处:http://blog.csdn.net/u010278305点击打开链接


  • 相关阅读:
    201920201学期 20192410《网络空间安全专业导论》第一周学习总结
    201920201学期 20192410《网络空间安全专业导论》第二周学习总结
    Oracle trunc()函数的用法
    20130528
    让ListBox控件支持拖动
    幸福是什么
    实例解析C++/CLI程序进程之间的通讯
    Boost源码剖析之:容器赋值assign
    VC++ MFC 多线程及线程同步
    MFC下窗口分割和文字输出的实现
  • 原文地址:https://www.cnblogs.com/chenyn2014/p/4222671.html
Copyright © 2020-2023  润新知