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.

UsageReturns
Image.spectralDistance(image2, metric)Image
ArgumentTypeDetails
this: image1ImageThe first image.
image2ImageThe second 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).