Herror ::rgb1_to_gray (
    Hobject RGBImage,
    Hobject *GrayImage
)
HImage HImage::Rgb1ToGray (
    void
) const
HImageArray HImageArray::Rgb1ToGray (
    void
) const

Transform an RGB image into a gray scale image.

::rgb1_to_gray 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:

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


Parameters

RGBImage (input_object)
image(-array) -> Hobject: HImage(Array) ( byte / int2 )
Three-channel RBG image.

GrayImage (output_object)
image(-array) -> Hobject * : HImage(Array) ( byte / int2 )
Gray scale image.


Example
/* Tranformation from rgb to gray  */
read_image(Image,"patras") ;
disp_color(Image,WindowHandle) ;
rgb1_to_gray(Image,&GrayImage) ;
disp_image(GrayImage,WindowHandle);

Possible Predecessors

::compose3


Alternatives

::trans_from_rgb, ::rgb3_to_gray


Module

Image filters



Copyright © 1996-2002 MVTec Software GmbH