% Illustration of FWT
% the box with a cross illustrates the vertical,
% horizontal and diagonal components of the image
%

% This is like the toon0232 of WaveLab802

imgmap = [(0:255)' (0:255)' (0:255)']/255;

% B = not(Make2dSignal('BoxWithCross', 128));
% save boxwcross B;
load boxwcross B; % values are in [0,1]

B1 = 255 * B; % values in [0,256]

subplot(121), image(B1), axis('image'), colormap(imgmap)

q = MakeONFilter('Daubechies', 4); % try other filters here
w = FWT2_PO(B, 3, q);
w = sqrt(abs(w));

%rescale and make small coeficients white, by taking the 256 complement

w = 255 - 255 * (w - min(min(w))) / (max(max(w)) - min(min(w)));

subplot(122), image(w), axis('image'), colormap(imgmap)
