?? example7_6.m
字號(hào):
%裝載并圖示原始圖像
load gatlin2;
subplot(2,2,1);
image(X);
colormap(map);
title('原始圖像');
axis square;
%==============================
%生成含噪圖像并圖示
init=2055615866;
randn('seed',init);
XX=X+8*randn(size(X));
subplot(2,2,2);
image(XX);
colormap(map);
title('含噪圖像');
axis square;
%==============================
%對(duì)圖像進(jìn)行消噪處理
%用小波函數(shù)coif2對(duì)圖像XX進(jìn)行2層分解
[c,l]=wavedec2(XX,2,'coif2');
n=[1,2];%設(shè)置尺度向量
p=[10.28,24.08];%設(shè)置閾值向量
%==============================
%對(duì)三個(gè)高頻系數(shù)進(jìn)行閾值處理
nc=wthcoef2('h',c,l,n,p,'s');
nc=wthcoef2('v',c,l,n,p,'s');
nc=wthcoef2('d',c,l,n,p,'s');
X1=waverec2(nc,l,'coif2');
subplot(2,2,3);
image(X1);
colormap(map);
title('第一次消噪后的圖像');
axis square;
%==============================
%再次對(duì)三個(gè)高頻系數(shù)進(jìn)行閾值處理
mc=wthcoef2('h',nc,l,n,p,'s');
mc=wthcoef2('v',nc,l,n,p,'s');
mc=wthcoef2('d',nc,l,n,p,'s');
%==========================================
%對(duì)更新后的小波分解結(jié)構(gòu)進(jìn)行重構(gòu)并圖示結(jié)果
X2=waverec2(mc,l,'coif2');
subplot(2,2,4);
image(X2);
colormap(map);
title('第二次消噪后的圖像');
axis square;
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -