公告:凡是在
2025 年 4 月 15 日前註冊使用 Earth Engine 的非商業專案,都必須
驗證非商業用途資格,才能繼續存取 Earth Engine。
ee.Image.spectralGradient
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
:計算圖像所有頻帶的頻譜梯度 (如果圖像為陣列類型,則計算第一個頻帶),方法是使用指定的結構化核心和距離指標,計算頻譜侵蝕和擴張之間的每像素差異。請參閱:Plaza, Antonio 等人,「Spatial/spectral endmember extraction by multidimensional morphological operations」(透過多維度形態作業擷取空間/光譜端元)。IEEE transactions on geoscience and remote sensing 40.9 (2002): 2025-2041.
用量 | 傳回 |
---|
Image.spectralGradient(metric, kernel, useCentroid) | 圖片 |
引數 | 類型 | 詳細資料 |
---|
這個:image | 圖片 | 輸入圖片。 |
metric | 字串,預設值為「sam」 | 要使用的頻譜距離指標。可以是「sam」(光譜角度對應器)、「sid」(光譜資訊差異)、「sed」(平方歐幾里得距離) 或「emd」(地球移動距離)。 |
kernel | 核心,預設值:null | 連結性核心。預設值為半徑 1 的正方形 (8 向連線)。 |
useCentroid | 布林值,預設值為 false | 如果為 true,系統會根據核心下所有像素的平均值計算距離,而非核心的中心像素。 |
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-26 (世界標準時間)。
[null,null,["上次更新時間:2025-07-26 (世界標準時間)。"],[[["\u003cp\u003eComputes the spectral gradient of an image by calculating the difference between spectral erosion and dilation using a specified kernel and distance metric.\u003c/p\u003e\n"],["\u003cp\u003eOffers a choice of four spectral distance metrics: SAM, SID, SED, and EMD.\u003c/p\u003e\n"],["\u003cp\u003eAllows customization of the connectedness kernel and the method of distance calculation (from the kernel's center or centroid).\u003c/p\u003e\n"],["\u003cp\u003ePrimarily used for spatial/spectral endmember extraction in hyperspectral images, as described in the cited research by Plaza et al.\u003c/p\u003e\n"],["\u003cp\u003eOperates on all bands of multi-band images or the first band of Array-typed images.\u003c/p\u003e\n"]]],[],null,["# ee.Image.spectralGradient\n\nComputes 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.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|---------------------------------------------------------------------|---------|\n| Image.spectralGradient`(`*metric* `, `*kernel* `, `*useCentroid*`)` | Image |\n\n| Argument | Type | Details |\n|---------------|-------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| this: `image` | Image | The input 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). |\n| `kernel` | Kernel, default: null | Connectedness kernel. Defaults to a square of radius 1 (8-way connected). |\n| `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. |"]]