Announcement: All noncommercial projects registered to use Earth Engine beforeApril 15, 2025 mustverify noncommercial eligibility to maintain access. If you have not verified by September 26, 2025, your access may be on hold.

ee.Image.spectralErosion

Computes the spectral/spatial erosion of an image by computing the spectral distance of each pixel under a structuring kernel from the centroid of all pixels under the kernel and taking the closest result. See 'Spatial/spectral endmember extraction by multidimensional morphological operations.' IEEE transactions on geoscience and remote sensing 40.9 (2002): 2025-2041.

UsageReturns
Image.spectralErosion(metric,kernel,useCentroid)Image
ArgumentTypeDetails
this:imageImageThe input image.
metricString, default: "sam"The spectral distance metric to use. One of 'sam' (spectral angle mapper), 'sid' (spectral information divergence), 'sed' (squared Euclidean distance), or 'emd' (earth movers distance).
kernelKernel, default: nullConnectedness kernel. Defaults to a square of radius 1 (8-way connected).
useCentroidBoolean, default: falseIf true, distances are computed from the mean of all pixels under the kernel instead of the kernel's center pixel.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2024-07-13 UTC.