geetools.Image.ImageAccessor.isletMask#

geetools.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 island size and we compute the max number of pixels to improve computation speed. The inpt Image needs to be a single band binary image.

Parameters:

offset (geetools.types.ee_number) – The limit of the islet size in square metters

Returns:

The island mask

Return type:

ee.Image

Examples

import ee, geetools

ee.Initialize()

image = ee.ImageCollection("COPERNICUS/S2_SR_HARMONIZED").first()
mask = image.select('SCL').eq(4)
mask = mask.geetools.islandMask(100)
print(mask.bandNames().getInfo())