一层小波变换
% 一层小波变换
clc;
clear all;
close all;
load wbarb;
image(X);
colormap(map);
[cA1, cH1, cV1, cD1]=dwt2(X,'bior3.7');
A1=upcoef2('a',cA1,'bior3.7',1);
H1=upcoef2('h',cV1,'bior3.7',1);
V1=upcoef2('v',cV1,'bior3.7',1);
D1=upcoef2('d',cD1,'bior3.7',1);
figure;colormap(map);
subplot(2,2,1); image(wcodemat(A1,180));
title('ApproximationAl')
subplot(2,2,2); image(wcodemat(H1, 255));
title('Horizontal Detail Hl')
subplot(2,2,3); image(wcodemat(V1,255));
title('Vertical Detail V1')
subplot(2,2,4); image(wcodemat(D1,255));
title('Diagonal Detail D1')
Y = 2.0*idwt2(A1,H1,V1,D1, 'bior3.7');
Y = imresize(Y,0.5);
figure; image(Y);colormap(map);