A co-occurrence matrix or co-occurrence distribution (also referred to as : gray-level co-occurrence matrices GLCMs) is a matrix that is defined over an image to be the distribution of co-occurring pixel values (grayscale values, or colors) at a given offset. It is used as an approach to texture analysis with various applications especially in medical image analysis.[1] [2]
Given a grey-level image
I
(\Deltax,\Deltay)
(1,2)
p
p x p
(i,j)th
ith
jth
For an image with
p
p x p
n x m
I
(\Deltax,\Deltay)
C\Delta
m\begin{cases} | |
(i,j)=\sum | |
y=1 |
1,&ifI(x,y)=iandI(x+\Deltax,y+\Deltay)=j\ 0,&otherwise\end{cases}
where:
i
j
x
y
(\Deltax,\Deltay)
I(x,y)
(x,y)
The 'value' of the image originally referred to the grayscale value of the specified pixel, but could be anything, from a binary on/off value to 32-bit color and beyond. (Note that 32-bit color will yield a 232 × 232 co-occurrence matrix!)
Co-occurrence matrices can also be parameterized in terms of a distance,
d
\theta
(\Deltax,\Deltay)
Any matrix or pair of matrices can be used to generate a co-occurrence matrix, though their most common application has been in measuring texture in images, so the typical definition, as above, assumes that the matrix is an image.
It is also possible to define the matrix across two different images. Such a matrix can then be used for color mapping.
Co-occurrence matrices are also referred to as:
Whether considering the intensity or grayscale values of the image or various dimensions of color, the co-occurrence matrix can measure the texture of the image. Because co-occurrence matrices are typically large and sparse, various metrics of the matrix are often taken to get a more useful set of features. Features generated using this technique are usually called Haralick features, after Robert Haralick.[3]
Texture analysis is often concerned with detecting aspects of an image that are rotationally invariant. To approximate this, the co-occurrence matrices corresponding to the same relation, but rotated at various regular angles (e.g. 0, 45, 90, and 135 degrees), are often calculated and summed.
Texture measures like the co-occurrence matrix, wavelet transforms, and model fitting have found application in medical image analysis in particular.
Co-occurrence matrices are also used for words processing in natural language processing (NLP).[4] [5]