-
Notifications
You must be signed in to change notification settings - Fork 11
/
performance.m
36 lines (29 loc) · 906 Bytes
/
performance.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
% algorithms to performance test
algos = {@rxg, @rxl, @dwest, @nswtd, @mwnswtd, @pcag, @mwpcag, @pcad, @knna};
algos_nice = {'Global RX', 'Local RX', 'DWEST', 'NSWTD', 'MW-NSWTD', 'PCAG', 'MW-PCAG', 'PCAD', 'KNN'};
% scenes to compare
scene_files = {'beach.jpg', 'desert.jpg', 'island.jpg'};
% results
tbl = zeros(numel(algos), numel(scene_files));
for i = 1:numel(algos)
cb = algos{i};
for j = 1:numel(scene_files)
% load scene
scene = scene_files{j};
s = load(sprintf('output/%s.mat', scene), 'scene');
img = s.scene;
% profile
t = cputime;
a = cb(img);
e = cputime - t;
% store result
tbl(i, j) = e;
end
end
% bar plot
b = bar(tbl);
ylabel('Average time (s)');
xlabel('Algorithm');
set(gca, 'XTickLabel', algos_nice);
title('Execution Time');
print(gcf, 'exec.png', '-dpng', '-r300');