SURF算法matlab实现
来源:互联网 发布:java webservice传xml 编辑:程序博客网 时间:2024/05/14 18:08
detectSURFFeatures
用法:
points = detectSURFFeatures(I) %I是输入的灰度图像,返回值是一个 SURFPoints类,这个SURFPoints类包含了一些从这个灰度图像中提取的一些特征points = detectSURFFeatures(I,Name,Value)
SURFPoints 这个类型
属性
- cout : 计算这个物体所拥有点的数量
- Location:定位这个点
- scale:确定这个兴趣点的取值范围
- length:长度
在这个地方我特有一些疑问,属性和方法事有区别的,方法中可以限制一些参数
属性和方法的区别:
如果非要说一些区别的话:我尝试了一下:就是说属性和方法一个,属性是有默认值的,方法是不能加任何默认值的。
extractFeatures
用法:
[features,validPoints] = extractFeatures(I,points);%这里的points就是刚刚detectSURFFeatures函数的返回值, I 就是输入的灰度图像feature作为匹配函数的输入值[features,validPoints] = extractFeatures(I,points,Name,Value)
用这个函数来提取刚刚选中的特征点:
这里的特征点只能是用这几种方法提取出的特征点:
这里point只能由下面的值来弄
matchFeatures
用法:
indexPairs = matchFeatures(features1,features2);[indexPairs,matchmetric] = matchFeatures(features1,features2);[indexPairs,matchmetric] = matchFeatures(features1,features2,Name,Value);
indexPairs 是返回的两幅图像匹配的指标%这个地方可以将他的返回值进行截图features1就是上面extractFeatures函数的返回值中validpoints,然后只用输入想要配对的两张图片就可以了
showMatchedFeatures
用法:
showMatchedFeatures(I1,I2,matchedPoints1,matchedPoints2)showMatchedFeatures(I1,I2,matchedPoints1,matchedPoints2,method)% I1 和 I2就是需要匹配的两个函数
这里有三种方法,第一种,假彩图像,混合图像和拼接图
最后整体拼接后的图像:
clc%读取图像I1= imread('D:\matlab 2015b\workspace\source\1.jpg'); I1=imresize(I1,0.6); %imresize 将原来的图像缩小原来的一般I1=rgb2gray(I1); %把RGB图像变成灰度图像figureimshow(I1)I2= imread('D:\matlab 2015b\workspace\source\2.jpg'); I2=imresize(I2,0.6); I2=rgb2gray(I2);figureimshow(I2)%寻找特征点 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)); %显示匹配figure('name','匹配后的图像'); showMatchedFeatures(I1,I2,matched_pts1,matched_pts2,'montage'); %总共找了39个特征点legend('matched points 1','matched points 2');
这个程序基本就是把MATLAB中示例程序跑了一遍
示例图片:
2 0
- SURF算法matlab实现
- 物体检测SURF算法matlab实现
- SURF配准差分算法实现
- matlab surf
- 在VS2010下实现的surf算法
- Surf算法原理及openCV代码实现
- Surf与flann 算法代码实现
- Opencv vs2010实现SURF简单算法
- surf算法
- surf算法
- surf算法
- SURF算法
- SURF算法
- SURF算法
- Surf算法
- Surf算法
- matlab surf mesh contour
- surf三维画图[matlab]
- Nginx介绍及Nginx的优点
- POJ 2676 Sudoku
- python代码很长,怎样阅读和调试
- Python实现冒泡排序算法
- Leetcode刷题记——18. 4Sum(4个数字和)
- SURF算法matlab实现
- 走迷宫游戏
- IO流基本框架
- caffe fine-tune策略
- 机器视觉开源代码集合(转载)
- iOS 键盘中使用[UIApplication sharedApplication].statusBarFrame
- 微信小程序开发教程(基础篇)8-数据绑定下
- 在Eclipse中安装SVN客户端插件并提交到SVN服务器上
- 对 Python 装饰器的理解心得