PANDORE Version 6 GREYC-IMAGE

prgb2gray



Converts RGB color image to gray space image.



Synopsis

prgb2gray red green blue [-m mask] [im_in|-] [im_out|-]

Description

prgb2gray converts a color image of color space RGB to a gray scale image.

The algorithm is as follows:

   pixel(im_out) = red*pixel.X(im_in)+green*pixel.Y(im_in)+blue*pixel.Z(im_in)/(red+green+blue);

For example, the NTSC standard method uses the following values for red, green and blue:

   red=0.299; green=0.587; blue=0.114;

Parameters

Inputs

Outputs

Result

Returns SUCCESS or FAILURE.

Examples

Converts parrot.pan to gray level image using the NTSC standard conversion:

   prgb2gray 0.299 0.587 0.114 parrot.pan a.pan

See also

Color

C++ prototype

Errc PRGB2Gray( const Imc2duc &im_in, Img2dsf &im_out, float red, float green, float blue);

Version française

Changement d'espace couleur de RGB vers niveaux de gris.


Author: Régis Clouard