SIFT特征具有缩放、旋转特征不变性,下载了大牛的matlab版SIFT特征提取代码,解释如下:

1.调用方法:

将文件加入matlab目录后,在主程序中有两种操作:

op1:寻找图像中的Sift特征:

[csharp] view plaincopy
  1. [image, descrips, locs] = sift('scene.pgm');
  2. showkeys(image, locs);

op2:对两幅图中的SIFT特征进行匹配:

[csharp] view plaincopy
  1. match('scene.pgm','book.pgm');

由于scene和book两图中有相同的一本书,但orientation和size都不同,可以发现所得结果中Sift特征检测结果非常好。

2.代码下载地址:

<span style="vertical-align: baseline; color: rgb(19, 61, 182);"><a target=_blank target="_blank" href="http://www.cs.ubc.ca/~lowe/keypoints/" style="color: rgb(19, 61, 182); text-decoration: none; vertical-align: baseline;"><span style="font-family: 'Microsoft YaHei'; font-size: 13px;">http://www.cs.ubc.ca/~lowe/keypoints/</span></a></span>
<span style="font-family: 'Microsoft YaHei'; font-size: 13px;">3.想用自己的图片进行调用:</span>
<span style="font-family: 'Microsoft YaHei'; font-size: 13px;"></span><div class="dp-highlighter bg_csharp" style="font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px; width: 878.5625px; overflow: auto; padding-top: 1px; margin: 18px 0px !important; background-color: rgb(231, 229, 220);"><div class="bar" style="padding-left: 45px;"><div class="tools" style="padding: 3px 8px 10px 10px; font-stretch: normal; font-size: 9px; line-height: normal; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; color: silver; border-left-width: 3px; border-left-style: solid; border-left-color: rgb(108, 226, 108); background-color: rgb(248, 248, 248);"><strong>[csharp]</strong> <a target=_blank href="http://blog.csdn.net/abcjennifer/article/details/7365882#" class="ViewSource" title="view plain" style="color: rgb(160, 160, 160); text-decoration: none; border: none; padding: 1px; margin: 0px 10px 0px 0px; font-size: 9px; display: inline-block; width: 16px; height: 16px; text-indent: -2000px; background-image: url(http://static.blog.csdn.net/scripts/SyntaxHighlighter/styles/images/default/ico_plain.gif); background-attachment: initial; background-color: inherit; background-size: initial; background-origin: initial; background-clip: initial; background-position: 0% 0%; background-repeat: no-repeat;">view plain</a><a target=_blank href="http://blog.csdn.net/abcjennifer/article/details/7365882#" class="CopyToClipboard" title="copy" style="color: rgb(160, 160, 160); text-decoration: none; border: none; padding: 1px; margin: 0px 10px 0px 0px; font-size: 9px; display: inline-block; width: 16px; height: 16px; text-indent: -2000px; background-image: url(http://static.blog.csdn.net/scripts/SyntaxHighlighter/styles/images/default/ico_copy.gif); background-attachment: initial; background-color: inherit; background-size: initial; background-origin: initial; background-clip: initial; background-position: 0% 0%; background-repeat: no-repeat;">copy</a><a target=_blank href="https://code.csdn.net/snippets/135681" target="_blank" title="在CODE上查看代码片" style="color: rgb(160, 160, 160); text-decoration: none; border: none; padding: 1px; margin: 0px 10px 0px 0px; font-size: 9px; display: inline-block; width: 16px; height: 16px; background-image: none; background-attachment: initial; background-color: inherit; background-size: initial; background-origin: initial; background-clip: initial; background-position: 0% 0%; background-repeat: no-repeat;"><img src="https://code.csdn.net/assets/CODE_ico.png" width="12" height="12" alt="在CODE上查看代码片" style="border: none; max-width: 100%; position: relative; top: 1px; left: 2px;" /></a><a target=_blank href="https://code.csdn.net/snippets/135681/fork" target="_blank" title="派生到我的代码片" style="color: rgb(160, 160, 160); text-decoration: none; border: none; padding: 1px; margin: 0px 10px 0px 0px; font-size: 9px; display: inline-block; width: 16px; height: 16px; background-image: none; background-attachment: initial; background-color: inherit; background-size: initial; background-origin: initial; background-clip: initial; background-position: 0% 0%; background-repeat: no-repeat;"><img src="https://code.csdn.net/assets/ico_fork.svg" width="12" height="12" alt="派生到我的代码片" style="border: none; max-width: 100%; position: relative; top: 2px; left: 2px;" /></a><div style="position: absolute; left: 405px; top: 1050px; width: 18px; height: 18px; z-index: 99;"></div></div></div><ol start="1" class="dp-c" style="padding: 0px; border: none; color: rgb(92, 92, 92); margin: 0px 0px 1px 45px !important; background-color: rgb(255, 255, 255);"><li class="alt" style="border-style: none none none solid; border-left-width: 3px; border-left-color: rgb(108, 226, 108); list-style: decimal-leading-zero outside; color: inherit; line-height: 18px; margin: 0px !important; padding: 0px 3px 0px 10px !important;"><span style="margin: 0px; padding: 0px; border: none; color: black; background-color: inherit;"><span style="margin: 0px; padding: 0px; border: none; background-color: inherit;">i1=imread(</span><span class="string" style="margin: 0px; padding: 0px; border: none; color: blue; background-color: inherit;">'D:\Images\New\Cars\image_0001.jpg'</span><span style="margin: 0px; padding: 0px; border: none; background-color: inherit;">);  </span></span></li><li style="border-style: none none none solid; border-left-width: 3px; border-left-color: rgb(108, 226, 108); list-style: decimal-leading-zero outside; line-height: 18px; margin: 0px !important; padding: 0px 3px 0px 10px !important; background-color: rgb(248, 248, 248);"><span style="margin: 0px; padding: 0px; border: none; color: black; background-color: inherit;">i2=imread(<span class="string" style="margin: 0px; padding: 0px; border: none; color: blue; background-color: inherit;">'D:\Images\New\Cars\image_0076.jpg'</span><span style="margin: 0px; padding: 0px; border: none; background-color: inherit;">);  </span></span></li><li class="alt" style="border-style: none none none solid; border-left-width: 3px; border-left-color: rgb(108, 226, 108); list-style: decimal-leading-zero outside; color: inherit; line-height: 18px; margin: 0px !important; padding: 0px 3px 0px 10px !important;"><span style="margin: 0px; padding: 0px; border: none; color: black; background-color: inherit;">i11=rgb2gray(i1);  </span></li><li style="border-style: none none none solid; border-left-width: 3px; border-left-color: rgb(108, 226, 108); list-style: decimal-leading-zero outside; line-height: 18px; margin: 0px !important; padding: 0px 3px 0px 10px !important; background-color: rgb(248, 248, 248);"><span style="margin: 0px; padding: 0px; border: none; color: black; background-color: inherit;">i22=rgb2gray(i2);  </span></li><li class="alt" style="border-style: none none none solid; border-left-width: 3px; border-left-color: rgb(108, 226, 108); list-style: decimal-leading-zero outside; color: inherit; line-height: 18px; margin: 0px !important; padding: 0px 3px 0px 10px !important;"><span style="margin: 0px; padding: 0px; border: none; color: black; background-color: inherit;">imwrite(i11,<span class="string" style="margin: 0px; padding: 0px; border: none; color: blue; background-color: inherit;">'v1.jpg'</span><span style="margin: 0px; padding: 0px; border: none; background-color: inherit;">,</span><span class="string" style="margin: 0px; padding: 0px; border: none; color: blue; background-color: inherit;">'quality'</span><span style="margin: 0px; padding: 0px; border: none; background-color: inherit;">,80);  </span></span></li><li style="border-style: none none none solid; border-left-width: 3px; border-left-color: rgb(108, 226, 108); list-style: decimal-leading-zero outside; line-height: 18px; margin: 0px !important; padding: 0px 3px 0px 10px !important; background-color: rgb(248, 248, 248);"><span style="margin: 0px; padding: 0px; border: none; color: black; background-color: inherit;">imwrite(i22,<span class="string" style="margin: 0px; padding: 0px; border: none; color: blue; background-color: inherit;">'v2.jpg'</span><span style="margin: 0px; padding: 0px; border: none; background-color: inherit;">,</span><span class="string" style="margin: 0px; padding: 0px; border: none; color: blue; background-color: inherit;">'quality'</span><span style="margin: 0px; padding: 0px; border: none; background-color: inherit;">,80);  </span></span></li><li class="alt" style="border-style: none none none solid; border-left-width: 3px; border-left-color: rgb(108, 226, 108); list-style: decimal-leading-zero outside; color: inherit; line-height: 18px; margin: 0px !important; padding: 0px 3px 0px 10px !important;"><span style="margin: 0px; padding: 0px; border: none; color: black; background-color: inherit;">match(<span class="string" style="margin: 0px; padding: 0px; border: none; color: blue; background-color: inherit;">'v1.jpg'</span><span style="margin: 0px; padding: 0px; border: none; background-color: inherit;">,</span><span class="string" style="margin: 0px; padding: 0px; border: none; color: blue; background-color: inherit;">'v2.jpg'</span><span style="margin: 0px; padding: 0px; border: none; background-color: inherit;">);  </span></span></li></ol></div>
<span style="font-family: 'Microsoft YaHei'; font-size: 13px;">experiment results:</span>
<span style="font-family: 'Microsoft YaHei'; font-size: 13px;"><img src="http://hi.csdn.net/attachment/201203/18/0_1332039524thQs.gif" alt="" style="border: none; max-width: 100%;" />
</span>
<span style="font-family: 'Microsoft YaHei'; font-size: 13px;">scene</span>

