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

RGBToHLS and HLSToRGB small error

georgiswan
Beginner
327 Views
Hello,

I found that doing a straight conversion from RGB to HLS and back to RGB ( RGBToHLS and HLSToRGB) produces a small error (+/-2 gray levels) for some colors. I did not do very much investigation but I am just wondering if this is expected or it there someting wrong.

In case, it makes a difference, what I really did is:

1) convert a 8u RGB image to 16u
2) convert to 16u HLS
3) convert to 16u RGB
4) convert to 8u RGB'

The difference between RGB and RGB' is +/- 2 gray levels for about half of all possible RGB colors and 0 for the other half colors (usinga test image with all the 16 millions colors).

I dont see such a differnce for HSV.

Any reason for the HLS difference, is it due to the equations?

Thank you!

Gilbert

0 Kudos
1 Reply
georgiswan
Beginner
327 Views

Ok, I found the problem. I used ippiConvert to go to 16 bits but I should have used ippiScale (ippiConvert does not scale the input image as I first thought...). I dont see any conversion error when I use a properly scaled input image to 16 bits.

0 Kudos
Reply