% Test my algorithme á trous on an interesting image; verify the inverse.
% CCK 2018-Feb-28

image = imread('Ansel_Adams_and_camera.jpg');

figure(1)
hold off
imagesc(image)
colormap(gray)
axis equal
title('Original image')

W = atrous(image, 8);

% Verify inverse
reconstructed = sum(W,3);

figure(2)
hold off
imagesc( reconstructed )
colormap(gray)
axis equal
title('Reconstructed by sum(W,3)')

residuals = double(image) - reconstructed;

figure(3)
hold off
imagesc( residuals )
colormap(gray)
axis equal
title('Residuals')

min(min(residuals))
max(max(residuals))