gbc: Gamma back correction

View source: R/gbc.R

gbcR Documentation

Gamma back correction

Description

Gamma back correction of JPEG images

Usage

gbc(DN_from_JPEG, gamma = 2.2)

Arguments

DN_from_JPEG

Numeric vector or object of the SpatRaster class. Digital numbers from a JPEG file (0 to 255, i.e., the standard 8-bit encoded).

gamma

Numeric vector of length one. Gamma value. Please see \insertCiteDiaz2018;textualrcaiman for details.

Details

Digital cameras usually use sRGB as color space. It is a standard developed to ensure accurate color and tone management. The transfer function of sRGB, known as gamma correction, is very close to a power function with the exponent 1/2.2. This is why a DN of a born-digital photograph that was encoded in sRGB has a non-linear relationship with luminance despite having the sensor a linear response.

Value

The same class as DN_from_JPEG, with dimension unchanged but values rescaled between 0 and 1 in a non-linear fashion.

References

\insertAllCited

See Also

Other Pre-processing Functions: enhance_caim(), local_fuzzy_thresholding(), membership_to_color(), normalize()

Examples

path <- system.file("external/DSCN4500.JPG", package = "rcaiman")
r <- read_caim(path, c(1250, 1020) - 745, 745 * 2, 745 * 2)
r
gbc(r)

rcaiman documentation built on Nov. 15, 2023, 1:08 a.m.