book

compare result

EXP2:

C代码:

[cpp] view plaincopy
  1. // FeatureDetector.cpp : Defines the entry point for the console application.
  2. //
  3. #include "stdafx.h"
  4. #include "highgui.h"
  5. #include "cv.h"
  6. #include "vector"
  7. #include "opencv\cxcore.hpp"
  8. #include "iostream"
  9. #include "opencv.hpp"
  10. #include "nonfree.hpp"
  11. #include "showhelper.h"
  12. using namespace cv;
  13. using namespace std;
  14. int _tmain(int argc, _TCHAR* argv[])
  15. {
  16. //Load Image
  17. Mat c_src1 =  imread( "..\\Images\\3.jpg");
  18. Mat c_src2 = imread("..\\Images\\4.jpg");
  19. Mat src1 = imread( "..\\Images\\3.jpg", CV_LOAD_IMAGE_GRAYSCALE);
  20. Mat src2 = imread( "..\\Images\\4.jpg", CV_LOAD_IMAGE_GRAYSCALE);
  21. if( !src1.data || !src2.data )
  22. { std::cout<< " --(!) Error reading images " << std::endl; return -1; }
  23. //sift feature detect
  24. SiftFeatureDetector detector;
  25. std::vector<KeyPoint> kp1, kp2;
  26. detector.detect( src1, kp1 );
  27. detector.detect( src2, kp2 );
  28. SiftDescriptorExtractor extractor;
  29. Mat des1,des2;//descriptor
  30. extractor.compute(src1,kp1,des1);
  31. extractor.compute(src2,kp2,des2);
  32. Mat res1,res2;
  33. int drawmode = DrawMatchesFlags::DRAW_RICH_KEYPOINTS;
  34. drawKeypoints(c_src1,kp1,res1,Scalar::all(-1),drawmode);//在内存中画出特征点
  35. drawKeypoints(c_src2,kp2,res2,Scalar::all(-1),drawmode);
  36. cout<<"size of description of Img1: "<<kp1.size()<<endl;
  37. cout<<"size of description of Img2: "<<kp2.size()<<endl;
  38. BFMatcher matcher(NORM_L2);
  39. vector<DMatch> matches;
  40. matcher.match(des1,des2,matches);
  41. Mat img_match;
  42. drawMatches(src1,kp1,src2,kp2,matches,img_match);//,Scalar::all(-1),Scalar::all(-1),vector<char>(),drawmode);
  43. cout<<"number of matched points: "<<matches.size()<<endl;
  44. imshow("matches",img_match);
  45. cvWaitKey();
  46. cvDestroyAllWindows();
  47. return 0;
  48. }

