LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

La*b* colour conversion

Hi,

 

I'm having trouble with the IMAQ RGBToColor2 VI for RGB to CIE La*b* conversion.  For simple values such as 255, 255, 255 it works, but for other values it gives me different answers than other implementations of the conversion algorithm.  For example the website http://www.easyrgb.com/index.php?X=CALC converts the RGB values 5, 50, 128 to 23.244, 19.428, -47.710.  The Labview VI converts it to 126.408, -1.605, -41.324.  I found a post on this forum which indicates that the luminance value is in the range 0-255 instead of 0-100, however even when I apply this scaling the luminance value is still not correct, and it does not explain the problems with the a* and b* values.

 

Can anyone help me with this please?  Am I missing something in how I should use this VI? (The results by the way are from directly entering the RGB values using the VI front panel).

 

Thanks,

 

Mari

0 Kudos
Message 1 of 7
(2,638 Views)

Hello Mari,

 

After I went through your problem and have contact with our support in VS I can say that our IMAQ vi is under test to make its problem to be solved. But if you still have the same problem you could use another vi which is given in my example as attachment. As you could see, this vi gives the same results as what you can get from the other softwares that you linked.

I hope that it would be helpful and if you have questions I will hear them.

 

Regards,

 

0 Kudos
Message 2 of 7
(2,410 Views)

Thanks very much.  I hope that the debugging of the IMAQ VI will go well.  In any case it helps a lot to have the problem confirmed.

0 Kudos
Message 3 of 7
(2,400 Views)

Hello,

 

Today I got the answer from our support in Canada which is given below.

Unfortunately, this is the expected behavior of that VI.  As I mentioned earlier, R&D decided not to include the normalization step because most machine vision cameras don't apply a gamma correction.

 

The CAR I filed was just a suggestion to improve the help documentation to explain this.  I also suggested that they add the option to apply normalization with the VI, but that's up to R&D to decide if they want to do that for a later release.

As I mentioned in my previous feedback, you can use that VI's that they provided for you.

I hope that you can go on and if you have questions, you can come back here.

 

Best regards,

 

0 Kudos
Message 4 of 7
(2,372 Views)

Hi,

 

Thanks for your reply.  So if I understand correctly, the RGB->La*b* conversion assumes linear RGB as input? 

 

It helps to understand why there is a difference in the results, thank you.  We can then choose which method is most suitable for our application. 

0 Kudos
Message 5 of 7
(2,363 Views)

Hi,

 

I was able to talk with R&D about this VI, and they said this is expected
behavior. There are different ways to do the conversion, and our VI happens to
do it differently. To convert from RGB to LAB there are conversions (first
convert to XYZ and then from XYZ to LAB).

To convert from RGB to XYZ typically two steps are performed as explained here.

The first step (linearization) is to remove non linearity introduced by gamma correction

and to normalize the RGB. However, VDM does not do this because we assume most
industrial color cameras don't apply gamma correction (typically this correction
is limited to consumer digital cameras).

 

I hope that it helps you.

 

Regards,

0 Kudos
Message 6 of 7
(2,345 Views)

Yes, thank you.

0 Kudos
Message 7 of 7
(2,343 Views)