Next: , Previous: , Up: Image Processing   [Contents][Index]


Texture

The Guile-CV procedures and methods related to image texture measures.

Procedures

im-texture
im-glcp
im-glcm

Description

Although introduced a long time ago12, image texture measures are still very actual, with new research and practicle applications in many areas, as described in this (highly recommended) document13.

Image texture measures are ‘descriptive statistics’, derived from the ‘Gray Level Co-occurrence Matrices (GLCM)’ and its associated set of ‘Gray Level Co-occurrence Probability (GLCP)’ matrices.

Guile-CV GLCM and GLCP data structures are identical to the one used for Guile-CV images (See Image Structure and Accessors). Although they are not images ‘per se’, they are composed of four square matrices (four channels), of size n-gl (the number of gray levels to consider), and upon which we (and users) need to run linear algebra procedures, already defined and available in Guile-CV.

Guile-CV offers the 11th first texture measures, out of the 14th originally proposed by Haralick et al., which are the most commonly used and adopted ones.

This reference manual assumes you are familiar with the concepts, terminology and mathematic formulas involved in the calculations of GLCMs, GLCPs and image texture measures. If that is not the case, consider carefully reading one or both of the documents cited above (or any other tutorial or reference material of your choice of course).

Procedures

Procedure: im-texture image n-gl [#:dist 1] [#:p-max 255] [#:use-log2 #f] [#:no-px-y0 #f]

Returns a list.

The procedure calls im-glcp, passing image, n-gl (the number of gray levels to consider), dist (the distance between the ‘reference’ and the ‘neighbour’ pixels) and p-max (the image (pixel) maximum value), then computes and returns a list of the 11th first texture measures proposed by Haralick et al., which are:

(h1) uniformity (angular second moment)
(h2) contrast
(h3) correlation
(h4) variance (sum of squares)
(h5) homogeneity (inverse difference moment)
(h6) sum average
(h7) sum variance
(h8) sum entropy
(h9) entropy
(h10) difference variance
(h11) difference entropy

The #:use-log2 optional keyword argument, which defaults to #f, is passed to the internal procedures that calculate the parameters h8, h9 and h11. The original formulas proposed by Haralck and al. use log, but I have seen a couple of implementations using log214.

The #:no-px-y0 optional keyword argument, which defaults to #f, is passed to the internal procedure that calculate the parameter h10. For some obscure reason, and only with respect to this parameter, I have seen some implementations eliminating the first element of the so-called Px-y, an internediate f32vector result, which holds, as its first element, the sum of the elements of the main diagnal of the GLCP15.

Procedure: im-glcp image n-gl [#:dist 1] [#:p-max 255]

Returns the GLCP for image.

The procedure calls im-glcm, passing image, n-gl (the number of gray levels to consider), dist (the distance between the ‘reference’ and the ‘neighbour’ pixels) and p-max (the image (pixel) maximum value), adds GLCM' (the transposed version of GLCM, so the result is symmetrical around the diagonal), then computes and returns the GLCP.

The returned GLCP is an ‘image’ composed four channels (four square matrices of size n-gl), corresponding to the (symmetrical) Gray Level Co-occurrences expressed as propabibilities, each calculated at a specific ‘angle’, respectively , 45º, 90º, and 135º.

Procedure: im-glcm image n-gl [#:dist 1] [#:p-max 255]

Returns the GLCM for image.

The procedure scales the original image (it brings its values in the range [0 (- n-gl 1)]), then computes and returns the GLCM.

The returned GLCM is an ‘image’ composed four channels (four square matrices of size n-gl), corresponding to the Gray Level Co-occurrences, each calculated at a specific ‘angle’, respectively , 45º, 90º, and 135º.


Footnotes

(12)

R. M. Haralick, K. Shanmugam, and I. Dinstein, Textural Features of Image Classification, IEEE Transactions on Systems, Man and Cybernetics, vol. SMC-3, no. 6, Nov. 1973.

(13)

M. Hall-Beyer, GLCM Texture: A Tutorial v. 3.0 March 2017

(14)

Since it is used as a factor in all three formulas, the final result obtained using log2 is equivalent to the result obtained using log multiplied by 1.4426950408889634

(15)

Guile-CV computes the difference average using all elements of the Px-y, by default, but offers this option as a courtesy, for users who would want to use Guile-CV as an immediate substitute to compute image texture measures for a (large) image set for which they would already have trained a classifier. It is not recommended to use it otherwise.


Next: Features, Previous: Histogram, Up: Image Processing   [Contents][Index]