A co-occurrence matrix or co-occurrence distribution 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.
For an image with different pixel values, the co-occurrence matrix C is defined over an image I, parameterized by an offset , as: