Setting up the image data for S-CIELAB


  1. Convert the RGB data to LMS (or XYZ if you like):

    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);
  2. Identify the color space:

    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';
Now we are finally ready to perform the S-CIELAB calculation on our images.
© Xuemei Zhang