Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

separating lab image into 3 components

Hello Everyone, I want to dividide a BGR image into 3 images containing the 3 different CIE Lab color components (with just one channel). I know that I can do something like this:

 #include <opencv2/opencv.hpp>

 using namespace std;
 using namespace cv;

 int main( int argc, char** argv )
 {
      Mat src = imread( "/home/diego/Documents/sunset.jpg", -1 ), lab;
      cvtColor(src, lab, CV_BGR2Lab);
      imshow("lab", lab);
      return 0;
 }

And this gives me a kind of result like this

image description

However I read something that tells me that I need to treat the Luminance between 0 and 100, and a,b with values between -127 to 127 (So I don't know if this image is right or wrong). I would like to ask what is meant with these values... are these ones the pixel values, are these ones normalized values from the original 0 to 255? Are the values of this 3 channel image representing L((lab[0]), A(lab[1]), and B(lab[2])?

I have checked in several webpages to give me an idea but I just see very theoretical information about how the 3 axis Lab color space is composed but nothing that I can convert into real things.

Thanks and sorry for so many questions.

separating lab image into 3 components

Hello Everyone, I want to dividide a BGR image into 3 images containing the 3 different CIE Lab color components (with just one channel). I know that I can do something like this:

 #include <opencv2/opencv.hpp>

 using namespace std;
 using namespace cv;

 int main( int argc, char** argv )
 {
      Mat src = imread( "/home/diego/Documents/sunset.jpg", -1 ), lab;
      cvtColor(src, lab, CV_BGR2Lab);
      imshow("lab", lab);
      return 0;
 }

And this gives me a kind of result like this

image description

However I read something that tells me that I need to treat the Luminance between 0 and 100, and a,b with values between -127 to 127 (So I don't know if this image is right or wrong). I would like to ask what is meant with these values... are these ones the pixel values, are these ones normalized values from the original 0 to 255? Are the values of this 3 channel image representing L((lab[0]), A(lab[1]), and B(lab[2])?

I have checked in several webpages to give me an idea but I just see very theoretical information about how the 3 axis Lab color space is composed but nothing that I can convert into real things.

Thanks and sorry for so many questions.