Figure 6
From: High-resolution surface water dynamics in Earth’s small and medium-sized reservoirs

Method of surface water area detection for reservoirs. The algorithm to compute surface water consists of the next steps: (1) Select satellite images least cloudy over the reservoir area (2) Compute spectral water index (NDWI here, but could be any spectral index suitable for surface water detection) (3) Apply Canny edge filter to detect water/land edges (additional steps can include edge suppression based on the spectral properties around edges) (4) Define sampling region for pixels surrounding water/land edges (5) Sample spectral index values within the buffer computed during step 4 and compute optimal threshold using Otsu method used to (6) Compute the surface water area (7) Select surface water occurrence (8) Fill gaps (false-negatives) in the resulting water mask, remove incorrectly detected water (false-positives) by sampling water occurrence along water edges, and compute the final filled surface water area mask by clipping water occurrence at a given probability and combining it with the detected water mask. The figure was generated using Google Earth Engine Code Editor tool14. Code: https://code.earthengine.google.com/54602c8309f44cf83e42cf93a854dc49.