-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtutorial_canforms.m
68 lines (58 loc) · 1.66 KB
/
tutorial_canforms.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
% A. M. Bronstein, M. M. Bronstein, R. Kimmel, Numerical geometry of
% non-rigid shapes, Springer, 2008
%
% http://tosca.cs.technion.ac.il/book
%
% TUTORIAL
% Demonstration of multidimensional scaling using SMACOF algorithm
%
% This tutorial is based on MDS RRE code, distributed as part of
% TOSCA = Toolbox for Surface Comparison and Analysis
% Web: http://tosca.cs.technion.ac.il
%
% (C) Copyright Michael Bronstein, 2008
% All rights reserved.
% load and display man dataset
load man1
figure(1),
h = trisurf(man.TRIV,man.X,man.Y,man.Z);
shading interp, colormap([1 1 1]*0.9), lighting phong, camlight head
axis image; axis off
title('Man, pose 1');
drawnow
pause;
%man = init_surface(man);
options.X0 = [man.X,man.Y,man.Z];
options.method = 'rre';
options.cycles = 2;
options.iter = 10;
[X_] = mds(man.D,options);
figure(2),
h = trisurf(man.TRIV,X_(:,1),X_(:,2),X_(:,3));
shading interp, colormap([1 1 1]*0.9), lighting phong, camlight head
axis image; axis off
axis([-150 150 -150 150 -150 150])
title('Canonical form, pose 1');
drawnow
pause
load man2
figure(3),
h = trisurf(man.TRIV,man.X,man.Y,man.Z);
shading interp, colormap([1 1 1]*0.9), lighting phong, camlight head
axis image; axis off
title('Man, pose 2');
drawnow
pause;
%man = init_surface(man);
options.X0 = [man.X,man.Y,man.Z];
options.method = 'rre';
options.cycles = 2;
options.iter = 10;
[X_] = mds(man.D,options);
figure(4),
h = trisurf(man.TRIV,X_(:,1),X_(:,2),X_(:,3));
shading interp, colormap([1 1 1]*0.9), lighting phong, camlight head
axis image; axis off
axis([-150 150 -150 150 -150 150])
title('Canonical form, pose 2');
drawnow