defect detection in fabric images using two...
TRANSCRIPT
DEFECT DETECTION IN FABRIC IMAGES USING TWO DIMENSIONAL DISCRETE
WAVELET TRANSFORMATION TECHNIQUE
T.D.Venkateswaran1
Research Scholar, Department of Computer Science, Madurai Kamaraj University, Madurai, India.
G.Arumugam2
Senior Professor and Head, Department of Computer Science, Madurai Kamaraj University, Madurai,
India.
Abstract
Defect recognition is one of the problems in image
processing and many different methods based on
texture analysis have been proposed. In this paper, a
method is proposed for recognizing defects in fabric image textures based on two dimensional discrete
wavelet transformation techniques. The proposed
approach applied to real fabric textures. The proposed
algorithm shows good result to detect all types of
defects occurred in fabric images. High detection rate
and low computational complexity are advantages of
this proposed approach.
Keywords: Defect Detection, Image Processing,
Discrete wavelet transformation technique.
1. Introduction Today thanks to advances in machine visions and
hardware, monitoring and classification process of
industrial products can be performed automatically
using intelligent software and high speed hardware.
Visual quality inspection system play an important role
in many industrial and commercial applications such as
tiles, metal, agricultural products, fabric, ceramic, paper
and etc. Any hole, damage, abnormalities and slot in
products surfaces are called defect. Ghazini et al.
proposed a defect detection approach of tiles using
combination of two dimensional wavelet transform and
statistical features. Henry et al. used ellipsoidal region
features and min-max technique on patterned fabric for
detecting defects. Ch. Lin et al., described a texture
defect detection system based on image deflection
compensation. Tolba used a probabilistic neural
network (PNN) for fast defect classification based on the maximum posterior probability of the Log-Gabor
based statistical features. Alimohammadi et al.,
proposed a new method using optimal Gabor filters to
detecting skin defect of fruits which was usable in
agricultural products visual quality inspection systems
(APVQIS). Some of defect detection approaches are
compared by Xie et al.
The computational complexity of most of previous
approaches is too high and some of them don’t guarantee an accurate result for every model of defects.
So in this article, an approach is proposed to defect
detection without these problems.
1.1 Wavelet Transformation Because the frequency contents of signals are very
important, transforms are usually used. The earliest
well known transform is Fourier transform which is a
mathematical technique for transforming our view of
the signal from time domain to frequency domain.
Fourier transform breaks down the signal constituents
into sinusoids of different frequencies. However,
Fourier transform comes with serious shortage that is
the lost of time information which mean it is
impossible to tell when a particular event take place
[20]. This shortage vanishes with using wavelet
transform. A shifted version of the original signal is called mother wavelet which it is a wave form
effectively a limited duration and its average value is
zero. The most well known wavelets are Haar. Figure
(1) depicts some types of these wavelets [21].
1.2 Continuous Wavelet Transform The Continuous Wavelet Transform (CWT) given in
Equation (1), where x(t) is the signal to be analyzed,
and ψ(t) is the mother wavelet or the basis function
which it must be integrated to zero as given in
Equation. All the wavelet functions used in the
transformation are derived from the mother wavelet
T D Venkateswaran et al , International Journal of Computer Science & Communication Networks,Vol 4(1),33-40
33
ISSN:2249-5789
(Figure 3) through translation (shifting) and scaling (dilation or compression).
Note that τ and S are real numbers representing
translation and scaling parameters respectively. The
translation parameter τ relates to the location of the
wavelet function as it is shifted through the signal.
Thus, it corresponds to the time information in the
Wavelet Transform. The scale parameter S shows either
dilates (expands) or compresses a signal. Scaling
parameters are calculated as the inverse of frequency
[22].
Figure 1. Most popular Wavelets.
1.3 1-D Discrete Wavelet Transform
The CWT calculates coefficients at every scale
which leads to need much time and awful lot amount of
data. If scales and positions are selected based on
powers of two, analysis will be much more efficient
and accurate. This type of selection is called dyadic scales and positions. This analysis can be produced
from the Discrete Wavelet Transform (DWT) [17].
DWT is used to decompose (analyze) the signal into
approximation and detail called coefficients.
Approximation coefficients represent the high scale
(low frequency) components of the signal as if it is a
low pass filter. Detail coefficients represent the low
scale (high frequency) components of the signal as if it
is a high pass filter. Given a signal S of size N,
downsampling the approximation coefficients (cA) is
given by N/2 and the detail coefficients (cD) is given
by N/2 (Fig. 2).
Figure 2 1-D discrete wavelet transforms
The decomposition process of DWT can be
iterated to the first time approximation coefficients cA1
resulting second detail coefficients cD2 and second
approximation coefficients cA2 which can be
decomposed again. This process is known as the
Wavelet decomposition tree (Fig. 3-a) and its inverse
operation of decomposition is called reconstruction, or synthesis. Reconstruction is used to retrieve the signal
back from wavelet coefficients without lose of
information. The reconstruction of the signal is done
using Inverse Discrete Wavelet Transform (IDWT)
operation (Fig. 3-b).
Figure (3). a) 1-D DWT decomposition tree, b) 1-D
DWT reconstruction tree
1.4 2-D Discrete Wavelet Transform
Discrete Wavelet Transform (DWT) is not only
applied to 1-D signals, but also applied to two
dimensional matrixes applied images. Each element in
the matrix represents the intensity of gray color in the
image. The computation of the wavelet transform of
image is applied as a successive convolution by a filter
of row/column followed by a column/row. The results
of DWT on image are four coefficients matrices [15].
T D Venkateswaran et al , International Journal of Computer Science & Communication Networks,Vol 4(1),33-40
34
ISSN:2249-5789
Given image f (x, y), the 2-D wavelet analysis operation consists of filtering and down-sampling horizontally
using a 1-D low pass filter L and a high pass filter to
each row in the image f (x, y), and produces the
coefficient matrices f L (x, y) and f H (x, y). Vertically,
filtering and down-sampling follow using the low pass
and high pass filters L and H to each column in fL(x, y)
and fH (x, y). This produces 4 sub-images fLL (x, y),
fLH (x, y), fHL(x, y) and fHH (x, y) for one level of
decomposition. f LL (x, y) is a smooth sub-image,
which represents the approximation of the image. fLH
(x, y), fHL (x, y), and fHH (x, y) are detail sub-images
which represent the horizontal, vertical and diagonal
directions of the image respectively [14]. As mentioned
before, DWT can be applied again to the approximation
fLL (x, y) where the resulted coefficients matrix of
approximation and details of DWT determined by the
level k of decomposition using the relation 3k+1. Fig.
(4-a) and (4-b) show the first and third level concepts of DWT for image f (x, y).
Figure 4 (a) First level of DWT
Figure 4 (b) Third level of DWT
This paper is organized as follows. In section II, we review the literature in the area of defect detection in
fabric image. In section III, we give the proposed defect
detection algorithm using singular value decomposition
technique. In section IV, we give the results and
discussions and in section V we provide the conclusion
for this paper.
2. LITERATURE REVIEW Methods that are found in literature for the
inspection of patterned texture images include the
traditional image subtraction methods [6-10], the
method of golden image subtraction (GIS) [1], the
method of wavelet-preprocessed golden image
subtraction (WGIS) [1], the method of Direct-
Thresholding (DT) based on wavelet transform [1], the Bollinger Bands method [2], the Regular Bands
method, the Local Binary Pattern (LBP) method [3],
and the motif-based methods [4, 5].
The basic GIS method involves a training stage with
lot of defect-free samples and a testing stage [1]. In the
training stage, the energy of the golden image
subtraction, which is defined as the sum of absolute
difference between the golden image (a template unit of
size that is more than that of the periodic unit) and a
histogram-equalized reference image (defect-free
image) over a given window, is obtained at every pixel
location. Thresholds are obtained from several defect-
free images. In the testing stage, energies obtained from
the golden image and the defective test images are
compared with the thresholds obtained from the
training stage to find the defects after using a median
filter or Weiner filter to perform filtering. The method was tested with 30 defect-free and 30 defective pmm
images. The detection success rates obtained for the
pmm images are 100% for defect-free images and
56.67% for defective images. The overall success rate
was found to be 78.33%. In order to conquer the
sensitivity of this method to noise, the WGIS method
was developed [1]. This is similar to the GIS method
expect that a Haar wavelet transform is applied over all
the images and the sub-images (in level-1
approximation) are utilized instead of the original
image. The overall success rate was improved to
96.7%.
The traditional image subtraction method developed
by Chin and Harlow for the examination of printed
circuit boards involves a direct subtraction of the image
that is under inspection with a defect-free template
image [6]. Since this method involves pixel to pixel comparison, it is sensitive to noises and distortions.
Khalaj et al. developed a method of inspecting
patterned wafers based on periodicity estimation using
a gray value projection and a reference image that is
T D Venkateswaran et al , International Journal of Computer Science & Communication Networks,Vol 4(1),33-40
35
ISSN:2249-5789
constructed from the input image itself using the average gray values of all the periodic units [7].
Pixel-to-pixel comparison between the test image
and the reference or template image, which is based on
an assumed threshold, helps in identifying the defects.
Xie and Guan presented a similar method, wherein the
building block needed for constructing a reference
image is extracted based on linear interpolation [8].
However, when the defect size in the image is too
large, the building block constructed based on the
methods recommended in [7, 8] can never be a good
estimate of the true value.
In the method of DT [1], the Haar wavelet transform
is applied to the reference images and the fourth level
horizontal and vertical details are extracted. Lower and
upper bound values of the three horizontal details in
level-4 and also vertical details are extracted and their
averages are calculated after filtering. Thresholds
obtained using these horizontal and vertical details in the training stage with defect-free images are utilized in
the testing stage for finding the defects in pmm images.
The detection success rates were found to be 86.77%
for defect-free images and 90% for defective images.
The overall detection success rate was found to be
88.3%.
Fabric defect detection using the modified local
binary pattern (LBP) [3] involves two stages, namely,
the training stage and the defect detection stage. In the
training stage, the LBP operator is applied to an image
of defect-free fabric pixel-by-pixel, and a reference
feature vector is computed. The defect-free fabric is
then divided into several windows of size that are
slightly more than that of periodic unit and an LBP
operator is applied to each of these windows to get a
suitable threshold from the defect-free image. In the
detection stage the defective fabric is divided into several windows (as in the training stage) and LBPs are
obtained. Defects are then located in the fabric based
on the threshold. The method was tested on pmm, p2,
and p4m images and the detection success rate was
found to be 96.7%.
Ngan et al. [4, 5] developed motif-based methods
for detecting defective lattices from 16 out of 17
wallpaper groups based on energy and the variance of
the hand-located lattices. Minimum- maximum
decision boundaries (rectangular boundaries) are
obtained in an energy variance space from several
defect-free test images using hand-located defect-free
and defective lattices that are said to be composed of
motifs[4]. The energy of the moving subtraction
between a motif and its circular shift matrices is
derived using a norm-metric measurement and the
variance of the energies for all motifs is obtained. By learning the distribution of these values over a number
of defect-free lattices, boundary conditions for discerning defective and defect free lattices are
obtained. As the 16 wallpaper groups of patterned
fabric can be transformed into three major groups,
namely, pmm, p2, and p4m, the method was evaluated
over these three major wallpaper groups. Decision
boundaries were obtained using 160 defect-free lattices
samples and the method was tested with 140 defect-free
and 113 defective samples. An overall detection
success rate of 93.3% was achieved.
3. PROPOSED ALGORITHM
The steps for proposed Defect Detection Algorithm are
as follows:
Load the Test Texture image in BMP or JPEG
Format.
Reduce the noises in Test Texture image using
median filter.
Convert the Test Texture image to Gray scale
image.
Transform the gray scale image (spatial
domain) into frequency domain using Haar
wavelet. Extract the approximation coefficient
matrix image and compute the otsu’s threshold
and number of regions in the approximation
matrix image.
Compare the Otsu’s threshold value and the number of regions present in the test image with
the reference image.
If the difference is greater than detection
sensitivity level (D), declare that test fabric
image is defective; otherwise test fabric image
is defect free.
The flowchart of the Algorithm is shown in Figure 5.
4. RESULTS AND DISCUSSIONS
Table I shows the values of number of regions,
Otsu’s threshold value, number of regions difference
and Otsu’s threshold difference with respect to defect
free and several defective fabric texture images. The
value of D is 5 and the threshold difference is within 0.0045882. But in transform domain, traditional
inspection result not matched with the proposed
method for the defect miss-pick. The proposed method
shows defect-free fabric texture even though the fabric
having miss-pick defect. The Haar wavelet is used for
this experimentation.
Table II shows the values of number of
regions, Otsu’s threshold value, number of regions
difference and Otsu’s threshold difference with respect
to defect free and several defective slate texture images
in wavelet transformation domain. The value of D is 25
and the threshold difference is within 0.0035686. The
T D Venkateswaran et al , International Journal of Computer Science & Communication Networks,Vol 4(1),33-40
36
ISSN:2249-5789
proposed method result shows that the defect free slate texture as defective one.
5. CONCLUSION
In this paper, two dimensional discrete wavelet
transformation techniques have been effectively used
for the development of the automated defect detection
scheme for fabric texture images. Experiments on real
fabric and slate texture images with defects show that
the proposed method is robust in finding fabric defects and slate defects. Thus, the proposed method can
contribute to the development of computerized defect
detection in fabric industries.
REFERENCES
[1] H.Y.T. Ngan, G.K.H. Pang, S.P. Yung and M.K. Ng, “Wavelet based methods on patterned fabric defect detection,” Pattern Recognit., Vol.38, No.4, 2005, pp.559-576. [2] H.Y.T. Ngan and G.H.K. Pang, “Novel method for patterned fabric inspection using Bollinger bands,” Opt. Eng., Vol.45, No.8, 2006,
pp.087202-1-15. [3] F. Tajeripour, E. Kabir and A. Sheikhi, “Fabric Defect Detection Using Modified Local Binary Patterns,” Proc. of the Int. Conf. on Comput. Intel. and Multimed. Appl., Sivakasi, Tamilnadu, India, December, 2007, pp.261-267. [4] H.Y.T. Ngan, G.H.K. Pang and N.H.C. Yung, “Motif-based defect detection for patterned
fabric,” Pattern Recognit., Vol.41, No.6, 2008, pp.1878-1894. [5] H.Y.T. Ngan and G.H.K. Pang, “Ellipsoidal decision regions for motif-based patterned fabric defect detection,” Pattern Recognit., Vol.43, No.6, 2010, pp.2132-2144. [6] R.T. Chin and C.A. Harlow, “Automated
visual inspection: A survey,” IEEE Trans. on Pattern Anal. and Mach. Intel., Vol.4, No.6, 1982, pp.557-573. [7] B.H. Khalaj and T. Kailath, “Patterned wafer inspection by high resolution spectral estimation techniques,” Mach. Vision and Appl., Vol.7, 1994, pp.178-185.
[8] P. Xie and S.U. Guan, “A golden-template self-generating method for patterned wafer inspection,” Mach. Vision and Appl., Vol.12, 2000, pp.149-156.
[9] Gonzalez, R., R. Woods and S. Eddins, 2004. “Digital Image Processing Using MATLAB”. 1st Edn., Prentice Hall, [10] Jain A K,”Image Analysis and Computer Vision”, PHI, New Delhi, 1997 [11] O. Silv´en, M. Niskanen, and H. Kauppinen, “Wood inspection with non-supervised
clustering”, Machine Vision and Applications, 13:275–285, 2003. [12] I. Rossi, M. Bicego, and V.Murino. “Statistical classification of raw textile defects”, In IEEE Internationa Conference on Pattern Recognition, volume 4, pages 311– 314, 2004. [13] F. Adamo., F. Attivissimo, G. Cavone, N. Giaquinto and AML. Lanzolla “Artificial Vision
Inspection Applied To Leather Quality Control”, 13th International Conference on Pattern Recognition, Volume 2, 25-29; 2006. [14] F. Pernkopf., “Detection of surface defects on raw steel blocks using Bayesian network classifiers”, Pattern Analysis and Applications, 7:333–342, 2004.
[15] Z. Ibrahim, S. Al-Attas, Z. Aspar. “Model-based PCB Inspection Technique Using Wavelet Transform”. Proceedings of the 4th Asian Control Conference (ASCC), 2002. [16] C. Boukouvalas, J. Kittler, R. Marik, M. Mirmehdi, and M. Petrou, “Ceramic tile inspection for colour and structural defects”, Proceedings of AMPT95, ISBN 1 872327 01 X, pp.
390–399, August 1995. [17] H. M. Elbehiery, A. A. Hefnawy, and M. T. Elewa. “Visual Inspection for Fired Ceramic Tile's Surface Defects Using Wavelet Analysis”. Graphics, Vision and Image Processing (GVIP) Vol no 2, pp. 1-8, January 2005. [18] M. Leo, T. D’Orazio, P. Spagnolo and A.
Distante. “Wavelet and ICA Preprocessing for Ball Recognition in Soccer Images” ICGST International Journal on Graphics, Vision and Image Processing (GVIP),Vol no. 1 pp. 11-16, 2007. [19] XianghuaXie. “A ReviewofRecentAdvancesin Surface Defect Detection using Texture analysis
Techniques” Electronic Letters on Computer Vision and Image Analysis vol. (3):1-22, 2008. [20] Matlab Wavelet toolbox documentation. “The language of technical computing” from mathworks. Version 7.0, 2006.
T D Venkateswaran et al , International Journal of Computer Science & Communication Networks,Vol 4(1),33-40
37
ISSN:2249-5789
[21] C.H. Lee, Y.J. Wang and W.L. Huang. “A Literature Survey of Wavelets in Power Engineering Applications”. Proceeding National Science Council. Vol. 24, no. 4, pp. 249-258, 2000. [22] E. Bozzi, G. Cavaccini, M. Chimenti, M. G. Di Bono and O. Salvetti. “Defect detection in C -
scan maps”. Pattern Recognition and Image Analysis, Vol. 17, No. 4, pp. 545–553, 2007. [23] D.M. Tsai and B. Hsiao. “Automatic surface inspection using wavelet reconstruction”, Pattern Recognition. Vol. 34 no. 6, pp. 1285–1305, 2001.
Figure 5. Flowchart of the proposed algorithm
LOAD THE TEST TEXTURE IMAGE
NOISE REDUCTION USING MEDIAN FILTER
COMPARE THE OTSU’S THRESHOLD VALUE AND
NUMBER OF REGIONS IN TEST IMAGE WITH
REFERENCE IMAGE
CONVERT THE RGB IMAGE TO GRAY SCALE IMAGE
CONVERT THE GRAY SCALE IMAGE TO WAVELET
TRANSFORM IMAGE USING HAAR WAVELET AND
EXTRACT THE APPROXIMATION MATRIX IMAGE
IF DEFECT
DETECTED?
DEFECT FREE TEST TEXTURE
IMAGE
DEFECTIVE TEST TEXTURE
IMAGE
END
NO YES
T D Venkateswaran et al , International Journal of Computer Science & Communication Networks,Vol 4(1),33-40
38
ISSN:2249-5789
Table I Feature values related to fabric textures images in transform domain
Pictorial representation of Table I is shown in Figure 6.
0
20
40
60
80
100
120
140
160
180
DEFECT FREE R
EFERENCE
HOLE DEFECT
STAIN
MIS
S-PIC
K
MIS
S-END
DOUBLE-P
ICK
DOUBLE-E
ND
WARP-F
LOAT
COURSE-PIC
K
WEFT D
ENSITY
TEAR
CONTAMIN
ATION
SNARL
DEFECT FREE F
ABRIC
Series1
Series2
Figure 6 Pictorial representation of Table I
FABRIC TEXTURES NO OF
REGIONS
THRESHOLD
VALUE
NO OF
REGIONS
DIFFERENCE
THRESHOLD
DIFFERENCE
RESULT OF
TRADITIONAL
INSPECTION
RESULT OF
PROPOSED
METHOD
DEFECT FREE
REFERENCE
19 0.91765 0 0 DEFECT FREE DEFECT FREE
HOLE DEFECT 43 0.87059 24 0.04706 DEFECTIVE DEFECTIVE
STAIN 25 0.90588 6 0.01177 DEFECTIVE DEFECTIVE
MISS-PICK 17 0.92157 2 0.00392 DEFECTIVE DEFECT FREE
MISS-END 53 0.86667 34 0.05098 DEFECTIVE DEFECTIVE
DOUBLE-PICK 19 0.84314 0 0.07451 DEFECTIVE DEFECTIVE
DOUBLE-END 4 0.92941 15 0.01176 DEFECTIVE DEFECTIVE
WARP-FLOAT 2 0.92549 17 0.00784 DEFECTIVE DEFECTIVE
COURSE-PICK 153 0.91373 134 0.00392 DEFECTIVE DEFECTIVE
WEFT DENSITY 33 0.88627 14 0.03138 DEFECTIVE DEFECTIVE
TEAR 21 0.86275 2 0.0549 DEFECTIVE DEFECTIVE
CONTAMINATION 1 0.9098 18 0.00785 DEFECTIVE DEFECTIVE
SNARL 50 0.8902 31 0.02745 DEFECTIVE DEFECTIVE
DEFECT FREE FABRIC 14 0.91765 5 0 DEFECT FREE DEFECT FREE
T D Venkateswaran et al , International Journal of Computer Science & Communication Networks,Vol 4(1),33-40
39
ISSN:2249-5789
Table II Feature values related to slate textures images in transform domain
Pictorial representation of Table II is shown in Figure 7.
0
5
10
15
20
25
30
DEFEC
T FR
EE REFER
ENCE
DRO
PLET D
EFECT
SPO
TS DEFE
CT
DEB
RIS
DEFEC
T
TEMPLATE D
EFECT
LUM
P DEFEC
T
NO
PAIN
T DEFEC
T
EFFLORESEN
CE D
EFECT
SHADE D
EFEC
T
INSU
FFICIE
NT P
AINT D
EFECT
TEMPLATE M
ARK D
EFEC
T
DEFEC
T FR
EE SLA
TE
Series1
Series2
Figure 7 Pictorial representation of Table II
FABRIC TEXTURES NO OF
REGIONS
THRESHOLD
VALUE
NO OF
REGIONS
DIFFERENCE
THRESHOLD
DIFFERENCE
RESULT OF
TRADITIONAL
INSPECTION
RESULT OF
PROPOSED
METHOD
DEFECT FREE
REFERENCE
19 0.91765 0 0 DEFECT FREE DEFECT FREE
HOLE DEFECT 43 0.87059 24 0.04706 DEFECTIVE DEFECTIVE
STAIN 25 0.90588 6 0.01177 DEFECTIVE DEFECTIVE
MISS-PICK 17 0.92157 2 0.00392 DEFECTIVE DEFECT FREE
MISS-END 53 0.86667 34 0.05098 DEFECTIVE DEFECTIVE
DOUBLE-PICK 19 0.84314 0 0.07451 DEFECTIVE DEFECTIVE
DOUBLE-END 4 0.92941 15 0.01176 DEFECTIVE DEFECTIVE
WARP-FLOAT 2 0.92549 17 0.00784 DEFECTIVE DEFECTIVE
COURSE-PICK 153 0.91373 134 0.00392 DEFECTIVE DEFECTIVE
WEFT DENSITY 33 0.88627 14 0.03138 DEFECTIVE DEFECTIVE
TEAR 21 0.86275 2 0.0549 DEFECTIVE DEFECTIVE
CONTAMINATION 1 0.9098 18 0.00785 DEFECTIVE DEFECTIVE
SNARL 50 0.8902 31 0.02745 DEFECTIVE DEFECTIVE
DEFECT FREE FABRIC 14 0.91765 5 0 DEFECT FREE DEFECT FREE
T D Venkateswaran et al , International Journal of Computer Science & Communication Networks,Vol 4(1),33-40
40
ISSN:2249-5789