Python代码:

http://blog.csdn.net/abcjennifer/article/details/7639681

关于sift的其他讲解:

http://blog.csdn.net/abcjennifer/article/details/7639681

http://blog.csdn.net/abcjennifer/article/details/7372880

http://blog.csdn.net/abcjennifer/article/details/7365882

from: http://blog.csdn.net/abcjennifer/article/details/7365882

SIFT特征提取-应用篇相关推荐

  1. SIFT特征提取算法总结

    转自:http://www.jellon.cn/index.php/archives/374 一.综述 Scale-invariant feature transform(简称SIFT)是一种图像特征 ...

  2. [转]SIFT特征提取分析

    SIFT(Scale-invariant feature transform)是一种检测局部特征的算法,该算法通过求一幅图中的特征点(interest points,or corner points) ...

  3. SIFT特征提取分析

    SIFT特征提取分析 SIFT(Scale-invariant feature transform)是一种检测局部特征的算法,该算法通过求一幅图中的特征点(interest points,or cor ...

  4. 计算机视觉——SIFT特征提取与检索

    目录 一.SIFT算法 1.1算法介绍 1.2算法特点 1.3特征检测 1.4特征匹配 二.SIFT特征提取与检索实验 2.1实验要求 2.2实验准备 2.3实验过程 2.3.1图片的SIFT特征提取 ...

  5. 计算机视觉——SIFT特征提取与检索+匹配地理标记图像+RANSAC算法

    SIFT特征提取与检索 1. SIFT算法 1.1 基本概念 1.2 SIFT算法基本原理 1.2.1 特征点 1.2.2 尺度空间 1.2.3 高斯函数 1.2.4 高斯模糊 1.2.5 高斯金字塔 ...

  6. SIFT特征提取与检测

    文章目录 一.SIFT算子介绍 二.SIFT算子特点 三.SIFT算子应用 四.SIFT特征点提取算法 五.SIFT算法特征匹配实验 六.RANSAC算法 1.算法描述 2.RANSAC算法在SIFT ...

  7. SIFT特征提取与匹配算法

    目录 SIFT尺度不变特征变换 1. SIFT方法简介 2. SIFT特征提取步骤 3. 构建尺度空间 3.1 尺度空间的概念 3.2 图像多尺度表述 3.3 尺度空间的极值检测 4. 关键点定位 4 ...

  8. SIFT特征提取和匹配

    一.sift特征原理部分: SIFT特征详解 - Brook_icv - 博客园 (cnblogs.com) sift特征提取算法_July_Zh1的博客-CSDN博客_sift特征提取算法 二.si ...

  9. 计算机视觉3 SIFT特征提取与全景图像拼接

    1.原理 检测并提取图像的特征和关键点 匹配两个图像之间的描述符 使用RANSAC算法使用我们匹配的特征向量估计单应矩阵 拼接图像 步骤一和步骤二过程是运用SIFT局部描述算子检测图像中的关键点和特征 ...

最新文章

  1. 基于 Spring Cloud 的微服务架构分析
  2. C++字符串的个人理解
  3. LeetCode 423. 从英文中重建数字(找规律)
  4. Bootstrap validation
  5. Linux命令行下播放音乐SOX
  6. 1047: 对数表 ZZULIOJ
  7. ProxySQL 入门教程
  8. steam邮箱登录教程
  9. python按文件后缀进行分类,解放生产力
  10. tensorflow 2.0 Layer定义的源码分析
  11. 唯样商城:英飞凌 —— 一文弄懂IGBT驱动
  12. java list集合包含_Java 中的集合类包括 ArrayList 、 Linke
  13. 2022年运动品牌推荐,双十一运动装备推荐
  14. EDMA - DMA QDMA 完美总结
  15. Artiifact分析HSV数据
  16. 【数据压缩】第八次作业——MPEG音频编码
  17. cocos2d-iphone之魔塔20层第二部分
  18. 饿了么多人订餐时计算费用bug(饿了么商品促销优惠金额分摊计算规则)
  19. GitHub Desktop使用简介
  20. python 爬虫框架对比_几种爬虫框架效果分析,python最好爬虫框架是哪一种?

热门文章

  1. 为什么JavaScript现在和将来都是编程语言首选?
  2. mysql登录抓包_MySQL登录验证的抓包
  3. 高并发编程-自定义简易的线程池(1),体会原理
  4. python mvc web_浅谈python_web的MVC和MTV
  5. 某些情况下安卓引入so冲突的解决
  6. Ubuntu 安装docker-engine的三种方法
  7. 如何正确运用计算机,如何正确使用电脑
  8. vscode-git中的U,M和D文件标记含义
  9. 混沌系统 matlab仿真分析
  10. matlab 神经网络ann用于分类方法