📄 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 + -