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

RGB To HLS 8u P3-C3 conversions

b_k_
New Contributor I
382 Views

Hello,

I was trying to replace ippiRGBToHLS_8u_C3R with ippiBGRToHLS_8u_C3P3R.

The functions give differing results for some RGB values, and ippiBGRToHLS_8u_C3P3R gives differing results for the same RGB values.

Here is an example:

// a BGR image, 5 pixels per row (R,G,B)
// padding to 16 bytes
IppStatus st;
Ipp8u BGR[16] = {  91, 182, 204,  91, 182, 204,  91, 182, 204,  91, 182, 204,  91, 182, 204, 0 };
Ipp8u RGB[16] = { 204, 182,  91, 204, 182,  91, 204, 182,  91, 204, 182,  91, 204, 182,  91, 0 };
IppiSize roi = { 5, 1 };

// convert RGB->HLS
Ipp8u HLS3ch[16];
st = ippiRGBToHLS_8u_C3R(RGB, 16, HLS3ch, 16, roi);
// extract to channels
Ipp8u H0[8 ], L0[8 ], S0[8 ];
Ipp8u* pHLS0[] = { H0, L0, S0 };
st = ippiCopy_8u_C3P3R(HLS3ch, 16, pHLS0, 8, roi);

Ipp8u H[8 ], L[8 ], S[8 ];
Ipp8u* pHLS[] = { H, L, S };
st = ippiBGRToHLS_8u_C3P3R(BGR, 16, pHLS, 8, roi);

The H0 and H channels are identical, as are the L0 and L channels. But

S0 = 134 134 134 134 134

S = 133 133 133 133 134

Using: i7-4790, IPP8.1 32bit, Win10 64bit.

0 Kudos
3 Replies
Chao_Y_Intel
Moderator
382 Views

Hi,  

Thanks for your report.   does that only have the difference with "1"?   We will have further check on this.

Thanks,
Chao 

0 Kudos
b_k_
New Contributor I
382 Views

Hi,

I checked on some other images and the differences were 1's only.

Attached is an image where many differences occure in the H,L,S channels.

By the way, using the values from the example {91, 182, 204} in an image that is 1x1 size results in identical HLS values

0 Kudos
b_k_
New Contributor I
382 Views

Hi,

The results of ippiBGRToHLS_8u_P3R also differ from the results of ippiBGRToHLS_8u_C3R.

0 Kudos
Reply