資源簡介
眼底圖像形態學操作MATLAB代碼

代碼片段和文件信息
function?out_img?=?morpho_sub(img)
A?=?img;
B=[0?1?0
???1?1?1
???0?1?0];
%?B=strel(‘disk‘3);
%膨脹
for?i?=1:6
????A=imdilate(AB);
end
%?subplot(121)imshow(A);
%?title(‘使用B后6次膨脹后的圖像‘);
%腐蝕
for?i?=1:6
????A=imerode(AB);
end
%?subplot(122)imshow(A);
%?title(‘使用B后6次膨脹后的圖像‘);
se1=strel(‘disk‘7);%這里是創建一個半徑為5的平坦型圓盤結構元素
A=imerode(Ase1);
A=A-img;
A=255-A-50;
out_img?=?A;
%?figure?imshow(out_img);
end
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????529??2017-06-05?21:01??morpho_tophat.m
?????文件????????484??2017-06-05?21:00??morpho_sub.m
-----------?---------??----------?-----??----
?????????????????1013????????????????????2
評論
共有 條評論