OpencvSharp LbgrtoLab

Does anyone know what “L” means in LbgrtoLab conversion code? I searched on the Internet and cannot find any description of this conversion code, currently I tried to use BgrtoLab / LbgrtoLab, I found that the values ​​are different in channels A and B using the same image source. It seems that LBgr might get a better result.

I am currently using OpenCvSharp 2.4.10.

+4
source share
1 answer

Despite the fact that the meaning of this color conversion code is not documented, there is no need to despair - OpenCV is an open source library, so let's look at 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);

    // ....

, L (sRGB) RGB. , , .

+4

Source: https://habr.com/ru/post/1690598/


All Articles