I am comparing an image with known HSV to my output using the IPP library.
Output from Ipp call converting from RGB to HSV:
If I normalize by 255,
So, this explains the encoding for S and V.
What I expect is to multiply the normalized Hue value by 360 to get back the "true" value, which in this case should be 149.As you can see I am getting back 90 instead.
What don't I understand about the IPP representation of Hue?
I used a HLS conversion on the same image.
The "true" values:
The values from the HLS:
If I normalize (divide by 255):
and then multiply H by 360 and L and S by 100
Not too bad of a match.
So the H in the IPP HLS algorithm gives approxthe right answer, but the H in the IPP HSV algorithm is still a mystery.
Could someone please help explain?
Thanks for your response. The values I used were:
I added the testimage (green149.jpg) as an attachment.
I was a bit confused whether the red and blue channels needed to beswapped The HLS method (which appears to be bringing back the correct results) is named "ippiBGRToHLS" (not, RGB to HLS), whereas the HSV method (which appears to not be correct) is named "ippiRGBtoHSV".
Having played with this problem a bit more this morning, it appears that I need to swap the R and B channels from the order in which they naturally occur in my imported Bitmap, whenever I use a method named RGB.
ps just tested and this did the trick.