Reprint Address: http://www.cnblogs.com/skyseraph/archive/2011/08/27/2155776.html
A principle
1 Concept: GLCM, that is, gray-scale symbiosis matrix, GLCM is a l*l square, L is the gray level of the source image
2 Meaning: describes the joint distribution of two pixels with a certain spatial position relation, which can be regarded as a combined histogram of two pixel gray pairs, is a second-order statistic
3 Common spatial position relationships: Four kinds, vertical, horizontal, plus or minus 45°
4 Common characteristics of GLCM features :
(1) Energy : is the square sum of the values of gray-scale co-occurrence matrix elements, so also called energy, reflecting the image gray distribution uniformity and texture thickness degree.
If all the values of the Symbiosis matrix are equal, the ASM value is small; Conversely, if some of the values are large and the other values are small, the ASM value is large.
When the elements in the Symbiosis matrix are centrally distributed, the ASM values are large at this time. The ASM value indicates a more homogeneous and regular variation of the texture pattern.
(2) contrast : reflects the sharpness of the image and the degree of texture groove depth. The deeper the texture groove, the greater the contrast, the clearer the visual effect.
Conversely, the contrast is small, the groove is shallow, the effect is blurred. The higher the gray-scale difference, the greater the contrast, the greater the number of pixels.
The larger the value of the elements away from the diagonal in the gray-scale Commons matrix, the greater the con.
(3) related : It measures the similarity of the elements in the line or column direction of the spatial gray-scale symbiotic matrix element, therefore, the correlation value size reflects the local gray-level correlation in the image.
When the values of the matrix elements are equal, the correlation values are large; Conversely, if the matrix cell values differ greatly, the correlation values are small. If there is a horizontal orientation texture in the image,
The cor of the horizontal direction matrix is larger than the Cor value of the remaining matrices.
(4) entropy : is a measure of the amount of information that the image has, and the information of the texture belongs to the image, it is a measure of randomness, when all the elements in the Symbiosis matrix have the greatest randomness,
When all the values in the space Symbiosis matrix are almost equal, the entropy is larger when the elements in the Symbiosis matrix are distributed. It represents the degree of heterogeneity or complexity of textures in an image.
(5) inverse gap : reflects the homogeneity of the image texture, the measurement of the image texture local changes in how much. The large value indicates that there is a lack of change between the different regions of the image texture, and the local is very homogeneous.
5 Principle Understanding :
Suppose the texture matrix p for the clothing image is as follows:
P = [0 1 2 0 1 2
1 2 0 1 2 0
2 0 1 2 0 1
0 1 2 0 1 2
1 2 0 1 2 0
2 0 1 2 0 1
]
① is 1 (the first parameter) and the position direction is 0° the second parameter) The GLCM matrix is as follows:
[0 10 10
10 0 10
10 10 0
]
resolution : Because the gray level in P is 3, so GLCM is the 3*3 phalanx
② 1 (first parameter), position direction is positive or negative 45° second parameter) The GLCM matrix is as follows:
[16 0 0
0 16 0
0 0 18
]
--------------------------------------------------------------------------------------------------------------- ----------------
Two results
Image (Lenna):
Also attached: about Lenna, swept the image of the image, the source of the original anecdote: http://www.cs.cmu.edu/~chuck/lennapg/^_^
The mean, variance GLCM characteristics of a single GLCM and 4 directions:
--------------------------------------------------------------------------------------------------------------- ----------------
Three source
Class header file :
View Code
Class source file-1: Initialization and resource release
View Code
Class source file-2: Calculate texture characteristics
View Code
Class source file-3: Compute symbiosis Matrix
View Code
class source file-4: Calculate GLCM features
View Code
class source file-5: Calculate GLCM feature mean and variance
View Code
Description
Reference to "visualc++ Digital Image Pattern Recognition technology detailed", "Digital image processing and machine vision-visualc++ and MATLAB implementation" and other books, such as the author of the original, can be directly invoked, reproduced/quoted please indicate the source.
--------------------------------------------------------------------------------------------------------------- ----------------
Four references
-
GLCM Texture Tutorial
-
Gray-level co-occurrence Matrix (gray-scale symbiosis matrix) _ Pi Zi
Gray-scale Symbiosis Matrix-tyut-Blog Park
Using OpenCV's CVGLCM error
Topic of gray-scale co-hair matrix _ Baidu Library
Gray-scale Symbiosis Matrix VC + + Implementation _ Baidu Library
Image Gray-scale symbiosis matrix _ Baidu Library
Gray-Scale Symbiosis matrix _ Baidu Library
Extracting symbiosis Matrix Features-WQVBJHC's column-CSDN blog
Texture feature extraction based on gray-scale symbiosis matrix-docin.com Bean Mesh
Research on image segmentation method based on gray-scale symbiotic matrix _ Baidu Library
An example of using GLCM. (Bug with Cvtexture modified)
"Visualc++ Digital Image Pattern recognition technology detailed"
"Digital image processing and machine vision-visualc++ and MATLAB implementation"
--------------------------------------------------------------------------------------------------------------- ---------------
Author:skyseraph
Email/gtalk: [email protected] qq:452728574
from:http://www.cnblogs.com/skyseraph/
Paper 131: "Image Algorithm" image features: GLCM "Reprint"