clc,clear all,close all; load woman; %单尺度二维离散小波分解。分解小波函数haar [cA,cH,cV,cD]=dwt2(X,'haar'); %单尺度二维离散小波重构(逆变换) Y=idwt2(cA,cH,cV,cD,'haar'); figure; subplot(1,2,1),imshow(X,map),title('原始图像'); subplot(1,2,2),imshow(Y,map),title('重构图像');
clear all;close all;clc; I=imread('C:\Users\Jv\Desktop\wenli.jpg'); gray=I; X=double(gray); [cA,cH,cV,cD]=dwt2(X,'haar'); %单尺度二维离散小波低、高频重构(逆变换) a=idwt2(cA,[],[],[],'haar'); h=idwt2([],cH,[],[],'haar');v=idwt2([],[],cV,[],'haar');d=idwt2([],[],[],cD,'haar'); figure; subplot(1,2,1),imshow(uint8(X)),title('原图'); subplot(1,2,2),imshow(uint8(a)),title('低频重构图'); figure; subplot(1,3,1),imshow(uint8(h)),title('水平高频重构图'); subplot(1,3,2),imshow(uint8(v)),title('竖直高频重构图'); subplot(1,3,3),imshow(uint8(d)),title('对角高频重构图');