im.dvi {imageRy} | R Documentation |
Compute the Difference Vegetation Index (DVI)
Description
This function calculates the Difference Vegetation Index (DVI) from a multispectral raster image. The DVI is computed as the difference between the Near-Infrared (NIR) and Red bands.
Usage
im.dvi(x, nir, red)
Arguments
x |
A 'SpatRaster' object representing the input multispectral image. |
nir |
An integer specifying the band index of the Near-Infrared (NIR) channel. |
red |
An integer specifying the band index of the Red channel. |
Details
The Difference Vegetation Index (DVI) is a simple vegetation index used to assess plant health. It is calculated as:
DVI = NIR - Red
Higher values indicate denser and healthier vegetation.
Value
A 'SpatRaster' object containing the computed DVI values.
References
For more details on the DVI index, see: https://en.wikipedia.org/wiki/Vegetation_Index
See Also
[im.classify()], [im.ridgeline()]
Examples
library(terra)
# Load a multispectral raster image with 3 bands
r <- rast(system.file("ex/logo.tif", package = "terra"))
# Compute DVI using band 2 (proxy for NIR) and band 1 (Red)
dvi_raster <- im.dvi(r, nir = 2, red = 1)
plot(dvi_raster)
[Package imageRy version 0.3.0 Index]