count_repetition = zeros(1,size(S.Data,2));
for t = 1: size( Test_image_Featur_Matrix ,1)
feature matrix of test
image
dita =[];
n = 1;
for i = 1: size(S.Data,2)
for j = 1:size(S.Data(i).Feature_Matrix,2)
for m = 1:size(S.Data(i).Feature_Matrix(j).Img,1)
dita(n,1) = norm (Test_image_Featur_Matrix(t,:)- S.Data(i).Feature_Matrix(j).Img(m,:));
row of test_image with every row of image
dita(n,2) = i;
dita(n,3) = j;
n = n+1;
end
end
end
val = min(dita(:,1));
if val < 20
in = find(dita(:,1) == val);
Result(t).distance = dita(in(1),1);
Result(t).Person_Num = dita(in(1),2);
Result(t).Image_Number = dita(in(1),3);
count_repetition(Result(t).Person_Num) = count_repetition(Result(t).Person_Num) + 1;
end
end
Matched = max(count_repetition);
if Matched>(size(Test_image_Featur_Matrix,1)/2)
ind_match = find (count_repetition == Matched);
text_fin = ['Authorized Person。 Person is: ' S.Data(ind_match).Name ];
else
text_fin = 'No Match。Unauthorized Person。';
end
set(handles.text4,'string',text_fin);
end