公告:所有在
2025 年 4 月 15 日之前注册使用 Earth Engine 的非商业项目都必须
验证是否符合非商业性质的资格条件,才能继续使用 Earth Engine。
ee.Image.glcmTexture
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
根据每个波段中每个像素周围的灰度共现矩阵计算纹理指标。GLCM 是一种表格,用于统计图片中不同像素亮度值(灰度)组合的出现频率。它会统计值 X 的像素在特定方向和距离上与值 Y 的像素相邻的次数,然后根据此表格推导出统计信息。
此实现会计算 Haralick 提出的 14 个 GLCM 指标,以及 Conners 提出的 4 个额外指标。输入必须为整数值。
如果开启了方向平均,输出由每个输入频段 18 个频段组成;如果未开启,输出由内核中每个方向对 18 个频段组成:
ASM:角二阶矩;用于衡量重复配对的数量
对比度:f2,对比度;用于衡量图片的局部对比度
CORR:f3,相关性;衡量像素对之间的相关性
VAR:f4,方差;衡量灰度分布的离散程度
IDM:f5,逆差分矩;用于衡量同质性
SAVG:f6,总和平均值
SVAR:f7,总方差
SENT:f8,熵总和
ENT:f9,熵。衡量灰度分布的随机性
DVAR:f10,差分方差
DENT:f11,差分熵
IMC1:f12,相关性 1 的信息度量
IMCORR2:f13,相关性信息度量 2
MAXCORR:f14,最大相关系数。(未计算)
DISS:相异性
INERTIA:惯性
SHADE:集群阴影
PROM:聚类显著性
如需了解详情,请参阅以下两篇论文:Haralick 等人撰写的“Textural Features for Image Classification”,https://doi.org/10.1109/TSMC.1973.4309314;以及 Conners 等人撰写的“Segmentation of a high-resolution urban scene using texture operators”,https://sdoi.org/10.1016/0734-189X(84)90197-X。
用法 | 返回 |
---|
Image.glcmTexture(size, kernel, average) | 图片 |
参数 | 类型 | 详细信息 |
---|
此:image | 图片 | 要计算纹理指标的图片。 |
size | 整数,默认值:1 | 要纳入每个 GLCM 中的邻域的大小。 |
kernel | 内核,默认值:null | 一个内核,用于指定计算 GLCM 的 x 和 y 偏移量。系统会为内核中每个非零像素(中心像素除外)计算一个 GLCM,前提是尚未针对同一方向和距离计算过 GLCM。例如,如果设置了东侧像素和/或西侧像素,则仅计算 1 个(水平)GLCM。系统会从左到右、从上到下扫描内核。默认值为 3x3 正方形,从而生成 4 个偏移量分别为 (-1, -1)、(0, -1)、(1, -1) 和 (-1, 0) 的 GLCM。 |
average | 布尔值,默认值:true | 如果为 true,则对每个指标的方向性频段求平均值。 |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[null,null,["最后更新时间 (UTC):2025-07-26。"],[[["\u003cp\u003eComputes 18 texture metrics, derived from Gray-Level Co-occurrence Matrices (GLCMs), for each band of an image to quantify texture.\u003c/p\u003e\n"],["\u003cp\u003eGLCMs analyze the frequency of pixel brightness value combinations within a specified neighborhood, offering insights into image texture.\u003c/p\u003e\n"],["\u003cp\u003eUsers can customize the neighborhood size and kernel to control the analysis scale and direction, with directional averaging available for output simplification.\u003c/p\u003e\n"],["\u003cp\u003eThe output includes Haralick's 14 GLCM metrics and Conners' 4 additional metrics, providing a comprehensive texture profile.\u003c/p\u003e\n"],["\u003cp\u003eThe provided links to scientific publications offer further details on the underlying theory and calculations of the texture metrics.\u003c/p\u003e\n"]]],["This content describes the computation of texture metrics using the Gray Level Co-occurrence Matrix (GLCM). It calculates 18 metrics, including Angular Second Moment, Contrast, Correlation, and Entropy, among others. The GLCM tabulates pixel brightness combinations within an image, considering direction and distance. Input images must be integer-valued. The `Image.glcmTexture` function takes `size`, `kernel` (pixel offsets), and `average` (directional averaging) as parameters. Output is 18 bands per input band, either averaged or per directional pair in the kernel.\n"],null,["# ee.Image.glcmTexture\n\nComputes texture metrics from the Gray Level Co-occurrence Matrix around each pixel of every band. The GLCM is a tabulation of how often different combinations of pixel brightness values (grey levels) occur in an image. It counts the number of times a pixel of value X lies next to a pixel of value Y, in a particular direction and distance. and then derives statistics from this tabulation.\n\n\u003cbr /\u003e\n\nThis implementation computes the 14 GLCM metrics proposed by Haralick, and 4 additional metrics from Conners. Inputs are required to be integer valued.\n\nThe output consists of 18 bands per input band if directional averaging is on and 18 bands per directional pair in the kernel, if not:\n\nASM: f1, Angular Second Moment; measures the number of repeated pairs\n\nCONTRAST: f2, Contrast; measures the local contrast of an image\n\nCORR: f3, Correlation; measures the correlation between pairs of pixels\n\nVAR: f4, Variance; measures how spread out the distribution of gray-levels is\n\nIDM: f5, Inverse Difference Moment; measures the homogeneity\n\nSAVG: f6, Sum Average\n\nSVAR: f7, Sum Variance\n\nSENT: f8, Sum Entropy\n\nENT: f9, Entropy. Measures the randomness of a gray-level distribution\n\nDVAR: f10, Difference variance\n\nDENT: f11, Difference entropy\n\nIMCORR1: f12, Information Measure of Corr. 1\n\nIMCORR2: f13, Information Measure of Corr. 2\n\nMAXCORR: f14, Max Corr. Coefficient. (not computed)\n\nDISS: Dissimilarity\n\nINERTIA: Inertia\n\nSHADE: Cluster Shade\n\nPROM: Cluster prominence\n\nMore information can be found in the two papers: Haralick et. al, 'Textural Features for Image Classification', https://doi.org/10.1109/TSMC.1973.4309314 and Conners, et al, Segmentation of a high-resolution urban scene using texture operators', https://sdoi.org/10.1016/0734-189X(84)90197-X.\n\n| Usage | Returns |\n|----------------------------------------------------------|---------|\n| Image.glcmTexture`(`*size* `, `*kernel* `, `*average*`)` | Image |\n\n| Argument | Type | Details |\n|---------------|------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| this: `image` | Image | The image for which to compute texture metrics. |\n| `size` | Integer, default: 1 | The size of the neighborhood to include in each GLCM. |\n| `kernel` | Kernel, default: null | A kernel specifying the x and y offsets over which to compute the GLCMs. A GLCM is computed for each pixel in the kernel that is non-zero, except the center pixel and as long as a GLCM hasn't already been computed for the same direction and distance. For example, if either or both of the east and west pixels are set, only 1 (horizontal) GLCM is computed. Kernels are scanned from left to right and top to bottom. The default is a 3x3 square, resulting in 4 GLCMs with the offsets (-1, -1), (0, -1), (1, -1) and (-1, 0). |\n| `average` | Boolean, default: true | If true, the directional bands for each metric are averaged. |"]]