forked from manar189/ABoB
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtnm034.m
32 lines (25 loc) · 738 Bytes
/
tnm034.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
function faceId = tnm034(im)
%TNM034 Matches an input face image against a database of faces.
%
% im: Image of unknown face, RGB-image in uint8 format in the
% range [0,255].
%
% id: The identity number (integer) of the identified person,
% i.e. ‘1’, ‘2’,…,‘16’ for the persons belonging to ‘db1’
% and ‘0’ for all other faces.
% Adds paths to subfolders
addpath(genpath(fileparts('Detection/')));
addpath(genpath(fileparts('Recognition/')));
addpath(genpath(fileparts('Pictures/')));
% Detection
try
normIm = detectFace(im);
catch e
faceId = 0;
fprintf('Error: \n%s \n%s \nReturned faceId = 0', e.identifier, e.message);
return
end
figure, imshow(normIm);
% Classification
faceId = classifyFace(normIm);
end