% waveletdemo.m % demonstration of wavelet decomposition of images % (C) 2005 by Yu Hen Hu % created: 11/29/2005 clear all, close all [tmp,map]=imread('lena.bmp'); % tmp is an indexed image file using % color map "map" x=double(ind2gray(tmp,map)); % convert the image into a grayscale image clear tmp map; [LL,LH,HL,HH]=dwt2(x,'haar'); % use Haar wavelet to perform % scale LH, HL, HH figure(1), subplot(221),imagesc(LL),colormap('gray'),title('LL') subplot(222),imagesc(HL),colormap('gray'),title('LH') subplot(223),imagesc(LH),colormap('gray'),title('HL') subplot(224),imagesc(HH),colormap('gray'),title('HH')