ee.Image.spectralGradient
Computes the spectral gradient over all bands of an image (or the first band if the image is Array typed) by computing the per-pixel difference between the spectral erosion and dilation with a given structuring kernel and distance metric. See: Plaza, Antonio, et al. 'Spatial/spectral endmember extraction by multidimensional morphological operations.' IEEE transactions on geoscience and remote sensing 40.9 (2002): 2025-2041.
Usage | Returns |
---|
Image.spectralGradient(metric, kernel, useCentroid) | Image |
Argument | Type | Details |
---|
this: image | Image | The input image. |
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). |
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. |
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-07-13 UTC.
[null,null,["Last updated 2024-07-13 UTC."],[[["Computes the spectral gradient of an image by calculating the difference between spectral erosion and dilation using a specified kernel and distance metric."],["Offers a choice of four spectral distance metrics: SAM, SID, SED, and EMD."],["Allows customization of the connectedness kernel and the method of distance calculation (from the kernel's center or centroid)."],["Primarily used for spatial/spectral endmember extraction in hyperspectral images, as described in the cited research by Plaza et al."],["Operates on all bands of multi-band images or the first band of Array-typed images."]]],[]]