-
Notifications
You must be signed in to change notification settings - Fork 0
/
face_match.m
83 lines (79 loc) · 1.47 KB
/
face_match.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
clc;
clear all;
close all;
u=5;
v=8;
hist_data = cell(1,200);
gaborArray = gaborFilterBank(u,v,39,39);
% match = zeros(9,40);
% min1 = zeros(9,1);
% figure;
% imshow( strcat('S4\1.bmp') );
% title('Input image');
for X=1:1:200
img = imread( strcat('TRAINING SET\a (',int2str(X),').bmp') );
img= imresize(img,[512 512]);
gaborResult = gabor_conv(img,gaborArray);
featureVector = gaborFeatures(img,gaborArray,gaborResult);
lbpfinal = im_lbp(gaborResult);
hist_data(1,X) = mat2cell(histo_gram(lbpfinal));
end
% A = cell2mat(hist_data(1,1));
%
% for i=2:10
%
% B = cell2mat(hist_data(1,i));
%
% match((i-1),:) = dist_chi(A,B);
% min1((i-1),:) = min(match((i-1),:));
% end
%
% min2 = min(min1);
%
%
% A = cell2mat(hist_data(1,1));
%
% for i=2:10
%
% B = cell2mat(hist_data(1,i));
%
% match((i-1),:) = histmatch(A,B);
% min1((i-1),:) = min(match((i-1),:));
% end
%
% min2 = min(min1);
%
%
%
% for i=1:9
%
% if min1(i)== min2
% figure;
% imshow( strcat('S4\',int2str(i+1),'.bmp') );
% title('Matched image');
% % sprintf('figure match is %d',(i+1));
% display((i+1));
% end
% end
% sh4=0;
% for i=1:256
% for j=1:256
%
% sh4 = sh6(i,j)+sh4;
%
% end
% end
%
% sh8=0;
% for i=1:256
% for j=1:256
%
% sh8 = sh6(i,j)+sh8;
%
% end
% end
% for i=1:9
%
% match1(i)= mean2(match(i,:));
% end
% match2=min(match1);