Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.

Conversion from RGB to XYZ Intel IPP

ElMicro
Beginner
1,611 Views

From a previous post about the conversion from RGB to XYZ in Intel IPP forum

Gamma correction

If this add value to the conversation:

Hi, I'm noticing this too. You say it will be fixed in version 2021.9. If it adds to the conversation, the matrix to convert from RGB to XYZ in your documentation is for sRGB color space with D65 as you can see in one of the common references:

http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html

But you need to apply an inverse sRGB companding after the matrix:

http://www.brucelindbloom.com/index.html?Eqn_RGB_to_XYZ.html

So, actually the API gives wrong results because doesn't apply the companding, and if it's linear, those are not the right values.

And actually is assumed that the results are for sRGB as it says in the OneAPI documentation when you use de XYZ to LAB conversion.

So, there's a lot of different variables in color spaces and gamma and white point out there that maybe could not be tackled but using the right sRGB aproach could be the best for the most used cases but with the companding.

 

If you need   more detailed information that could be useful, let me know but I know that you are working in the issue.

Besta regards.

Thank you so much.

José Silva

0 Kudos
7 Replies
ShanmukhS_Intel
Moderator
1,558 Views

Hi Jose Silve,

 

Thanks for posting in Intel Communities.

 

Could you please get back to us with more details regarding the discrepancy between the expected behavior of the API in terms of color conversion and the actual results obtained?

 

Could you please provide us with more details regarding the exact nature of the problem? It helps us in understanding the issue better.

 

It would be a great help if you provide us with a sample code with the usage of API which you mentioned.

 

Best Regards,

Shanmukh.SS

 

 

0 Kudos
ElMicro
Beginner
1,528 Views

Hi! Thank you for the response.

 

This is long so, I'm attaching some files about the case. If you can please escalate this to the developers team.

 

Sorry, it doesn't let me attach the cpp file so I'm attaching a zip file.

Thank you so much.

 

Jose Silva (ElMicro)

0 Kudos
ShanmukhS_Intel
Moderator
1,432 Views

Hi Jose Silva,

 

Thanks a lot for the elaborative information and the sample reproducer. We have shared the conveyed information to the concerned team. We are discussing your issue internally. We will get back to you soon with an update.

 

Thank you very much for the reply. I am impressed with the speed that the oneAPI library provides by taking advantage of all the capabilities of Intel processors. Keep up the Good work!

Really, really, thank you

>> Thanks a lot for your valuable suggestions and compliments.

 

Best Regards,

Shanmukh.SS

 

 

0 Kudos
ShanmukhS_Intel
Moderator
1,285 Views

Hi Jose,

 

We would like to inform you that, The color conversion functions generally operate with non-linear gamma-corrected images and functions without "_gamma" are meant for gamma-corrected images. The "forward" in gamma correction suggests that the documentation on color correction is clear with formulas for all conversions.

for ex: GammaFwd performs gamma-correction of the source image with RGB data.

 

As you confirmed that the calculation of RGBtoLABstep() in the first case is correct and matches the last step for the same values is a valid one. It seems the differences in understanding might be related to vocabulary and terminology, such as "gamma corrected" and "gammaFwd" terms were being used by IPP and should not be considered by terms "GammaInverseCompanding" which were used in Bruce Lindbloom's results.

 

As suggesting different other terms might add more confusion, it is recommended in relying on equations to understand the significance and the functionality better.

 

The terms being used by the user in Bruce Lindbloom's results should not be considered for the IPP's implementations as the terminology is different.

 

On the whole, they are correct in the equations and method of calculation for ippiRGBToLab_32f_C3R().  But as the documentation for this function does say "This function converts the BGR or RGB image pSrc to the CIE Lab image pDst," we feel if we add more terms, it leads to more confusion about the inputs.  Intel IPP doesn't use many of the terms that Bruce Lindbloom uses such as Inverse Companding, Inverse Gamma Companding, Inverse sRGB Companding, Inverse L* Companding, nor many of the symbols in our docs.

 

Reference links:

1. https://www.intel.com/content/www/us/en/docs/ipp/developer-reference/2021-9/color-models.html#primary-content

2. https://www.intel.com/content/www/us/en/docs/ipp/developer-reference/2021-9/gamma-correction-002.html#GUID-D00B6E22-6C9D-43AD-BEDF-A4E7BCBFD0D2

 

Best Regards,

Shanmukh.SS

 

ElMicro
Beginner
1,262 Views

Thank you so much. It's clear for me now.

0 Kudos
ShanmukhS_Intel
Moderator
1,203 Views

Hi Jose,

 

It’s great to know that the issue has been resolved, in case you run into any other issues please feel free to create a new thread.

 

Best Regards,

Shanmukh.SS

 

0 Kudos
Reply