I'm trying to load a CIE Lab* image using openCV in C++. Online I can find only examples that load an RGB image and convert it into a LAB image but I already have the LAB image so how can I load it and than access to the values of L, a and b?
The only way I find is to load the LAB image considering it an RGB image and convert it into a Lab image using:
cvtColor(source, destination, CV_BGR2Lab);
But I think this is not a good way to solve the problem because if I do this, the converted image looks very different from the original.
With a test image and the following code:
originalImage = imread(originalImagePath, CV_LOAD_IMAGE_UNCHANGED);
cout << originalImage.type() << endl;
Mat originalImageSplitted[3];
split(originalImage, originalImageSplitted);
cout << originalImageSplitted[0] << endl;
cout << originalImageSplitted[1] << endl;
cout << originalImageSplitted[2] << endl;
I get the result:
0
[]
[]
[]