lvcluv(3)

LIBRARY ROUTINE
lvcluv - Conversion from a linear Color Space to the Luv color space.

LIBRARY CALL
#include "vinclude.h"
int
lvcluv(img1, norm)
struct xvimage *img1;
float norm;

INPUT

img1
    input multispectral image of color space model ntscRGB, ntscYIQ, ntscCMY, genericRGB, cieXYZ, cieUVW or GENERIC.

norm
    normalization factor

OUTPUT

img1
    converted image of type FLOAT normalized between 0 and 1.

MODIFICATIONS

DESCRIPTION
lvcluv converts ntsc RGB,generic RGB ntsc YIQ, ntsc CMY, cie XYZ, cie UVW or GENERIC color spaces to cieucs Luv color spaces. Color images are displayed and manipulated using the NTSC receiver primary color system; thus reference white is set to R = 1, B = 1, G = 1.

The algorithm used is as follows:
L = 25(Y/Y0)^1/3 - 16
u = 13L(u' - u0')
u = 13L(v' - v0')
where u', v', u0' and v0' are
u' = 4X / X + 15Y + 3Z
v' = 9Y / X + 15Y + 3Z
u0' = 4X0 / X + 15Y + 3Z
u0' = 9Y0 / X + 15Y + 3Z

X0, Y0 and Z0 are calculated by setting R = 1, G = 1, B = 1 and converting to the XYZ color space (see vcltrans).

This routine needs to work with an image normalized between 0 and 1.

This algorithm was taken from Fundamentals of Digital Image Processing, Jain, and Color Science: Concepts and Methods, Quantitative Data and Formulae, Wyszecki and Stiles.

The norm option specifies the normalization factor. There is no default for the norm value.

This routine will not touch the data map; therefore, the map may be invalid after running this routine. The map may be deleted from the image or a new map may be inserted.

Variable img1 is the input multispectral image of colormap model RGB or HSV of data type FLOAT.

The variable norm is a normalization factor since the data must be normalized between zero and one.

lvcluv will return a one upon success and a zero upon failure.

SEE ALSO
vcluv(1), intro(3), vipl(3), verror(3), vutils(3)

RESTRICTIONS
lvcluv must have an input image of data storage type FLOAT and the input image color map model must be of type ntscRGB, genericRGB, cieXYZ, cieUVW, ntscYIQ, ntscCMY, or GENERIC.

AUTHOR
Tom Sauer

COPYRIGHT
Copyright 1991, University of New Mexico. All rights reserved.