Now, we convert the device-dependent rgb data into LMS format, using the color calibration information specified in the color calibration step.
This takes place in two steps. First, we correct the r,g,b frame-buffer values for the gamma curve. Second, we convert the linearized r,g,b values into cone absorptions using the matrix rgb2lms:
imgRGB = dac2rgb(rgbHats,gamma);
img1LMS = changeColorSpace(imgRGB,rgb2lms);
imgRGB = dac2rgb(rgbHatsc,gamma);
img2LMS = changeColorSpace(imgRGB,rgb2lms);
The S-CIELAB function accepts input in a few different formats. We need to tell it whether the input data are in lms, or xyz format.
imageformat = 'lms';