forked from ZouCheng321/fusion_kitti
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdrawBox3D.m
27 lines (24 loc) · 986 Bytes
/
drawBox3D.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
function drawBox3D(h,occlusion,corners,face_idx,orientation)
% set styles for occlusion and truncation
occ_col = {'w','g','y','r'};
% draw projected 3D bounding boxes
if ~isempty(corners)
for f=1:4
line([corners(1,face_idx(f,:)),corners(1,face_idx(f,1))]+1,...
[corners(2,face_idx(f,:)),corners(2,face_idx(f,1))]+1,...
'parent',h(2).axes, 'color',occ_col{occlusion+2},...
'LineWidth',6);
line([corners(1,face_idx(f,:)),corners(1,face_idx(f,1))]+1,...
[corners(2,face_idx(f,:)),corners(2,face_idx(f,1))]+1,...
'parent',h(2).axes,'color','k','LineWidth',2);
end
end
% draw orientation vector
if ~isempty(orientation)
line([orientation(1,:),orientation(1,:)]+1,...
[orientation(2,:),orientation(2,:)]+1,...
'parent',h(2).axes,'color','w','LineWidth',6);
line([orientation(1,:),orientation(1,:)]+1,...
[orientation(2,:),orientation(2,:)]+1,...
'parent',h(2).axes,'color','k','LineWidth',2);
end