example11_2.m

来自「matlab图像处理源代码 大家多多分享」· M 代码 · 共 38 行

M
38
字号
%装载原始图像信号并图示
load wgatlin;
subplot(2,2,1);
image(X);
colormap(map);
title('原始图像');
axis square;
%==============================
%生成含噪图像并图示
init=2055615866;
rand('seed',init);
XX=X+12*randn(size(X));
subplot(2,2,2);
image(XX);
colormap(map);
title('含噪图像');
axis square;
%==============================
%下面对图像消噪
%首先用sym4小波函数对XX进行2层分解
[c,l]=wavedec2(XX,2,'sym4');
%实现低通滤波消噪
a1=wrcoef2('a',c,l,'sym4',1);
%再次实现低通滤波消噪
a2=wrcoef2('a',c,l,'sym4',2);
%==============================
%图示消噪处理后的结果
subplot(2,2,3);
image(a1);
colormap(map);
title('第一次消噪图像');
axis square;
subplot(2,2,4);
image(a2);
colormap(map);
title('第二次消噪图像');
axis square;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?