Description Usage Arguments Value Examples
This function is used to convert an RGB image to Grayscale.
1 | Color2Gray(image, weight = c(0.299, 0.587, 0.114))
|
image |
an array of an RGB image file for processing. |
weight |
a numeric vector, giving weights for the Red, the Green and the Blue channels of the image, respectively. |
image |
A matrix of pixels of the image converted from RGB to Grayscale. |
1 2 3 4 5 6 | #read an RGB image
library(png)
image = readPNG(system.file("extdata", "image1.png",
package = "implant",
mustWork = TRUE))[ , ,c(1:3)]
imageGray = Color2Gray(image)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.