-
Notifications
You must be signed in to change notification settings - Fork 0
/
gabor_conv.m
35 lines (29 loc) · 842 Bytes
/
gabor_conv.m
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
32
33
34
35
function gaborResult = gabor_conv(img,gaborArray)
img = double(img);
%% Filtering
% Filter input image by each Gabor filter
[u,v] = size(gaborArray);
gaborResult = cell(u,v);
for i = 1:u
for j = 1:v
gaborResult{i,j} = conv2(img,gaborArray{i,j},'same');
% J{u,v} = filter2(G{u,v},I);
end
end
% Show filtered images
% Show real parts of Gabor-filtered images
% figure('NumberTitle','Off','Name','Real parts of Gabor filters');
% for i = 1:u
% for j = 1:v
% subplot(u,v,(i-1)*v+j)
% imshow(real(gaborResult{i,j}),[]);
% end
% end
% % Show magnitudes of Gabor-filtered images
% figure('NumberTitle','Off','Name','Magnitudes of Gabor filters');
% for i = 1:u
% for j = 1:v
% subplot(u,v,(i-1)*v+j)
% imshow(abs(gaborResult{i,j}),[]);
% end
% end