Texture can be described not only by frequency and orientation, but also by the statistical relationships among nearby gray levels. Statistical texture analysis asks which gray values tend to occur together, how different neighboring values are, and how local patterns repeat across an image.
1. Why a Gray-Level Histogram Is Not Enough
A histogram records how often each gray level occurs, but it does not record where those gray levels occur. Therefore, two image regions can have the same histogram while having very different textures.
Block Pattern
Large regions contain similar neighboring values.
Checkerboard Pattern
Neighboring values alternate rapidly even though the gray-level counts are unchanged.
2. Pixel Pairs, Distance, and Direction
One of the simplest ways to describe spatial texture is to examine pairs of pixels separated by a chosen displacement.
The displacement determines both the distance and direction of the relationship being measured.
\((d,0)\)
one diagonal direction
\((0,d)\)
the opposite diagonal
3. Spatial Gray-Level Dependence Matrix (SGLDM)
The spatial gray-level dependence matrix records how often one gray level occurs at the selected displacement from another gray level. It is closely related to what is commonly called a gray-level co-occurrence matrix.
Let the possible gray levels be \(Q=\{0,1,\ldots,L-1\}\). For a selected distance \(d\) and direction \(\theta\), define the count matrix
Row \(i\) represents the gray level of the reference pixel, and column \(j\) represents the gray level of its displaced neighbor.
| \(i\backslash j\) | 0 | 1 | 2 | 3 |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 |
| 1 | 0 | 5 | 0 | 0 |
| 2 | 0 | 0 | 4 | 0 |
| 3 | 0 | 0 | 0 | 0 |
Here all nine observed pairs contain equal gray levels, so the nonzero counts lie on the main diagonal.
4. Building an SGLDM Step by Step
The matrix is easiest to understand as a counting procedure. Choose one valid pair, read its two gray levels, and increment the corresponding matrix entry.
5. From Counts to a Normalized SGLDM
Raw counts depend on how many valid pairs are available. To compare matrices or compute probability-based features, divide each entry by the total number of counted pairs.
The normalized entries satisfy
Count Matrix
Normalized Matrix
6. Energy from the SGLDM
One texture feature built from the normalized SGLDM is energy:
Higher Energy
If probability is concentrated in relatively few SGLDM cells, squaring the entries produces a larger total.
Lower Energy
If probability is spread over many matrix cells, the squared entries are generally smaller and the total energy decreases.
7. SGLDM Entropy — Same Entropy Idea, Different Distribution
Entropy can also summarize how spread out the normalized SGLDM is. Using base-2 logarithms for consistency with the morphological entropy page,
Terms with \(P(i,j;d,\theta)=0\) contribute zero.
Lower SGLDM Entropy
If most probability is concentrated in a small number of gray-level pair combinations, the pair distribution is more predictable and its entropy tends to be lower.
Higher SGLDM Entropy
If probability is distributed across many different gray-level pair combinations, the pair distribution is more varied and its entropy tends to be higher.
Is This the Same as Morphological Entropy?
Morphological Entropy
The distribution is the pattern spectrum across morphological scales. It describes how an object’s area is distributed across scales of opening.
SGLDM Entropy
The distribution is the gray-level pair probability for a chosen displacement. It describes how varied the pair relationships are in a texture.
8. Gray-Level Difference Method (GLDM)
The SGLDM keeps the ordered pair \((i,j)\). The gray-level difference method compresses each pair to the magnitude of its gray-level difference:
For four gray levels \(Q=\{0,1,2,3\}\), the possible differences are
The GLDM groups pixel pairs by the absolute difference \(k=|i-j|\), rather than keeping the full ordered pair \((i,j)\).
If \(N_k\) is the number of valid pairs whose absolute difference equals \(k\), then the normalized GLDM probability is
9. Contrast from the GLDM
The GLDM can be summarized by a contrast feature that weights large gray-level differences more heavily:
Weight \(0^2=0\)
Equal neighboring values contribute nothing to contrast.
Weight \(1^2=1\)
Small gray-level changes contribute modestly.
Weight \(3^2=9\)
Large gray-level changes receive much greater weight.
10. Why Direction and Distance Matter
Texture can be directional. A pattern that looks highly regular along one direction may look very different along another. SGLDM and GLDM therefore depend on the displacement used to select pixel pairs.
Here \(\Delta r\) is the change in image row and \(\Delta c\) is the change in image column. The same idea is often described by a distance \(d\) and a direction \(\theta\). Using a discrete offset makes it especially clear which pixels are actually paired.
\(\Delta=(0,1)\)
\(\Delta=(1,0)\)
\(\Delta=(1,1)\)
\(\Delta=(-1,1)\)
immediate-neighbor relationship
wider spatial relationship
still larger-scale relationship
11. Comparing Statistical Texture Methods
| Method | What It Records | What It Describes |
|---|---|---|
| SGLDM | Gray-level pair counts or probabilities \((i,j)\) | Which gray levels tend to occur together? |
| GLDM | Distribution of \(|i-j|\) | How strongly do paired gray levels differ? |
| NGLDM | Local dependence on similar neighboring gray levels | How many neighbors behave similarly to a center pixel? |
| GLRLM | Runs of equal gray level and their lengths | How long do repeated same-level sequences persist? |
12. Neighboring Gray-Level Dependence Statistics (NGLDM)
NGLDM shifts attention from a single pixel pair to a center pixel and its surrounding neighborhood. A neighboring pixel is considered dependent on the center when it is sufficiently similar according to the selected dependence rule.
Dependence Count
The center value is compared with nearby values. Green cells satisfy the chosen similarity rule; the others do not.
NGLDM-based descriptors summarize how these local dependence counts are distributed throughout a texture.
13. Gray-Level Run-Length Matrix (GLRLM)
A run is a consecutive sequence of pixels with the same gray level along a selected direction. GLRLM records both the gray level of each run and how long that run continues.
length \(3\)
length \(2\)
length \(1\)
length \(4\)
One way to express a GLRLM entry is
14. Texture Feature Vectors and Discrimination
A texture classifier usually does not need the entire matrix as its final input. Instead, several numerical descriptors can be combined into a feature vector.
15. Interactive Statistical Texture Visualizer
The visualizer below lets you edit a four-level image, \(Q=\{0,1,2,3\}\), choose a displacement, and build the statistical texture descriptors directly from the selected pixel relationships.
SGLDM Builder
Step through valid pixel pairs and watch the corresponding \(C(i,j)\) entry increase. The normalized matrix \(P(i,j)\), energy, and SGLDM entropy update from the pairs that have been processed.
GLDM and Contrast
The same processed pairs are converted to \(k=|i-j|\). The GLDM difference distribution and contrast therefore remain aligned with the SGLDM calculation.
16. Summary
| Concept | Main Idea |
|---|---|
| Histogram | Counts gray levels but ignores spatial arrangement |
| Displacement | Defines the distance and direction between compared pixels |
| SGLDM | Counts gray-level pairs \((i,j)\) at a selected displacement |
| Normalization | Converts counts to \(P(i,j)\), a pair-probability distribution whose total is 1 |
| Energy | Measures concentration of normalized SGLDM probability |
| SGLDM Entropy | Measures spread of the gray-level pair probability distribution |
| Morphological vs. SGLDM Entropy | Same Shannon formula, but scale distribution versus gray-level pair distribution |
| GLDM | Describes the distribution of absolute gray-level differences |
| Contrast | Weights large gray-level differences more strongly |
| NGLDM | Describes local dependence on similar neighbors |
| GLRLM | Counts equal-gray-level runs by gray level and run length |
| Feature Vector | Combines numerical descriptors for comparison or classification |
Be First to Comment