-
Notifications
You must be signed in to change notification settings - Fork 1
/
match.m
executable file
·40 lines (39 loc) · 1.2 KB
/
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
% Matching Fingerprints with similarity score...
%
% arguments: M1 - First Minutiae
% M2 - Second Minutiae
% display_flag
%
% returns: S - Similarity Measure
function [ S ] = match( M1, M2, display_flag )
if nargin==2; display_flag=0; end
M1=M1(M1(:,3)<5,:);
M2=M2(M2(:,3)<5,:);
count1=size(M1,1); count2=size(M2,1);
bi=0; bj=0; ba=0; % Best i,j,alpha
S=0; % Best Similarity Score
for i=1:count1
T1=transform(M1,i);
for j=1:count2
if M1(i,3)==M2(j,3)
T2=transform(M2,j);
for a=-5:5 %Alpha
T3=transform2(T2,a*pi/180);
sm=score(T1,T3);
if S<sm
S=sm;
bi=i; bj=j; ba=a;
end
end
end
end
end
if display_flag==1
figure, title(['Similarity Measure : ' num2str(S)]);
T1=transform(M1,bi);
T2=transform(M2,bj);
T3=transform2(T2,ba*pi/180);
plot_data(T1,1);
plot_data(T3,2);
end
end