Skip to content

Commit

Permalink
Updated channelplot to take an argument to show all channels in one p…
Browse files Browse the repository at this point in the history
…lot.
  • Loading branch information
AllanLRH committed Dec 4, 2017
1 parent 16096e4 commit 3b12e1a
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion channelPlot.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,23 @@
imData{5} = rgb2ntsc(rgb);
imData{6} = rgb2ycbcr(rgb);

if nargin > 1
if nargin == 2 && ~ischar(varargin{1}) && all(class(varargin{1}) == 'function_handle')
imData = cellfun(varargin{1}, imData, 'UniformOutput', false);
names = {'f(rgb)', 'f(hsv)', 'f(lab)', 'f(sqrt(xyz))', 'f(ntsc)', 'f(ycbcr)'};
elseif nargin > 1 && strcmp(varargin{end}, 'oneplot')
figure;
runsum = 1;
for ii = length(imData):-1:1
data = imData{ii};
ch = size(data, 3);
for jj = 1:ch
subplot(length(imData), 3, runsum)
imsc(data(:, :, jj));
title(sprintf('%s(%d)', names{ii}, jj))
runsum = runsum + 1;
end
end
return
end

for ii = length(imData):-1:1
Expand Down

0 comments on commit 3b12e1a

Please sign in to comment.