File size: 730 Bytes
d4035c1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
% Load image
img = imread('test.jpg');

% Parameters:
Nblocks = 4;
imageSize = 128; 
orientationsPerScale = [8 8 4];
numberBlocks = 4;

% Precompute filter transfert functions (only need to do this one, unless image size is changes):
createGabor(orientationsPerScale, imageSize); % this shows the filters
G = createGabor(orientationsPerScale, imageSize);

% Computing gist requires 1) prefilter image, 2) filter image and collect
% output energies
output = prefilt(double(img), 4);
g = gistGabor(output, numberBlocks, G);


% Visualization
figure
subplot(221)
imshow(img)
title('Input image')
subplot(222)
o = 128+128*output/max(abs(output(:)));
imshow(uint8(o))
title('Prefiltered image')
subplot(212)
plot(g)
title('Descriptor')