-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathplot_cdf2.asv
More file actions
352 lines (302 loc) · 19.2 KB
/
plot_cdf2.asv
File metadata and controls
352 lines (302 loc) · 19.2 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
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
%% CDF
clc
close all;
clear all;
%% Color parameter
num_objects = 4;
linecolors = linspecer(num_objects, 'qualitative');
LineColors = flipud(linecolors);
%% Previous test
% fileID = fopen('/media/shapelim/UX9804/uHumans2_cloud/0730_w_gt_w_labels_to_skip/uhumans2__mesh_objects__ALIGNED_ROBOTS/chamfer_distances.txt', 'r');
% mesh_objects = textscan(fileID, '%s %s %f %f %f %f');
% fclose(fileID);
%
% fileID = fopen('/media/shapelim/UX9804/uHumans2_cloud/0730_w_gt_w_labels_to_skip/uhumans2__khronos__ALIGNED_ROBOTS/chamfer_distances.txt', 'r');
% khronos = textscan(fileID, '%s %s %f %f %f %f');
% fclose(fileID);
%
% fileID = fopen('/media/shapelim/UX9804/uHumans2_cloud/0730_w_gt_w_labels_to_skip/uhumans2__crisp__ALIGNED_ROBOTS/chamfer_distances.txt', 'r');
% crisp = textscan(fileID, '%s %s %f %f %f %f');
% fclose(fileID);
%% Load output file
% v1
% fileID = fopen('/home/shapelim/multi_ws/src/hydra_multi_system/hydra_multi_evaluation/scripts/results/0804_w_gt_w_plants/uhumans2__mesh_objects__ALIGNED_ROBOTS/chamfer_distances.txt', 'r');
% mesh_objects = textscan(fileID, '%s %s %f %f %f %f');
% fclose(fileID);
%
% fileID = fopen('/home/shapelim/multi_ws/src/hydra_multi_system/hydra_multi_evaluation/scripts/results/0804_w_gt_w_plants/uhumans2__khronos__ALIGNED_ROBOTS/chamfer_distances.txt', 'r');
% khronos = textscan(fileID, '%s %s %f %f %f %f');
% fclose(fileID);
%
% fileID = fopen('/home/shapelim/multi_ws/src/hydra_multi_system/hydra_multi_evaluation/scripts/results/0804_w_gt_w_plants/uhumans2__crisp_wo_cert__ALIGNED_ROBOTS/chamfer_distances.txt', 'r');
% crisp_wo_certifier = textscan(fileID, '%s %s %f %f %f %f %f %f %f');
% fclose(fileID);
%
% fileID = fopen('/home/shapelim/multi_ws/src/hydra_multi_system/hydra_multi_evaluation/scripts/results/0804_w_gt_w_plants/uhumans2__crisp_wo_cert__ALIGNED_ROBOTS/chamfer_distances.txt', 'r');
% crisp = textscan(fileID, '%s %s %f %f %f %f %f %f %f');
% fclose(fileID);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
fileID = fopen('/media/shapelim/UX9804/objectra_uHumans2_cloud/0813_w_gt_w_updated_bins/uhumans2__mesh_objects__ALIGNED_ROBOTS/chamfer_distances.txt', 'r');
mesh_objects = textscan(fileID, '%s %s %d %f %f %f %f %f');
fclose(fileID);
fileID = fopen('/media/shapelim/UX9804/objectra_uHumans2_cloud/0813_w_gt_w_updated_bins/uhumans2__khronos__ALIGNED_ROBOTS/chamfer_distances.txt', 'r');
khronos = textscan(fileID, '%s %s %d %f %f %f %f %f');
fclose(fileID);
fileID = fopen('/home/shapelim/multi_ws/src/hydra_multi_system/hydra_multi_evaluation/scripts/results/0813_w_gt_w_updated_bins/uhumans2__crisp_P41O3_wo_cert___ALIGNED_ROBOTS/chamfer_distances.txt', 'r');
crisp_wo_certifier = textscan(fileID, '%s %s %d %f %f %f %f %f %f %f');
fclose(fileID);
fileID = fopen('/home/shapelim/multi_ws/src/hydra_multi_system/hydra_multi_evaluation/scripts/results/0813_w_gt_w_updated_bins/uhumans2__crisp_P41O3_wo_cert___ALIGNED_ROBOTS/chamfer_distances.txt', 'r');
crisp = textscan(fileID, '%s %s %d %f %f %f %f %f %f %f');
fclose(fileID);
disp("Loading data complete!");
%% Plot parameters;
MAX_RANGE = 0.5;
INTERVAL = 100;
lindwidth = 2.5;
markerSize = 15;
LegendFontSize = 20;
ticksFontSIze = 20;
XLabelFontSize = 20; YLabelFontSize = 20;
precision_thr = 0.21;
IMAGE_WIDTH = 500;
IMAGE_HEIGHT = 450;
%% Draw cdf of chamfer distance:
figure("name", "Total", 'Position', [50, 50, IMAGE_WIDTH, IMAGE_HEIGHT]);
set(gca,'LooseInset', max(get(gca,'TightInset'), 0.02))
set(gca, 'FontSize', 25);
set(groot, 'defaultAxesTickLabelInterpreter','latex');
gap = MAX_RANGE / INTERVAL;
x_linspace = 0:gap:MAX_RANGE;
mesh_objects_cum = calcCDF(mesh_objects{4}, MAX_RANGE, INTERVAL) * 100;
khronos_cum = calcCDF(khronos{4}, MAX_RANGE, INTERVAL) * 100;
crisp_wo_certifier_cum = calcCDF(crisp_wo_certifier{4}, MAX_RANGE, INTERVAL) * 100;
crisp_w_filtering = crisp{4}(crisp_wo_certifier{10} > precision_thr);
crisp_cum = calcCDF(crisp_w_filtering, MAX_RANGE, INTERVAL) * 100;
crisp_w_filtering_b_iou = crisp{7}(crisp_wo_certifier{10} > precision_thr);
crisp_w_filtering_v_iou = crisp{8}(crisp_wo_certifier{10} > precision_thr);
disp("For all classes:");
fprintf("Hydra: B-IoU = %.3f, v-IoU = %.3f\n", mean(mesh_objects{7}), mean(mesh_objects{8}));
fprintf("Khronos: B-IoU = %.3f, v-IoU = %.3f\n", mean(khronos{7}), mean(khronos{8}));
fprintf("Ours w/o RMCC:B-IoU = %.3f, v-IoU = %.3f\n", mean(crisp_wo_certifier{7}), mean(crisp_wo_certifier{8}));
fprintf("Ours: B-IoU = %.3f, v-IoU = %.3f\n", mean(crisp_w_filtering_b_iou), mean(crisp_w_filtering_v_iou));
plot(x_linspace, mesh_objects_cum, '-.^', 'Color', LineColors(3, :), "MarkerSize", markerSize, ...
'LineWidth', lindwidth, 'MarkerIndices',1:8:length(x_linspace));
hold on;
plot(x_linspace, khronos_cum, '--d', 'Color', LineColors(1, :), "MarkerSize", markerSize, 'LineWidth', lindwidth, 'MarkerIndices',1:8:length(x_linspace));
plot(x_linspace, crisp_wo_certifier_cum,'-s', 'Color', LineColors(4, :), "MarkerSize", markerSize, 'LineWidth', lindwidth, 'MarkerIndices',1:8:length(x_linspace));
plot(x_linspace, crisp_cum, '-o', 'Color', LineColors(2, :), "MarkerSize", markerSize, 'LineWidth', lindwidth, 'MarkerIndices',1:8:length(x_linspace));
lgd = legend({'Hydra','Khronos', 'Ours w/o RMCC', 'Ours'},'Location','southeast','NumColumns',1, 'fontsize', LegendFontSize);
lgd.Interpreter = 'latex';
grid on;
set(gca, 'FontSize', ticksFontSIze);
xlabel('Chamfer distance [m$^2$]', "FontSize", XLabelFontSize, "Interpreter", 'latex')
ylabel('Percentage [\%]', "FontSize", YLabelFontSize, "Interpreter", 'latex')
print(gcf, "imgs/cdf_for_chamfer_distance.png",'-dpng','-r300');
% print -depsc 'imgs/cdf_for_chamfer_distance.eps'
exportgraphics(gcf, 'imgs/cdf_for_chamfer_distance.pdf', 'ContentType', 'vector');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Class-wise
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Class 5
figure("name", "Class 5 (Chair)", 'Position', [50, 700, IMAGE_WIDTH, IMAGE_HEIGHT]);
set(gca,'LooseInset', max(get(gca,'TightInset'), 0.02))
set(groot, 'defaultAxesTickLabelInterpreter','latex');
% Update this label
target_class_label = 5;
num_objects_in_gt = 33; % manually checked
gap = MAX_RANGE / num_objects_in_gt;
x_linspace = 0:gap:MAX_RANGE;
selected_mesh_objects = mesh_objects{4}(mesh_objects{3} == target_class_label);
selected_khronos = khronos{4}(khronos{3} == target_class_label);
selected_crisp_wo_cert = crisp_wo_certifier{4}(crisp_wo_certifier{3} == target_class_label);
selected_crisp = crisp{4}(crisp{3} == target_class_label & crisp_wo_certifier{10} > precision_thr);
disp(['# of valid node in class 5: ']);
size(selected_crisp)
mesh_objects_cum = calcCDF(selected_mesh_objects, MAX_RANGE, num_objects_in_gt) * 100;
khronos_cum = calcCDF(selected_khronos, MAX_RANGE, num_objects_in_gt) * 100;
crisp_wo_certifier_cum = calcCDF(selected_crisp_wo_cert, MAX_RANGE, num_objects_in_gt) * 100;
crisp_cum = calcCDF(selected_crisp, MAX_RANGE, num_objects_in_gt) * 100;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
m_b_iou = mesh_objects{7}(mesh_objects{3} == target_class_label);
m_v_iou = mesh_objects{8}(mesh_objects{3} == target_class_label);
k_b_iou = khronos{7}(khronos{3} == target_class_label);
k_v_iou = khronos{8}(khronos{3} == target_class_label);
c_b_iou = crisp_wo_certifier{7}(crisp_wo_certifier{3} == target_class_label);
c_v_iou = crisp_wo_certifier{8}(crisp_wo_certifier{3} == target_class_label);
c_w_filtering_b_iou = crisp{7}(crisp{3} == target_class_label & crisp{10} > precision_thr);
c_w_filtering_v_iou = crisp{8}(crisp{3} == target_class_label & crisp{10} > precision_thr);
disp("For class:" + target_class_label);
fprintf("Hydra: B-IoU = %.3f, v-IoU = %.3f\n", mean(m_b_iou), mean(m_v_iou));
fprintf("Khronos: B-IoU = %.3f, v-IoU = %.3f\n", mean(k_b_iou), mean(k_v_iou));
fprintf("Ours w/o RMCC:B-IoU = %.3f, v-IoU = %.3f\n", mean(c_b_iou), mean(c_v_iou));
fprintf("Ours: B-IoU = %.3f, v-IoU = %.3f\n", mean(c_w_filtering_b_iou), mean(c_w_filtering_v_iou));
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
plot(x_linspace, mesh_objects_cum, '-.^', 'Color', LineColors(3, :), "MarkerSize", markerSize, ...
'LineWidth', lindwidth, 'MarkerIndices',1:3:length(x_linspace));
hold on;
plot(x_linspace, khronos_cum, '--d', 'Color', LineColors(1, :), "MarkerSize", markerSize, 'LineWidth', lindwidth, 'MarkerIndices',1:3:length(x_linspace));
plot(x_linspace, crisp_wo_certifier_cum,'-s', 'Color', LineColors(4, :), "MarkerSize", markerSize, 'LineWidth', lindwidth, 'MarkerIndices',1:3:length(x_linspace));
plot(x_linspace, crisp_cum, '-o', 'Color', LineColors(2, :), "MarkerSize", markerSize, 'LineWidth', lindwidth, 'MarkerIndices',1:3:length(x_linspace));
lgd = legend({'Hydra','Khronos', 'Ours w/o RMCC', 'Ours'},'Location','southeast','NumColumns',1, 'fontsize', LegendFontSize);
lgd.Interpreter = 'latex';
grid on;
set(gca, 'FontSize', ticksFontSIze);
xlabel('Chamfer distance [m$^2$]', "FontSize", XLabelFontSize, "Interpreter", 'latex')
ylabel('Percentage [\%]', "FontSize", YLabelFontSize, "Interpreter", 'latex')
print(gcf, "imgs/cdf_for_chamfer_distance_class5.png",'-dpng','-r300');
% print -depsc 'imgs/cdf_for_chamfer_distance.eps'
exportgraphics(gcf, 'imgs/cdf_for_chamfer_distance_class5.pdf', 'ContentType', 'vector');
%% Class 7
figure("name", "Class 7 (Couch)", 'Position', [700, 700, IMAGE_WIDTH, IMAGE_HEIGHT]);
set(gca,'LooseInset', max(get(gca,'TightInset'), 0.02))
set(groot, 'defaultAxesTickLabelInterpreter','latex');
% Update this label
target_class_label = 7;
num_objects_in_gt = 19; % manually checked
gap = MAX_RANGE / num_objects_in_gt;
x_linspace = 0:gap:MAX_RANGE;
selected_mesh_objects = mesh_objects{4}(mesh_objects{3} == target_class_label);
selected_khronos = khronos{4}(khronos{3} == target_class_label);
selected_crisp_wo_cert = crisp_wo_certifier{4}(crisp_wo_certifier{3} == target_class_label);
selected_crisp = crisp{4}(crisp{3} == target_class_label & crisp_wo_certifier{10} > precision_thr);
disp(['# of valid node in class 7: ']);
size(selected_crisp)
mesh_objects_cum = calcCDF(selected_mesh_objects, MAX_RANGE, num_objects_in_gt) * 100;
khronos_cum = calcCDF(selected_khronos, MAX_RANGE, num_objects_in_gt) * 100;
crisp_wo_certifier_cum = calcCDF(selected_crisp_wo_cert, MAX_RANGE, num_objects_in_gt) * 100;
crisp_cum = calcCDF(selected_crisp, MAX_RANGE, num_objects_in_gt) * 100;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
m_b_iou = mesh_objects{7}(mesh_objects{3} == target_class_label);
m_v_iou = mesh_objects{8}(mesh_objects{3} == target_class_label);
k_b_iou = khronos{7}(khronos{3} == target_class_label);
k_v_iou = khronos{8}(khronos{3} == target_class_label);
c_b_iou = crisp_wo_certifier{7}(crisp_wo_certifier{3} == target_class_label);
c_v_iou = crisp_wo_certifier{8}(crisp_wo_certifier{3} == target_class_label);
c_w_filtering_b_iou = crisp{7}(crisp{3} == target_class_label & crisp{10} > precision_thr);
c_w_filtering_v_iou = crisp{8}(crisp{3} == target_class_label & crisp{10} > precision_thr);
disp("For class:" + target_class_label);
fprintf("Hydra: B-IoU = %.3f, v-IoU = %.3f\n", mean(m_b_iou), mean(m_v_iou));
fprintf("Khronos: B-IoU = %.3f, v-IoU = %.3f\n", mean(k_b_iou), mean(k_v_iou));
fprintf("Ours w/o RMCC:B-IoU = %.3f, v-IoU = %.3f\n", mean(c_b_iou), mean(c_v_iou));
fprintf("Ours: B-IoU = %.3f, v-IoU = %.3f\n", mean(c_w_filtering_b_iou), mean(c_w_filtering_v_iou));
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
plot(x_linspace, mesh_objects_cum, '-.^', 'Color', LineColors(3, :), "MarkerSize", markerSize, ...
'LineWidth', lindwidth, 'MarkerIndices',1:2:length(x_linspace));
hold on;
plot(x_linspace, khronos_cum, '--d', 'Color', LineColors(1, :), "MarkerSize", markerSize, 'LineWidth', lindwidth, 'MarkerIndices',1:2:length(x_linspace));
plot(x_linspace, crisp_wo_certifier_cum, '-s', 'Color', LineColors(4, :), "MarkerSize", markerSize, 'LineWidth', lindwidth, 'MarkerIndices',1:2:length(x_linspace));
plot(x_linspace, crisp_cum, '-o', 'Color', LineColors(2, :), "MarkerSize", markerSize, 'LineWidth', lindwidth, 'MarkerIndices',1:2:length(x_linspace));
lgd = legend({'Hydra','Khronos', 'Ours w/o RMCC', 'Ours'},'Location','southeast','NumColumns',1, 'fontsize', LegendFontSize);
lgd.Interpreter = 'latex';
grid on;
set(gca, 'FontSize', ticksFontSIze);
xlabel('Chamfer distance [m$^2$]', "FontSize", XLabelFontSize, "Interpreter", 'latex')
ylabel('Percentage [\%]', "FontSize", YLabelFontSize, "Interpreter", 'latex')
print(gcf, "imgs/cdf_for_chamfer_distance_class7.png",'-dpng','-r300');
% print -depsc 'imgs/cdf_for_chamfer_distance.eps'
exportgraphics(gcf, 'imgs/cdf_for_chamfer_distance_class7.pdf', 'ContentType', 'vector');
%% Class 13
figure("name", "Class 13 (plant)", 'Position', [50, 1500, IMAGE_WIDTH, IMAGE_HEIGHT]);
set(gca,'LooseInset', max(get(gca,'TightInset'), 0.02))
set(groot, 'defaultAxesTickLabelInterpreter','latex');
% Update this label
target_class_label = 13;
num_objects_in_gt = 12; % manually checked
gap = MAX_RANGE / num_objects_in_gt;
x_linspace = 0:gap:MAX_RANGE;
selected_mesh_objects = mesh_objects{4}(mesh_objects{3} == target_class_label);
selected_khronos = khronos{4}(khronos{3} == target_class_label);
selected_crisp_wo_cert = crisp_wo_certifier{4}(crisp_wo_certifier{3} == target_class_label);
selected_crisp = crisp{4}(crisp{3} == target_class_label & crisp_wo_certifier{10} > precision_thr);
disp(['# of valid node in class 13: ']);
size(selected_crisp)
mesh_objects_cum = calcCDF(selected_mesh_objects, MAX_RANGE, num_objects_in_gt) * 100;
khronos_cum = calcCDF(selected_khronos, MAX_RANGE, num_objects_in_gt) * 100;
crisp_wo_certifier_cum = calcCDF(selected_crisp_wo_cert, MAX_RANGE, num_objects_in_gt) * 100;
crisp_cum = calcCDF(selected_crisp, MAX_RANGE, num_objects_in_gt) * 100;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
m_b_iou = mesh_objects{7}(mesh_objects{3} == target_class_label);
m_v_iou = mesh_objects{8}(mesh_objects{3} == target_class_label);
k_b_iou = khronos{7}(khronos{3} == target_class_label);
k_v_iou = khronos{8}(khronos{3} == target_class_label);
c_b_iou = crisp_wo_certifier{7}(crisp_wo_certifier{3} == target_class_label);
c_v_iou = crisp_wo_certifier{8}(crisp_wo_certifier{3} == target_class_label);
c_w_filtering_b_iou = crisp{7}(crisp{3} == target_class_label & crisp{10} > precision_thr);
c_w_filtering_v_iou = crisp{8}(crisp{3} == target_class_label & crisp{10} > precision_thr);
disp("For class:" + target_class_label);
fprintf("Hydra: B-IoU = %.3f, v-IoU = %.3f\n", mean(m_b_iou), mean(m_v_iou));
fprintf("Khronos: B-IoU = %.3f, v-IoU = %.3f\n", mean(k_b_iou), mean(k_v_iou));
fprintf("Ours w/o RMCC:B-IoU = %.3f, v-IoU = %.3f\n", mean(c_b_iou), mean(c_v_iou));
fprintf("Ours: B-IoU = %.3f, v-IoU = %.3f\n", mean(c_w_filtering_b_iou), mean(c_w_filtering_v_iou));
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
plot(x_linspace, mesh_objects_cum, '-.^', 'Color', LineColors(3, :), "MarkerSize", markerSize, ...
'LineWidth', lindwidth, 'MarkerIndices',1:2:length(x_linspace));
hold on;
plot(x_linspace, khronos_cum, '--d', 'Color', LineColors(1, :), "MarkerSize", markerSize, 'LineWidth', lindwidth, 'MarkerIndices',1:2:length(x_linspace));
plot(x_linspace, crisp_wo_certifier_cum,'-s', 'Color', LineColors(4, :), "MarkerSize", markerSize, 'LineWidth', lindwidth, 'MarkerIndices',1:2:length(x_linspace));
plot(x_linspace, crisp_cum, '-o', 'Color', LineColors(2, :), "MarkerSize", markerSize, 'LineWidth', lindwidth, 'MarkerIndices',1:2:length(x_linspace));
lgd = legend({'Hydra','Khronos', 'Ours w/o RMCC', 'Ours'},'Location','southeast','NumColumns',1, 'fontsize', LegendFontSize);
lgd.Interpreter = 'latex';
grid on;
set(gca, 'FontSize', ticksFontSIze);
xlabel('Chamfer distance [m$^2$]', "FontSize", XLabelFontSize, "Interpreter", 'latex')
ylabel('Percentage [\%]', "FontSize", YLabelFontSize, "Interpreter", 'latex')
print(gcf, "imgs/cdf_for_chamfer_distance_class13.png",'-dpng','-r300');
% print -depsc 'imgs/cdf_for_chamfer_distance.eps'
exportgraphics(gcf, 'imgs/cdf_for_chamfer_distance_class13.pdf', 'ContentType', 'vector');
%% Class 18
figure("name", "Class 18 (bin)", 'Position', [700, 1500, IMAGE_WIDTH, IMAGE_HEIGHT]);
set(gca,'LooseInset', max(get(gca,'TightInset'), 0.02))
set(groot, 'defaultAxesTickLabelInterpreter','latex');
% Update this label
target_class_label = 18;
num_objects_in_gt = 31;
gap = MAX_RANGE / num_objects_in_gt;
x_linspace = 0:gap:MAX_RANGE;
selected_mesh_objects = mesh_objects{4}(mesh_objects{3} == target_class_label);
selected_khronos = khronos{4}(khronos{3} == target_class_label);
selected_crisp_wo_cert = crisp_wo_certifier{4}(crisp_wo_certifier{3} == target_class_label);
selected_crisp = crisp{4}(crisp{3} == target_class_label & crisp_wo_certifier{10} > precision_thr);
disp(['# of valid node in class 18: ']);
size(selected_crisp)
mesh_objects_cum = calcCDF(selected_mesh_objects, MAX_RANGE, num_objects_in_gt) * 100;
khronos_cum = calcCDF(selected_khronos, MAX_RANGE, num_objects_in_gt) * 100;
crisp_wo_certifier_cum = calcCDF(selected_crisp_wo_cert, MAX_RANGE, num_objects_in_gt) * 100;
crisp_cum = calcCDF(selected_crisp, MAX_RANGE, num_objects_in_gt) * 100;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
m_b_iou = mesh_objects{7}(mesh_objects{3} == target_class_label);
m_v_iou = mesh_objects{8}(mesh_objects{3} == target_class_label);
k_b_iou = khronos{7}(khronos{3} == target_class_label);
k_v_iou = khronos{8}(khronos{3} == target_class_label);
c_b_iou = crisp_wo_certifier{7}(crisp_wo_certifier{3} == target_class_label);
c_v_iou = crisp_wo_certifier{8}(crisp_wo_certifier{3} == target_class_label);
c_w_filtering_b_iou = crisp{7}(crisp{3} == target_class_label & crisp{10} > precision_thr);
c_w_filtering_v_iou = crisp{8}(crisp{3} == target_class_label & crisp{10} > precision_thr);
disp("For class:" + target_class_label);
fprintf("Hydra: B-IoU = %.3f, v-IoU = %.3f\n", mean(m_b_iou), mean(m_v_iou));
fprintf("Khronos: B-IoU = %.3f, v-IoU = %.3f\n", mean(k_b_iou), mean(k_v_iou));
fprintf("Ours w/o RMCC:B-IoU = %.3f, v-IoU = %.3f\n", mean(c_b_iou), mean(c_v_iou));
fprintf("Ours: B-IoU = %.3f, v-IoU = %.3f\n", mean(c_w_filtering_b_iou), mean(c_w_filtering_v_iou));
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
plot(x_linspace, mesh_objects_cum, '-.^', 'Color', LineColors(3, :), "MarkerSize", markerSize, ...
'LineWidth', lindwidth, 'MarkerIndices',1:3:length(x_linspace));
hold on;
plot(x_linspace, khronos_cum, '--d', 'Color', LineColors(1, :), ...
"MarkerSize", markerSize, 'LineWidth', lindwidth, ...
'MarkerIndices',1:3:length(x_linspace));
plot(x_linspace, crisp_wo_certifier_cum,'-s', 'Color', LineColors(4, :), ...
"MarkerSize", markerSize, 'LineWidth', lindwidth, ...
'MarkerIndices',1:3:length(x_linspace));
plot(x_linspace, crisp_cum, '-o', 'Color', LineColors(2, :), ...
"MarkerSize", markerSize, 'LineWidth', lindwidth, ...
'MarkerIndices',1:3:length(x_linspace));
lgd = legend({'Hydra','Khronos', 'Ours w/o RMCC', 'Ours'}, ...
'Location','southeast','NumColumns',1, 'fontsize', LegendFontSize);
lgd.Interpreter = 'latex';
grid on;
set(gca, 'FontSize', ticksFontSIze);
xlabel('Chamfer distance [m$^2$]', "FontSize", XLabelFontSize, "Interpreter", 'latex')
ylabel('Percentage [\%]', "FontSize", YLabelFontSize, "Interpreter", 'latex')
print(gcf, "imgs/cdf_for_chamfer_distance_class18.png",'-dpng','-r300');
% print -depsc 'imgs/cdf_for_chamfer_distance.eps'
exportgraphics(gcf, 'imgs/cdf_for_chamfer_distance_class18.pdf', 'ContentType', 'vector');