im.dvi | R Documentation |
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.
im.dvi(x, nir, red)
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. |
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.
A 'SpatRaster' object containing the computed DVI values.
For more details on the DVI index, see: https://en.wikipedia.org/wiki/Vegetation_Index
[im.classify()], [im.ridgeline()]
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.