Developer Reference

  • 2020
  • 07/15/2020
  • Public Content
Contents

RGBToLUV, BGRToLUV

Converts an RGB or BGR image to the LUV color model.

Syntax

Case 1: RGB to LUV
IppStatus ippiRGBToLUV_<mod>(const Ipp<datatype>*
pSrc
, int
srcStep
, Ipp<datatype>*
pDst
, int
dstStep
, IppiSize
roiSize
);
Supported values for
mod
:
8u_C3R
16u_C3R
16s_C3R
32f_C3R
8u_AC4R
16u_AC4R
16s_AC4R
32f_AC4R
Case 2: BGR to LUV
IppStatus ippiBGRToLUV_<mod>(const Ipp<datatype>*
pSrc
, int
srcStep
, Ipp<datatype>*
pDst
, int
dstStep
, IppiSize
roiSize
);
Supported values for
mod
:
8u_C3R
32f_C3R
Include Files
ippcc.h
Domain Dependencies
Headers:
ippcore.h
,
ippvm.h
,
ipps.h
,
ippi.h
Libraries:
ippcore.lib
,
ippvm.lib
,
ipps.lib
,
ippi.lib
Parameters
pSrc
Pointer to the source image ROI.
srcStep
Distance in bytes between starts of consecutive lines in the source image.
pDst
Pointer to the destination image ROI.
dstStep
Distance in bytes between starts of consecutive lines in the destination image.
roiSize
Size of the source and destination ROI in pixels.
Description
This function operates with ROI (see Regions of Interest in Intel IPP).
This function converts the
RGB
or
BGR
image
pSrc
to the CIE LUV
CIE LUV
image
pDst
in two steps. First, the conversion is done into
CIE XYZ
format, using equations defined for the
ippiRGBToXYZ
function. After that, conversion to
LUV
image is performed in accordance with the following equations:
L = 116. * (Y/Y
n
)
1/3.
- 16.
U = 13. * L * (u - u
n
)
V = 13. * L * (v - v
n
)
where
u = 4.*X / (X + 15.*Y + 3.*Z)
v = 9.*Y / (X + 15.*Y + 3.*Z)
u
n
= 0.197839
v
n
= 0.468342
The computed values of the
L
component are in the range [0..100],
U
component in the range [-134..220], and
V
component in the range [-140..122].
The equations above are given on the assumption that
R
,
G
, and
B
values are normalized to the range [0..1]. In case of the floating-point data type, the input
RGB
values must already be in the range [0..1]. For integer data types, normalization is done by the conversion function internally.
In case of
8u
data type, the computed
L
,
U
, and
V
values are quantized and converted to fit in the range
[0..IPP_MAX_8U]
as follows:
L = L * IPP_MAX_8U / 100.
U = (U + 134.) * IPP_MAX_8U / 354.
V = (V + 140.) * IPP_MAX_8U / 262.
In case of
16u
data type, the computed
L
,
U
, and
V
values are quantized and converted to fit in the range
[0..IPP_MAX_16U]
as follows:
L = L * IPP_MAX_16U / 100.
U = (U + 134.) * IPP_MAX_16U / 354.
V = (V + 140.) * IPP_MAX_16U / 262.
In case of
16s
data type, the computed
L
,
U
, and
V
values are quantized and converted to fit in the range
[IPP_MIN_16S..IPP_MAX_16S]
as follows:
L = L * IPP_MAX_16U / 100. + IPP_MIN_16S
U = (U + 134.) * IPP_MAX_16U / 354. + IPP_MIN_16S
V = (V + 140.) * IPP_MAX_16U / 262. + IPP_MIN_16S
For
32f
data type, no further conversion is done and
L
,
U,
and
V
components remain in the ranges [0..100], [-134..220], and [-140..122], respectively.
Return Values
ippStsNoErr
Indicates no error. Any other value indicates an error.
ippStsNullPtrErr
Indicates an error condition if
pSrc
or
pDst
is
NULL
.
ippStsSizeErr
Indicates an error condition if
roiSize
has a field with a zero or negative value.

Product and Performance Information

1

Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.

Notice revision #20110804