Code covered by the BSD License

# Multiresolution Gabor-like transforms

### Kunal Chaudhury (view profile)

11 May 2012 (Updated )

Matlab implementation of the multiresolution Gabor filters in 1 and 2 dimensions.

displayFigures (inImg, w, reconImg)
```function displayFigures (inImg, w, reconImg)
%
% Plots the original and the reconstructed images, and the modulus of the
% six complex wavelet subbands.
%
J = length(w);

figure,
imagesc(inImg), colormap gray, axis image,
h = get(1,'Position');
set(1,'Position', [20, 600, h(3), h(4)]);
title('Original Image', 'FontSize', 18);

figure,
imagesc(reconImg), colormap gray, axis image,
h=get(2,'Position');
set(2,'Position', [1300, 600, h(3), h(4)]);
title('Reconstructed Image', 'fontSize', 18);

% modulus of wavelet subbands
for depth = 1 : J

M     = length(w{depth}(:,:,1));
frame = zeros(2*M + 1,3*M + 2);

% normalization
frame(1 : M,1 : M) = abs(w{depth}(:,:,1)) / max(max(abs(w{depth}(:,:,1))));
frame(M + 2*1 : 2*M + 1,1 : M) = abs(w{depth}(:,:,2)) / ...
max(max(abs(w{depth}(:,:,2))));
frame(1 : M,M + 2*1 : 2*M + 1) = abs(w{depth}(:,:,3)) / ...
max(max(abs(w{depth}(:,:,3))));
frame(M + 2*1 : 2*M+1,M+2 : 2*M+1) = abs(w{depth}(:,:,4)) / ...
max(max(abs(w{depth}(:,:,4))));
frame(1 : M,2*M + 3 : 3*M + 2) = abs(w{depth}(:,:,5)) / ...
max(max(abs(w{depth}(:,:,5))));
frame(M + 2 : 2*M + 1, 2*M + 3 : 3*M + 2) = abs(w{depth}(:,:,6)) / ...
max(max(abs(w{depth}(:,:,6))));

frame(M + 1, :)   = 1;
frame(:,2*M + 2)  = 1;
frame(:,M + depth) = 1;

figure,
imagesc(frame), colormap gray, axis image,
h = get(depth+2,'Position');
set(depth+2,'Position', [100+400*depth, 300, h(3), h(4)]);
title(strcat('Directional subbands at level ', num2str(depth)), ...
'fontSize', 18);

end

```