公告:所有在
2025 年 4 月 15 日之前注册使用 Earth Engine 的非商业项目都必须
验证是否符合非商业性质的资格条件,才能继续使用 Earth Engine。
ee.Image.spectralGradient
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
通过计算给定结构化内核和距离度量下光谱腐蚀和膨胀之间的每像素差异,计算图像(或图像为 Array 类型时的第一个波段)所有波段的光谱梯度。参见: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,则距离的计算依据是内核下所有像素的平均值,而不是内核的中心像素。 |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[null,null,["最后更新时间 (UTC):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. |"]]