|
<P>% made by <STRONG>snowicemiao in 研学<BR> load trees; <BR>f0 = ind2gray(X,map); <BR>figure(1),imshow(f0) <BR>%加入高斯噪声并显示 <BR>f1=imnoise (f0, 'speckle', 0.01); <BR>f1=im2double(f1); <BR>figure(2),imshow(f1); <BR>% 给定均值滤波窗口 <BR>h3=1/9.*[1 1 1; 1 1 1; 1 1 1 ]; </STRONG></P>
<P><STRONG>%采用h3对图像f2进行卷积滤波 <BR>f4=conv2(f1, h3,'same'); <BR>figure(3),imshow(f4); %如图4-5所示 </STRONG></P>
<P><STRONG>% 进行sobel 滤波 <BR>h2=fspecial('sobel'); <BR>g3=filter2(h2,f1, 'same'); <BR>figure(4),imshow(g3); <BR>K=mat2gray(g3); <BR>figure(5),imshow(K); </STRONG></P> |
|