diff --git a/channelPlot.m b/channelPlot.m index afa32ce..914d134 100644 --- a/channelPlot.m +++ b/channelPlot.m @@ -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