Quiz: texture and co-occurrence matrices

Short questions to test your understanding. Try each on paper first, then open the answer. GLCMs are symmetric and normalised unless said otherwise.


Q1. Why can no feature computed from the histogram of an object tell a fine texture from a coarse one?

Shuffle the pixels of an object. What happens to its histogram?

The histogram ignores where the values are: shuffling the pixels changes the texture completely but leaves the histogram, and every statistic computed from it (mean, standard deviation, quartiles), unchanged. Texture is about pairs of pixels at some distance, which is what the co-occurrence matrix counts.


Q2. A GLCM has all its mass on the diagonal. What does that say about the image, and what are its contrast and homogeneity?

The diagonal means i = j.

Every pixel has the same (quantised) level as its partner at that offset: the image is constant along that direction, or periodic with the offset as a period. Contrast is 0 and homogeneity is 1.


Q3. White noise and a smooth texture with the same histogram are measured at d = 1 and d = 10. Which one’s contrast changes between the two distances?

At what distance are the pixels of each texture unrelated?

The smooth texture: at d = 1 neighbours are similar (low contrast); at d = 10, beyond the grain size, they are unrelated, and the contrast approaches that of white noise. White noise has the same high contrast at every distance, because its pixels are unrelated at any distance.


Q4. A collaborator quantises each cell to 8 levels between its own minimum and maximum before computing texture. A drug makes the cells dimmer and lowers their contrast. Will the texture features show it?

What does stretching each cell to its own range do to a dim cell?

Probably not: per-cell min–max quantisation stretches every cell to the full range of 8 levels, which undoes a change in brightness and contrast. Use one fixed range for all cells (and the same L), so that a lower contrast shows up as a lower GLCM contrast.


Q5. Why does L = 256 give unreliable texture features on a nucleus of 300 pixels?

How many cells does the matrix have, and how many pairs are counted?

The matrix has 65 536 cells but only a few hundred pairs are counted: almost every cell is 0 or 1. Features such as entropy and ASM then mostly reflect the number of pairs, and two nuclei with the same texture give quite different values. Use 8–16 levels for small objects.


Q6. Two programs report “energy” 0.25 and 0.5 for the same matrix. Can both be right?

Naming traps.

Yes: some programs call ASM = \sum p^2 “energy”, others use \sqrt{\text{ASM}}. Here ASM = 0.25 and \sqrt{\text{ASM}} = 0.5. Always check the formula, not only the name.


Q7. Why is the LBP histogram of an object unchanged when the illumination doubles?

What does an LBP code compare?

Each bit only records whether a neighbour is at least as bright as the centre. Doubling every value (or adding a constant, or any increasing map) keeps those comparisons, so every code and therefore the histogram stays the same. (Noise in dark, flat regions can still flip bits.)


Q8. (math) Show that for a symmetric GLCM, contrast = 2\sigma^2(1 - \text{correlation}). What is the contrast of a texture with correlation 1? With correlation −1 and \sigma^2 = 0.25?

Expand E[(I - J)^2] when I and J have the same mean and variance.

E[(I - J)^2] = \operatorname{var}(I) + \operatorname{var}(J) - 2\operatorname{cov}(I, J) = 2\sigma^2 - 2\rho\sigma^2 (the means cancel because they are equal). Correlation 1: contrast 0. Correlation −1, \sigma^2 = 0.25: contrast 1: the 0/1 checkerboard.