Given a grey-level image I, co-occurrence matrix computes how often pairs of pixels with a specific value and offset occur in the image. • The offset, (\Delta x, \Delta y), is a position operator that can be applied to any pixel in the image (ignoring edge effects): for instance, (1, 2) could indicate "one down, two right". • An image with p different pixel values will produce a p \times p co-occurrence matrix, for the given offset. • The (i, j)^\text{th} value of the co-occurrence matrix gives the number of times in the image that the i^\text{th} and j^\text{th} pixel values occur in the relation given by the offset. For an image with p different pixel values, the p \times p co-occurrence matrix
C is defined over an n \times m image
I, parameterized by an offset (\Delta x, \Delta y), as: :C_{\Delta x, \Delta y}(i,j)=\sum_{x=1}^n\sum_{y=1}^m\begin{cases} 1, & \text{if }I(x, y)=i\text{ and }I(x+\Delta x, y+\Delta y)=j \\ 0, & \text{otherwise}\end{cases} where: i and j are the pixel values; x and y are the spatial positions in the image
I; the offsets (\Delta x, \Delta y) define the spatial relation for which this matrix is calculated; and I(x, y) indicates the pixel value at pixel (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, and an angle, \theta, instead of an offset (\Delta x, \Delta y). 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. ==Aliases==