This example illustrates texture classification using gray level
co-occurrence matrices (GLCMs) [1]. A GLCM is a histogram of co-occurring
grayscale values at a given offset over an image.
In this example, samples of two different textures are extracted from
an image: grassy areas and sky areas. For each patch, a GLCM with
a horizontal offset of 5 (distance=[5] and angles=[0]) is computed.
Next, two features of the GLCM matrices are computed: dissimilarity and
correlation. These are plotted to illustrate that the classes form
clusters in feature space.
In a typical classification problem, the final step (not included in
this example) would be to train a classifier, such as logistic
regression, to label image patches from new images.