RGBToLUV

Converts an RGB image to the LUV color model.

Syntax

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

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

The function ippiRGBToLUV is declared in the ippcc.h file. It operates with ROI (see Regions of Interest in Intel IPP).

This function converts the RGB 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/Yn)1/3. - 16.

U = 13. * L * (u - un)

V = 13. * L * (v - vn)

where

u = 4.*X / (X + 15.*Y + 3.*Z)

v = 9.*Y / (X + 15.*Y + 3.*Z)

un = 4.*xn / ( -2.*xn + 12.*yn + 3. )

vn = 9.*yn / ( -2.*xn + 12.*yn + 3. )

Here xn = 0.312713, yn = 0.329016 are the CIE chromaticity coordinates of the D65 white point, and Yn = 1.0 is the luminance of the D65 white point.

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.

Submit feedback on this help topic

Copyright © 2000 - 2011, Intel Corporation. All rights reserved.