/
facerecognition.asv
53 lines (51 loc) · 1.8 KB
/
facerecognition.asv
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
% load('human_face1_1_4k.mat');
% tosca_x = remesh(human_face_4k, set_options('vertices',1000));
% [tosca_x] = init_surface (tosca_x);
%
%
% s=what;
% matfiles=s.mat;
%
% for a=1:numel(matfiles)
% load(char(matfiles(a)));
% tosca_y = remesh(human_face_4k, set_options('vertices',1000));
% [tosca_y] = init_surface (tosca_y);
% N = 50;
% disp(char(matfiles(a)));
% [tx, ux, ty, uy, f, rmsdist, maxdist, local_stress] = gmds (tosca_x, tosca_y, N);
% clearvars human_face_4k;
% end
function [] = facerecognition (input_file)
load(input_file);
tosca_x = remesh(human_face_4k, set_options('vertices',1000));
[a] = init_surface (tosca_x);
A = zeros(3,3);
max = zeros(3,3);
rms = zeros(3,3);
N = 50;
for k = 1:4
% Create a mat filename, and load it into a structure called matData.
for l = 1:3
matFileName = sprintf('human_face%d_%d_4k.mat', k, l);
if input_file
if exist(matFileName, 'file')
matData = load(matFileName);
tosca_y = remesh(matData.human_face_4k, set_options('vertices',1000));
[b] = init_surface (tosca_y);
disp(matFileName);
if k == 4 && l == 2
[tx, ux, ty, uy, f, rmsdist, maxdist, local_stress] = gmds (b, a, N);
else if a!=b
[tx, ux, ty, uy, f, rmsdist, maxdist, local_stress] = gmds (a, b, N);
end
end
A(k,l) = f;
max(k,l) = maxdist;
rms(k,l) = rmsdist;
else
fprintf('File %s does not exist.\n', matFileName);
end
end
end
plot(reshape(A',1,12),'--gs','LineWidth',2,'MarkerSize',10,'MarkerEdgeColor','b','MarkerFaceColor',[0.5,0.5,0.5]);ylabel('Stress');xlabel('face');axis([1 12 0 350]);title('human face 4.2 vs Dataset.')
end