Learn R Programming

OpenImageR (version 1.0.8)

rgb_2gray: convert an RGB image to Gray

Description

convert an RGB image to Gray

Usage

rgb_2gray(RGB_image)

Arguments

RGB_image

a 3-dimensional array

Value

a matrix

Details

This function converts an RGB image to gray

Examples

Run this code
# NOT RUN {
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