【Matlab数字图像处理】第九章:形态学

来源:互联网 发布:python 爬虫要学多久 编辑:程序博客网 时间:2024/05/22 06:05

膨胀

A = imread('DIP3E_Original_Images_CH09/Fig0907(a)(text_gaps_1_and_2_pixels).tif');B = [0 1 0;1 1 1;0 1 0];A2 = imdilate(A,B);subplot(121),imshow(A);subplot(122),imshow(A2); 

 

%% imerode腐蚀clcclearA1=imread('DIP3E_Original_Images_CH09/Fig0905(a)(wirebond-mask).tif');subplot(221),imshow(A1);title('腐蚀原始图像');%strel函数的功能是运用各种形状和大小构造结构元素se1=strel('disk',5);%这里是创建一个半径为5的平坦型圆盘结构元素A2=imerode(A1,se1);subplot(222),imshow(A2);title('使用结构原始disk(5)腐蚀后的图像');se2=strel('disk',10);A3=imerode(A1,se2);subplot(223),imshow(A3);title('使用结构原始disk(10)腐蚀后的图像');se3=strel('disk',20);A4=imerode(A1,se3);subplot(224),imshow(A4);title('使用结构原始disk(20)腐蚀后的图像');%图像腐蚀处理过程运行结果如下:

 


 

0 0
原创粉丝点击