使用小波进行图像分解

时间:2014-05-03 10:57:51

标签: matlab wavelet

我使用下面的代码以小波分解我的图像。但是我希望详细的系数(' h'' v'和' d')是一个文件而不是3个不同的图像。

X=imread('snow.tif');
close all
clf
image(X)
colormap('default')
axis ('image'); set(gca,'XTick',[],'YTick',[]); title('Original')
pause

dwtmode('sym')
wname = 'bior4.4'

t = wtree(X,2,'bior4.4');
plot(t)
pause
close(2)

[wc,s] = wavedec2(X,5,wname);

a1 = appcoef2(wc,s,wname,1);         
h1 = detcoef2('h',wc,s,1);           
v1 = detcoef2('v',wc,s,1);           
d1 = detcoef2('d',wc,s,1);           

a2 = appcoef2(wc,s,wname,2);
h2 = detcoef2('h',wc,s,2);
v2 = detcoef2('v',wc,s,2);
d2 = detcoef2('d',wc,s,2);

0 个答案:

没有答案