?? example7_14.m
字號:
%裝載原始圖像
load gatlin;
%=====================================
%對圖像加噪聲并顯示出含噪圖像
init=2788605800;
randn('seed',init);
X=X+10*randn(size(X));
subplot(1,2,1);
image(X);colormap(map);
title('含噪圖像');
%=====================================
%圖像平滑:應用中值濾波進行處理
for i=2:479
for j=2:639
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(1,2,2);
image(X1);colormap(map);
title('平滑圖像');
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -