Level 0: Foundation
★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.Colours beyond what we see
A camera in orbit records not just red, green and blue but also light our eyes cannot see: near-infrared and shortwave-infrared. Healthy leaves are dark in red light, because chlorophyll uses it, but very bright in near-infrared. Water is dark in both infrared ranges. So a simple ratio of two bands lights up vegetation or water. The most famous, NDVI, is the difference between near-infrared and red divided by their sum: close to 0.8 for a lush field, near 0.1 for bare soil and below 0 for water. Indices are quick and useful, but each has blind spots. The demo lets you mix leaves, soil and water and watch the indices respond.
NDVI time series drive crop-yield forecasts, drought early warning (FEWS NET) and vegetation health maps; NBR maps burn severity after wildfires; MNDWI maps flood extent and reservoirs.
- 1. Healthy leaves are brightest in…
- 2. NDVI of open water is usually…
- 3. A spectral index combines…
Level 1: Beginner
★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.Bands and the main indices
- Bands (Sentinel-2 centres, S2A): B2 blue 490 nm, B3 green 560, B4 red 665 (all 10 m); red-edge B5 705, B6 740, B7 783 (20 m); B8 NIR 842 (10 m) and narrow B8A 865 (20 m); SWIR B11 1610 and B12 2190 (20 m). Landsat 8/9 OLI: blue 0.45–0.51 µm, green 0.53–0.59, red 0.64–0.67, NIR 0.85–0.88, SWIR1 1.57–1.65, SWIR2 2.11–2.29, all 30 m.
- NDVI = (NIR − Red)/(NIR + Red) (Rouse et al. 1974; Tucker 1979). Dense vegetation 0.6–0.9, soil 0.1–0.2, water below 0. Saturates over dense canopies.
- SAVI = (1 + L)(NIR − Red)/(NIR + Red + L), L = 0.5 (Huete 1988), and MSAVI2 (Qi et al. 1994): reduce the effect of soil background.
- EVI = 2.5 (NIR − Red)/(NIR + 6 Red − 7.5 Blue + 1) (Huete et al. 2002, the MODIS index): less saturation, uses blue to correct for aerosols.
- NIRv = NDVI × NIR (Badgley et al. 2017): tracks photosynthesis and separates vegetation from soil.
- NDRE = (NIR − RedEdge)/(NIR + RedEdge): stays sensitive to chlorophyll where NDVI saturates.
- NDWI = (Green − NIR)/(Green + NIR) (McFeeters 1996) for open water; Gao’s 1996 NDWI = (NIR − SWIR)/(NIR + SWIR) measures leaf water instead. MNDWI = (Green − SWIR1)/(Green + SWIR1) (Xu 2006).
- NBR = (NIR − SWIR2)/(NIR + SWIR2); dNBR = NBR before − NBR after a fire (Key and Benson 2006). NDSI = (Green − SWIR1)/(Green + SWIR1) for snow (Hall et al. 1995).
- Scaling: Landsat Collection 2 L2 reflectance = DN × 0.0000275 − 0.2. Sentinel-2 L2A = (DN − 1000)/10000 since processing baseline 04.00 (January 2022), DN/10000 before.
- 1. MNDWI replaces NIR with…
- 2. EVI uses the blue band to…
- 3. Sentinel-2 L2A after baseline 04.00 needs…
Level 2: Intermediate
★★★☆☆ Intermediate⏱ 25 minUndergraduate students and practising engineers.Computing indices on real data
Exercise 1.
- NDVI, NDWI, MNDWI, SAVI, EVI and NBR.
- Landsat Collection 2 and Sentinel-2 L2A reflectance scaling.
Practice.
- Convert stored integers to reflectance first, and mask clouds, shadows, snow and saturated pixels (Sentinel-2 SCL, Landsat QA_PIXEL) before computing anything.
- Indices are ratios: near-zero denominators (dark water, shadow) give noisy or infinite values; guard the division.
- Do not mix sensors blindly: band widths differ, so NDVI from Landsat and Sentinel-2 differ slightly; HLS applies bandpass adjustments.
- Choose thresholds per scene or learn them (Otsu, a classifier) rather than trusting 0 everywhere.
- For anything beyond a quick look, feed all bands to a model; indices are features, not ground truth.
import numpy as np, rasterio
with rasterio.open("S2_B04.tif") as r4, rasterio.open("S2_B08.tif") as r8, rasterio.open("S2_SCL.tif") as rs:
red = (r4.read(1).astype("float32") - 1000) / 10000 # L2A, baseline >= 04.00
nir = (r8.read(1).astype("float32") - 1000) / 10000
scl = rs.read(1, out_shape=red.shape) # 20 m classes resampled to 10 m
ok = np.isin(scl, [4, 5, 6]) & (nir + red > 0.01) # vegetation, bare soil, water only
ndvi = np.where(ok, (nir - red) / (nir + red), np.nan)- 1. Before computing NDVI, first…
- 2. Sentinel-2's scene classification layer is called…
- 3. Index thresholds should be…
Level 3: Advanced
★★★★☆ Advanced⏱ 25 minGraduate level, with full derivations and proofs.Theory
Why ratios. If illumination scales both bands by the same factor k (slope, sun angle, thin haze to first order), NDVI = (kN − kR)/(kN + kR) is unchanged. That is the main reason normalised differences beat single bands.
Why NDVI depends on soil. For a pixel with vegetation cover f over soil of brightness b, N = f Nᵥ + (1 − f) b Nₛ and R = f Rᵥ + (1 − f) b Rₛ. NDVI is a ratio of these mixtures, so its value at fixed f depends on b: a dark soil contributes little to the denominator, so the vegetation term dominates and NDVI is high; a bright soil pulls it down. SAVI adds a constant L to the denominator so that the soil brightness matters less; NIRv multiplies by NIR, which is close to linear in f.
Why water indices fail at edges. In a pixel with water fraction w mixed with leaves, NDWI crosses 0 only when Green exceeds NIR, which for leafy shores needs w of about 0.9; MNDWI, using SWIR (leaf SWIR is lower than leaf NIR), crosses near 0.74. Both underestimate water at vegetated shores, NDWI more so.
Saturation. NDVI approaches its asymptote as red reflectance falls toward zero, while NIR keeps rising with leaf area; differences in dense canopies are compressed. EVI, NDRE and NIRv keep more dynamic range.
- 1. Scaling both bands by k changes NDVI by…
- 2. At fixed cover, darker soil makes NDVI…
- 3. Over dense canopies NDVI…
Level 4: Expert
★★★★★ Expert⏱ 30 minResearchers: original papers and open problems.How much do soil brightness and mixed pixels distort the standard indices?
History.
- J. W. Rouse, R. H. Haas, J. A. Schell and D. W. Deering, “Monitoring vegetation systems in the Great Plains with ERTS” (1974); C. J. Tucker, “Red and photographic infrared linear combinations for monitoring vegetation” (1979).
- A. R. Huete, “A soil-adjusted vegetation index (SAVI)” (1988); A. Huete et al., EVI for MODIS (2002).
- S. K. McFeeters, “The use of the normalized difference water index (NDWI)” (1996); H. Xu, “Modification of normalised difference water index (NDWI)” (2006).
Exercise 2. Synthetic Sentinel-2 pixels from illustrative reflectance spectra (6 bands, noise 0.005).
- Part A, vegetation cover: cover f uniform in [0, 1] over soil whose brightness varies 0.4–1.6× (wet and dark to dry and bright); each index is calibrated to f with a quadratic on 300 pixels and tested on 3700.
- Part B, water: clear and turbid water, vegetation, soil and built-up pixels (2000 each, brightness ±40%, built-up with ±15% per-band material variation), plus 2000 shoreline pixels mixing water and leaves; threshold at 0.
| index | cover RMSE | bias on dark soil | bias on bright soil |
|---|---|---|---|
| NDVI | 0.0739 | +0.077 | −0.061 |
| SAVI | 0.0317 | +0.013 | −0.015 |
| EVI | 0.0382 | +0.006 | −0.005 |
| NIRv | 0.0328 | −0.016 | +0.011 |
| water index | water recall | built-up flagged as water | shoreline accuracy |
|---|---|---|---|
| NDWI | 1.0 | 0.207 | 0.603 |
| MNDWI | 1.0 | 0.021 | 0.747 |
- Soil matters for NDVI: at the same cover NDVI read about 0.07 too high on dark soil and 0.06 too low on bright soil; SAVI and NIRv more than halved the error, and EVI had the smallest soil bias.
- Open water is easy: both water indices found every water pixel, clear or turbid, and never flagged vegetation or soil.
- Built-up and shores separate them: NDWI called a fifth of built-up pixels water; MNDWI, using SWIR where built-up surfaces are bright, cut that tenfold and was 14 points more accurate on shoreline pixels.
- Seeds 1 and 2 agreed: NDVI RMSE 0.0730 and 0.0722 (SAVI 0.0312 and 0.0304); NDWI built-up false positives 0.200 and 0.199 (MNDWI 0.025 and 0.016).
- Caveat: illustrative spectra, no atmosphere and no bidirectional effects; real built-up false positives depend strongly on roof materials and shadows.
Spectral indices in AI, robotics and aerospace
- Features for models: indices are standard extra input channels for crop-type and land-cover classifiers; foundation models learn similar band combinations themselves (G5-8, G5-9).
- Agricultural drones: multispectral cameras with red-edge and NIR bands map NDVI and NDRE for variable-rate fertilising.
- Wildfire and flood services: dNBR from Sentinel-2 and Landsat for burn severity; MNDWI and radar for flood extent in emergency mapping.
- Planetary science: the same band-ratio idea maps minerals on Mars and ice on the Moon.
References
- J. W. Rouse, R. H. Haas, J. A. Schell and D. W. Deering (1974). “Monitoring vegetation systems in the Great Plains with ERTS.” Third ERTS Symposium, NASA SP-351.
- C. J. Tucker (1979). “Red and photographic infrared linear combinations for monitoring vegetation.” Remote Sensing of Environment.
- A. R. Huete (1988). “A soil-adjusted vegetation index (SAVI).” Remote Sensing of Environment.
- A. Huete et al. (2002). “Overview of the radiometric and biophysical performance of the MODIS vegetation indices.” Remote Sensing of Environment.
- S. K. McFeeters (1996). “The use of the normalized difference water index (NDWI) in the delineation of open water features.” International Journal of Remote Sensing.
- H. Xu (2006). “Modification of normalised difference water index (NDWI) to enhance open water features in remotely sensed imagery.” International Journal of Remote Sensing.
- G. Badgley, C. B. Field and J. A. Berry (2017). “Canopy near-infrared reflectance and terrestrial photosynthesis.” Science Advances.
- C. H. Key and N. C. Benson (2006). “Landscape assessment: ground measure of severity, the composite burn index; and remote sensing of severity, the normalized burn ratio.” USDA Forest Service RMRS-GTR-164-CD.