Professional Documents
Culture Documents
The Fabric Defect Detection Based On CIE L A B Color Space Using 2-D Gabor Filter
The Fabric Defect Detection Based On CIE L A B Color Space Using 2-D Gabor Filter
The Fabric Defect Detection Based On CIE L A B Color Space Using 2-D Gabor Filter
To cite this article: Junfeng Jing, Suimei Liu, Pengfei Li & Lei Zhang (2016) The fabric defect
detection based on CIE L*a*b* color space using 2-D Gabor filter, The Journal of The Textile
Institute, 107:10, 1305-1313, DOI: 10.1080/00405000.2015.1102458
The fabric defect detection based on CIE L*a*b* color space using 2-D Gabor filter
Junfeng Jing*, Suimei Liu, Pengfei Li and Lei Zhang
College of Electronic and Information, Xi’an Polytechnic University, Xi’an Shaanxi, China
(Received 11 November 2014; accepted 17 September 2015)
A detection algorithm based on CIE L*a*b* color space is proposed to detect various colorful fabric defects more
accurately and avoid the error detection resulted from losing image information of graying. CIE L*a*b* color space is
transformed from XYZ space via nonlinear transformation of RGB space. First, three features including the brightness
characteristics L*, color information of a* and b* which are used to form 2-D Gabor filter in a complex number can be
acquired. Genetic algorithm with the objective function in a form of energy is adopted to select optimal Gabor filter
parameters. Second, filter built by flawless image is used to filter the corresponding drawbacks of image. Third, ultimate
results are obtained through sliding threshold segmentation method and properly de-noising. The experiment success rate
is 95.83%, which indicate that this method can detect diversiform colorful fabric defect accurately.
Keywords: colorful fabrics; defect detection; CIE L*a*b* color space; 2-D Gabor filter
Introduction (Mokji & Abu Baker, 2007) that reflects the probability
Flaws which are caused by many factors such as quality of two gray appearing simultaneously in a certain space,
of cotton, procedure of weaving, printing, dyeing, and autocorrelation is an energy spectrum function which
post-tailoring make a big influence on textile quality. could extract roughness and directionality. The operation
The quality of textile not only is a standard for of structural approaches is mainly focused on the
measuring both production and management level of analysis of image texture primitive. Filter-based methods
enterprises, but also affects textile trade. Hence, it is have been extensively applied because of their better
significant that detecting defects while putting fabric into performance. Gabor filter has been used to detect defects
use. The defective regions is marked and trimmed by on texture materials (Kumar & Pang, 2002), Chan &
comparing detected fabrics with model fabrics during Pang, (2000) used Fourier transform (FT) in fabric
detect process in traditional manual testing. The speed of defect detection and Yang, Pang, and Yung (2005) used
defect online detection is generally higher than 60 m/ multiple adaptive wavelets to detect and classify defects
min. The minimum size of defect is 0.5 mm (Zou, in fabrics. Model-based approaches include random field,
Wang, & Sun, 2009). However, the speed of a skilled synchronous autoregressive model. Except these
defect detection staff ordinary is 15–20 m/min. Besides, methods, there are also a number of algorithms to detect
lower resolution of human eyes and higher inattention defects such as the BP neural network and fuzzy control
after long-time work leads that accuracy rate is only and have been adopted to realize the fabric defect
70% when human complete the detection of 0.8–1.0 m detection (Hung & Chen, 2001).
of fabric (Jing, Zhang, & Li, 2013). Therefore, automatic However, the use of single algorithm mentioned
detection is developed gradually for shunning the lower above is unable to detect accurately for various flaws
labor detection efficiency, slower detection speed, higher appearing in defect detection process. In addition,
false detection rate, and stronger subjective accuracy of fabric image test is affected by tested
consciousness influence of human detection. fabric itself and image acquiring equipment. Lighting
So far, many scholars throughout the world have equipment is the most influential factor which could
proposed lots of methods in defect detection. Most provide stable and consistent light to ensure that the
popular classification of these methods is divided into testing image have uniform gray, consistent
four categories, namely statistical approaches, structural chromaticity. During the whole process, it is important
approaches, filter-based methods, and model-based to reduce the impact of light as far as possible. Color
approaches (Xie, 2008). Statistical approaches are used imaging system has been widely used in detection and
to achieve detect defect by extracting spatial information chromatic consistency plays an important role in fabric
of image gray scale. Such as the co-occurrence matrix quality. While using the above methods for testing, the
u v
with
u ¼ ðx t1 Þ cos h þ ðy t2 Þ sin h; (14)
Figure 3. The imaginary part of a basic Gabor function.
v ¼ ðx t1 Þ sin h þ ðy t2 Þ cos h; (15)
" #
1 x2 y2
gðr; h; f Þ ðx; yÞ ¼ exp 2 2 : (16)
2pr2 2rx 2ry
u v (18)
ðcosð2 pi f ðx cos h þ y sin hÞÞÞ;
u v (19)
ðsinð2 pi f ðx cos h þ y sin hÞÞÞ:
Figure 2. The real part of a basic Gabor function.
The Journal of The Textile Institute 1309
Generally, various center frequency and bandwidth are the optimal solution of groups is random. It is
extracted from different textures of fabric. Textures are also influenced by encoding method and fitness
constantly changing while processing image. Hence, function. Selection is the procedure to select the
finding the optimal parameters of Gabor filter is individuals which are processed with the high
particularly important. Presetting the center frequency fitness among initial or new populations. Then,
and bandwidth has blindness and low efficiency. To crossover is exchanging parts of two father
achieve tunable parameters of Gabor filter, genetic individuals according to probability of crossover
algorithm is adopted in this paper to find optimal (pc). In this article, pc equals to 0.6. Next,
parameters. mutation is changing some bits of each
Genetic algorithm is a search heuristic that mimics individual to produce new individual follow the
biological evolution mechanism. It regards excellent probability of mutation (pm). In this study, pm is
individuals as paternal individual who leave 0.1. Namely exchange 1 to 0 or 0 to 1 (Yang &
chromosomes and genes to posterities then reach Jiang, 2001). Crossover has global search
recombination. Genetic algorithm usually starts from a capability and mutation operator has local search
population of randomly generated individuals which are capability. The coordination of these parameters
represented in binary as strings of 0s and 1s. It is can accelerate the convergence of the optimal
designed without the limitation of prior knowledge. Then solution.
the fitness of populations in each generation is (4) Termination: This generational process is
calculated. The fitness is got from objective function. repeated step 2 and 3 until the termination
Finally, the optimal solution can be obtained by criteria are reached. Such as when the fitness of
approaching to fitness through selection, crossover, and the best individual gets to a given threshold, or
mutation until reach termination criteria. Genetic the number of iterations reaches to a preset
algorithm is a global optimization method that searches value.
parallel along multiple routes (Li, Xie, & Yi, 2005).
Genetic algorithm has four steps as follows: The optimal individuals through genetic algorithm are
expressed as a set of binary string. Parameters for the
(1) Initialization: Initial population (Jin, Yang, & final design of Gabor filter can be acquired through
Ding, 2001) is composed of a binary string with transcoding this binary string into decimal vector.
the length match to the required parameters of Algorithm flow chart is shown in Figure 5.
Gabor filter. The first generation is constructed Flaw image Id is filtered by the Gabor filter which is
by those random chromosomes or genes. constructed by a flawless image. A simplified
(2) Assessment of fitness: According to the actual
requirements of this paper, the fitness cE is
calculated as follows:
Start
l¼k m¼k
½b ðx þ l; y þ mÞ gi ðl; mÞg; ð21Þ
Crossover: two father individual
according the pc to exchange some
X
k X
k parts, pc: 0.6
Ci ¼ f½a ðx þ l; y þ mÞ gi ðl; mÞ
l¼k m¼k
þ½b ðx þ l; y þ mÞ gr ðl; mÞg:
ð22Þ Mutation: one bite of chromosome No
changing with the pm to produce If the population achieve the termination
new individual, pm= 0.1 criteria
Yes
(3) Genetic manipulation: Three basic operators
End
including selection, crossover, and mutation will
be started when individuals in groups in
accordance with fitness in step 2. Tendency to Figure 5. Flow chart of genetic algorithm.
1310 Junfeng Jing et al.
N N
a defect-fre defective filtered binary a defect-fre defective filtered binary
m e image image image image m e image image image image
e e
a i
b j
c k
d l
e m
f n
g o
h p
Figure 6. The images: (a) and (b) are holes; (c) and (d) are Figure 7. The images: (i) and (j) are holes; (k) and (l) are
scratches; (e) and (f) are stains; (g) and (h) are thrums. Each scratches; (m) and (n) are stains; (o) and (p) are thrums.
column indicates the name of image, defect-free image,
defective image, filtered image, and binary image, respectively. qffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi
Im ðx; yÞ ¼ ½Gr ðx; yÞ Id ðx; yÞ2 : (23)
convolution formula expressed as Equation (22) could be Gr denotes the real part of Gabor function. Median
employed to filter images, but only the real part of filtering is combined to eliminate various noises after
Gabor function is adopted. convolution of Gr and Id.
The Journal of The Textile Institute 1311
Threshold segmentation in filtered images 255 if Bðx; yÞ Te
outðx; yÞ ¼ : (26)
General methods for threshold segmentation have been 0 if Bðx; yÞ [ Te
proposed including simple threshold method, Otsu Due to different textures, quality of image and accuracy
method (Yang, 2003), and Bernsen method which is an of threshold selection, the noises will exist after image
adaptive method of dynamic threshold selection. segmentation. In this paper, watershed segmentation
Main steps of threshold segmentation are determining method is used to eliminate noise (Maiti, Desai, & Ray,
a threshold, comparing pixel value of the target picture 2000).
with the threshold value, and classifying pixels into the
defects and the background.
Selection of best threshold is crucial for the final test Experimental results
results. The threshold should separate the target and Experimental samples in this paper including 144
background as clear as possible and save the original colorful images with 72 flawless images and 72
information as much as possible. corresponding defective images. All 72 images are
General statistical histogram method is based on the divided into two kinds of patterned and non-patterned.
use of the whole image gray features with large Non-patterned images are classified into four types: hole,
calculation. The threshold segmentation method in this scratch, stain, thrum, each type including 10 images.
paper is divided into following steps: Patterned images are classified as the same way, but
each type consists of eight images. Overall detection is
(1) L is the gradation level of the flawless image A. summation of true detection and false detection. True
N is the number of pixels of A. Amax is the detection is the white area of final binary image matches
maximum pixel value and Amin is the minimum with the defective area. False detection is the white area
pixel value of A. Tf is the initial threshold value. of final binary image differs from the defect in that
Whole image region is divided by Tf. Calculate defective image. During non-patterned image detecting,
the average gray degree of G1 and G2, holes, scratches, and thrums can be accurately detected.
respectively, to generate a new threshold value Whereas the stains close to background, detection will
Tf1. be influenced after color space transformation. When
detecting patterned color fabric, holes and thrums have
Tf ¼ ðAmax þ Amin Þ=2; (24) been calculated with a higher detection rate. There are
some false detection of scratches and stains for their
Tf 1 ¼ ðg1 þ g2 Þ=2: (25) similar texture structure with background. Experiment
results indicate that the combination of CIE L*a*b*
Repeat this iteration until the deviation of two color space transformation and optimal 2-D Gabor filter
adjacent values is within the setting range, then calculate has a high detective accuracy rate. The fabric detection
the final threshold value Te. rate is demonstrated in Table 1.
(2) Dividing result of flaw image B is shown in the Parts of consequences of non-patterned images are
following formulation: shown in Figure 6 including defect-free images,
defective images, filtered images, and binary images.
Images name σv t1 t2 f θ
a 1.3891 172.8250 117.3998 14.9041 2.6953
b, c, and g 1.5057 138.9052 145.9759 9.8242 2.8226
d 1.2395 120.2346 182.6002 8.9410 2.7050
e 1.8348 181.4272 137.1457 7.7569 2.8324
f 1.8043 139.1984 152.0039 10.8022 3.0054
h 1.7849 135.7771 145.7221 12.6415 2.8207
i 1.8778 129.2278 150.7331 11.4007 2.6226
j and m 1.6256 118.8661 111.1437 8.4958 2.6502
k 1.3148 165.6891 180.5474 14.7217 3.0008
l 1.4018 121.8964 160.3128 10.0723 2.7101
n 1.1574 176.9306 162.6588 14.4443 3.1319
o 1.3040 132.9423 107.6246 8.9045 2.8673
p 1.2581 175.8553 190.6158 10.0139 2.8340
1312 Junfeng Jing et al.
Yang, B. (2003). Image segmentation of the genetic algorithms Yang, X., Pang, G., & Yung, N. (2005). Robust fabric defect
on the base of Otsu. Journal of Natural Science of Hunan detection and classification using multiple adaptive
Normal University, 26, 32–36. wavelets. IEE Proceedings - Vision, Image, and Signal
Yang, Q., & Jiang, J. (2001). Genetic algorithm used to Processing, 152, 715–723.
optimize the improvement of speed. Software, 12, 270–275. Zou, C., Wang, B., & Sun, Z. (2009). Survey on fabric defect
Yang, J., Liu, L., Jiang, T., & Fan Y. (2003). A modified detection based on machine vision. Journal of Tianjing
Gabor filter design method for fingerprint image Polytechnic University, 28, 78–82.
enhancement. Pattern Recognition Letters, 24, 1805–1817.