Skip to content

Commit

Permalink
Improve PCAG and MW-PCAG.
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanntg committed Apr 24, 2015
1 parent 960e965 commit e0ca2a9
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions analyze.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
% algorithms to compare
algos = {'rx', 'rxl', 'dwest', 'nswtd', 'mwnswtd', 'pcag', 'mwpcag', 'knna'};
algos_nice = {'Global RX', 'Local RX', 'DWEST', 'NSWTD', 'MW-NSWTD', 'PCAG', 'MW-PCAG', 'KNN'};
algos = {'rx', '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 = dir('scenes/*.jpg');
Expand Down Expand Up @@ -62,7 +62,7 @@

% bar plot
b = bar(tbl);
ylim([0.65 1.0]);
ylim([0.6 1.0]);
ylabel('AUC');
xlabel('Color space');
legend(b, algos, 'Location', 'EastOutside');
Expand Down
6 changes: 3 additions & 3 deletions mwpcag_block.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@
% largest
if fm > bm
fm_i = min_size - 1 + fm_i;
ret(s_i(1:fm_i)) = ret(s_i(1:fm_i)) + (fm * p_la(c));
ret(s_i(1:fm_i)) = ret(s_i(1:fm_i)) + fm;
else
bm_i = numel(s) - max_size - 1 + bm_i + diff_num;
ret(s_i(bm_i:end)) = ret(s_i(bm_i:end)) + (bm * p_la(c));
ret(s_i(bm_i:end)) = ret(s_i(bm_i:end)) + bm;
end
end

% normalize
% restore shape
px = reshape(ret / sum(p_la), block_size(1), block_size(2));
px = reshape(ret, block_size(1), block_size(2));

end
6 changes: 3 additions & 3 deletions pcag_block.m
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@
% largest
if fm > bm
fm_i = min_size - 1 + fm_i;
ret(s_i(1:fm_i)) = ret(s_i(1:fm_i)) + (fm * p_la(c));
ret(s_i(1:fm_i)) = ret(s_i(1:fm_i)) + fm;
else
bm_i = numel(s) - max_size - 1 + bm_i + diff_num;
ret(s_i(bm_i:end)) = ret(s_i(bm_i:end)) + (bm * p_la(c));
ret(s_i(bm_i:end)) = ret(s_i(bm_i:end)) + bm;
end
end

% normalize
% restore shape
px = reshape(ret / sum(p_la), block_size(1), block_size(2));
px = reshape(ret, block_size(1), block_size(2));

end
6 changes: 3 additions & 3 deletions performance.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
% 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'};
algos = {@RX_global, @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'};
Expand Down Expand Up @@ -29,7 +29,7 @@

% bar plot
b = bar(tbl);
ylabel('Time (s)');
ylabel('Average time (s)');
xlabel('Algorithm');
set(gca, 'XTickLabel', algos_nice);
title('Execution Time');
Expand Down

0 comments on commit e0ca2a9

Please sign in to comment.