Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Computed from
Gray Level Run Length Matrices
Fritz Albregtsen
Image Processing Laboratory
Department of Informatics
University of Oslo
November 14, 1995
Abstract
The purpose of the present text is to present the theory and techniques
behind the Gray Level Run Length (GLRL) method, and the state-of-the-art
of the eld, as applied to two dimensional images. It does not present a survey
of practical results.
1
Albregtsen : Texture Measures Computed from GLRL-Matrices 2
A small (4 4) sub-image with 4 gray levels and its corresponding Gray Level
Run Length Matrices ( j = 0o) is illustrated below.
P i j
IMAGE
1 2 3 4
1 3 4 4
3 2 2 2
4 1 4 1
Figure 1: A small image and its Gray Level Run Length Matrix ( P i j j = 0o).
The number of gray levels in the image is often reduced by re-quantization prior
to the accumulation of the Gray Level Run Length Matrix. Even visually, quan-
tization into 16 gray levels is often sucient for discrimination or degmentation
of textures. Using few levels is equivalent to viewing the image on a coarse scale,
whereas more levels give an image with more detail. However, the performance of
a given GLRL-based feature, as well as the ranking of the features, may depend on
the number of gray levels used.
Figure 2 below illustrates the geometrical relationships of GLRL measurements
made for angles of = 0 4 2 and 3 4 radians.
= = =
A number of scalar texture features may be computed from the Gray Level Run
Length Matrices. Let
- (
p i j j ) is the ( )th element of the run length matrix for a direction
i j
Galloway 1975
2] introduced ve statistical texture features to be extracted from
the Gray Level Run Length matrices:
Albregtsen : Texture Measures Computed from GLRL-Matrices 3
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
0o
.
.
.
.
.
.
.
.
.
..
.
. .....
.............................................................................................................................................................................................................................................................................................................
. ........
....
....................
x
. .........
.
.
. ......
.
.
.
.
.
.
.
Figure 2: Geometry for measurement of Gray Level Run Length Matrix for 4 angles.
Short Runs Emphasis :
X
G X
R ( j ) X
G X
R
= ( j ) (1)
p i j
S RE
2 = p i j
i=1 j =1 j
i=1 j =1
By dividing each run length value by the square of its length, short run lengths
are emphasised. The denominator is the total number of runs in the image.
Long Runs Emphasis :
X
G X R
2 ( j ) XX ( j )
G R
= LRE (2) j p i j = p i j
i=1 j =1 i=1 j =1
Here we multiply each run length value by the square of its length, in order to
give higher weight to the long runs.
Gray Level Non-uniformity :
0R 12 G R
X
G X XX
= @ ( j )A
GLN ( j ) (3) p i j = p i j
i=1 j =1 i=1 j =1
High run length values will contribute most to this feature. The GLN feature
will have its lowest value if the runs are evenly distributed over all gray levels.
Run Length Non-uniformity :
XR X G !2 X G XR
= RLN( j ) ( j ) (4) p i j = p i j
j =1 i=1 i=1 j =1
The RLN feature will have its lowest value if the runs are evenly distributed
over all run lengths.
Albregtsen : Texture Measures Computed from GLRL-Matrices 4
Run Percentage :
X
G X
R
RP =1 (
p i j j )
(5)
n
i=1 j =1
This feature is the ratio between the total number of observed runs in the
image and the total number of possible runs if all runs had a length of one.
Chu et al. (1990)
1] introduced two additional features, namely Low Gray Level
Emphasis (LGRE) and High Gray Level Emphasis (HGRE). These features make
use of the gray levels of the runs, and are introduced in order to distinguish textures
that are similar according to their SRE and LRE features, but dier in gray level
distribution of the runs.
Low Gray level Runs Emphasis :
XG XR ( j ) X G XR
LGRE = 2
p i j
( j )
= (6) p i j
i=1 j =1 i
i=1 j =1
Now we may simplify the above equations by letting the variables ( j ) and r j
( j )
g i
XG
( j )= ( j )
r j p i j (8)
i=1
XR
( j )=
g i (
p i j j ) (9)
j =1
represent the number of runs of length and the number of runs of gray scale ,
j i
XG X R X
G XR
S = ( j )= ( j )= ( j )
p i j g i (10) r j
i=1 j =1 i=1 j =1
The equations may then be written as follows:
1 XG XR ( j ) 1X R ( j )
S RE= = p i j
2
r j
2
(11)
S
i=1 j =1 j S
j =1 j
Albregtsen : Texture Measures Computed from GLRL-Matrices 5
1 4 0 0 0 4
2 1 0 1 0 2
3 3 0 0 0 3
4 3 1 0 0 4
( j )
r j 11 1 1 0 S=13
Figure 3: Gray Level Run Length Matrix ( j = 0o) for the image above,P i j
together with ( j ) and ( j ), i.e. the number of runs of length and the
r j g i j
X
G X
R X
R
LRE =1 2 (
j p i j j )= 1
r j ( j ) j
2 (12)
S
i=1 j =1 S
j =1
0R
12
XG X 1X G
GLN =1 @ ( j )A = ( j )2
p i j g i (13)
i=1 j =1
S
i=1 S
X
R X G ! 2 XR
RLN = 1 ( j ) =1 ( j )2
p i j r j (14)
S
j =1 i=1 S
j =1
1X G XR 1X
R
RP = (
p i j j )=
( j )
r j (15)
n
i=1 j =1 j =1 n
LGRE =
1XG X
j j )
R p(i
= 1X G g (i j )
(16)
2 2
S
i=1 j =1 i S
i=1 i
H GRE =
1X G X R
2
i p (i j j ) =
1X G
2
i g (i j ) (17)
S
i=1 j =1 S
i=1
We note that all features may be calculated without actually accumulating a
two-dimensional GLRL matrix. Only the two arrays ( j ) and ( j ), i.e. the r j g i
number of runs of length and the number of runs of gray level value , have to be
j i
accumulated.
We also note that
Before the run length matrices are accumulated, the gray levels may be quan-
tized into levels (e.g. = 8 16 32 ).
M M :::
The run lengths may also be grouped into ranges, e.g. 1, 2-3, 4-7, 8-15, 16-31,
etc.
Albregtsen : Texture Measures Computed from GLRL-Matrices 6
References
2] RM.M. Galloway,
"Texture Analysis Using Gray Level Run Lengths",
Computer Graphics and Image Processing, Vol. 4, pp. 172-179, 1975.