Skip to content

rgb3_to_grayrgb3_to_grayRgb3ToGrayRgb3ToGrayrgb3_to_grayrgb3_to_gray🔗

Short description🔗

rgb3_to_grayrgb3_to_grayRgb3ToGrayRgb3ToGrayrgb3_to_grayrgb3_to_gray — Transform an RGB image to a gray scale image.

Signature🔗

rgb3_to_gray( image ImageRed, image ImageGreen, image ImageBlue, out image ImageGray )rgb3_to_gray( ImageRed, ImageGreen, ImageBlue : ImageGray : : )void Rgb3ToGray( const HObject& ImageRed, const HObject& ImageGreen, const HObject& ImageBlue, HObject* ImageGray )static void HOperatorSet.Rgb3ToGray( HObject imageRed, HObject imageGreen, HObject imageBlue, out HObject imageGray )def rgb3_to_gray( image_red: HObject, image_green: HObject, image_blue: HObject ) -> HObject

Herror rgb3_to_gray( const Hobject ImageRed, const Hobject ImageGreen, const Hobject ImageBlue, Hobject* ImageGray )

Herror T_rgb3_to_gray( const Hobject ImageRed, const Hobject ImageGreen, const Hobject ImageBlue, Hobject* ImageGray )

HImage HImage::Rgb3ToGray( const HImage& ImageGreen, const HImage& ImageBlue ) const

HImage HImage.Rgb3ToGray( HImage imageGreen, HImage imageBlue )

Description🔗

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

Execution information🔗

Execution information
  • Supports OpenCL compute devices.

  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Automatically parallelized on domain level.

Parameters🔗

ImageRedimageRedimage_red (input_object) singlechannelimage(-array) → object (byte / int2 / uint2 / real)object (byte / int2 / uint2 / real)HObject (byte / int2 / uint2 / real)HImage (byte / int2 / uint2 / real)HObject (byte / int2 / uint2 / real)Hobject (byte / int2 / uint2 / real)

Input image (red channel).

ImageGreenimageGreenimage_green (input_object) singlechannelimage(-array) → object (byte / int2 / uint2 / real)object (byte / int2 / uint2 / real)HObject (byte / int2 / uint2 / real)HImage (byte / int2 / uint2 / real)HObject (byte / int2 / uint2 / real)Hobject (byte / int2 / uint2 / real)

Input image (green channel).

ImageBlueimageBlueimage_blue (input_object) singlechannelimage(-array) → object (byte / int2 / uint2 / real)object (byte / int2 / uint2 / real)HObject (byte / int2 / uint2 / real)HImage (byte / int2 / uint2 / real)HObject (byte / int2 / uint2 / real)Hobject (byte / int2 / uint2 / real)

Input image (blue channel).

ImageGrayimageGrayimage_gray (output_object) singlechannelimage(-array) → object (byte / int2 / uint2 / real)object (byte / int2 / uint2 / real)HObject (byte / int2 / uint2 / real)HImage (byte / int2 / uint2 / real)HObject (byte / int2 / uint2 / real)Hobject * (byte / int2 / uint2 / real)

Gray scale image.

Example🔗

(HDevelop)


* Transformation from rgb to gray
read_image(Image,'patras')
dev_display(Image)
decompose3(Image, ImageR, ImageG, ImageB)
rgb3_to_gray(ImageR,ImageG,ImageB,GrayImage)
dev_display(GrayImage)
(C)
/* Transformation 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)\;

Combinations with other operators🔗

Combinations

Possible predecessors

decompose3Decompose3

Alternatives

rgb1_to_grayRgb1ToGray, trans_from_rgbTransFromRgb

Module🔗

Foundation