gbc {rcaiman} | R 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 Díaz and Lencinas (2018) 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
Díaz GM, Lencinas JD (2018). “Model-based local thresholding for canopy hemispherical photography.” Canadian Journal of Forest Research, 48(10), 1204–1216. doi:10.1139/cjfr-2018-0006.
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)