公告:凡是在
2025 年 4 月 15 日前註冊使用 Earth Engine 的非商業專案,都必須
驗證非商業用途資格,才能繼續存取 Earth Engine。
ee.Image.spectralDistance
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
:計算兩張圖片之間每個像素的光譜距離。如果圖片是以陣列為基礎,則只會使用每張圖片的第一個波段;否則所有波段都會參與距離計算。因此,這兩張圖片應包含相同數量的波段,或具有相同的一維陣列長度。
用量 | 傳回 |
---|
Image.spectralDistance(image2, metric) | 圖片 |
引數 | 類型 | 詳細資料 |
---|
這個:image1 | 圖片 | 第一張圖片。 |
image2 | 圖片 | 第二張圖片。 |
metric | 字串,預設值為「sam」 | 要使用的頻譜距離指標。可以是「sam」(光譜角度對應器)、「sid」(光譜資訊差異)、「sed」(平方歐幾里得距離) 或「emd」(地球移動距離)。 |
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-26 (世界標準時間)。
[null,null,["上次更新時間:2025-07-26 (世界標準時間)。"],[[["\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). |"]]