您好,欢迎访问三七文档
对图像二维信号进行3层小波分解。解:本题二维图像采用MATLAB自带的图片,实现图片多层小波分解的函数是:[C,S]=wavedec2(X,N,’wname’),即使用给定小波‘wname’对二维信号X进行N层小波分解。本题使用’bior3.7’小波进行分析。重构二维小波信号的低频成分函数为:A1=wrcoef2('a',C,S,'wname',N);重构二维小波信号的水平、垂直和对角线高频成分函数为:H1=wrcoef2(‘h’,C,S,’wname’,N);V1=wrcoef2('v',C,S,’wname’,N);D1=wrcoef2('d',C,S,’wname’,N);实现二维信号3层小波分解的MATLAB代码如下:clearall;clc;%装载图像loadwoman;%显示原始图像image(X);colormap(map);nbcol=size(map,1)%进行3层小波分解[C,S]=wavedec2(X,3,'bior3.7');%重构低频信号A1=wrcoef2('a',C,S,'bior3.7',1);A2=wrcoef2('a',C,S,'bior3.7',2);A3=wrcoef2('a',C,S,'bior3.7',3);%重构高频信号H1=wrcoef2('h',C,S,'bior3.7',1);V1=wrcoef2('v',C,S,'bior3.7',1);D1=wrcoef2('d',C,S,'bior3.7',1);H2=wrcoef2('h',C,S,'bior3.7',2);V2=wrcoef2('v',C,S,'bior3.7',2);D2=wrcoef2('d',C,S,'bior3.7',2);H3=wrcoef2('h',C,S,'bior3.7',3);V3=wrcoef2('v',C,S,'bior3.7',3);D3=wrcoef2('d',C,S,'bior3.7',3);%显示3层二维分解结果figure(3)colormap(map);subplot(4,3,1);image(wcodemat(A1,nbcol));title('低频A1')subplot(4,3,4);image(wcodemat(H1,nbcol));title('水平高频H1')subplot(4,3,7);image(wcodemat(V1,nbcol));title('´垂直高频V1')subplot(4,3,10);image(wcodemat(D1,nbcol));title('对角高频D1')subplot(4,3,2);image(wcodemat(A2,nbcol));title('低频A2')subplot(4,3,5);image(wcodemat(H2,nbcol));title('水平高频H2')subplot(4,3,8);image(wcodemat(V2,nbcol));title('垂直高频V2')subplot(4,3,11);image(wcodemat(D2,nbcol));title('对角高频D2')subplot(4,3,3);image(wcodemat(A2,nbcol));title('低频A3')subplot(4,3,6);image(wcodemat(H2,nbcol));title('水平高频H3')subplot(4,3,9);image(wcodemat(V2,nbcol));title('垂直高频V3')subplot(4,3,12);image(wcodemat(D2,nbcol));title('对角高频D3')%重构原始图像X0=waverec2(C,S,'bior3.7');%显示重构图像figure(4)image(X0);title('重构图像')colormap(map);图像小波分解结果如下:图2原始图像图3二维小波分解结果图4重构图像
本文标题:二维小波分解报告
链接地址:https://www.777doc.com/doc-4903821 .html