資源簡介
利用matlab提取圖像的邊緣,利用susan算法,把圖像的邊緣找出來。。。
代碼片段和文件信息
%?-----------------------------------------------------------------------
%?
%?This?function?uses?the?SUSAN?algorithm?to?find?edges?within?an?image
%?
%
%?>>image_out?=?susan(image_inthreshold)
%
%
%?Input?parameters?...?The?gray?scale?image?and?the?threshold?
%?image_out?..?(class:?double)?image?indicating?found?edges
%?typical?threshold?values?may?be?from?10?to?30
%
%
%The?following?steps?are?performed?at?each?image?pixel:?
%?(?from?the?SUSAN?webpage?http://www.fmrib.ox.ac.uk/~steve/susan/susan/node4.html?)
%?
%?Place?a?circular?mask?around?the?pixel?in?question.?
%?Calculate?the?number?of?pixels?within?the?circular?mask?which?have?similar?brightness?to?
%?the?nucleus.?These?define?the?USAN.?
%?Subtract?USAN?size?from?geometric?threshold?to?produce?edge?strength?image.?
%
%?Estimating?moments?to?find?the?edge?direction?has?not?been?implemented?.?
%?Non-maximal?suppresion?to?remove?weak?edges?has?not?been?implemented?yet.
%
%?example:
%
%?>>?image_in=imread(‘test_pattern.tif‘);
%?>>?image?=?susan(image_in27);
%?>>?imshow(image[])?
%
%
%?Abhishek?Ivaturi
%?
%?-------------------------------------------------------------------------
function?image_out?=?susan(imthreshold)
close?all
clc
%?check?to?see?if?the?image?is?a?color?image...
d?=?length(size(im));
if?d==3
????image=double(rgb2gray(im));
elseif?d==2
????image=double(im);
end
%?mask?for?selecting?the?pixels?within?the?circular?region?(37?pixels?as
%?used?in?the?SUSAN?algorithm
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]);
%?the?outpu
- 上一篇:深度學習matlab代碼
- 下一篇:基于GPS_IMU組合定位的kalman濾波
評論
共有 條評論