isletMask#
- geetools.ee_image.ImageAccessor.isletMask(offset)#
Compute the islet mask from an image.
An islet is a set of non-masked pixels connected together by their edges of very small surface. The user define the offset of the islet size, and we compute the max number of pixels to improve computation speed. The input Image needs to be a single band binary image.
- Parameters:
offset (float | int | ee.Number) – The limit of the islet size in square meters.
- Returns:
The islet mask.
- Return type:
Examples
import ee, geetools ee.Initialize() image = ee.ImageCollection("COPERNICUS/S2_SR_HARMONIZED").first() mask = image.select('SCL').eq(4) mask = mask.geetools.isletMask(100) print(mask.bandNames().getInfo())