4

Does anyone know what is "L" means in conversion code LbgrtoLab? I searched in web and cannot find any description on this conversion code, currently I tried to use both BgrtoLab / LbgrtoLab, I found that values are different in A and B channels with using same image source. Seems that LBgr can get a better result.

Currently I am using OpenCvSharp 2.4.10.

Jeru Luke
  • 20,118
  • 13
  • 80
  • 87
JL2018
  • 53
  • 5

1 Answers1

4

Even though the meaning of this colour conversion code doesn't appear to be documented, there's no need to despair -- OpenCV is an open source library, so let's consult the source code.

case COLOR_BGR2Lab: case COLOR_RGB2Lab: case COLOR_LBGR2Lab: case COLOR_LRGB2Lab:
case COLOR_BGR2Luv: case COLOR_RGB2Luv: case COLOR_LBGR2Luv: case COLOR_LRGB2Luv:

    // ....

    bool srgb = code == COLOR_BGR2Lab || code == COLOR_RGB2Lab
        || code == COLOR_RGB2Luv || code == COLOR_BGR2Luv;

    // ....

        if (srgb && usRGBGammaTab.empty())
            Mat(1, 256, CV_16UC1, sRGBGammaTab_b).copyTo(usRGBGammaTab);
        else if (ulinearGammaTab.empty())
            Mat(1, 256, CV_16UC1, linearGammaTab_b).copyTo(ulinearGammaTab);

    // ....

This suggests that the prefix L is meant to distinguish between non-linear (sRGB) and linear RGB colour spaces. More details about what this means can be found in this answer.

Dan Mašek
  • 17,852
  • 6
  • 57
  • 85