Code covered by the BSD License  

Highlights from
Consistent imaging with consumer cameras

image thumbnail

Consistent imaging with consumer cameras

by

 

08 Jul 2013 (Updated )

Accurate color capture using consumer cameras.

getChartRGBvalues(Irgb,masks,colors)
function RGB = getChartRGBvalues(Irgb,masks,colors)
%
% RGB = GETCHARTRGBVALUES(IRGB,MASKS,COLORS)
% 
% IRGB     : RGB image of size NxMx3
% MASKS     : masks for the patches of the color chart
% COLORS    : cell array containing the names, or numbers of color patches
% in the chart being used. see macbethColorChecker.m for the format.
% RGB     : RGB values corresponding to each patch, 
%           size size(colors,1) * size(colors,2) x 3
%
% ************************************************************************
% If you use this code, please cite the following paper:
%
%
% <paper>
%
% ************************************************************************
% For questions, comments and bug reports, please use the interface at
% Matlab Central/ File Exchange. See paper above for details.
% ************************************************************************



n = 1;
s = size(colors);
RGB = zeros(s(1)*s(2),3);
for row = 1:s(1)
    for col = 1:s(2)
        curColor = colors{row,col};
        mask = masks.(curColor).mask;
        RGB(n,:) = getPatchMean(Irgb,mask);
        n = n+1;
    end
end

Contact us