rgbShadowMask: Shadow mask from RGB (satellite) imagery

View source: R/rgbShadowMask.R

rgbShadowMaskR Documentation

Shadow mask from RGB (satellite) imagery

Description

This function builds a shadow mask from a RGB Raster* object.

Usage

rgbShadowMask(x, n = 1L, ...)

Arguments

x

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

n

Integer, defaults to '1'. Number of iterations to distinguish between shadow and non-shadow pixels. The more iterations, the fewer shadow pixels will remain.

...

Further arguments passed on to rgb2YCbCr.

Value

A shadow mask RasterLayer.

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.

See Also

rgb2YCbCr

Examples

library(RColorBrewer)

data(gmap_hel)
plotRGB(gmap_hel)

gmap_hel_wsh <- rgbShadowMask(gmap_hel)
plot(gmap_hel_wsh, axes = FALSE, legend = FALSE, 
     col = c(rev(brewer.pal(9, "Greys"))), alpha = .25, add = TRUE)


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