赞
踩
这篇介绍提取Harris角点描述子的函数
函数/Function
函数名称:extractFeatures
功能:提取利用诸如BRISK/Harris/FREAK/SURF/Block等方法检测到的特征点的描述子
语法:[features,validPoints] = extractFeatures(I,points);
[features,validPoints] = extractFeatures(I,points,Name,Value);
其中,I为2-D灰度图像,points为特征点检测算法获取的特征点(可能为BRISKPoints/CornerPoints/MSERRegions/SURFPoints对象或Mx2的[x,y]坐标矩阵),Name为用一对单引号包含的字符串,Value为对应Name的值
Name | Value |
---|---|
’Method' | 默认为‘Auto',可以为'BRISK'/'FREAK'/'SURF'/'Block'/'Auto',具体见“Method及其含义”表 |
'BlockSize' | 对应’Block'方法的邻域正方形的大小 |
'SURFSize' | 获取的SURF描述子的长度,默认值为64,还可以设置为128,设置为128在提高精度的同时增加了匹配的时间 |
Method | 含义 |
---|---|
'BRISK' | 对应输入为BRISKPoints对象,函数将输出变量’validPoints'对象中的方向(Orientation)属性设置为直径的方向 |
‘FREAK' | Fast Retina KeyPoint(FREAK),对应输入为CornerPoints对象,函数将输出变量’validPoints'对象中的方向(Orientation)属性设置为直径的方向 |
’SURF' | 对应输入为SURFPoints/MSERRegions对象,当输入为SURFPoints,函数将输出变量’validPoints'对象中的方向(Orientation)属性设置为直径的方向;当输入为MSERRegions(需要理解,后续添加) |
'Block' | 简单正方形邻域,仅对输入为Mx2的[x,y]坐标矩阵时可用。‘Block’方法只会抽取正方形领域中的所有点在图像内的特征,所以,输出的点可能会比输入的点少! |
‘Auto' | 函数的默认值,对应不同的输入对象,调用不同的方法 |
<pre name="code" class="plain">close all;
clear all;
clc;
% Extract corner features from an image.
I = imread('cameraman.tif');
corners = detectHarrisFeatures(I);
[features, valid_corners] = extractFeatures(I, corners);
figure; imshow(I); hold on
% Plot valid corner points
plot(valid_corners);
title('Harris')
% Extract SURF features
I = imread('cameraman.tif');
points = detectSURFFeatures(I);
[features, valid_points] = extractFeatures(I, points);
% Visualize 10 strongest SURF features, including their scale, and
% orientation which was determined during the descriptor extraction
% process.
figure; imshow(I); hold on;
plot(valid_points.selectStrongest(10),'showOrientation',true);
title('SURF')
% Extract MSER features
I = imread('cameraman.tif');
regions = detectMSERFeatures(I);
% Use MSER with SURF feature descriptor
[features, valid_points] = extractFeatures(I, regions);
% Visualize SURF features corresponding to the MSER ellipse centers
% along with scale and orientation.
figure; imshow(I); hold on;
plot(valid_points,'showOrientation',true);
title('MSER')

Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。