GLCM_STATS Function
Calculates five statistics on the graylevel co-occurrence matrix (the result of a call to the GLCM function).
Usage
result = GLCM_STATS(glcm_matrix[, k])
Input Parameters
glcm_matrix—The graylevel co-occurrence matrix computed by GLCM.
k—(optional) A scalar float that is the order of the element difference moment and the inverse element difference moment statistics. (Default: 1.0)
Returned Value
result—A five-element double array containing the following statistics: the maximum, the element difference moment of order k, the inverse element difference moment of order k, the entropy, and the uniformity.
Keywords
None.
Discussion
The first statistic in the returned array is the maximum value of the graylevel co-occurrence matrix (GLCM). The maximum is the greatest response to the Xoffset and Yoffset used in the GLCM computation.
The second statistic returned is the element difference moment of order k. This statistic is lowest when large values of the GLCM are clustered near the matrix diagonal. The element difference moment of order k is given by:
where glcm_matrix is an N-by-M array.
The third statistic returned is the inverse element difference moment of order k. The inverse element difference moment of order k is lowest when large GLCM values are located away from the matrix diagonal. The inverse element difference moment of order k is given by:
and glcm_matrix is an N-by-M array.
The GLCM entropy, the fourth element of the returned array indicates the “randomness” of the GLCM. The entropy is inversely proportional to the randomness; that is, the entropy is smallest for the greatest amount of randomness in the matrix, and is at a maximum when the elements of the GLCM are equal. (See the ENTROPY function for the applicable equation.)
The fifth statistic returned is the GLCM uniformity. The uniformity is minimum when all values of the GLCM are equal. (See the UNIFORMITY function for the applicable equation.)
Example
image = IMAGE_READ(!IP_Data + 'texture.tif')
; Compute the graylevel co-occurrence matrix (GLCM).
glcm_array = GLCM(image('pixels'))
; Display the glcm_array.
TVSCL, glcm_array
; Compute the GLCM texture statistics for this image.
glcm_texture = GLCM_STATS(glcm_array)
PRINT, glcm_texture
See Also