Calculate the coefficient of variation (CV) of reflectance across all spectral bands for each pixel. CV is a standardized, dimensionless measure of spectral dispersion relative to mean brightness.
Arguments
- x
A
SpatRasterwith hyperspectral data.- index_name
Character. Name for the output layer. Default
NULL.- na.rm
Logical. Remove
NAvalues. DefaultTRUE.- filename
Character. Output filename. Default
""keeps result in memory.- overwrite
Logical. Overwrite existing file. Default
FALSE.- ...
Additional arguments passed to
terra::writeRaster().
Value
A SpatRaster with coefficient of variation values.
Details
CV is calculated as sd / mean for each pixel across all wavelengths.
Unlike standard deviation alone, CV normalizes for brightness differences,
making it comparable across pixels with different mean reflectance values.
See also
hsi_calc_rsd() for standard deviation,
hsi_calc_rmean() for mean reflectance.
Other HSI Transformations:
hsi_apply_mnf(),
hsi_calc_difference(),
hsi_calc_mnf(),
hsi_calc_ndi(),
hsi_calc_raba(),
hsi_calc_rabd(),
hsi_calc_ratio(),
hsi_calc_reflectance(),
hsi_calc_remp(),
hsi_calc_rmean(),
hsi_calc_rmedian(),
hsi_calc_rsd(),
hsi_calc_stretch(),
hsi_destripe(),
hsi_remove_continuum(),
hsi_smooth_median(),
hsi_smooth_savgol(),
hsi_tiled(),
hsi_write_scaled()
Examples
if (FALSE) { # \dontrun{
x <- terra::rast("REFLECTANCE_testdata.tif")
x_rcv <- hsi_calc_rcv(x)
x_rcv <- hsi_calc_rcv(
x,
index_name = "cv_reflectance",
filename = "output_rcv.tif",
overwrite = TRUE
)
} # }