Quantcast
Channel: Intel® Software - Intel® Integrated Performance Primitives
Viewing all articles
Browse latest Browse all 1489

RGB To HLS 8u P3-C3 conversions

$
0
0

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.


Viewing all articles
Browse latest Browse all 1489

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>