Skip to content

Commit

Permalink
structure aware code
Browse files Browse the repository at this point in the history
  • Loading branch information
vishalvijay18 committed Apr 20, 2016
1 parent 500b1a4 commit 03039b5
Show file tree
Hide file tree
Showing 291 changed files with 347,615 additions and 0 deletions.
36 changes: 36 additions & 0 deletions ICP_Matlab/SimplifiedICP.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
function [error, Reallignedsource] = SimplifiedICP(target,source)

% This function rotates, translates and scales a 3D "source" of N*3 size (N points in N rows, 3 collumns for XYZ)
% to fit a similar shaped "target" again of N by 3 size
%
% The output shows the minimized value of dissimilarity measure in "error", the transformed source data set

if(nargin < 2)
display('require at least 2 arguments');
end

%**********---ICP---****************
% Initially assign high error value
errortemp(1,:) = 100000;
index=2;
iteration = 1; % number of iterations after which loop will terminate
threshold = 0.000001;
% Initial calculation of alignment
[errortemp(index,:),Reallignedsource,transform] = procrustes(target,source);
% applying alignment
source = transform.b*source*transform.T+repmat(transform.c(1,1:3),size(source,1),1);

% max iterations or error > threshold
while ((errortemp(index-1,:) - errortemp(index,:)) > threshold && iteration < 10)
% display ('inside')
% Update error and again calculate alignment and apply
[errortemp(index+1,:),Reallignedsource,transform] = procrustes(target,source);
source = transform.b*source*transform.T+repmat(transform.c(1,1:3),size(source,1),1);
index=index+1;
iteration =iteration+1;
end

display ('error')
error = errortemp(index,:)


8 changes: 8 additions & 0 deletions ICP_Matlab/meshs/chair-mapping.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
65 73
66 74
67 75
68 76
69 77
70 78
71 79
72 80
107,157 changes: 107,157 additions & 0 deletions ICP_Matlab/meshs/chair.obj

Large diffs are not rendered by default.

32 changes: 32 additions & 0 deletions ICP_Matlab/meshs/chair_2-mapping.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
33 1
34 2
35 3
36 4
37 5
38 6
39 7
40 8
41 9
42 10
43 11
44 12
45 13
46 14
47 15
48 16
49 17
50 18
51 19
52 20
53 21
54 22
55 23
56 24
57 25
58 26
59 27
60 28
61 29
62 30
63 31
64 32
107,157 changes: 107,157 additions & 0 deletions ICP_Matlab/meshs/chair_2.obj

Large diffs are not rendered by default.

2,294 changes: 2,294 additions & 0 deletions ICP_Matlab/meshs/fullchair_dec.obj

Large diffs are not rendered by default.

59 changes: 59 additions & 0 deletions ICP_Matlab/meshs/newbigTable-catmull-mapping.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
1 60
2 61
3 62
4 63
5 64
6 65
7 66
8 67
9 68
10 69
11 70
12 71
13 72
14 73
15 74
16 75
17 76
18 77
19 78
20 79
21 80
22 81
23 82
24 83
25 84
26 85
27 86
28 87
29 88
30 89
31 90
32 91
33 92
34 93
35 94
36 95
37 96
38 97
39 98
40 99
41 100
42 101
43 102
44 103
45 104
46 105
47 106
48 107
49 108
50 109
51 110
52 111
53 112
54 113
55 114
56 115
57 116
58 117
59 118
Loading

0 comments on commit 03039b5

Please sign in to comment.