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 .
|
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. | |
/* 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).
rgb3_to_gray is reentrant and automatically parallelized (on tuple level, domain level).
Image filters