clc; clear all; o=imread('E:/工作/科研/奇异值/image/lena.bmp'); % figure,imshow(o); % o=[ 1 2;3 4;5 6]; o=double(o); %进行第一层提升小波变换 % els ={'p',[-0.125 0.125],0}; % lshaarInt = liftwave('haar','int2int'); % lsnewInt = addlift(lshaarInt,els); % [oa1,oh1,ov1,od1]=lwt2(o,lsnewInt); % subplot(2,2,1);imshow(oa1,[])%;colormap(gray); % subplot(2,2,2);imshow(oh1,[]);colormap(gray); % subplot(2,2,3);imshow(ov1,[]);colormap(gray); % subplot(2,2,4);imshow(od1,[]);colormap(gray); map=gray; [c,s] = wavedec2(o,3,'db1'); subplot(3,3,1); % image(o); imshow(o,[]); colormap(map); title('原始图像'); ca2=appcoef2(c,s,'db1',2); subplot(3,3,2); % image(ca2); imshow(ca2,[]); colormap(map); title('尺度为2时低频图像'); ca1=appcoef2(c,s,'db1',1); subplot(3,3,3); % image(ca1); imshow(ca1,[]); colormap(map); title('尺度为1时低频图像'); [chd2,cvd2,cdd2]=detcoef2('all',c,s,2); subplot(3,3,4); % image(chd2); imshow(chd2,[]); % a='尺度为2时';'高频图像的水平部分'; title(sprintf('%s /n %s','尺度为2时','高频图像的水平部分')); subplot(3,3,5); % image(cvd2); imshow(cvd2,[]); % title('尺度为2时的高频图像的垂直部分'); title(sprintf('%s /n %s','尺度为2时','高频图像的垂直部分')); subplot(3,3,6); % image(cdd2); imshow(cdd2,[]); % title('尺度为2时的高频图像的对角图像'); title(sprintf('%s /n %s','尺度为2时','高频图像的对角部分')); [chd1,cvd1,cdd1]=detcoef2('all',c,s,1); subplot(3,3,7); % image(chd1); imshow(chd1,[]); % title('尺度为1时高频图像的水平部分'); title(strvcat('尺度为1时','高频图像的水平部分')); subplot(3,3,8); % image(cvd1); imshow(cvd1,[]); % title('尺度为1时高频图像的垂直部分'); title(strvcat('尺度为1时','高频图像的垂直部分')); subplot(3,3,9); % image(cdd1); imshow(cdd1,[]); % title('尺度为1时高频图像的对角部分'); title(strvcat('尺度为1时','高频图像的对角部分'));