Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

normImage

Normalize Raster Images: Center and Scale


Description

For each pixel subtracts the mean of the raster layer and optionally divide by its standard deviation.

Usage

normImage(img, norm = TRUE, ...)

Arguments

img

Raster* object. Image to transform. Transformation will be performed separately for each layer.

norm

Logical. Perform normalization (scaling) in addition to centering, i.e. divide by standard deviation.

...

further arguments passed to writeRaster.

Value

Returns a Raster* with the same number layers as input layers with each layer being centered and optionally normalized.

Examples

library(raster)
## Load example data
data(rlogo)

## Normalization: Center and Scale
rlogo_center_norm <- normImage(rlogo)
hist(rlogo_center_norm)

## Centering
rlogo_center <- normImage(rlogo, norm = FALSE)

RStoolbox

Tools for Remote Sensing Data Analysis

v0.2.6
GPL (>= 3)
Authors
Benjamin Leutner [cre, aut], Ned Horning [aut], Jakob Schwalb-Willmann [aut], Robert J. Hijmans [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.