function showWaveDecomp2(path,filespec,maxn,L) % function showWaveDecomp2(path,filespec,maxn,L) % path is a directory % filespec is a file spec within that directory (e.g., *.tif) % maxn is the maximum number of images to process % L is the number of levels of decomposition desired % dwtmode('per'); dirls=dir(strcat(path,'/',filespec)); for i=1:min(length(dirls),maxn) img=imread(strcat(path,'/',dirls(i).name)); a=double(img); b=(a-min(min(a)))./(max(max(a))-min(min(a))); %imshow(b); bsiz=min(fix(size(b)/(2^L))*(2^L)); [c,s]=wavedec2(b(1:bsiz,1:bsiz),L,'db2'); y=dwtreshape(c,s); imshow(y,[min(min(y)) max(max(y))]); colormap(prism); pause(1); end