3.3 Feature Extraction
The most important task in the classification of seam
puckers is to extract features which can characterize
the roughness degree of various grades. In this
research feature extractions are based on three main
aspects considered in the process of inspection by
humans, they are density, depth and thickness of the
seam puckers.
Images of seam puckers can be considered as a
kind of textures, hence the co-occurrence matrix,
also known as the spatial gray-level dependence
matrix, is used for the texture analysis. A grey-level
co-occurrence matrix (GLCM) is a second-order
statistical measure of gray-level variation whose
entries are transitions between all pairs of two gray-
levels (Haralick et.al., 1973.). Let
(, ; , )Pi jd
be
the transition probability from gray-level i to gray-
level j, which is defined using the following relation:
(, ; , )
(( , ),( , )) ( ) ( ): ( , )( , ) , ( , ) ( , ) ,
#
(,) ,( ,)
(,)
xy xy
Pi jd
kl mn L L L L kl mn kl mn d
Ikl iImn j
Nd
θ
θ
∈××× ∠ = − =
==
=
⎧⎫
⎪⎪
⎨⎬
⎪⎪
⎩⎭
(4)
Where
∠ denotes the angle between (k, l) and (m,
n), || (k, l) - (m, n) || = d indicates that (k, l) and (m,
n) are d-pixel apart, # stands for the function
“number of”, L
x
and L
y
are the horizontal and
vertical spatial domains, I (x, y) is the image
intensity at point (x, y), and N (d, θ) is the total
number of pixel pairs in the image having angle θ
with d-pixel apart.
GLCM is a two dimensional matrix with the same
size as the number of grey-levels in an image. In this
study, the images have 256 distinct grey levels;
therefore the GLCM will be a matrix of size 256 ×
256. In order to reduce calculation time, the gray-
level range is transformed from [0, 255] to [0, 31] by
coarseness technique results in 32×32 GLCM, which
is used for evaluating the textural features of each
seam pucker sample. The new images with fewer
gray-levels are almost the same as the original ones
visually, but the calculation time is reduced
enormously.
To generate a suitable co-occurrence matrix, the
relative distance d plays a major role whose value is
always 1, 2, 3 or 4. The classification of fine textures
usually requires small values of d, whereas coarse
textures require large values of d. Here d = 4 is
selected and two angles (θ = 0, θ = 90) are
considered for evaluation. In this way, two GLCM
are calculated for each of the seam pucker samples.
Haralick proposed 14 feature measures derived
from the GLCM for image texture analysis, and each
represents certain image properties such as
coarseness, contrast, homogeneity and texture
complexity. In the present study, three of the
features: Contrast (CON), Inverse Difference
Moment (IDM) and Entropy (ENT) are used for
classifying the seam puckers because they are found
to show better discrimination than the other features.
They are described as below.
1. Contrast:
2
()(,|,)CON i j p i j d
ij
=−
∑∑
(5)
Contrast is a measure of the image contrast or the
amount of local variations present in an image, in
which a zero-value denotes no contrast while larger
values corresponds to an increase in contrast or
coarseness.
2. Inverse difference moment:
2
1
(, | , )
1( )
ij
IDM p i j d
ij
=
∑∑
+−
(6)
Inverse Difference Moment is a measure of lack
of local variability. A large value indicates few
varieties among different areas of an image and a
flat pixel distribution in local area.
3. Entropy:
(, | , )log( (, | , ))
ij
ENT pijd pijd
θ
=−
∑∑
(7)
Entropy determines the degree of randomness or
lack of information contained in the co-occurrence
matrix. When the value of Entropy is zero, no
information is attributed to the matrix. As the
magnitude increases more uncertainty is associated
with the image region.
In Equations (5)-(7), i and j are the rows and
columns of the co-occurrence matrix. For two
directions (θ = 0, θ = 90) are considered there are
totally six features extracted from GLCM.
In general, it is not easy for humans to tell depth
information from an image. Since variance (a kind
of central moment feature) reflects the amplitude of
an image, it can be used as the depth feature of
images.
2
255
0
()()
i
DEP k p k
μ
=
=−×
∑
(8)
where
()pk is the probability of gray-level value k
OBJECTIVE EVALUATION OF SEAM PUCKER USING AN ADAPTIVE NEURO-FUZZY INFERENCE SYSTEM
237