資源簡(jiǎn)介
本代碼主要利用MATLAB工具實(shí)現(xiàn)MATLAB——二維小波分析進(jìn)行圖像壓縮,簡(jiǎn)單明了,易于理解
代碼片段和文件信息
%裝入圖像
load?tire
%顯示圖像
subplot(221);image(X);colormap(map)
title(‘原始圖像‘);
axis?square
disp(‘壓縮前圖像X的大?。骸?
whos(‘X‘)
%對(duì)圖像用bior3.7小波進(jìn)行二層小波分解
[cs]=wavedec2(X2‘bior3.7‘);
%提取小波分解結(jié)構(gòu)中第一層低頻系數(shù)和高頻系數(shù)
ca1=appcoef2(cs‘bior3.7‘1);
ch1=detcoef2(‘h‘cs1);
cv1=detcoef2(‘v‘cs1);
cd1=detcoef2(‘d‘cs1);
%分別對(duì)各頻率成分進(jìn)行重構(gòu)
a1=wrcoef2(‘a(chǎn)‘cs‘bior3.7‘1);
h1=wrcoef2(‘h‘cs‘bior3.7‘1);
v1=wrcoef2(‘v‘cs‘bior3.7‘1);
d1=wrcoef2(‘d‘cs‘bior3.7‘1);
c1=[a1h1;v1d1];
%顯示分解后各頻率成分的信息
subplot(222);image(c1);
axis?square
title(‘分解后低頻和高頻
評(píng)論
共有 條評(píng)論