Learn R Programming

OpenImageR (version 1.3.0)

rgb_2gray: convert an RGB image to Gray

Description

convert an RGB image to Gray

Usage

rgb_2gray(RGB_image)

Value

a matrix

Arguments

RGB_image

a 3-dimensional array where the third dimension is equal to 3

Author

Lampros Mouselimis

Details

This function converts an RGB image to gray

Examples

Run this code

path = system.file("tmp_images", "1.png", package = "OpenImageR")

image = readImage(path)

gray = rgb_2gray(image)

Run the code above in your browser using DataLab