Mryka Hall-Beyer

Home
Contacts
Biography
Tutorial: GLCM Texture
Publications
Research
Courses
Students
Committees

 

 

Contrast (CON) (this is also called "sum of squares variance"):

Contrast equation

Explanation:

When i and j are equal, the cell is on the diagonal and (i-j)=0. These values represent pixels entirely similar to their neighbour, so they are given a weight of 0.
If i and j differ by 1, there is a small contrast, and the weight is 1.
If i and j differ by 2, contrast is increasing and the weight is 4.
The weights continue to increase exponentially as (i-j) increases.
 

Calculation example: for the horizontal GLCM, Contrast equals

Contrast weights:             X                 horizontal GLCM                     =           multiplication result

0 9
 
0.166 0.083 0.042 0
 
0 0.083 .168 0
1 4
 
0.083 0.166 0 0
 
0.083 0 0 0
4 1
 
0.042 0 .249 0.042
 
.168 0 0 .042
9 0
 
0 0 0.042 0.083
 
0 0 .042 0

 

Sum of all elements in the multiplication result table = 0.586

In detail:

.166*(0-0)2 + .083*(0-1)2 + .042*(0-2)2 + 0*(0-3)2 +

.083*(1-0)2 + .166*(1-1)2 + 0*(1-2)2 + 0*(1-3)2 +

.042*(2-0)2 + 0*(2-1)2 + .250*(2-2)2 + .042*(2-3)2 +

0*(3-0)2 + 0*(3-1)2 + .042*(3-2)2 + .083*(3-3)2

= .166(0) + .083(1) + .042(4) + .083(1) + .166(0) + .042(4) + .25(0) + .042(1) + .042(1) + .083(0)

= .083 + .168 + .083 + .168 + .042 + .042

= .586

Image Example

Important practical matter: Since Contrast can evidently be <1, it must be recorded in an image channel equipped to handle real numbers. If put into an 8-bit or 16 bit integer channel, the value would become 0.

Self test: a. What is the degree of this measure? b. What does a Contrast of 0 mean? 

Exercise: Calculate the Contrast for the vertical GLCM and compare it with the Contrast for the horizontal GLCM 

 Dissimilarity   Homogeneity

BACK      NEXT