show_from_motion_patch_25.m
1.41 KB
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
%your motion_patch location
ori = imread('/home/rfj/바탕화면/actionGAN/motion_patch/S001C001P001R001A020.png');
ori = im2double(ori);
ori = ori(:,:,:);
dx = [];
dy = [];
dz = [];
for f = 1:numel(ori(:,1,1))
for j = 1:25
dx = [dx;ori(f,j,1)];
dy = [dy;ori(f,j,2)];
dz = [dz;ori(f,j,3)];
end
end
a = [1 0 0]; % Red 척추 1,2,3,4,20
b = [0 0 1]; % Blue 오른팔 8,9,10,11,23,24
c = [0 1 0]; % Green왼팔 5,6,7,21,22 (여기서 5번이 빠짐. 넣고싶으면 나중에 24 joint가 아니라 25 joint로 추가)
d = [1 1 0]; % Yellow 오른다리 16,17,18,19
e = [0 1 1]; % Skyblue 왼다리 12,13,14,15
colors = [a;a;a;a;c;c;c;c;b;b;b;b;e;e;e;e;d;d;d;d;a;c;c;b;b];
scatter3(dx,dy,dz,100,'filled');
connecting_joints= ...
[2 1 21 3 21 5 6 7 21 9 10 11 1 13 14 15 1 17 18 19 2 8 8 12 12];
for jj=1:25:numel(dx)% 1부터 8개씩 numel = 열갯수..?
current = [];
current(:,1) = dy(jj:jj+24) ;
current(:,2) = dz(jj:jj+24) ;
current(:,3) = dx(jj:jj+24) ;
scatter3(current(:,1),current(:,2),current(:,3),100,colors(:,:),'filled');
for j =1:25
k=connecting_joints(j);
line([current(j,1) current(k,1)], [current(j,2) current(k,2)] , [current(j,3) current(k,3)])
end
set(gca,'Xdir','reverse','Ydir','reverse')
xlim([0 1]);
xlabel('x')
ylim([0 1]);
ylabel('y')
zlim([0 1]);
zlabel('z')
drawnow
pause(0.01)
end