rgb2YCbCr: Convert from RGB to YCbCr color space

View source: R/rgb2YCbCr.R

rgb2YCbCrR Documentation

Convert from RGB to YCbCr color space

Description

This function transforms a RGB Raster* object to YCbCr color space.

Usage

rgb2YCbCr(x, r = 1, g = 2, b = 3)

Arguments

x

A RasterStack or RasterBrick object. 3 bands are mandatory (usually red, green and blue).

r

Integer, defaults to '1'. Index of the red channel.

g

Integer, defaults to '2'. Index of the green channel.

b

Integer, defaults to '3'. Index of the blue channel.

Value

A true-color RasterStack object converted to YCbCr color space.

Author(s)

Florian Detsch, Tim Appelhans

References

Deb, K. and Suny, A.H. (2014): Shadow Detection and Removal Based on YCbCr Color Space. Smart Computing Review 4, 23-33, doi:10.6029/smartcr.2014.01.003.

Examples

b_rgb <- brick(system.file("external/rlogo.grd", package="raster"))
plotRGB(b_rgb)

b_ycbcr <- rgb2YCbCr(b_rgb)
plot(b_ycbcr, 
     main = c("luminance", "blue-yellow chrominance", "green-red chrominance"))


environmentalinformatics-marburg/Rsenal documentation built on July 28, 2023, 6:09 a.m.