?? f11_6.m
字號:
%裝載原始圖像
load gatlin;
%對圖像加噪聲并顯示出含噪圖像
init=2788605800;
randn('seed',init);
X=X+10*randn(size(X));
subplot(2,2,1);
image(X);
colormap(map);
title('含噪圖像');
%應用中值濾波進行圖像平滑處理
[p,q]=size(X);
for i=2:p-1
for j=2:q-1
Xtemp=0;
for m=1:3
for n=1:3
Xtemp=Xtemp+X(i+m-2,j+n-2);
end
end
Xtemp=Xtemp/9;
X1(i,j)=Xtemp;
end
end
%顯示結果
subplot(2,2,2);
image(X1);
colormap(map);
title('平滑后圖像');
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -