Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

M Wigham

Member

07-25-2011 04:33 AM

Options

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

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

Hossein128

NI Employee (retired)

09-05-2011 03:55 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

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,

09-05-2011 09:21 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Hossein128

NI Employee (retired)

09-13-2011 06:29 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

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,

09-13-2011 08:31 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

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.

Hossein128

NI Employee (retired)

09-14-2011 05:06 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

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,

09-14-2011 05:08 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Yes, thank you.