fillminima

Module to implement filling of local minima in a raster surface.

The algorithm is from
Soille, P., and Gratin, C. (1994). An efficient algorithm for drainage network
extraction on DEMs. J. Visual Communication and Image Representation. 5(2). 181-189.

The algorithm is intended for hydrological processing of a DEM, but is used by the Fmask cloud shadow algorithm as part of its process for finding local minima which represent potential shadow objects.

fmask.fillminima.fillMinima(img, nullval, boundaryval)[source]

Fill all local minima in the input img. The input array should be a numpy 2-d array. This function returns an array of the same shape and datatype, with the same contents, but with local minima filled using the reconstruction-by-erosion algorithm.