-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdrawBox2D_detection.m
36 lines (32 loc) · 1.54 KB
/
drawBox2D_detection.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
function drawBox2D(h,object,color,min_score)
% set styles for occlusion and truncation
%occ_col = {'g','y','r','w'};
trun_style = {'-','--'};
% draw regular objects
if ((~strcmp(object.type,'DontCare')) & object.score>min_score)%jdk edit
% fprintf('Hello! :)\n');
% show rectangular bounding boxes
pos = [object.x1,object.y1,object.x2-object.x1+1,object.y2-object.y1+1];
trc = double(object.truncation>0.1)+1;
% rectangle('Position',pos,'EdgeColor',occ_col{object.occlusion+1},...
% 'LineWidth',3,'LineStyle',trun_style{trc},'parent',h(1).axes)
rectangle('Position',pos,'EdgeColor',color,... %jdk edit, remove occlusion colorings
'LineWidth',3,'LineStyle',trun_style{trc},'parent',h(1).axes) %jdk edit, remove occlusion colorings
rectangle('Position',pos,'EdgeColor','b', 'parent', h(1).axes)
% draw label
label_text = sprintf('%s - %d\n%1.1f rad',object.type,object.id,object.alpha);
x = (object.x1+object.x2)/2;
y = object.y1;
% text(x,max(y-5,40),label_text,'color',occ_col{object.occlusion+1},...
text(x,max(y-5,40),label_text,'color',color,... %jdk edit, remove occlusion colorings
'BackgroundColor','k','HorizontalAlignment','center',...
'VerticalAlignment','bottom','FontWeight','bold',...
'FontSize',12,'parent',h(1).axes);
% % draw don't care regions
% else
%
% % draw dotted rectangle
% pos = [object.x1,object.y1,object.x2-object.x1+1,object.y2-object.y1+1];
% rectangle('Position',pos,'EdgeColor','c',...
% 'LineWidth',2,'LineStyle','-','parent',h(1).axes)
end