-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathright_hand_coordinates.m
63 lines (57 loc) · 2.32 KB
/
right_hand_coordinates.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
function BX=right_hand_coordinates()
flag=1;
for i=1:678
%filename='H:\Adavus and postures\another1\export\USB-VID_045E&PID_02BF-0000000000000000_'
%filename='H:\Adavus and postures\good\export\export2\USB-VID_045E&PID_02BF-0000000000000000_'
%filename='H:\Adavus and postures\abhishek1\export\USB-VID_045E&PID_02BF-0000000000000000_';
%filename='H:\Adavus and postures\abhishek1\export\USB-VID_045E&PID_02BF-0000000000000000_'
filename='E:\Natta_MatFiles\USB-VID_045E&PID_02BF-0000000000000000_'
temp=num2str(i);
filename=strcat(filename,temp);
A=load(filename);
fprintf('filename : %s\n',filename);
%disp(filename);
for j=1:6
if strcmp(A.SkeletonFrame.Skeletons(j).TrackingState,'Tracked')==1
flag=0;
break;
end
end
if flag==0
break;
end
% if i==50
% [m n]=size(X);
% BX = zeros(m, n);
% f1=fopen('temp.txt','w');
% for j=1:m
% for k=1:n
% fprintf(f1,'%d,%d,%d\n',X(j,k),Y(j,k),Z(j,k));
% end
% end
%
% end
end
output_file1=strcat('data_xy.txt');
f1=fopen(output_file1,'w');
output_file2=strcat('data_yz.txt');
f2=fopen(output_file2,'w');
output_file3=strcat('data_zx.txt');
f3=fopen(output_file3,'w');
for k=i:531
filename='E:\Natta_MatFiles\USB-VID_045E&PID_02BF-0000000000000000_'
temp=num2str(k);
filename=strcat(filename,temp);
A=load(filename);
for l=1:6
if strcmp(A.SkeletonFrame.Skeletons(l).TrackingState,'Tracked')==1
break;
end
end
fprintf(f1,'%f %f %d\n',A.SkeletonFrame.Skeletons(l).Joints(12).Position.X,A.SkeletonFrame.Skeletons(l).Joints(12).Position.Y,k);
% A.SkeletonFrame.Skeletons(l).Joints(12).Position.X,A.SkeletonFrame.Skeletons(l).Joints(12).Position.Y,k;
fprintf(f2,'%f %f %d\n',A.SkeletonFrame.Skeletons(l).Joints(12).Position.Y,A.SkeletonFrame.Skeletons(l).Joints(12).Position.Z,k);
fprintf(f3,'%f %f %d\n',A.SkeletonFrame.Skeletons(l).Joints(12).Position.Z,A.SkeletonFrame.Skeletons(l).Joints(12).Position.X,k);
end
%fclose(f1);fclose(f2);fclose(f3);
end