forked from AnilOsmanTur/SignRecorderAU
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSkeletonData.cs
558 lines (476 loc) · 20.1 KB
/
SkeletonData.cs
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace KinectRecorder
{
class SkeletonData
{
// to check the frame
public int frameID { get; set; }
// first 3 are camera space points
// Base of the spine.
public double SpineBase_X { get; set; } // = 0,
public double SpineBase_Y { get; set; }
public double SpineBase_Z { get; set; }
// depth space mapped points
public double SpineBase_depth_X { get; set; }
public double SpineBase_depth_Y { get; set; }
// color space mapped points
public double SpineBase_color_X { get; set; }
public double SpineBase_color_Y { get; set; }
// Middle of the spine.
public double SpineMid_X { get; set; } // = 1,
public double SpineMid_Y { get; set; }
public double SpineMid_Z { get; set; }
public double SpineMid_depth_X { get; set; }
public double SpineMid_depth_Y { get; set; }
public double SpineMid_color_X { get; set; }
public double SpineMid_color_Y { get; set; }
// Neck.
public double Neck_X { get; set; } // = 2,
public double Neck_Y { get; set; }
public double Neck_Z { get; set; }
public double Neck_depth_X { get; set; }
public double Neck_depth_Y { get; set; }
public double Neck_color_X { get; set; }
public double Neck_color_Y { get; set; }
// Head.
public double Head_X { get; set; } // = 3,
public double Head_Y { get; set; }
public double Head_Z { get; set; }
public double Head_depth_X { get; set; }
public double Head_depth_Y { get; set; }
public double Head_color_X { get; set; }
public double Head_color_Y { get; set; }
// Left shoulder.
public double ShoulderLeft_X { get; set; } // = 4,
public double ShoulderLeft_Y { get; set; }
public double ShoulderLeft_Z { get; set; }
public double ShoulderLeft_depth_X { get; set; }
public double ShoulderLeft_depth_Y { get; set; }
public double ShoulderLeft_color_X { get; set; }
public double ShoulderLeft_color_Y { get; set; }
// Left elbow.
public double ElbowLeft_X { get; set; } // = 5,
public double ElbowLeft_Y { get; set; }
public double ElbowLeft_Z { get; set; }
public double ElbowLeft_depth_X { get; set; }
public double ElbowLeft_depth_Y { get; set; }
public double ElbowLeft_color_X { get; set; }
public double ElbowLeft_color_Y { get; set; }
// Left wrist.
public double WristLeft_X { get; set; } // = 6,
public double WristLeft_Y { get; set; }
public double WristLeft_Z { get; set; }
public double WristLeft_depth_X { get; set; }
public double WristLeft_depth_Y { get; set; }
public double WristLeft_color_X { get; set; }
public double WristLeft_color_Y { get; set; }
// Left hand.
public double HandLeft_X { get; set; } // = 7,
public double HandLeft_Y { get; set; }
public double HandLeft_Z { get; set; }
public double HandLeft_depth_X { get; set; }
public double HandLeft_depth_Y { get; set; }
public double HandLeft_color_X { get; set; }
public double HandLeft_color_Y { get; set; }
// Right shoulder.
public double ShoulderRight_X { get; set; } // = 8,
public double ShoulderRight_Y { get; set; }
public double ShoulderRight_Z { get; set; }
public double ShoulderRight_depth_X { get; set; }
public double ShoulderRight_depth_Y { get; set; }
public double ShoulderRight_color_X { get; set; }
public double ShoulderRight_color_Y { get; set; }
// Right elbow.
public double ElbowRight_X { get; set; } // = 9,
public double ElbowRight_Y { get; set; }
public double ElbowRight_Z { get; set; }
public double ElbowRight_depth_X { get; set; }
public double ElbowRight_depth_Y { get; set; }
public double ElbowRight_color_X { get; set; }
public double ElbowRight_color_Y { get; set; }
// Right wrist.
public double WristRight_X { get; set; } // = 10,
public double WristRight_Y { get; set; }
public double WristRight_Z { get; set; }
public double WristRight_depth_X { get; set; }
public double WristRight_depth_Y { get; set; }
public double WristRight_color_X { get; set; }
public double WristRight_color_Y { get; set; }
// Right hand.
public double HandRight_X { get; set; } // = 11,
public double HandRight_Y { get; set; }
public double HandRight_Z { get; set; }
public double HandRight_depth_X { get; set; }
public double HandRight_depth_Y { get; set; }
public double HandRight_color_X { get; set; }
public double HandRight_color_Y { get; set; }
// Left hip.
public double HipLeft_X { get; set; } // = 12,
public double HipLeft_Y { get; set; }
public double HipLeft_Z { get; set; }
public double HipLeft_depth_X { get; set; }
public double HipLeft_depth_Y { get; set; }
public double HipLeft_color_X { get; set; }
public double HipLeft_color_Y { get; set; }
// Left knee.
public double KneeLeft_X { get; set; } // = 13,
public double KneeLeft_Y { get; set; }
public double KneeLeft_Z { get; set; }
public double KneeLeft_depth_X { get; set; }
public double KneeLeft_depth_Y { get; set; }
public double KneeLeft_color_X { get; set; }
public double KneeLeft_color_Y { get; set; }
// Left ankle.
public double AnkleLeft_X { get; set; } // = 14,
public double AnkleLeft_Y { get; set; }
public double AnkleLeft_Z { get; set; }
public double AnkleLeft_depth_X { get; set; }
public double AnkleLeft_depth_Y { get; set; }
public double AnkleLeft_color_X { get; set; }
public double AnkleLeft_color_Y { get; set; }
// Left foot.
public double FootLeft_X { get; set; } // = 15,
public double FootLeft_Y { get; set; }
public double FootLeft_Z { get; set; }
public double FootLeft_depth_X { get; set; }
public double FootLeft_depth_Y { get; set; }
public double FootLeft_color_X { get; set; }
public double FootLeft_color_Y { get; set; }
// Right hip.
public double HipRight_X { get; set; } // = 16,
public double HipRight_Y { get; set; }
public double HipRight_Z { get; set; }
public double HipRight_depth_X { get; set; }
public double HipRight_depth_Y { get; set; }
public double HipRight_color_X { get; set; }
public double HipRight_color_Y { get; set; }
// Right knee.
public double KneeRight_X { get; set; } // = 17,
public double KneeRight_Y { get; set; }
public double KneeRight_Z { get; set; }
public double KneeRight_depth_X { get; set; }
public double KneeRight_depth_Y { get; set; }
public double KneeRight_color_X { get; set; }
public double KneeRight_color_Y { get; set; }
// Right ankle.
public double AnkleRight_X { get; set; } // = 18,
public double AnkleRight_Y { get; set; }
public double AnkleRight_Z { get; set; }
public double AnkleRight_depth_X { get; set; }
public double AnkleRight_depth_Y { get; set; }
public double AnkleRight_color_X { get; set; }
public double AnkleRight_color_Y { get; set; }
// Right foot.
public double FootRight_X { get; set; } // = 19,
public double FootRight_Y { get; set; }
public double FootRight_Z { get; set; }
public double FootRight_depth_X { get; set; }
public double FootRight_depth_Y { get; set; }
public double FootRight_color_X { get; set; }
public double FootRight_color_Y { get; set; }
// Between the shoulders on the spine.
public double SpineShoulder_X { get; set; } // = 20,
public double SpineShoulder_Y { get; set; }
public double SpineShoulder_Z { get; set; }
public double SpineShoulder_depth_X { get; set; }
public double SpineShoulder_depth_Y { get; set; }
public double SpineShoulder_color_X { get; set; }
public double SpineShoulder_color_Y { get; set; }
// Tip of the left hand.
public double HandTipLeft_X { get; set; } // = 21,
public double HandTipLeft_Y { get; set; }
public double HandTipLeft_Z { get; set; }
public double HandTipLeft_depth_X { get; set; }
public double HandTipLeft_depth_Y { get; set; }
public double HandTipLeft_color_X { get; set; }
public double HandTipLeft_color_Y { get; set; }
// Left thumb.
public double ThumbLeft_X { get; set; } // = 22,
public double ThumbLeft_Y { get; set; }
public double ThumbLeft_Z { get; set; }
public double ThumbLeft_depth_X { get; set; }
public double ThumbLeft_depth_Y { get; set; }
public double ThumbLeft_color_X { get; set; }
public double ThumbLeft_color_Y { get; set; }
// Tip of the right hand.
public double HandTipRight_X { get; set; } // = 23,
public double HandTipRight_Y { get; set; }
public double HandTipRight_Z { get; set; }
public double HandTipRight_depth_X { get; set; }
public double HandTipRight_depth_Y { get; set; }
public double HandTipRight_color_X { get; set; }
public double HandTipRight_color_Y { get; set; }
// Right thumb.
public double ThumbRight_X { get; set; } // = 24,
public double ThumbRight_Y { get; set; }
public double ThumbRight_Z { get; set; }
public double ThumbRight_depth_X { get; set; }
public double ThumbRight_depth_Y { get; set; }
public double ThumbRight_color_X { get; set; }
public double ThumbRight_color_Y { get; set; }
public SkeletonData() { }
public SkeletonData( int id, double[] a)
{
frameID = id;
int i=0;
SpineBase_X = a[i++];
SpineBase_Y = a[i++];
SpineBase_Z = a[i++];
SpineBase_depth_X = a[i++];
SpineBase_depth_Y = a[i++];
SpineBase_color_X = a[i++];
SpineBase_color_Y = a[i++];
// Middle of the spine.
SpineMid_X = a[i++];
SpineMid_Y = a[i++];
SpineMid_Z = a[i++];
SpineMid_depth_X = a[i++];
SpineMid_depth_Y = a[i++];
SpineMid_color_X = a[i++];
SpineMid_color_Y = a[i++];
// Neck.
Neck_X = a[i++];
Neck_Y = a[i++];
Neck_Z = a[i++];
Neck_depth_X = a[i++];
Neck_depth_Y = a[i++];
Neck_color_X = a[i++];
Neck_color_Y = a[i++];
// Head
Head_X = a[i++];
Head_Y = a[i++];
Head_Z = a[i++];
Head_depth_X = a[i++];
Head_depth_Y = a[i++];
Head_color_X = a[i++];
Head_color_Y = a[i++];
// Left shoulder.
ShoulderLeft_X = a[i++];
ShoulderLeft_Y = a[i++];
ShoulderLeft_Z = a[i++];
ShoulderLeft_depth_X = a[i++];
ShoulderLeft_depth_Y = a[i++];
ShoulderLeft_color_X = a[i++];
ShoulderLeft_color_Y = a[i++];
// Left elbow.
ElbowLeft_X = a[i++];
ElbowLeft_Y = a[i++];
ElbowLeft_Z = a[i++];
ElbowLeft_depth_X = a[i++];
ElbowLeft_depth_Y = a[i++];
ElbowLeft_color_X = a[i++];
ElbowLeft_color_Y = a[i++];
// Left wrist.
WristLeft_X = a[i++];
WristLeft_Y = a[i++];
WristLeft_Z = a[i++];
WristLeft_depth_X = a[i++];
WristLeft_depth_Y = a[i++];
WristLeft_color_X = a[i++];
WristLeft_color_Y = a[i++];
// Left hand.
HandLeft_X = a[i++];
HandLeft_Y = a[i++];
HandLeft_Z = a[i++];
HandLeft_depth_X = a[i++];
HandLeft_depth_Y = a[i++];
HandLeft_color_X = a[i++];
HandLeft_color_Y = a[i++];
// Right shoulder.
ShoulderRight_X = a[i++];
ShoulderRight_Y = a[i++];
ShoulderRight_Z = a[i++];
ShoulderRight_depth_X = a[i++];
ShoulderRight_depth_Y = a[i++];
ShoulderRight_color_X = a[i++];
ShoulderRight_color_Y = a[i++];
// Right elbow.
ElbowRight_X = a[i++];
ElbowRight_Y = a[i++];
ElbowRight_Z = a[i++];
ElbowRight_depth_X = a[i++];
ElbowRight_depth_Y = a[i++];
ElbowRight_color_X = a[i++];
ElbowRight_color_Y = a[i++];
// Right wrist.
WristRight_X = a[i++];
WristRight_Y = a[i++];
WristRight_Z = a[i++];
WristRight_depth_X = a[i++];
WristRight_depth_Y = a[i++];
WristRight_color_X = a[i++];
WristRight_color_Y = a[i++];
// Right hand.
HandRight_X = a[i++];
HandRight_Y = a[i++];
HandRight_Z = a[i++];
HandRight_depth_X = a[i++];
HandRight_depth_Y = a[i++];
HandRight_color_X = a[i++];
HandRight_color_Y = a[i++];
// Left hip.
HipLeft_X = a[i++];
HipLeft_Y = a[i++];
HipLeft_Z = a[i++];
HipLeft_depth_X = a[i++];
HipLeft_depth_Y = a[i++];
HipLeft_color_X = a[i++];
HipLeft_color_Y = a[i++];
// Left knee.
KneeLeft_X = a[i++];
KneeLeft_Y = a[i++];
KneeLeft_Z = a[i++];
KneeLeft_depth_X = a[i++];
KneeLeft_depth_Y = a[i++];
KneeLeft_color_X = a[i++];
KneeLeft_color_Y = a[i++];
// Left ankle.
AnkleLeft_X = a[i++];
AnkleLeft_Y = a[i++];
AnkleLeft_Z = a[i++];
AnkleLeft_depth_X = a[i++];
AnkleLeft_depth_Y = a[i++];
AnkleLeft_color_X = a[i++];
AnkleLeft_color_Y = a[i++];
// Left foot.
FootLeft_X = a[i++];
FootLeft_Y = a[i++];
FootLeft_Z = a[i++];
FootLeft_depth_X = a[i++];
FootLeft_depth_Y = a[i++];
FootLeft_color_X = a[i++];
FootLeft_color_Y = a[i++];
// Right hip.
HipRight_X = a[i++];
HipRight_Y = a[i++];
HipRight_Z = a[i++];
HipRight_depth_X = a[i++];
HipRight_depth_Y = a[i++];
HipRight_color_X = a[i++];
HipRight_color_Y = a[i++];
// Right knee.
KneeRight_X = a[i++];
KneeRight_Y = a[i++];
KneeRight_Z = a[i++];
KneeRight_depth_X = a[i++];
KneeRight_depth_Y = a[i++];
KneeRight_color_X = a[i++];
KneeRight_color_Y = a[i++];
// Right ankle.
AnkleRight_X = a[i++];
AnkleRight_Y = a[i++];
AnkleRight_Z = a[i++];
AnkleRight_depth_X = a[i++];
AnkleRight_depth_Y = a[i++];
AnkleRight_color_X = a[i++];
AnkleRight_color_Y = a[i++];
// Right foot.
FootRight_X = a[i++];
FootRight_Y = a[i++];
FootRight_Z = a[i++];
FootRight_depth_X = a[i++];
FootRight_depth_Y = a[i++];
FootRight_color_X = a[i++];
FootRight_color_Y = a[i++];
// Between the shoulders on the spine.
SpineShoulder_X = a[i++];
SpineShoulder_Y = a[i++];
SpineShoulder_Z = a[i++];
SpineShoulder_depth_X = a[i++];
SpineShoulder_depth_Y = a[i++];
SpineShoulder_color_X = a[i++];
SpineShoulder_color_Y = a[i++];
// Tip of the left hand.
HandTipLeft_X = a[i++];
HandTipLeft_Y = a[i++];
HandTipLeft_Z = a[i++];
HandTipLeft_depth_X = a[i++];
HandTipLeft_depth_Y = a[i++];
HandTipLeft_color_X = a[i++];
HandTipLeft_color_Y = a[i++];
// Left thumb.
ThumbLeft_X = a[i++];
ThumbLeft_Y = a[i++];
ThumbLeft_Z = a[i++];
ThumbLeft_depth_X = a[i++];
ThumbLeft_depth_Y = a[i++];
ThumbLeft_color_X = a[i++];
ThumbLeft_color_Y = a[i++];
// Tip of the right hand.
HandTipRight_X = a[i++];
HandTipRight_Y = a[i++];
HandTipRight_Z = a[i++];
HandTipRight_depth_X = a[i++];
HandTipRight_depth_Y = a[i++];
HandTipRight_color_X = a[i++];
HandTipRight_color_Y = a[i++];
// Right thumb.
ThumbRight_X = a[i++];
ThumbRight_Y = a[i++];
ThumbRight_Z = a[i++];
ThumbRight_depth_X = a[i++];
ThumbRight_depth_Y = a[i++];
ThumbRight_color_X = a[i++];
ThumbRight_color_Y = a[i++];
}
public double[] getDepthValues()
{
double[] depthValues = new double[50];
depthValues[0] = SpineBase_depth_X;
depthValues[1] = SpineBase_depth_Y;
depthValues[2] = SpineMid_depth_X;
depthValues[3] = SpineMid_depth_Y;
depthValues[4] = Neck_depth_X;
depthValues[5] = Neck_depth_Y;
depthValues[6] = Head_depth_X;
depthValues[7] = Head_depth_Y;
depthValues[8] = ShoulderLeft_depth_X;
depthValues[9] = ShoulderLeft_depth_Y;
depthValues[10] = ElbowLeft_depth_X;
depthValues[11] = ElbowLeft_depth_Y;
depthValues[12] = WristLeft_depth_X;
depthValues[13] = WristLeft_depth_Y;
depthValues[14] = HandLeft_depth_X;
depthValues[15] = HandLeft_depth_Y;
depthValues[16] = ShoulderRight_depth_X;
depthValues[17] = ShoulderRight_depth_Y;
depthValues[18] = ElbowRight_depth_X;
depthValues[19] = ElbowRight_depth_Y;
depthValues[20] = WristRight_depth_X;
depthValues[21] = WristRight_depth_Y;
depthValues[22] = HandRight_depth_X;
depthValues[23] = HandRight_depth_Y;
depthValues[24] = HipLeft_depth_X;
depthValues[25] = HipLeft_depth_Y;
depthValues[26] = KneeLeft_depth_X;
depthValues[27] = KneeLeft_depth_Y;
depthValues[28] = AnkleLeft_depth_X;
depthValues[29] = AnkleLeft_depth_Y;
depthValues[30] = FootLeft_depth_X;
depthValues[31] = FootLeft_depth_Y;
depthValues[32] = HipRight_depth_X;
depthValues[33] = HipRight_depth_Y;
depthValues[34] = KneeRight_depth_X;
depthValues[35] = KneeRight_depth_Y;
depthValues[36] = AnkleRight_depth_X;
depthValues[37] = AnkleRight_depth_Y;
depthValues[38] = FootRight_depth_X;
depthValues[39] = FootRight_depth_Y;
depthValues[40] = SpineShoulder_depth_X;
depthValues[41] = SpineShoulder_depth_Y;
depthValues[42] = HandTipLeft_depth_X;
depthValues[43] = HandTipLeft_depth_Y;
depthValues[44] = ThumbLeft_depth_X;
depthValues[45] = ThumbLeft_depth_Y;
depthValues[46] = HandTipRight_depth_X;
depthValues[47] = HandTipRight_depth_Y;
depthValues[48] = ThumbRight_depth_X;
depthValues[49] = ThumbRight_depth_Y;
return depthValues;
}
}
}