Code covered by the BSD License
- XYZ2ProPhoto(inImg)% PPRGB = XYZ2PROPHOTO(INIMG)
- getChartRGBvalues(Irgb,ma...% RGB = GETCHARTRGBVALUES(IRGB,MASKS,COLORS)
- getChartXYZvalues(chart,c...% XYZ = GETCHARTXYZVALUES(CHART,COLORS)
- getPatchMean(I,mask)
- getPatchValues(I,masks,lo...% VALS = GETPATCHVALUES(I,MASKS,LOCS,COLORS)
- getlincam(ref,RGB)
- linearizeRGB(p,inImg)% OUTIMG = linearizeRGB(P,INIMG)
- makeChartMask(inImg,chart...% MASKS = MAKECHARTMASK(INIMG,CHART,COLORS,DIM)
- plotLinearization(RGB,ref...% OUTIMG = PLOTLINEARIZATION(RGB,REF,PRS)
- readDNGfile(path)% OUTIMG = READDNGFILE(PATH)
- spectra2XYZ(reflectance,l...% XYZ = SPECTRA2XYZ(REFLECTANCE,LIGHT,CMF)
- visualizeXYZ(xyz,numRow,n...% VISUALIZEXYZ(XYZ,NUMROW,NUMCOL)
- whiteBalance(inImg,maskWS...% IWB = WHITEBALANCE(INIMG,MASKWS,MASKDS,F)
- demo.m
- macbethColorChecker.m
-
View all files
from
Consistent imaging with consumer cameras
by Derya
Accurate color capture using consumer cameras.
|
| XYZ2ProPhoto(inImg) |
function ppRGB = XYZ2ProPhoto(inImg)
%
% PPRGB = XYZ2PROPHOTO(INIMG)
%
% INIMG : input RGB image of size NxMx3, linear RGB.
% PPRGB : output RGB image of size NxMx3, in ProPhoto RGB space.
% Transformation taken from http://brucelindbloom.com. To get to the relevant page, click Math, click
% RGB/XYZ matrices.
%
% ************************************************************************
% 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.
% ************************************************************************
s = size(inImg);
M = [1.3459 -0.2556 -0.0511;...
-0.5446 1.5082 0.0205;...;
0 0 1.2118];
RGB = M*reshape(xyz2double(inImg),[s(1)*s(2) 3])';
RGB(RGB<=0)=0;
RGB(RGB>1)=1;
ppRGB = reshape(RGB',[s(1) s(2) 3]);
|
|
Contact us