Linear or histogram equalization stretch of values in a SpatRaster.
For linear stretch, provide the desired output range (
maxv) and the lower and upper bounds in the original data, either as quantiles (
maxq, or as cell values (
smax are both not
maxq are ignored.
For histogram equalization, these arguments are ignored, but you can provide the desired scale of the output.
# S4 method for SpatRaster stretch(x, minv=0, maxv=255, minq=0, maxq=1, smin=NA, smax=NA, histeq=FALSE, scale=1, filename="", ...)
numeric >= 0 and smaller than maxv. lower bound of stretched value
numeric <= 255 and larger than maxv. upper bound of stretched value
numeric >= 0 and smaller than maxq. lower quantile bound of original value. Ignored if smin is supplied
numeric <= 1 and larger than minq. upper quantile bound of original value. Ignored if smax is supplied
numeric < smax. user supplied lower value for the layers, to be used instead of a quantile computed by the function itself
numeric > smin. user supplied upper value for the layers, to be used instead of a quantile computed by the function itself
TRUE histogram equalization is used instead of linear stretch
numeric. The scale (maximum value) of the output if
character. Output filename
additional arguments for writing files as in