The Grey Level Co-occurrence Matrix,
GLCM (also called the Grey Tone Spatial Dependency Matrix)
GLCM is a tabulation of how often different combinations of pixel brightness
values (grey levels) occur in an image.
The test image:
Here is a simple "test image" for working out examples. The values are image grey levels (GLs). It will be used throughout this tutorial.
The GLCM described here is used for a series of "second order" texture calculations.
Framework for the GLCM:
Spatial relationship between two pixels:
GLCM texture considers the relation between two pixels at a time, called the reference and the neighbour pixel. In the illustration below, the neighbour pixel is chosen to be the one to the east (right) of each reference pixel. This can also be expressed as a (1,0) relation: 1 pixel in the x direction, 0 pixels in the y direction.
Each pixel within the window becomes the reference pixel in turn, starting in the upper left corner and proceeding to the lower right. Pixels along the right edge have no right hand neighbour, so they are not used for this count.
To see images of the effect of different spatial relationships, click here.
Separation between two pixels:
All the examples in this
tutorial use 1 pixel offset (a reference pixel and its immediate
neighbour). If the window is large enough, using a larger offset is perfectly
possible. There is no difference in calculation method. The sum of all the
entries in the GLCM (i.e. the number of pixel combinations) will just be smaller
for a given window size.
Combinations of the grey levels that are possible for the test image, and their position in the matrix.
A different co-occurrence matrix exists for each spatial relationship (above, next to, diagonal). More information: click here.