Haralick Textural Features: Difference between revisions

From David's Wiki
Line 53: Line 53:
==Resources==
==Resources==
* [https://ieeexplore.ieee.org/document/4309314 Textural Features for Image Classification (1973)]  
* [https://ieeexplore.ieee.org/document/4309314 Textural Features for Image Classification (1973)]  
** [https://www.researchgate.net/publication/302341151_Textural_Features_for_Image_Classification Researchgate Mirror][https://www.researchgate.net/profile/Robert-Haralick/publication/302341151_Textural_Features_for_Image_Classification/links/58e024be92851c369549051c/Textural-Features-for-Image-Classification.pdf PDF]
** [https://www.researchgate.net/publication/302341151_Textural_Features_for_Image_Classification Researchgate Mirror] [https://www.researchgate.net/profile/Robert-Haralick/publication/302341151_Textural_Features_for_Image_Classification/links/58e024be92851c369549051c/Textural-Features-for-Image-Classification.pdf PDF]
* [https://murphylab.web.cmu.edu/publications/boland/boland_node26.html Haralick texture features explanation]
* [https://murphylab.web.cmu.edu/publications/boland/boland_node26.html Haralick texture features explanation]



Revision as of 15:16, 2 May 2022

These are a set of image features discovered by Wikipedia: Robert Haralick.

Algorithm

Texture vs Tone

Each image will have a tone and a texture:

  • Tone - average color in a patch
  • Texture - "variation of features of discrete gray tone"

Gray-Tone Spatial-Dependence matrices

Today, these are known as Gray Level Co-occurrence Matrix (GLCM).

For a matrix with \(\displaystyle N_g\), a Gray-Tone Spatial-Dependence matrix will be a \(\displaystyle N_g \times N_g\) symmetric matrix where entry \(\displaystyle i,j\) will contain the number of occurrences where a pixel with value \(\displaystyle i\) neighbors a pixel with value \(\displaystyle j\).

In an image each pixel will have eight neighboring pixels, except at the edges:

Nearest Neighbors to *
135° 90° 45°
*
45° 90° 135°

Then \(\displaystyle P(i,j,d,\alpha)\) is the number of occurrences where a pixel with value \(\displaystyle i\) and a pixel with value \(\displaystyle j\) are distance \(\displaystyle d\) apart along angle \(\displaystyle \alpha \in \{0^\circ, 45^\circ, 90^\circ, 135^\circ\}\).

If we fix d=1, then we get four matrices of co-occurances along each direction:

  • \(\displaystyle P_{H} = \{P(i,j,1, 0^\circ)\}\)
  • \(\displaystyle P_{V} = \{P(i,j,1, 90^\circ)\}\)
  • \(\displaystyle P_{LD} = \{P(i,j,1, 135^\circ)\}\)
  • \(\displaystyle P_{RD} = \{P(i,j,1, 45^\circ)\}\)

For horizontal and vertical directions with resolution N, each row or column will have 2(N-1) neighbors. Thus in total, there will be \(\displaystyle R=2 N_x(N_y-1)\) or \(\displaystyle R=2 N_y(N_x-1)\) neighbors.
For diagonal directions, there will be \(\displaystyle R=2 (N_x - 1)(N_y-1)\) neighbors.
Each co-occurance matrix \(\displaystyle P\) can be normalized by dividing each entry by R: \(\displaystyle p= P/R\).

Features

There are 14 values Haralick et al. compute per co-occurance matrix. The mean and range among the matrices are used to get 28 features.

  1. Angular second moment: \(\displaystyle f_1 = \sum_i \sum_j p(i,j)^2\)
  2. Contrast:
  3. Correlation:
  4. Sum of squares variance:
  5. Inverse difference moment:
  6. Sum Average:
  7. Sum Entropy:
  8. Entropy:
  9. Difference Variance:
  10. Difference Entropy:
  11. Information Measures of Correlation 1:
  12. Information Measures of Correlation 2:
  13. Maximal Correlation Coefficient:

Resources

Implementations