二维小波变换,并显示各个子带图

网友投稿 726 2022-11-07

二维小波变换,并显示各个子带图

二维小波变换,并显示各个子带图

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时','高频图像的对角部分'));

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:jdk的环境配置问题
下一篇:imwrite遇到的问题
相关文章

 发表评论

暂时没有评论,来抢沙发吧~