- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
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
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.

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