Function Reference
— Function File: P = graycomatrix(im, levels, distances, angles)

Calculates the gray-level co-occurrence matrix P of a gray-level image im.

P is a 4-dimensional matrix (histogram). The value P(i,j,d,theta) is the number of times that gray-level j occurs at a distance d and at an angle theta from gray-level i.

im is the input image which should contain integers in [0, levels-1], where levels indicate the number of gray-levels counted (typically 256 for an 8-bit image). distances and angles are vectors of the different distances and angles to use.