The Gray-Level Co-occurrence Matrix (GLCM), also known as the gray-tone spatial-dependence matrix, characterizes image texture by tabulating how often pairs of pixels with specific values and in a specified spatial relationship occur in an image. Unlike first-order statistics that ignore spatial context, GLCM captures the second-order joint conditional probability density function of pixel intensities. The matrix is constructed by defining a displacement vector d (distance) and an angle θ (typically 0°, 45°, 90°, or 135°), then counting co-occurrences of gray levels i and j at that offset.
Glossary
Gray-Level Co-occurrence Matrix (GLCM)

What is Gray-Level Co-occurrence Matrix (GLCM)?
A Gray-Level Co-occurrence Matrix (GLCM) is a second-order statistical method for texture analysis that quantifies the spatial relationship between pixel pairs by calculating the frequency of specific intensity combinations occurring at a defined distance and angular offset.
From the constructed matrix, Haralick et al. defined 14 statistical features that quantify textural properties such as homogeneity, contrast, and entropy. Key derived metrics include contrast (measuring local intensity variation), energy (also called Angular Second Moment, quantifying textural uniformity), correlation (linear dependency of gray levels), and homogeneity (closeness of element distribution to the diagonal). In radiomics, GLCM features are computed after intensity discretization to reduce the number of gray levels, and are often averaged across multiple angular directions to achieve rotational invariance, providing robust quantitative descriptors of tissue heterogeneity in medical images.
Core GLCM-Derived Haralick Features
The Gray-Level Co-occurrence Matrix (GLCM) quantifies texture by tabulating how often pairs of pixel intensities occur at a defined spatial offset. From this matrix, Robert Haralick proposed 14 statistical measures that describe image texture characteristics such as homogeneity, contrast, and complexity.
Angular Second Moment (ASM) & Energy
Measures textural uniformity—the sum of squared GLCM entries.
- High ASM: Image has constant or periodic pixel patterns (few dominant gray-tone transitions)
- Low ASM: Pixel intensities are randomly distributed across the matrix
- Energy is the square root of ASM, providing a more linear scaling
- Clinical relevance: Homogeneous tumors often exhibit higher ASM values, correlating with less aggressive phenotypes in certain cancers
- Formula: ASM = Σᵢⱼ p(i,j)² where p(i,j) is the normalized co-occurrence probability
Contrast
Quantifies the local intensity variation and the depth of texture grooves.
- High contrast: Large differences between neighboring pixel intensities (sharp edges, noise)
- Low contrast: Smooth, visually flat regions with minimal intensity variation
- Weighted by distance: Squared difference (i-j)² amplifies contributions from far-apart gray levels
- Clinical relevance: Malignant lesions often show higher contrast due to heterogeneous internal architecture
- Related term: Inertia—identical mathematical formulation, emphasizing resistance to intensity change
Correlation
Measures the linear dependency of gray levels on those of neighboring pixels.
- Range: -1 to +1, where +1 indicates perfect positive linear relationship
- High correlation: Predictable, structured texture with directional patterns
- Low correlation: Uncorrelated, chaotic pixel arrangements
- Directionally sensitive: Values change based on the spatial offset angle (0°, 45°, 90°, 135°)
- Clinical relevance: Quantifies tissue anisotropy—fibrotic tissue shows directional correlation patterns distinct from normal parenchyma
Homogeneity (Inverse Difference Moment)
Weighs the closeness of GLCM elements to the diagonal, indicating local similarity.
- High homogeneity: Matrix elements cluster near the diagonal—adjacent pixels have similar intensities
- Low homogeneity: Wide distribution of intensity pairs, indicating rough texture
- Inverse weighting: 1/(1+(i-j)²) gives higher weight to small intensity differences
- Clinical relevance: Benign masses often demonstrate greater internal homogeneity than malignant counterparts
- Related metric: Inverse Difference Normalized (IDN) removes dependence on total number of gray levels
Entropy
Measures the randomness and information content of the texture pattern.
- High entropy: Broad distribution of co-occurrence probabilities—complex, unstructured texture
- Low entropy: Concentrated probabilities—simple, repetitive patterns
- Theoretical basis: Derived from information theory; -Σ p(i,j) × log(p(i,j))
- Clinical relevance: High entropy in tumor ROIs often indicates necrosis, hemorrhage, or aggressive growth patterns
- Distinction: GLCM entropy captures spatial disorder, unlike first-order entropy which ignores pixel relationships
Cluster Shade & Cluster Prominence
Higher-order measures of matrix asymmetry and tailedness.
- Cluster Shade: Measures skewness of the GLCM—positive values indicate dominance of low-intensity pairs, negative values indicate high-intensity dominance
- Cluster Prominence: Measures kurtosis—high values indicate a peaked distribution with heavy tails (dominant clusters)
- Clinical relevance: Cluster prominence is a key discriminator in tumor grading, with aggressive lesions showing prominent high-intensity clusters
- Calculation: Both use cubed and fourth-power deviations from the mean, making them sensitive to outliers in the co-occurrence distribution
GLCM vs. Other Texture Matrices in Radiomics
A comparative analysis of the Gray-Level Co-occurrence Matrix against other standardized texture matrices defined by the Image Biomarker Standardisation Initiative (IBSI), highlighting spatial relationship modeling, computational complexity, and clinical utility.
| Feature | GLCM | GLRLM | GLSZM | GLDM |
|---|---|---|---|---|
Statistical Order | Second-order | Higher-order | Higher-order | Higher-order |
Spatial Relationship Modeled | Pairwise pixel co-occurrence at defined offset | Consecutive collinear runs of identical intensity | Connected homogeneous regions of identical intensity | Dependence of center voxel on neighborhood |
Rotationally Invariant | ||||
Primary Texture Captured | Contrast, correlation, homogeneity | Roughness, linear structure | Granularity, non-linear homogeneity | Local intensity dependence |
Number of IBSI Features | 24 | 16 | 16 | 14 |
Computational Complexity | High | Medium | Medium | Low |
Sensitivity to Discretization | High | Medium | Medium | Low |
Typical Clinical Application | Lesion heterogeneity quantification | Tissue anisotropy assessment | Tumor sub-region texture | Noise-robust texture analysis |
Frequently Asked Questions
Clear, technical answers to the most common questions about the Gray-Level Co-occurrence Matrix and its role in radiomic texture quantification.
A Gray-Level Co-occurrence Matrix (GLCM) is a second-order statistical method that quantifies image texture by tabulating how frequently specific pairs of pixel intensity values occur at a defined spatial offset. The algorithm constructs an N×N matrix—where N equals the number of discretized gray levels—by scanning the region of interest and counting every instance where a pixel of intensity i neighbors a pixel of intensity j at a specified distance d and angle θ. This matrix captures the spatial dependency of intensities, distinguishing homogeneous textures (where similar values cluster) from heterogeneous ones (where values vary wildly). The raw co-occurrence counts are then normalized to probabilities, and Haralick texture features—such as contrast, correlation, energy, and homogeneity—are derived from these probability distributions to provide quantitative descriptors of the tissue architecture.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
Understanding GLCM requires familiarity with the broader radiomics pipeline and related texture matrices. These concepts form the foundation for quantitative tissue characterization.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us