ee.Image.spectralDistance
Computes the per-pixel spectral distance between two images. If the images are array based then only the first band of each image is used; otherwise all bands are involved in the distance computation. The two images are therefore expected to contain the same number of bands or have the same 1-dimensional array length.
Usage | Returns | Image.spectralDistance(image2, metric) | Image |
Argument | Type | Details | this: image1 | Image | The first image. |
image2 | Image | The second 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). |
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 distance between two images on a per-pixel basis, considering either a single band or all bands depending on image type."],["Images must have the same number of bands or be 1-dimensional arrays of the same length."],["Offers various spectral distance metrics including SAM, SID, SED, and EMD, with SAM as the default."],["Returns a new image representing the calculated spectral distances."],["Accessible through the `spectralDistance()` method applied to the first image, taking the second image and an optional metric as arguments."]]],[]]