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

16u color conversions

Adriaan_van_Os
New Contributor I
449 Views

RGB.png

This shows a histogram created with ippiHistogram_16u_C4R from the 16u RGB image at http://adriaan.biz/preview/DSCA_002205-preview.tif

HSV.png

The histogram of the same 16u RGB image after a call to ippiRGBToHSV_16u_AC4R and ippiHSVToRGB_16u_AC4R.

HLS.png

The histogram of the same 16u RGB image after a call to ippiRGBToHLS_16u_AC4R and ippiHLSToRGB_16u_AC4R.

XYZ.png

The histogram of the same 16u RGB image after a call to ippiRGBToXYZ_16u_AC4R and ippiXYZToRGB_16u_AC4R.

Luv.png

The histogram of the same 16u RGB image after a call to ippiRGBToLUV_16u_AC4R and ippiLUVToRGB_16u_AC4R.

The histograms show that the RGB to HSV and HLS conversions (and back to RGB) are good. The RGB to XYZ conversion (and back) isn't precise in the high tones. The RGB to LUV conversion (and back) looses information in the high tones. I think 16u is precise enough that the XYZ and LUV round-trip conversions should be better. So, I am reporting this as a bug.

Regards,

Adriaan van Os

 

 

0 Kudos
5 Replies
Adriaan_van_Os
New Contributor I
449 Views

There may be a drawing or creation error in the histograms. I will investigate that further. For the moment, please forget about the above post. I apologize.for the noise,

Adriaan van Os

 

0 Kudos
Adriaan_van_Os
New Contributor I
449 Views

The histograms in my post above are wrong. The cause is in the parameters that have to be passed to ippiHistogram_16u_C4R. For a 256 bin histogram you have to pass:

  lowerLevel = 0.0, upperLevel = 65536.0. Levels = 257

I understand the analogy with non-uniform histograms, but for uniform histograms this is rather misleading. The code example in the Reference Manual fell into the same trap, as it passes 

  Ipp32f upperLevel[] = {255}

instead of 

  Ipp32f upperLevel[] = {256}

I now have the correct histograms, below.

RGB.png

 

HSV.png

 

HLS.png

 

XYZ.png

 

Luv.png

We see that XYZ conversion loses information.

Regards,

Adriaan van Os

 

0 Kudos
Adriaan_van_Os
New Contributor I
449 Views

Ping.

0 Kudos
Andrey_B_Intel
Employee
449 Views

Hi Adriaan.

Thanks for your permanently feedback to IPP. Could you please provide reproducer with input image, reference image and IPP output for your case? This reproducer helps to understand your issue and develop fix if necessary.

Thanks.  

0 Kudos
Adriaan_van_Os
New Contributor I
449 Views

 

The URL for the input image is listed above. The reproducer is described above, call ippiHistogram_16u_C4R for the input image, either alone or after a call to the color conversion routine pairs, mentioned above. The output image is what you get as a result. For a comparison, you can print or display the result of ippiHistogram_16u_C4R. Alternatively, you can load the input and the output image into any software that displays histograms

The wrong example code can be found in the Ippi Reference Manual, as described above.

Regards,

Adriaan van Os

 

0 Kudos
Reply