rgb1_to_grayrgb1_to_grayRgb1ToGrayRgb1ToGrayrgb1_to_gray (算子名称)
名称
rgb1_to_grayrgb1_to_grayRgb1ToGrayRgb1ToGrayrgb1_to_gray — Transform an RGB image into a gray scale image.
参数签名
def rgb1_to_gray(rgbimage: HObject) -> HObject
描述
rgb1_to_grayrgb1_to_grayRgb1ToGrayRgb1ToGrayRgb1ToGrayrgb1_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.114 * blue .
If one of the input images in RGBImageRGBImageRGBImageRGBImageRGBImagergbimage is a single-channel image
its reference will be simply copied to the output GrayImageGrayImageGrayImageGrayImagegrayImagegray_image.
运行信息
- 支持OpenCL计算设备。
- 多线程类型:可重入(与非独占操作符并行运行)。
- 多线程作用域:全局(可以从任何线程调用)。
- 在元组级别自动并行化。
- Automatically parallelized on domain level.
参数表
RGBImageRGBImageRGBImageRGBImageRGBImagergbimage (input_object) (multichannel-)image(-array) → objectHImageHObjectHImageHobject (byte / int2 / uint2 / real)
Three-channel RBG image.
GrayImageGrayImageGrayImageGrayImagegrayImagegray_image (output_object) singlechannelimage(-array) → objectHImageHObjectHImageHobject * (byte / int2 / uint2 / real)
Gray scale image.
例程 (HDevelop)
* Transformation from rgb to gray
read_image(Image,'patras')
dev_display(Image)
rgb1_to_gray(Image,GrayImage)
dev_display(GrayImage)
例程 (C)
/* Transformation from rgb to gray */
read_image(Image,"patras");
disp_color(Image,WindowHandle);
rgb1_to_gray(Image,&GrayImage);
disp_image(GrayImage,WindowHandle);
例程 (HDevelop)
* Transformation from rgb to gray
read_image(Image,'patras')
dev_display(Image)
rgb1_to_gray(Image,GrayImage)
dev_display(GrayImage)
例程 (HDevelop)
* Transformation from rgb to gray
read_image(Image,'patras')
dev_display(Image)
rgb1_to_gray(Image,GrayImage)
dev_display(GrayImage)
例程 (HDevelop)
* Transformation from rgb to gray
read_image(Image,'patras')
dev_display(Image)
rgb1_to_gray(Image,GrayImage)
dev_display(GrayImage)
可能的前置算子
compose3compose3Compose3Compose3Compose3compose3
可替代算子
trans_from_rgbtrans_from_rgbTransFromRgbTransFromRgbTransFromRgbtrans_from_rgb,
rgb3_to_grayrgb3_to_grayRgb3ToGrayRgb3ToGrayRgb3ToGrayrgb3_to_gray
模块
Foundation