rgb1_to_grey ( RGBImage : GreyImage : : )

Transform an RGB image into a gray scale image.

rgb1_to_grey transforms an RGB image into a gray scale image. The three channels of the RGB image are passed as the first three channels of the input image. The image is transformed according to the following formula:

   grey = 0.299 * red + 0.587 * green + 0.144 * blue .


Parameters

RGBImage (input_object)
image(-array) -> object : byte
Three-channel RBG image.

GreyImage (output_object)
image(-array) -> object : byte
Gray scale image.


Example
/* Tranformation from rgb to grey  */
read_picture(:Image:'tiff',0,0,'patras':Channels) >
disp_color(Image:::) >
rgb1_to_grey(Image:GreyImage::) >
disp_image(GreyImage:::).

Possible Predecessors

compose3


Alternatives

trans_from_rgb, rgb3_to_grey



Copyright © 1996-1997 MVTec Software GmbH