Code covered by the BSD License  

Highlights from
Algorithm Development with MATLAB

image thumbnail
from Algorithm Development with MATLAB by Sumit Tandon
Demo files to go with recorded webinar.

colorPlanesPlot(rPlane, gPlane, bPlane, justGreen)
function colorPlanesPlot(rPlane, gPlane, bPlane, justGreen)
%CREATEFIGURE(rPlane,gPlane,bPlane,justGreen)
%  rPlane:  image cdata
%  gPlane:  image cdata
%  bPlane:  image cdata
%  justGreen:  image cdata

%  Auto-generated by MATLAB on 21-Dec-2012 14:13:16

% Copyright 2013 The MathWorks, Inc.

% Create figure
figure1 = figure('Colormap',...
    [0 0 0;0.0158730167895556 0.0158730167895556 0.0158730167895556;0.0317460335791111 0.0317460335791111 0.0317460335791111;0.0476190485060215 0.0476190485060215 0.0476190485060215;0.0634920671582222 0.0634920671582222 0.0634920671582222;0.0793650820851326 0.0793650820851326 0.0793650820851326;0.095238097012043 0.095238097012043 0.095238097012043;0.111111111938953 0.111111111938953 0.111111111938953;0.126984134316444 0.126984134316444 0.126984134316444;0.142857149243355 0.142857149243355 0.142857149243355;0.158730164170265 0.158730164170265 0.158730164170265;0.174603179097176 0.174603179097176 0.174603179097176;0.190476194024086 0.190476194024086 0.190476194024086;0.206349208950996 0.206349208950996 0.206349208950996;0.222222223877907 0.222222223877907 0.222222223877907;0.238095238804817 0.238095238804817 0.238095238804817;0.253968268632889 0.253968268632889 0.253968268632889;0.269841283559799 0.269841283559799 0.269841283559799;0.28571429848671 0.28571429848671 0.28571429848671;0.30158731341362 0.30158731341362 0.30158731341362;0.31746032834053 0.31746032834053 0.31746032834053;0.333333343267441 0.333333343267441 0.333333343267441;0.349206358194351 0.349206358194351 0.349206358194351;0.365079373121262 0.365079373121262 0.365079373121262;0.380952388048172 0.380952388048172 0.380952388048172;0.396825402975082 0.396825402975082 0.396825402975082;0.412698417901993 0.412698417901993 0.412698417901993;0.428571432828903 0.428571432828903 0.428571432828903;0.444444447755814 0.444444447755814 0.444444447755814;0.460317462682724 0.460317462682724 0.460317462682724;0.476190477609634 0.476190477609634 0.476190477609634;0.492063492536545 0.492063492536545 0.492063492536545;0.507936537265778 0.507936537265778 0.507936537265778;0.523809552192688 0.523809552192688 0.523809552192688;0.539682567119598 0.539682567119598 0.539682567119598;0.555555582046509 0.555555582046509 0.555555582046509;0.571428596973419 0.571428596973419 0.571428596973419;0.58730161190033 0.58730161190033 0.58730161190033;0.60317462682724 0.60317462682724 0.60317462682724;0.61904764175415 0.61904764175415 0.61904764175415;0.634920656681061 0.634920656681061 0.634920656681061;0.650793671607971 0.650793671607971 0.650793671607971;0.666666686534882 0.666666686534882 0.666666686534882;0.682539701461792 0.682539701461792 0.682539701461792;0.698412716388702 0.698412716388702 0.698412716388702;0.714285731315613 0.714285731315613 0.714285731315613;0.730158746242523 0.730158746242523 0.730158746242523;0.746031761169434 0.746031761169434 0.746031761169434;0.761904776096344 0.761904776096344 0.761904776096344;0.777777791023254 0.777777791023254 0.777777791023254;0.793650805950165 0.793650805950165 0.793650805950165;0.809523820877075 0.809523820877075 0.809523820877075;0.825396835803986 0.825396835803986 0.825396835803986;0.841269850730896 0.841269850730896 0.841269850730896;0.857142865657806 0.857142865657806 0.857142865657806;0.873015880584717 0.873015880584717 0.873015880584717;0.888888895511627 0.888888895511627 0.888888895511627;0.904761910438538 0.904761910438538 0.904761910438538;0.920634925365448 0.920634925365448 0.920634925365448;0.936507940292358 0.936507940292358 0.936507940292358;0.952380955219269 0.952380955219269 0.952380955219269;0.968253970146179 0.968253970146179 0.968253970146179;0.98412698507309 0.98412698507309 0.98412698507309;1 1 1]);

% Create subplot
subplot1 = subplot(2,2,1,'Parent',figure1,'YDir','reverse','Layer','top');
%% Uncomment the following line to preserve the X-limits of the axes
xlim(subplot1,[0.5 320.5]);
%% Uncomment the following line to preserve the Y-limits of the axes
ylim(subplot1,[0.5 240.5]);
box(subplot1,'on');
hold(subplot1,'all');

% Create image
image(rPlane,'Parent',subplot1,'CDataMapping','scaled');

% Create title
title('R');

% Create subplot
subplot2 = subplot(2,2,2,'Parent',figure1,'YDir','reverse','Layer','top');
%% Uncomment the following line to preserve the X-limits of the axes
xlim(subplot2,[0.5 320.5]);
%% Uncomment the following line to preserve the Y-limits of the axes
ylim(subplot2,[0.5 240.5]);
box(subplot2,'on');
hold(subplot2,'all');

% Create image
image(gPlane,'Parent',subplot2,'CDataMapping','scaled');

% Create title
title('G');

% Create subplot
subplot3 = subplot(2,2,3,'Parent',figure1,'YDir','reverse','Layer','top',...
    'CLim',[0 255]);
%% Uncomment the following line to preserve the X-limits of the axes
xlim(subplot3,[0.5 320.5]);
%% Uncomment the following line to preserve the Y-limits of the axes
ylim(subplot3,[0.5 240.5]);
box(subplot3,'on');
hold(subplot3,'all');

% Create image
image(bPlane,'Parent',subplot3,'CDataMapping','scaled');

% Create title
title('B');

% Create subplot
subplot4 = subplot(2,2,4,'Parent',figure1,'YDir','reverse','Layer','top');
%% Uncomment the following line to preserve the X-limits of the axes
xlim(subplot4,[0.5 320.5]);
%% Uncomment the following line to preserve the Y-limits of the axes
ylim(subplot4,[0.5 240.5]);
box(subplot4,'on');
hold(subplot4,'all');

% Create title
title('Just Green');

% Create image
image(justGreen,'Parent',subplot4,'CDataMapping','scaled');

Contact us