measure the CieLab color of a square

asked 2020-03-08 11:57:47 -0500

SylvainArd gravatar image

updated 2020-03-08 11:58:09 -0500

Hi, For compute the CieLab color of a square of an image do we have to compute the mean of each RVB channels then to convert this mean color to CieLab or a nother method ? Thank you ! Bye !

edit retag flag offensive close merge delete



What did you try? There is a function for everything you need in OpenCV! You can get the desired ROI, compute the mean and convert the result using cvtColor

kbarni gravatar imagekbarni ( 2020-03-09 04:56:27 -0500 )edit

but I want the true CieLab, the with the primary RGB and white coordinates calculus

SylvainArd gravatar imageSylvainArd ( 2020-03-09 07:18:03 -0500 )edit

What is the true CieLab for you? (and which is the false one?) There's only one CieLab standard as far as I know...

kbarni gravatar imagekbarni ( 2020-03-09 09:00:49 -0500 )edit

I am trying to find the true colors of the ROI so the RGB is not the true colors but depends of the material. In fact to convert properly the RGB of the image (depending of the hardware) to the CieLab we need the white and primary coordinates of the material to convert properly. The default OpenCV conversion use default coordinates which not suit to me. I hope you understand. Best regards

Sylvain2553 gravatar imageSylvain2553 ( 2020-03-09 10:23:53 -0500 )edit

I don't really understand what you want. The RGB image you have is just a numerical representation of the scene. The CieLab also. The interest of CieLab is that the euclidean difference between 2 colors is the same as the perceptual difference. Not that it's a real representation of the material color. Just think of the white highlights on the surface of an object - it doesn't depend on the real color.

As the camera adjusts automatically the white balance of the image, you can take the D65 white point reference.

If you can access the RAW RGB values and you need to process the image using a known white point (color temperature), you can get from wikipedia the standard illuminant x and y values and every formula needed to do the conversion yourself.

kbarni gravatar imagekbarni ( 2020-03-09 10:57:17 -0500 )edit