rgb3_to_gray ( ImageRed, ImageGreen, ImageBlue : ImageGray : : )

Transform an RGB image to a gray scale image.

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

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


Parameters

ImageRed (input_object)
image(-array) -> object : byte / int2
Input image (red channel).

ImageGreen (input_object)
image(-array) -> object : byte / int2
Input image (green channel).

ImageBlue (input_object)
image(-array) -> object : byte / int2
Input image (blue channel).

ImageGray (output_object)
image(-array) -> object : byte / int2
Gray scale image.


Example
/* Tranformation from rgb to gray  */
read_image(Image,'patras') 
disp_color(Image,WindowHandle) 
decompose3(Image,Rimage,Gimage,Bimage) 
rgb3_to_gray(Rimage,Gimage,Bimage,GrayImage) 
disp_image(GrayImage,WindowHandle).

Parallelization Information

rgb3_to_gray is reentrant and automatically parallelized (on tuple level, domain level).


Possible Predecessors

decompose3


Alternatives

rgb1_to_gray, trans_from_rgb


Module

Image filters



Copyright © 1996-2005 MVTec Software GmbH