Computer Vision · Intermediate level

Intermediate level · Module 5: Image Segmentation · Lesson 2 of 3

Segmenting Satellite Images for Water and Vegetation

Learners work with freely available Sentinel-2 imagery, compute vegetation and water indices from spectral bands and map water and vegetation extent before and after a flood.

In this lesson you will

  • Explain multispectral bands and spectral indices
  • Map water and vegetation with NDWI and NDVI

Key concepts

multispectral bandsNDVI = (NIR − Red) / (NIR + Red)NDWI = (Green − NIR) / (Green + NIR)resolution and cloud coverbefore/after comparison

The lesson

Satellites such as Sentinel-2 record several bands, including near-infrared (NIR), which human eyes cannot see. Copernicus data is free and open through the Copernicus Data Space Ecosystem. Healthy vegetation reflects NIR strongly; water absorbs it.

Simple formulas called spectral indices exploit this. NDVI = (NIR − Red) / (NIR + Red) is high for vegetation. NDWI = (Green − NIR) / (Green + NIR) is high for open water. Thresholding NDWI gives a water mask without any training.

Comparing masks from two dates shows change, such as flood extent. Cloud cover, image resolution and thresholds all affect results, so maps must be presented with their dates, sources and uncertainty, and checked against ground reports where possible.

Step by step

  1. Download a small Sentinel-2 area (or use the provided offline tiles) for two dates.
  2. Load the Green, Red and NIR bands as arrays.
  3. Compute NDVI and NDWI and threshold NDWI to a water mask.
  4. Compute water area for both dates and map the change.

Practice activity

Produce a before/after water-extent map and area estimate for a chosen area, with sources and caveats.

Expected result: Correct index maps, an area comparison and an honest statement of limitations.

Check your understanding

  1. Why is near-infrared useful for mapping water?

    Show answer

    Water absorbs near-infrared light while vegetation reflects it strongly.

  2. What affects the reliability of satellite water maps?

    Show answer

    For example cloud cover, image resolution, dates and threshold choice.

Further learning

Taught live by an instructor — online or in person. Free course lessons are for self-study and do not lead to a certificate — see registration options.