HALCON Reference Manual 10.0.2
Table of Contents / Filters / Color ClassesClassesClasses | | | Operators

rgb1_to_grayrgb1_to_grayrgb1_to_grayRgb1ToGrayRgb1ToGray (Operator)

Name

rgb1_to_grayrgb1_to_grayrgb1_to_grayRgb1ToGrayRgb1ToGray — Transform an RGB image into a gray scale image.

Signature

rgb1_to_gray(RGBImage : GrayImage : : )

Herror rgb1_to_gray(const Hobject RGBImage, Hobject* GrayImage)

Herror T_rgb1_to_gray(const Hobject RGBImage, Hobject* GrayImage)

Herror rgb1_to_gray(Hobject RGBImage, Hobject* GrayImage)

HImage HImage::Rgb1ToGray() const

HImageArray HImageArray::Rgb1ToGray() const

void HOperatorSetX.Rgb1ToGray(
[in] IHUntypedObjectX* RGBImage, [out] IHUntypedObjectX*GrayImage)

IHImageX* HImageX.Rgb1ToGray()

static void HOperatorSet.Rgb1ToGray(HObject RGBImage, out HObject grayImage)

HImage HImage.Rgb1ToGray()

Description

rgb1_to_grayrgb1_to_grayrgb1_to_grayRgb1ToGrayRgb1ToGray 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.114 * blue .

Parallelization

Parameters

RGBImageRGBImageRGBImageRGBImageRGBImage (input_object)  image(-array) objectHImageHImageHImageXHobject (byte / int2 / uint2 / real)

Three-channel RBG image.

GrayImageGrayImageGrayImageGrayImagegrayImage (output_object)  image(-array) objectHImageHImageHImageXHobject * (byte / int2 / uint2 / real)

Gray scale image.

Example (HDevelop)

* Transformation from rgb to gray
read_image(Image,'patras')
disp_color(Image,WindowHandle)
rgb1_to_gray(Image,GrayImage)
disp_image(GrayImage,WindowHandle)

Example (C)

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

Example (HDevelop)

* Transformation from rgb to gray
read_image(Image,'patras')
disp_color(Image,WindowHandle)
rgb1_to_gray(Image,GrayImage)
disp_image(GrayImage,WindowHandle)

Example (HDevelop)

* Transformation from rgb to gray
read_image(Image,'patras')
disp_color(Image,WindowHandle)
rgb1_to_gray(Image,GrayImage)
disp_image(GrayImage,WindowHandle)

Example (HDevelop)

* Transformation from rgb to gray
read_image(Image,'patras')
disp_color(Image,WindowHandle)
rgb1_to_gray(Image,GrayImage)
disp_image(GrayImage,WindowHandle)

Possible Predecessors

compose3compose3compose3Compose3Compose3

Alternatives

trans_from_rgbtrans_from_rgbtrans_from_rgbTransFromRgbTransFromRgb, rgb3_to_grayrgb3_to_grayrgb3_to_grayRgb3ToGrayRgb3ToGray

Module

Foundation


Table of Contents / Filters / Color ClassesClassesClasses | | | Operators
HALCON Reference Manual 10.0.2 Copyright © 1996-2011 MVTec Software GmbH