ndvi
Normalized difference vegetation index
Description
computes the normalized difference vegetation index (NDVI) value for each pixel in the data
cube and returns an NDVI image. The NDVI image displays the vegetation cover regions of the
input hyperspectral or multispectral data. The function computes the NDVI value using the
red (R) band and the near-infra red (NIR) band images in the data cube. The
output
= ndvi(spcube
)ndvi
function uses the 670 nm and 800 nm band reflectance values
for the red and NIR band images respectively.
specifies the block size for block processing of the spectral data. (since R2021a)output
= ndvi(spcube
,BlockSize=blocksize
)
The function divides the input image into distinct blocks,
processes each block, and then concatenates the processed output of each block to form the
output matrix. Spectral images are multi-dimensional data sets that can be too large to fit in
system memory in their entirety. This can cause the system to run out of memory while running
the ndvi
function. If you encounter such an issue, perform block
processing by using this syntax.
For example, ndvi(spcube,BlockSize=[50 50])
divides the input image
into non-overlapping blocks of size 50-by-50 and then computes the NDVI values for pixels in
each block.
Note
This function requires the Hyperspectral Imaging Library for Image Processing Toolbox™. You can install the Hyperspectral Imaging Library for Image Processing Toolbox from Add-On Explorer. For more information about installing add-ons, see Get and Manage Add-Ons.
The Hyperspectral Imaging Library for Image Processing Toolbox requires desktop MATLAB®, as MATLAB Online™ and MATLAB Mobile™ do not support the library.
Examples
Input Arguments
Output Arguments
References
“Change Detection of Vegetation Cover by NDVI Technique on Catchment Area of the Panchet Hill Dam, India.” International Journal of Research in Geography 2, no. 3 (2016). https://doi.org/10.20431/2454-8685.0203002.
[1] Haboudane, D. “Hyperspectral Vegetation Indices and Novel Algorithms for Predicting Green LAI of Crop Canopies: Modeling and Validation in the Context of Precision Agriculture.” Remote Sensing of Environment 90, no. 3 (April 15, 2004): 337–52. https://doi.org/10.1016/j.rse.2003.12.013.
[2] “Change Detection of Vegetation Cover by NDVI Technique on Catchment Area of the Panchet Hill Dam, India.” International Journal of Research in Geography 2, no. 3 (2016). https://doi.org/10.20431/2454-8685.0203002.