diff --git a/analyze.m b/analyze.m index 0f2bb96..cdf872f 100644 --- a/analyze.m +++ b/analyze.m @@ -1,6 +1,6 @@ % algorithms to compare -algos = {'rx', 'dwest', 'nswtd', 'mwnswtd', 'pcag'}; -algos_nice = {'Global RX', 'DWEST', 'NSWTD', 'MW-NSWTD', 'PCAG'}; +algos = {'rx', 'rxl', 'dwest', 'nswtd', 'mwnswtd', 'pcag', 'mwpcag', 'knna'}; +algos_nice = {'Global RX', 'Local RX', 'DWEST', 'NSWTD', 'MW-NSWTD', 'PCAG', 'MW-PCAG', 'KNN'}; % scenes to compare scene_files = dir('scenes/*.jpg'); @@ -8,7 +8,7 @@ % scene_files = {'beach.jpg', 'desert.jpg', 'island.jpg'}; % color spaces to compare -color_spaces = {'RGB', 'L*a*b', 'u''v''L', 'uvL', 'xyY', 'XYZ', '*a*b', 'u''v''', 'uv', 'xy', 'XZ', 'log(L)*a*b'}; +color_spaces = {'RGB', 'L*a*b', 'u''v''L', 'uvL', 'xyY', 'XYZ', '*a*b', 'u''v''', 'uv', 'xy', 'XZ', 'log(L)*a*b', 'YCbCr', 'CbCr'}; % make comprehensive target target = []; @@ -62,7 +62,7 @@ % bar plot b = bar(tbl); -ylim([0.85 1.0]); +ylim([0.65 1.0]); ylabel('AUC'); xlabel('Color space'); legend(b, algos, 'Location', 'EastOutside'); diff --git a/performance.m b/performance.m new file mode 100644 index 0000000..359a25f --- /dev/null +++ b/performance.m @@ -0,0 +1,36 @@ +% algorithms to performance test +algos = {@RX_global, @rxl, @dwest, @nswtd, @mwnswtd, @pcag, @pcag, @knn}; +algos_nice = {'Global RX', 'Local RX', 'DWEST', 'NSWTD', 'MW-NSWTD', 'PCAG', 'MW-PCAG', '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('Time (s)'); +xlabel('Algorithm'); +set(gca, 'XTickLabel', algos_nice); +title('Execution Time'); +print(gcf, 'exec.png', '-dpng', '-r300'); \ No newline at end of file