ee.Image.spectralDistance
Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Oblicza odległość spektralną między dwoma obrazami dla każdego piksela. Jeśli obrazy są oparte na tablicy, używany jest tylko pierwszy pasmo każdego obrazu. W przeciwnym razie w obliczeniach odległości uwzględniane są wszystkie pasma. Oczekuje się więc, że oba obrazy będą zawierać tę samą liczbę pasm lub będą miały tę samą długość tablicy jednowymiarowej.
Wykorzystanie | Zwroty |
---|
Image.spectralDistance(image2, metric) | Obraz |
Argument | Typ | Szczegóły |
---|
to: image1 | Obraz | Pierwszy obraz. |
image2 | Obraz | Drugi obraz. |
metric | Ciąg znaków, domyślnie: „sam” | Wskaźnik odległości spektralnej, który ma zostać użyty. Jedna z wartości: „sam” (spectral angle mapper), „sid” (spectral information divergence), „sed” (squared Euclidean distance) lub „emd” (earth movers distance). |
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2025-07-26 UTC.
[null,null,["Ostatnia aktualizacja: 2025-07-26 UTC."],[[["\u003cp\u003eComputes the spectral distance between two images on a per-pixel basis, considering either a single band or all bands depending on image type.\u003c/p\u003e\n"],["\u003cp\u003eImages must have the same number of bands or be 1-dimensional arrays of the same length.\u003c/p\u003e\n"],["\u003cp\u003eOffers various spectral distance metrics including SAM, SID, SED, and EMD, with SAM as the default.\u003c/p\u003e\n"],["\u003cp\u003eReturns a new image representing the calculated spectral distances.\u003c/p\u003e\n"],["\u003cp\u003eAccessible through the \u003ccode\u003espectralDistance()\u003c/code\u003e method applied to the first image, taking the second image and an optional metric as arguments.\u003c/p\u003e\n"]]],[],null,["# ee.Image.spectralDistance\n\nComputes 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.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|----------------------------------------------|---------|\n| Image.spectralDistance`(image2, `*metric*`)` | Image |\n\n| Argument | Type | Details |\n|----------------|------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| this: `image1` | Image | The first image. |\n| `image2` | Image | The second 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). |"]]