Announcement: All noncommercial projects registered to use Earth Engine before April 15, 2025 must verify noncommercial eligibility to maintain Earth Engine access.
Stay organized with collections
Save and categorize content based on your preferences.
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.
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).
kernel
Kernel, default: null
Connectedness kernel. Defaults to a square of radius 1 (8-way connected).
useCentroid
Boolean, default: false
If true, distances are computed from the mean of all pixels under the kernel instead of the kernel's center pixel.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-07-13 UTC."],[[["\u003cp\u003eComputes the spectral/spatial erosion of an image based on spectral distance.\u003c/p\u003e\n"],["\u003cp\u003eUtilizes a structuring kernel to determine the spectral relationship between pixels.\u003c/p\u003e\n"],["\u003cp\u003eOffers various spectral distance metrics: SAM, SID, SED, and EMD.\u003c/p\u003e\n"],["\u003cp\u003eAllows for customization of the kernel and distance calculation method.\u003c/p\u003e\n"]]],[],null,["# ee.Image.spectralErosion\n\nComputes 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.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|--------------------------------------------------------------------|---------|\n| Image.spectralErosion`(`*metric* `, `*kernel* `, `*useCentroid*`)` | Image |\n\n| Argument | Type | Details |\n|---------------|-------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| this: `image` | Image | The input image. |\n| `metric` | String, 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). |\n| `kernel` | Kernel, default: null | Connectedness kernel. Defaults to a square of radius 1 (8-way connected). |\n| `useCentroid` | Boolean, default: false | If true, distances are computed from the mean of all pixels under the kernel instead of the kernel's center pixel. |"]]