资源简介
SUSAN 角点检测 matlab代码.
主代码是testSusan.m.
若读入图像格式不对,请自行修改
代码片段和文件信息
function [ map r c ] = susanCorner( img )
%SUSAN Corner detection using SUSAN method.
% [R C] = SUSAN(IMG) Rows and columns of corner points are returned.
% Edward @ THUEE xjed09@gmail.com
maskSz = [7 7];
fun = @(img) susanFun(img);
map = nlfilter(imgmaskSzfun);
[r c] = find(map);
end
function res = susanFun(img)
% SUSANFUN Determine if the center of the image patch IMG
% is corner(res = 1) or not(res = 0)
mask = [...
0 0 1 1 1 0 0
0 1 1 1 1 1 0
1 1 1 1 1 1 1
1 1 1 1 1 1 1
1 1 1 1 1 1 1
0 1 1 1 1 1 0
0 0 1 1 1 0 0];
% uses 2 thresholds to distinguish corners from edges
thGeo = (nnz(mask)-1)*.2;
thGeo1 = (nnz(mask)-1)*.4;
thGeo2 = (nnz(mask)-1)*.4;
thT = .07;
thT1 = .04;
sz = size(img1);
usan = ones(sz)*img(round(sz/2)round(sz/2));
similar = (abs(usan-img) similar = similar.*mask;
res = sum(similar(:));
if res < thGeo
dark = nnz((img-usan<-thT1).*mask);
bright = nnz((img-usan>thT1).*mask);
res = min(darkbright)thGeo2;
else
res = 0;
end
end
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 1066 2014-02-12 13:27 susanCorner.m
文件 162 2014-12-17 21:11 testSusan.m
文件 46216 2014-02-12 13:27 corner2.gif
文件 1306 2014-02-12 13:27 license.txt
----------- --------- ---------- ----- ----
48750 4
- 上一篇:rs编译码程序MATLAB
- 下一篇:ExOR算法 的 matlab 实现
评论
共有 条评论