Fabric Defect Detection Using Image Processing Techniques
Fabric Defect Detection Using Image Processing Techniques
Fabric Defect Detection Using Image Processing Techniques
PROCESSING TECHNIQUES
i
CONTEN
Page
ii
CONTEN
2.4Methods of Using Signal Processing-Based Features.......................................23
2.4.1 Spatial Filtering Approach.......................................................................24
2.4.2Karhunen-Loeve Transform Approach.....................................................26
2.4.3Fourier Transform Approach.....................................................................27
2.4.4Gabor Transform Approach......................................................................30
2.4.5Wavelet Transform Approach...................................................................33
2.5Summary...........................................................................................................36
3.2.19Miss-pick.................................................................................................43
3.2.20Double-pick.............................................................................................43
3.2.21Coarse-pick..............................................................................................43
iii
CONTEN
3.2.22Tight/Slack weft thread...........................................................................43
4.1 Introduction......................................................................................................46
4.2Theory of DOOG Filters...................................................................................46
4.2.1 Gaussian Function....................................................................................47
4.2.2The Multivariate Gaussian distribution.....................................................50
4.3Difference of Offset Gaussian (DOOG) Filters................................................52
4.3.1 Background of DOOG Filters..................................................................52
4.3.2Theory of DOOG Filters...........................................................................53
4.4FDDS Based on DOOG filter with Histogram Analysis..................................56
4.4.1 Parameter..................................................................................................56
4.4.1.1 Standard Deviation...........................................................................56
4.4.1.2Size of filter.......................................................................................58
4.4.1.3Orientation.........................................................................................59
4.4.2Designing and Implementation Processing...............................................60
4.4.2.1 Filter Design.....................................................................................60
4.4.2.2Implementation of filters...................................................................62
4.4.2.2.1 Fast Fourier Transform (FFT)...................................................64
4.4.3Post- processing.........................................................................................66
4.4.4Classification.............................................................................................71
4.5Proposed FDDS Graphical User Interface........................................................72
4.5.1 Fabric defect detection System GUI.........................................................73
4.5.1.1 Processing panel...............................................................................73
4.5.1.2Parameters panel................................................................................75
4.5.1.3Classification panel............................................................................75
4.5.1.4Output panel.......................................................................................75
4.5.1.5Image grid..........................................................................................75
4.5.1.6Data grid............................................................................................76
4.6Summary...........................................................................................................76
6.1 Conclusions......................................................................................................92
6.2Features works...................................................................................................94
REFERENCES..........................................................................................................95
v
CHAPTER ONE
INTRODUCTION
Around seven cover billion people are currently live on in the world and all the
people use clothes to their bodies. Therefore, textile industry becomes very large and
an important sector. Fabrics are the raw materials of textile industry and they have
very sensitive structure. Consequently, quality is very important parameter for
textile, so good quality products is a key issue for increasing rate of profit and
customer satisfaction (Schneiderman A. M, 1986), as a result the industry‘s
competitive edge is expanded in the global market (K. Srinivasan, P. H. Dastor, P.
Radhakrishnaihan and S. Jayaraman, 1992). If defects in the fabrics are not
discovered before the garment manufacturing process, significant financial losses can
adversely affectsbothdealersandmanufacturers. For example, if damages in patterns
of the fabric are, due to human absence, not discovered prior to manufacturing the
fabric, as a result considerable loss of time, money and distrust between
dealersandmanufacturers can occur. In addition, defected fabrics lose 55 − 65% value
against non-defected fabrics (K. Srinivasan, P. H. Dastor, P. Radhakrishnaihan and
S. Jayaraman, 1992). This is a verygreat loss for manufacturers. For this reason, the
inspection of fabric defects is necessary and important for the textile industry.
1
2
The fabric defect causes deterioration on the fabric pattern and there are various
pattern faults. The yarns are weaved in the longitudinal direction of the fabric that is
named as warp direction. If the yarns are weaved in the width-wise direction they are
weft direction. These makes the fabric patterns In general, the defects occur in
weaving process and several reasons can cause to defects formations (A. S. Tolba, A.
N. Abu-Rezeq, 1997). The most important reason of these defects, such as double-
end, double-pick, irregular weft density, broken end, and broken pick, slubs,
contaminations or waste can occur if yarns failure in pattern. Furthermore, a large
part of defects are related with fabric machine structural failures or machine residue
(A. S. Malek, 2012).
In textile industry defect detection process is named as fabric inspection. Next
sections will give brief information about fabric inspections, fabric inspections‘
techniques and also compare these techniques.
In modern textile industry, fabrics are available in more complex web form, also
advanced machines weave wide and long fabrics as soon as possible. In addition,
fabrics easily affected by external factors. Consequently, the inspection process
3
becomes more difficult and more complicated stage (Conci A. and Proença C. B.,
2000). Therefore, industrial fabric inspection (Kumar A. and Pang G., 2002) has
extremely high requirements.
When the inspector notices a defect on the moving fabric, then he records the
defect and its location. During the inspection process, if the operator encounters with
too many defects, the inspector warns the production department for immediate
correction of faults. Either the new parameter are entered the weave machine or the
production is stopped (Kumar A., 2008), (Dorrity J., Vachtsevanos G. and Jasper W.,
1996).
4
From the first day that Inspection process is implemented in Textile industry,
Human based inspection Systems met all the requirements (Anstey J., Peters D. and
Dawson C., 2005). Although manpower is still used in inspection process, while
modern weaving machines increase the production rate and production pattern size.
So, the human based inspection has no ability to satisfy today requirements because
of the limitations based on their physiological nature of human. The researches
shows that Human based Inspection Systems detect only 60-70% of the defects (T. S.
Newman, and A. K. Jain, 1995). Beside this, Human based Inspection Systems (HIS)
suffers from many drawbacks. They can be described as follows:
Because of these vast drawbacks and in order to increase accuracy, attempts are
being made to replace manual visual inspection by automated one that employs a
camera and imaging routines to insure the best possibility of objective and consistent
evaluation for fabric quality.
5
High cost, low accuracy and very slow performance of human visual inspection
has increased interest in automatic inspection systems, so nowadays more researches
are working on automatic inspection systems. Automatic inspection systems are
designed for increasing the precision, stability and speed with respect to Human
Inspection Systems. Beside this, these automatic inspection systems provide high
defect detection rates. Moreover, these systems also reduce labour costs, improve
product quality and increase manufacturing efficiency (H. Sari-Sarraf and J. S.
Goddard, 1999).
Image Acquisition
Post processing
1.2.3.2 Pre-processing
This part is a pre-processing part which is used to obtain useful information from
captured fabric images by feature extraction techniques. Although fabric images are
captured in high resolution, the images also include noises and other distortion.
Median filtering, histogram equalization, etc. are some applications that use for
preclude the adverse effects. Median filtering (S. H. Jeong, H.T. Choi, S. R. Kim, J.
Y. Jaung, S. H. Kim, 2001) is used for removing small noises and histogram
equalization reduces the effect of unstable illuminations (Y. F. Zhang, R. R. Bresee,
1995). Histogram equalization is so effective. It determines the gray level values,
then set new gray-level values of pixels to achieve a more uniform gray-level
distribution in an image (R. C. Gonzalez, R. E. Woods., 2002). Histogram
equalization can be seen by looking at noticeable changes in contrast. Finally, pre-
7
processed images are isolated from harming affects that making it difficult to
perceive the defects. A new modified image is produced for achieving better
detection. Beside this, these applications do not change the dimensions and size of
the images.
The aim of feature extraction is to obtain useful information from an image. In the
case of fabric defect detection, defected and non-defected texture are characterized
and analysed. The relationships or the differentiations define helpful information that
is used as features. Features are very importance to most fabric defect detection
systems because they possess a close relationship to the detection accuracy of the
fabric defect detection method.
In practice, features from textured images are described as feature vectors. For
discrimination in fabric images, the feature vectors are realized by measuring those
values which are very similar in the fabric defects. The values for defect-free fabrics
are measured as well. If better features are obtained, that means better computations
and better discrimination shall be done. So the accuracy rate of fabric defect
detection is increased. Features are empiricallyverified. In this case, determinations
are measured by testing sample by sample, rather than they are compared with some
predetermined thresholds. Deviations beyond the predetermined thresholds are
counted as defects. Nevertheless, determination of the thresholds is usually
subjective, so some errors in defect inspection may still be perceived due to dust
particles, and lighting conditions. In other cases, other statistical or soft classification
techniques may be used (Y. F. Zhang, R. R. Bresee, 1995)
This part actually works like the fabric defect detector .In detection and
classification section feature vectors are used to determine and classify the patterns
to classes. In the detection of fabrics, since there are two classes considered: the
normal fabric and the fabric defects. Fabric images will be assigned to only one of
these classes. Difficulty of this part is derived from thevariability of the feature
values. Therefore, different techniques will be used to determine which type of
detectors is more convenient and provides satisfactory results.
1.2.3.5 Post-processing
The main disadvantages of existing inspection systems are the high hardware and
software development costs, the huge computational efforts are required, and the
limited range of the defects to be detected, e.g., defect sizes, defect types, etc.
(Kumar A.,2001). So, researches aim to design useful methods or systems by
spending minimal costs. The developments in fabric inspection systems‘ software
facilitate to better characterization of defects and patterns. This parameter becomes
main requirements of fabric defect detection systems. Also, the other requirements
9
are shown as below (M. Bennamoun, A. Bodnarova, 1998), (T. Li, W. Peter, K.Tim,
1997), (D. Brzakovic and N. Vujovic, 1996):
(1) One of the most important requirements is that the systems should be
designed with minimum costs.
(2) Automated inspection systems must provide the needs of the real-time
inspection conditions.
(3) The systems must work in different types of fabric patterns.
(4) Performance of Automated inspection systems should not be less than human
based inspection systems
(5) Systems should be resisting the bad conditions of textile industry
environment both as hardware and software.
(6) The systems should have easy and understandable control mechanism that
everyone uses without forcing.
Automated Inspection Systems are designed for providing the needs of textile
industry. In the past 40 years, different techniques of computer vision have been
applied to solve automated inspection problems (Nalwa V.S., 1993) and also new or
advance systems are developed. The reasons of concentration on automated
Inspection systems are shown that the system has more advantages than human based
inspection. The advantages are summarized as following (Newman T.S. and Jain
A.K. ,1995),( Tolba A.S. and Abu-Rezeq A.N. ,1997, Malamas E.N., Petrakis
E.G.M., Zervakis M., Petit L. and Legat J.D., 2003):
(1) The most import advantages is, Automated inspection systems increase the speed
and the reliability of inspection.
(2) Fabrics are very sensitive structures. Because of Automated inspection is a non-
contact process, it prevents the pattern from disturbances that may occur during
contact period.
1
(3) Automated inspection behaves more stable and involvement is less by the
external conditions
(4) High percentages of inspection rates are provided;
The necessary part of inspection software is the fabric defect detection approach,
which use feature extraction methods for detecting process. The efficiency of a
fabric defect system is highly related with the strength of feature extractor, which is
tried to define effective features with strong discriminations between the defect and
the non-defected region for fabric defect detection, and use the features in fabric
defect classification process.
Fabric patterns have periodic and symmetric structures. The structures break
down due to various reasons that called as defects. Also, different types of defects
may occur on fabric pattern.In order to overcome all of these problems, patterns must
characterize in details. In Automated Inspection Systems feature extraction process
obtain the information about defects and non-defected patterns. Feature extraction
process is also examine in following four categories:
Unlike the above approaches which discriminates the defects in terms of the
visual properties of the fabric texture, the signal processing-based approach extracts
features by applying various signal processing techniques on the fabric image. It is
expected that the separability between the defect and the non-defect can be enhanced
in the processed fabric image. This approach further consists of the following
methods:
Spatial filtering,
Karhunen-Loeve transform,
Fourier transform,
Gabor transform,
Wavelets transform.
The edges of defects are different from free fabric texture in scale and orientation.
Spatial filtering approach aims at enhancing these edge-based differences by
designing a set of spatial masks, which enable for easy detection of the defect region.
As a disadvantage of this approach, its performance is easily affected by the noise in
the fabric image. Karhunen- Loeve transform is able to wrap the energy of the fabric
image into a set of uncorrelated coefficients. These coefficients represent optimally
the defect-free fabric image, however, not the optimal discrimination between the
defect and the non-defect. On the other hand, Fourier transform can be used to
capture the periodic structure of the fabric texture, and detect the presence of defects.
Since Fourier based approaches do not have local support in the spatial domain;
the features extracted from the Fourier transform are not so effective in detecting
small local defects. In fact, fabric defects either appear to be singularities in the
homogeneous background, or texture whose primitives are different from the
background texture in scale and orientation. Wavelet transform, Gabor transform use
localized spatial-frequency analysis at multi-scale and multi-orientation to determine
1
the defects. They are more capable in the discrimination of fabric defects than the
other methods that rely on the texture analysis at a single scale (Y. F. Zhang and R.
R. Bresee, 1995). Compared to the Gabor transform, the wavelet transform has the
advantage of more flexibility in the decomposition of the fabric image (B. Nickolay,
K. Schicktanz and H. Schmalfub, 1993). Based on the above discussions, the wavelet
transform is viewed as the most appropriate approach to the feature extraction for
fabric defect detection.
This research aims to design a useful and high detection rate automated visual
inspection system software. The use of advanced image processing and signal
processing techniques is proposed, including image segmentation and representation,
which would effectively detect a variety of defects in textile fabrics. The
improvement of this study is to design filters which use Gaussian function called
Difference of offset Gaussian (DOOG) and use filters for better extraction of
features. Although similar methods have been proposed in the past to detect defects,
many problems remain to be solved for practical implementations. Hence, the study
described in this thesis involves the following principal objectives:
(1) To design systems that detects more class of defects and also detects the non-
defected patterns.
(2) To design effective structure that determines parameters automatically by using
type of patterns,
(3) To design a high detection rate system with high detection speed.
(4) To determine the classes of defects that detect from system.
The economic benefit of this research is to reduce the total cost in fabric and
garment manufacturing by minimizing rejections due to defects in fabrics, and to
enable more effective management of the company‘s logistics operations. Indeed, the
knowledge gained from this project can also be applied to solve similar quality
control problems for other industries.
1
Finally, it will introduce how to design a Matlab Graphical User Interface and
how to use the special properties such as graphical icons, visual indicators or special
graphical elements.
1
Chapter 5: This section summarizes and discusses the important findings of defect
detection and classification results.
Chapter 6: The thesis is concluded in Chapter 6. Suggestions for future research are
also presented.
CHAPTER TWO
REVIEW OF LİTERATURE
16
1
standard deviation is taken by using colour or gray level values of texture, a simple
statistic features are extracted (R. C. Gonzalez, R. E. Woods,2002).Generally, the
standard Deviation has shown better performance than mean method. Because, if a
fabric image is exposed by illumination, the difference in the level of local pixels
themselves remains almost the same. Using only the mean is hard to discriminate
between defect and defect-free regions. But, the standard deviation in a small region
reveals a different set of values in different types of regions. Thus, the precision of
representing a defected texture is more accurate.
Previous works show that means and standard deviation and Shannon entropy is
effective in detecting large areas of defect (M.C. Hu, 2000).Despite of this; the local
statistical features are solely good at characterizing those defects whose intensities
are sufficiently different from the defect-free regions, e.g. oily stain and holes. This
is because the window size affects the extracted information and there is no
guarantee of an accurate detection with this method.
Skewness and Kurtosis methods are classified in first-order statistics (K. Y. Song,
M. Petrou, J. Kittler, 1992). The skewness is related with symmetry of texture and
Kurtosis is related with peakedness of probability data in normal distribution.
Skewness and Kurtosis are also extracted in a window and are defined as:
Skewness = 1
∑ (𝑥−µ) ³ (2.1)
𝑁 𝜎
4
Kurtosis = 1 ∑ (𝑥−µ
(2.2)
) −3
𝑁 𝜎
µ denotes the mean, σ denotes the standard deviation, x denotes the gray level
intensity of a pixel and N is the total number of pixels in the pattern.
1
The second-order statistical texture features, which are extracted using gray level
co-occurrence matrices (R. M. Haralic, K. Shanmugam and I. Deinstein, 1973),
autocorrelation function (R. M. Haralic, 1979), and gray-level difference (R. W.
Conners and C. A. Harlow,1980), etc. methods, are classified under second-order
statistical texture features, these methods use spatial interrelationships of the gray
level intensity in texture. The second-order texture features, co-occurrence matrices-
based features have more efficiency to discriminate of texture than other methods (R.
M. Haralic, 1979), (P. P. Ohanian and R. C. Dubes, 1992).
Suppose {Im (u, v), 0 ≤ u≤ (M−1), 0 ≤ v ≤ (M−1)} denotes an image of size M×M
with G gray-levels, the G×G gray level co-occurrence matrix C for a
displacementvector d = (dx, dy) is defined as follows:
C (i,j) = | {((r, s), (r+dx, s+dy)) : Im(r, s)= i, Im (r+dx, s+dy) = j} (2.3)
The aim of this method is to create a much closed texture. In the main title
probability density function are used for patterning texture. More specifically,
stochastic models generate similar pattern with using gray level interrelationships of
texture. The fabric patterns can be modeled by a set of model parameters, all these
parameter are used as a feature for texture discrimination.
2
Most commonly Markov random field (MRF) are used to create a model for the
texture images (G. R. Cross and A. K. Jain, 1983), (R. Chellappa and S. Chatterjee,
1985) because MRF algorithms highly describe statistical dependence of the texture
image. So MRF has been successfully applied in the field of defect detection for
textile fabrics. In MRF, the pixel values are assumed to consist of a noise element
plus a value determined in a statistical way by the neighbours of the pixel.
Gaussian Markov random field (GMRF) is a major class of MRF and has been
successfully applied in the field of defect detection for textile fabrics. This section
will introduce the technique and its applications in defect detection in detail.
2
D =,z
p
= (k, l): ||p − z|| ≤ N p, z G (0,0)-,(2.10)
𝜎² if z = (0,0)
E(n(p). n(z + p)) = ,−𝜎2 𝛽p − v if zϵ
Dp(2.11)
0
2
The GRMF model is parameterized by a parameter set of βp, r and σ² which can
be estimated when the model is used to represent a texture image. Therefore, the
parameter set can represent features for the discrimination of the image. Fig. 2.1
shows the structure of a GMRF model of the neighbourhood Dpwith p = 5.
7 6 7
5 4 3 4 5
7 4 2 1 2 4 7
6 3 1 v 1 3 6
7 4 2 1 2 4 7
5 4 3 4 5
7 6 7
Figure 2.1The structure of a GMRF model
The model-based approaches are efficient methods that use for fabric image
because the MRF-based detection approaches requires less computation and also
characterize fabric patterns more firmly in the local texture information. However, in
a real application, because of Model based approaches make calculation based on
pixel neighbourhood, Model based approaches model are poor in discriminating
small local defects, In contrast, the model parameters gives good estimation in large
regions.
From a structural view, fabric patterns are combinations of wefts and warps.
Wefts and warps are weaved in periodical and symmetrical structure blocks and
these blocks create fabric patterns. Geometric approaches use the relationships of the
periodic blocks and corresponding placement rule and generate a structural model of
fabric pattern (M. Tuceryan and A. K. Jain, 1999). All the distortions, on the
2
symmetrical and periodic structural model, are used as features for defect detection.
Defects are easier to find by using these features, so geometric approaches based
features are frequently used in defect detection systems. Fabric inspection systems
use two geometrical approaches based features for defect detection (D. Chetverikov
and A. Hanbury, 2002). Regularity and local orientation (anisotropy), the approaches
which use these features is named as ―StrucDef‖. It determines structural defects as
regions of abruptly falling regularity. In real application, the approach firstly defines
the directional regularity for an angle i as:
R(i)=[Rint(i)Rpos(i)]2 (2.12)
Rint(i) represent intensity regularity and Rpos(i) represent the position regularity.
In order to obtain these two variables, a contrast function F(x) has to be defined,
which is calculated from the normalized autocorrelation of the image in the polar
representation. The contrast function F(x) is then smoothed by using a filter. The
intensity regularity is computed as:
𝐹𝑚i𝑛
Fint = 1- (2.13)
𝐹𝑚𝑎𝑥
Where Fmin and Fmaxshow the limits of F(j), and the following equation, shows
how to get position regularity, parameters x1andx2 are the positions of the two
lowest minima in F ( x) (x1<x2). Sequence of the local maximum values of R (i) are
symbolized as Tlandobtained from equation (2.12), where l (l =1, ... , l 0) is the index
of the maxima sequence, and then is threshold at Tthr= 0.15. Two features can be
calculated from the sequence threshold: the largest value MR and the mean µR (0
≤µR ≤ MR ≤1), which are used to indicate whether a texture is regular or random.
𝑅𝑝𝑜𝑠 = 1 − |1 − 2𝑥1|(2.14)
2
�
defected regions and high regularity represents non-defected regions. pi show feature
vector of a sub-window . A central point pc can be found in the equation:
Where
Beside this, Chen J. and Jain A.K. (Chen J. and Jain A.K., 1988) designed a
different structural approach for detecting defects in textured images. The approach
called as skeleton representation that operates on mapping images into special data
structure. The approaches use location and length histograms of the skeleton, the
statistical measurements for ripple, mean jump and end spell for detect defects.
Geometric approaches are only suitable for detecting fabric defects appearing
in a fabric with a regular macro texture. In addition to this disadvantage, such
approaches can only detect effectively those defects causing disorders in sufficiently
large areas of the texture background. However, geometrical approaches have some
problems to characterize a fabric image with a regular micro texture.
The approaches which discussed above generate features directly from the
gray- level values of an image. The features can provide an easy identification with
simple and fast ways. However, these approaches may not be very efficient for
complex fabric patterns. In this section, the reviews of signal processing methods are
2
revised. These methods include some filtering or transform operations for extracting
features for the discrimination of fabric defects.
This method characterizes the patterns by using the structural extensions. The
obtained features change according to characteristics of the used filters. In contrast to
previously surveyed methods, the advantage of this method is to provide efficient
features in micro weaved fabrics. Fabric patterns are characterized in terms of edge
responses by using various types of spatial filters (T. Randen, 1997). Defected
regions lead to changes on the non-defected fabric pattern. Various types of spatial
filters use these differences and generate dissimilar edge responses that allow
differences between defects and non-defect fabric regions. In addition, defect
responses to edge of defected regions provide features about defected region
coordinates, which is the advantage of their method, so redeem to design an
alternative process to determine the defect region coordinates. The block diagram of
Spatial filtering approach used fabric defect detection is shown in figure 2.2.
Fabric Image
Detection Result
Spatial Filter Calculate Local Thresholding
the exact defect region. Some advanced spatial filtering approaches include several
processes for better defect region segmentation.
The spatial filtering approach has been widely used for fabric defect detection.
However, the designed filter(s) are only efficient for a limited number of defect
classes, due to the different spatial-frequency characteristics of various classes of
2
fabric defects. Moreover, the spatial filtering approach is sensitive to the noise in the
fabric image.
μ = E{x} (2.18)
Then the eigenvectors eiand eigenvalues βiof the covariance matrix C are calculated
which satisfy,
Ozdemir et al. tried to detect the defects on fabric pattern by using K-L transform
(S. Ozdemir, A. Ercil,1996). Eigenvectors designate as transform coefficients.
2
Studied images are processed into pieces. Sum of the largest three eigenvalues are
used for identifying the pieces of images. Fabric patterns vector features has normal
levels but defects region pieces has anomalous levels that a differentiation to
detecting the defects. In addition, new K-L transforms used detection process is
design by Mamic and Bennamoun (G. Mamic and M. Bennamoun, 2000). This
method use also Neyman-Pearson detector with eigenvalues for detecting the defects.
Some disadvantages of this method are reducing the number of studies in textile
industry. K–L transform approach based on optimality property of the fabric texture,
if there is not an optimal difference between defect and non-defect pattern. This
approach faces major challenges.
Fourier transform translate the calculations between time domain and frequency
domain knowledge, as well asit is a very useful method for analysing periodic signals
due to the algorithmic structure of the Fourier transform. Domain and Fourier
transform is a very suitable technique for analysing periodic signals because of
certain desirable properties, including noise immunity and translation invariance (A.
Boggess, F. J. Narcowich, 2001). Fourier transform is a well-known technique that
relates the frequency and time. It characterized the objects as complex valued
functions in two dimensional structures, and all of these processes are performed in
frequency domain. In parallel, a magnitude spectrum is formed, magnitude spectrum
contains information about the Periodicity and directionality of the pattern, also
periodical and directional disturbance can change the peaks in spectrum. These
differences lead to identify the deformity on signal or patterns (C.H. Chan, G.K.H.
Pang, 2000). Periodic structure of fabrics makes Fourier transform suitable for use
during the detection process. Fourier transform will also have a regular, crystalline
structure of isolated peaks (Lois M. Hoffer, Franco Francini, Bruno Tiribilli,
Giuseppe Longobardi, 1996). A defect on the fabric has expanded over a region in
the magnitude spectrum. In the same way, sizes, shapes and spread of defects change
2
Let M and N be the length and width of an image, F (fx, fy) be the Fourier
transform of f(x,y) with fxand fyas the spatial frequencies. The general equation of a
two-dimensional Fourier transform is defined as
1 N−1 N−1
j2 (xm+yn)
F(m, n) = ∑X=1 . ∑y=1 I(x, − N (2.22)
y). e N 2
Ø ( fx , fy Fim(fx,fy)
)=tan−1 Fr(fx,fy) (2.2
In study (I-Shou Tsai, Ming-Chuan Hu, 1996), a fabric defect detection system is
designed by using Fourier transform. Fourier power spectrum of a fabric pattern
created as a feature for detecting process. Warp and weft densities determine the
variables of power spectrum. The features can convey to artificial neural network
process which can identify the defects. This research can determine only missing
end, a missing pick, a broken fabric and an oily fabric defects.
B. and Longobardi G., 1996). The scheme can detect potential defects with a back
propagation network, in which a small subset of pixels from an acquired image is
used as the input. Another survey conducted by Campbell J.G., Fraley C., Murtagh F.
and Raftery A.E. (Campbell J.G., Fraley C., Murtagh F. and Raftery A.E., 1997) that
use Fourier transform and morphological conjunction, Hough transform and model-
based clustering techniques to create features for defining the defects on fabric
pattern.
In 2000, Fourier transform based Fabric defect detection system is designed (C.
H. Chan and G. Pang, 2000). The properties of detection process convert the outputs
of Fourier transform to two central spatial frequency spectrums. The information that
is obtained from these spectrums can assist to determine different types of fabric
defects.
Tsai and Hsieh‗s research use Fourier and Hough transform to detect the defects
on textile fabrics (Tsai D.M. and Hsieh C.Y., 1999). In detecting process, transforms
are separately applied to the fabric pattern. Fourier transform is used for
characterized the pattern and Inverse Fourier transform is used to transform
information from frequency domain to time domain, as well as Hough transform is
used for deleting the line patterns in the image. The features that are obtained from
transform are combined on grid. Also, system determine thresholding levels for
recognize the defects.
J. G. Daugman can recognize the simple cells in the visual cortex and modelled
cells by using Gabor functions. Frequency and orientation representations of Gabor
filters provide a convenience to analyse the textural patterns. In the time domain, a
2D Gabor filter is a Gaussian kernel function modulated by a sinusoidal plane wave.
Gabor filters which are used in applications look in very complex structure, but they
are deriving by the dilation and orientation of main wave.
Complex;
𝘍2+𝗒2𝑦𝘍2
g(x, y; λ, θ, ψ, σ, γ) = 𝑒𝑥𝑝 (− 𝑥 𝑥𝘍 (2.26)
) 𝑒𝑥𝑝 .i (2𝜋 + †)/
2𝜎2 ℎ
Real; 𝘍2+𝗒2𝑦𝘍2
g(x, y; λ, θ, ψ, σ, γ) = 𝑒𝑥𝑝 (− 𝑥
𝑥𝘍 (2.27)
) 𝑐𝑜𝑠 (2𝜋 + †)
2𝜎2 ℎ
Imaginary 𝘍2
+𝗒2𝑦𝘍2
g(x, y; λ, θ, ψ, σ, γ) = 𝑒𝑥𝑝 (− 𝑥
𝑥𝘍 (2.28)
) 𝑠i𝑛 (2𝜋 + †)
2𝜎2 ℎ
Where
𝑦′ = −𝑥 sin 𝜃 + 𝑦 cos
𝜃
3
In this equation, λ denotes the wavelength of the sinusoidal factor, θ show the
orientation of the normal to the parallel stripes of a Gabor function, ψ define the
phase offset, σ is the sigma of the Gaussian envelope and γ specifies the ellipticity
of the support of the Gabor function. This filter often results in characteristically
striped response. Filter selection is based on the frequency and orientation properties
of a Gabor filter which are explicitly expressed in its frequency domain
representation. The Fourier transform of g(x, y) is expressed as
1 (𝑚−𝑚0)2 𝑛2 1 (𝑚+𝑚0)2 𝑛2
−2 ( + 2) −2 ( +𝜎2 )
H(m, n) = 2𝜋𝜎𝑥𝜎𝑦{𝑒 2
�� �� +𝑒 2
�� }
�
(2.30)
Where σm =1/ 2πσxand σn =1/ 2πσy. The selection of Gabor filters for texture
analysis is based on the centre frequencies and the orientation (A.K. Jain and F.
Farrokhnia, 1991) (T. Randen and J.H. Husoy, 1994). Centre frequency can obtained
1 𝑁𝑐√2
as values : , 2√2 ,4√2 , … , and the filter rotations degrees are 0°, 45°, 90°,
√2 4
135°. The orientations degrees guarantee that places which high frequency filter
passes are mirrored on image array.
In research (Beirao C. and Figueiredo M., 1994), two different Gabor filter is used
for Fabric defect detection systems. One is multi-channel and other filter is complex-
valued Gabor filter. After filtering process, a global Gaussian model, a nearest
neighbour method and a local Gaussian model are applied the filter output to extract
more precisely defect region detection.
Gabor filter is a popular a method which is also used in Fabric defect detection
systems. Large sets of Gabor filter gives advantages to characterize all differentiation
in different directions. However, it cause to make hard computations and too much
features will lead to information pollution. Therefore, more efforts are needed to
study the methods of designing Gabor filters for detecting fabric defects
3
Wavelet transform is a method that can characterize and extract features both in
spatial and frequency domain. An important property of wavelet transform is, an
hierarchical framework is generated for analysing the multi-scale and multi-
orientation properties of the image (S. Mallat, 1989). In pattern recognition, multi-
scale algorithms are analysed patterns until even the thinnest details, and then
characterize the features (S. Mallat, 1996). Multi-scales algorithms obtain strong
features by separating the image parts in single scale data. These properties of
wavelet transform increase the use of wavelet transform in pattern recognition.
Patterns have different structures that cause to have different scales and orientations.
Wavelet transform examine and analyse these properties to characterize the textures.
Wavelet transform is effectively used on pattern recognition and they are also used in
Fabric defect detection systems (H. Sari-Sarraf and J. S. Goddard, 1999), (S. Kim,
M. H. Lee and K. B. Woo, 1999). Fabric defects are textural distortions which
disrupt the symmetry and regularity of fabric pattern. So, texture‘s scales and
orientations can locally change depend on the location of defect regions. The
differences lead to build features to detect the fabric defects.
+∞
Wƒ(𝑠, 𝑡) =< ƒ, †s, t >=∫
ƒ(𝑥)†* (𝑥)𝑑𝑥(2.31)
−∞ 𝑠,𝑡
* is a symbol of the complex conjugate. s,t are ∈R, s ≠ 0. {ѱs,t(x)} functions are
calculate by scaling and translating a function ψ(x) ∈L² (R) ,L²(R) shows the vector
space of measurable, square-integrable one dimensional functions:
1
{ѱs,t (x)} = †(𝑥−𝑡) (2.32)
√𝑠 𝑠
The wavelet function ψ(x) should satisfy the following acceptability condition (S.
Mallat, 1999):
3
+∞ |†^(w)|²
𝐶 =∫ 𝑑𝑤 < ∞
†
(2.33)
−∞ |w|
+∞
∫ †(𝑥)𝑑𝑥 = 0 (2.34)
−
In Fabric defect detection system, the wavelet transform is applied to fabric image
by convolving an image with a set of dilated wavelets with spatial orientation
selectivity. The decomposition of the image by using the wavelet transform yields
multi-resolution and multi-orientation representationsof the image (S. Mallat, 1999),
which is appropriate for interpreting the image information.
Most commonly used method that enhance the detection process, is wavelet
transforms. Sari-Sarraf and Goddard (1999) designed a fabric detection system built
by using multi-scales wavelet representations (MSWAR). Daubechies D2 low-pass
and high-pass filters used for facilitate application of transforms(S. Mallat, 1999),
Multi-scales wavelet representations (MSWAR) system use shift invariance
properties and also get full resolution fabric images that is important for analysing
fabric images clearly. In pre-process, images are analysed with wavelet transform,
after that non defected fabric patterns‘ energies are reduced and defects‘ energies are
raised. In detecting process, features can obtained after analysing these
differentiation and features are characterized global homogeneity of the images.
Disrupting the global homogeneity show the defected regions coordinates. Last part
3
of detection process is using thresolding to eliminate the faulty features and detect
the exact place of defects.
Another research based on Mexican hat wavelet filter is designed by Kim et al. (S.
Kim, M. H. Lee and K. B. Woo, 1999). Research is to analyse the fabric patterns in
vertical and horizontal directions and features are stored in one dimensional data
store. Finally, optimal scales are used for reducing the noise effect. Kim et al. also
similar performed studies on adaptive wavelet based approach to extract texture
features for developing defect detection process in 2005. Lambert and Bock preclude
the subsample of wavelet transform for the sake of a shift invariant representation
and full resolution decomposition (G. Lambert and F.Bock, 1997). Tsai and Hsiao
studied on a new research to develop fabric defect detection (D. M. Tsai and B.
Hsiao, 2001). Tsai and Hsiao used wavelet reconstruction to create a reference defect
pattern, and then subtract the reference pattern from original fabric pattern, so the
defects energies are sharped which gives a clue about defects.
Different feature extraction methods also used with wavelet transform for
reinforcing the detection and classification process. In Ref. (Y. A. Karayiannis, R.
Stojanovic, P. Mitropoulos, C. Koulamas, T. Stouraitis, S. Koubias and G.
Papadopoulos, 1999), Karayiannis et al. extracted Gray LevelDifference Method-
based features from sub-bands of the wavelet transform for fabricdefect
classification. Amet, Ertuzun and Ercil use Markov random field and co-occurrence
approaches to obtain more efficient features from the output of wavelet transform
(A.L. Amet, A.Ertuzun, A.Ercil, 2000).As a result of the tests, it shows the feature
extraction used wavelet transform are better than simple wavelet transform.
In this section wavelet transform based fabric defect detection systems examined.
The wavelet transform analyse the fabric pattern better than other methods, so this
approach is less affected from noise, irregular lighting. Also the formed reference
patterns are directly extracted from original image that increase the efficiency of
obtained features.
3
2.5 Summary
In this section, available methods were reviewed and also their advantages or
weak properties were analysed. All the methods are used to obtain features for better
fabric defect detection system. Statistical approaches are examined in two methods.
One is first-order statistical texture and other method is Second-order statistical
texture. First-order statistical texture has more simple structure, so the method
generates the features faster than other methods. But, the method work properly if
there is enough difference between defects and non-defected background‘s gray
levels. So, it is limited efficiency in Fabric defect detection systems. Second-order
statistical texture methods characterize the pattern by using pixel gray-level relation
between its adjacent pixels. As a result of this, these methods take longer time to
make processing. However, method achieves detecting process if the defect regions
must have enough contrast difference than background. Textural model features
work in same logic like second-order statistical texture. Textural model features
obtain the features by using the gray-level relations of fabric textures‘ pixels. So, it
has problems to identify small defect that does not enough change to be recognized.
Furthermore, signal processing-based approaches are reviewed in this chapter.
Spatial filtering approaches are efficient feature extractor. If exhaustive filters are
used, several classes of fabric defects can recognize. But, the disadvantage of this
method is its sensitivity to the noise in the fabric image. Karhunen-Loeve transform
approaches obtain features by using optimal representations. However, researches
did not give the expected results in small defect detection. Fourier transform
approaches generate the features in frequency domain. Although method is widely
used in fabric defect detection systems, it does not detect the defects that has small
region. Gabor transform approaches analyse the fabric patterns better than others,
because it use multi-scale and multi-orientation property to design filters. So, filters
act as a multiple filters that obtain more features about defects. But, the multiple
structure cause to increasing in the number of computations and the size of data
store. Wavelet transform approaches has the same processing principles like Gabor
transform approaches. Wavelet transform approaches only has an advantage that is,
more interfering structure.
3
38
3
Fabrics are produced after passing many processing. Different machines and
techniques are used during processing stages. So, fabrics are exposed to forces and
stresses which cause defects. According to their forms and directions, defects take
different names. The following descriptions summarize the most common fabric
defects, and their reasons (HiteshChoudhary, 2005), (Aasim Ahmed, 2000) and table
3.1 shows the appearance of fabric defects with their types (A. S. Malek, 2012).
3.2.1 Floats
Weft and warp threads can twist during weaving process for forming the fabric
pattern.More twisted parts of the weft threads named as weft curling defects. It is
caused by applying much twisting or less twisting on weft threads.
3.2.3 Slubs
3.2.4 Holes
Oil smeared regions can defined on the fabric patterns. It is caused by much
lubrication of machines or externally taints the oil on fabrics.
3.2.6 Stitching
Fabric regions that are not weave as a desired forms or disorder of fabric. It is
caused by a result of any unwanted movements of weaving machines such as:
shedding, picking, etc.
3.2.7 Knots
Knots regions are connecting togetherends of the yarns. The regions are shown as
4
fluffy parts. The reason of these defects is, the broken or finished yarns are floated
for maintaining the continuity of weaving process.
3.2.9 Snag
Yarns pulled outward from its normal pattern represent the snag type fault.
Defects can occur with sharp objects rubbing the fabric pattern.
3.2.10 Tear
Tear defects has similar structures with hole defects. But tears have irregular
shapes. Cloth rolls can be torn with sharp edges or rigid object that use in
manufacturing processes or damaged gears on machines.
3.2.11 Gouts
3.2.12 Snarls
Weft and warp threads can twist for creating fabric patterns. These defects are
shown as twisted distortions on patterns. It is caused by friction force that is
increased due to high twisting rates of looms.
4
3.2.13 Miss-end
The absences of threads occur in warp direction. Defects can be in short or long
distance. Wrong wrap weaving time in manufacturing processing can miss the
weave the warp threads, so these defects can occur.
3.2.14 Stripes
One or more different defects can occur in a zone at the same direction. It is
caused by scrape or friction between threads and machines‘ combs or improper
reeding.
A yarn or parts of yarn are tighter or slacker than the others in warp direction.
Mistaken tensions are the main reason of Tight/Slack warp thread defects.
Two ends yarns are abreast weaved without weft yarns between them. It is caused
by fault in warp weaving. Weaving machine skip to weaving the weft direction
threats, so two or more ends yarns becomes side by side.
3.2.17 Smash
Many warp threads break down the pattern. It is caused by a wrong timing of
shedding, soft picking, insufficient checking of shuttle in the boxes, severe slough
off, and damaged or broken picking accessories.
3.2.19 Miss-pick
The absences of threads occur in weft direction. Defects can be in short or long
distance. Wrong weft weaving time in manufacturing processes can miss the weave
the weft threads, so these defects can occur.
Two picks yarns are abreast weaved without warp yarns between them. It is
caused by fault in weft weaving. Weaving machine skip to weaving the warp
direction threats, so two or more picks yarns becomes side by side.
3.2.21 Coarse-pick
A weft thread or pieces of weft thread which are coarser than the
otherpieces/threads. The presence of a weft thread causes this defect that has
different count than the other weft threads.
A yarn or parts of yarn are tighter or slacker than the others in weft direction.
Mistaken tensions are the main reason of Tight/Slack weft thread defects.
of defects that are change in size, direction which complicate the detection of defects.
In the same time, the defects are randomly distributed on fabric images,so the defects
exist in the top, bottom, right or left side of the image.
HoleOil stainStitching
4. 1 Introduction
46
4
In this section the theory and background of difference of offset Gaussian filters
can reviewed. Gaussian functions are also examined for better understanding of
DOOG filter, because DOOG filters are based on Gaussian function. DOOG filters
are explored in 1985 by Richard A. YOUNG (Richard A. YOUNG,2001). First at
all,theory and properties of Gaussian functions will be reviewed in section 4.2.1. In
section 4.2.2 Multivariate Gaussian Distributions are introduced which is another
way to design Gaussian function. After that section,background, theory of DOOG
filterwill be examined.
𝑔(𝑥) = 1
𝑒 𝑥²
√2𝜋𝜎² −
2𝜎² (4.1)
Where x is along a directional axis and σ shows the standard deviation of filter,
The Gaussian function in two dimensional coordinates (x, y), x is the horizontal and
y is the vertical axis, is represented as:
𝑔(𝑥, 𝑦) = 𝑥²+𝑦²
1 −(2𝜎² (4.2)
2𝜋𝜎² 𝑒
4
(a) (b)
Figure 4.1 One dimensional Gaussian function at (a), and two dimensional Gaussian
function at fig (b).
Gaussian functions have many properties because of their various physical and
probabilistic structures (Carlo Tomasi, 2000).Only useful properties which help to
design better filters, can be examined. Gaussian function is designed as proper
symmetric structure that seems as cone(Guo, H.,2011).This property reduce the
blurring and also the noise effect can be reduced.
Smoothness is the other useful property of the Gaussian function. The aim of
smoothing is to reduce the noise effect and the sharpness in image. Gaussian
Smoothing operations are applied to image by using convolution. Two dimension
images and Gaussian function are shown as matrixes which have x and y
components. The Gaussian function based filters and image are convolved in
frequency domain. Then the pixel values can be replaced with local averaging
values. So, these averaging operations reduce the level of noise on image. Another
important property is that every pixel must be non-zero. Since each pixel can
contribute calculations, then all pixels have values that are also essential for edge
detector.
Gaussian also has separation property. When the Gaussian function is applied to
image as two independent one dimensional function which means one-dimensional
Gaussian matrices can apply image at horizontal and the other Gaussian matrix
4
applied image at vertical dimensions that provide a convenience for processing and
calculations. A Gaussian function can separate two dimensional functions as,
𝑒𝑥+𝑦 = 𝑒𝑥𝑒𝑦(4.4)
𝑔 (𝑥) = 𝑥²
1 −
2𝜎² (4.5)
√2𝜋𝜎² 𝑒
𝑔(𝑦) = 1
𝑒 𝑦²
√2𝜋𝜎² −
2𝜎² (4.6)
𝑐(𝑥, 𝑦) = ∑𝑛 𝑛
𝑥= ∑𝑦=−𝑛 𝑔(𝑥, 𝑦)i(𝑚 − 𝑥, 𝑛 − 𝑦)(4.7)
Since two dimensional Gaussian functions are separated into two one dimensional
functions, the convolution can also be split in two one dimensional processes that
shown as:
The separated convolution reduces the number of multiplication process. So, more
rapid and exact results can be obtained. The proof is, there are (2n+1) pixels in a row
or column in Gaussian function that shows (2n+1)² multiplication and (2n+1)²-1
summations done in convolution process. However, one dimensional convolution
makes only (2n+1) multiplication and (2n) summations.
5
( ) 1
(2𝜋)𝑁/2|∑|1/2 exp (− 1 (𝑥 − µ)𝑇∑−1(𝑥 − µ))(4.9)
𝑝 𝑥𝑛 2
µ =E(x) (4.10)
The Images is represented in I(x,y) in two dimensional space with two variables.
Therefore, filters should be two dimensional. As a reason of this,multivariate
Gaussian distribution represented by X1 and X2 random variables in matrix X. X1 has
(µ1, σ1) and X2 has (µ2,σ2) parameters also the number of variables determine the
value of N=2, and the paramaters are show as below
X
1
X = [ ](4.13)
X2
µ1
µ = [µ ](4.14)
2
𝜎21 0
∑=[ 2 ](4.15)
0 𝜎2
1
0
𝜎2
∑ −1
=* 1
1 +(4.16)
0
𝜎2
2
5
( ) 1
exp (− 1 (𝑥 − µ)𝑇∑−1(𝑥 − µ))(4.17)
𝑝 𝑥1 , X (2𝜋)2/2|∑|1/2 2
1
0 X1 − µ1
𝑝(X1, X2) = 1
1 exp (− (X1 − µ1 , X2 − µ2) * 𝜎2 +( ))(4.18)
1
(2𝜋)2/2|∑|1/2 1 X2 − µ 2
0 2
2 �
The equation 4.18 shows the representation of create a 2D Gaussian function with
statistical techniques. The advantage of this method is that two parameters are
enough to create the Gaussian functions. In this research, this research‘s Gaussian
functions that use that DOOG filter are also created with this method.
The Difference of offset Gaussian in short DOOG filters first named in Young‘s
research in 1985 and 1986 (Richard A. YOUNG,2001). According to these studies,
DOOG filters are mathematically represented as the discrete form of continuous
Gaussian derivatives (GD).So, DOOG and GD functions are equivalent (Richard A.
YOUNG,2001). The difference between DOOG and GD is that offset parameter
change the shape of DOOG filter and filter becomes an asymmetric structure but
GDsare always presented in symmetric form.Therefore, the DOOG filter becomes
tenderer to process all the differentiations on patterns or shapes (Richard A.
YOUNG,2001), (Wei-Ying Ma,2000).
Before Young R.A. explore DOOG filters, Macleod‘s two researches working on
development of machine vision in seventies use some filter that is similar to DOOG
5
filters. Also similar filters were used for introducing psychophysical data by Macleod
and Rosenfeld (1974), (Richard A. YOUNG,2001). Shortly before DOOG is named,
they were used in cat simple cell receptive field‘s research by Heggelund (Richard A.
YOUNG,2001). After this study, Young used filters to modelled simple cells that are
called as DOOG filters (Richard A. YOUNG,2001). Livingstone (1998) and De
Valois et al. (2000) used wiring modelling technique to model the primate simple
cells. These wiring models designed with developing spatio-temporal receptive field
shapes that the structures are closely matched with a DOOG spatio-temporal model.
The successful modelling outputs of these filters enhance their confidence in
physiological mechanism researches.
All these researches show that the DOOG filters has a success in modelling and
patterns characterizing. Fabric Defect detection systems have a similar logic with
these researches. Defects create some abnormal differentiations on fabric pattern.
Identification of these defects is related with a better pattern characterization.
Previous researches show that DOOG filters are good in texture segmentation.
Fabric, that explained before, are created after a weft threads and wrap threads weave
with a knitting plan. Also the fabric thread structures may be bigger or smaller. It is
harder to perceive the defects If thread texture plan becomes smaller, in parallel also
the defects has small regions that hard to detect without extra process. Therefore,
5
better texture characterization and segmentation must be done for catching all the
textural information .This research use difference of offset Gaussian filter DOOG
filter for texture characterization and segmentation process. Also the algorithmic
simplicity, rapid design and implementation properties are the other reasons to
choose this filter.
DOOG filters are designed by using Gaussian functions. As its name suggests,
theoretical description of DOOG filter is, difference of designed Gaussian functions
with an offset value. Offset value is the distance between two Gaussian kernels(Wei-
Ying Ma, 1998).DOOG filter also explained in a different definition. Young (1985)
explain that the derivative of a Gaussian function is mathematically closely equal to
discrete difference between Gaussian function with vanishingly small offset distance
(Richard A. YOUNG,2001).It can be easily designed because of their simple
structure that is:
Where d is the offset value that shows the distance between two Gaussian
functions. Also the Gaussian derivative functions are represented as
𝑔𝑛 𝑛
(𝑥) = 𝑑 𝑔0 (𝑥)(4.20)
𝑑𝑥 �
g0 shows the Gaussian function that also shown in equation 4.20 and x denotes
the horizontal axis.If we compare the first two steps of derivation of Gaussian and
DOOG filter (Richard A. YOUNG,2001).
𝑔1(𝑥) = −𝑥𝑔0(𝑥)(4.21)
𝑔2(𝑥) = (𝑥2 − 1)𝑔0(𝑥)(4.22)
The important case is that an offset value of DOOG filters offset values d may be
smaller to resemble to Gaussian derivative. The similarities of these two methods are
shown in experimental results that all the three stage DOOG filters can be plotted.
However, the difference between DOOG and DG is that the former is asymmetric
whereas the latter one is a symmetric operator. This property of DOOG, unlike DG,
makes it sensitive to the directions θ and θ+π, as shown in the contour plots in Fig.
4.2 (c) and (d) (P. Ghosh, L. Bertelli, B. Sumengen, B. S. Manjunath, 2010).
(a) (b)
(c) (d)
Fig.4.2. This figure demonstrates the difference between the Difference of offset
Gaussian (DOOG) and the first derivative of Gaussian (DG), (a) The surface plots of
DOOG, (b)(c) and (d) gives the corresponding contour plots, respectively. The offset
(d=4σ) of DOOG is shown by a black arrow in the contour plot (bottom left). It is to be
noted that DOOG is an asymmetric operator unlike DG which is symmetric.
5
Our fabric defect detection System includes two different properties to solve
above described problems. The first one is to use two different DOOG filtersfor
detecting process. Filters are used for increasing the efficiency of detection process.
One filter can cause to lose the detailed information but if two filters to use work
together, it decreases the probability of missing. The second property is to use a
multi parameter blocks in designing process. A block parameter sets entered to the
system so the filters are designed at each parameter. After that, all filters can apply to
fabrics then results can be compared to decide the best filter and features. Also the
two properties examined in detail in this section. The first thing to do in pre-process
is to assign the parameters of filters.
4.4.1. Parameter
There are five parameters to design the filters. Two Standard deviation parameters
in horizontal and vertical direction, size of the filter, orientation and offset value.
This is the most important parameters to design the filters. Standard deviation is a
parameter which set the width of filters. Standard deviation decreases effects of filter
as filters become tighter and increases to expand the effects of filters. Two standard
5
.
Figure 4.3 Flow-chart of proposed FDDS.
5
(a)
(b) (c)
Figure 4.4 (a) DOOG filter with three different σx andσy values; (a), (b), and(c).
Size parameter determines the dimensions of filter grid. Designed filters are
created on these grids. The size is significant because if the grid is not big enough the
5
filters overflow from grid so the significant properties of filter cannot be used. Filters
are in 2D structures as (x,y) so the grid must be also two dimensional. But system
use size parameter that set both of x and y axis length and consist a square grid in
(size, size) dimensions.
4.4.1.3 Orientation, θ
But in studies the orientation values and added to the image as a rotation matrix
cos 𝜃 − sin
𝑅 = *𝜃
+(4.32) sin 𝜃
cos 𝜃
Hence, the new coordinates can be obtained by the equation
𝑥' 𝑥
[ ] = 𝑅 * *𝑦 +(4.33)
𝑦'
6
Filters are created with various parameters by software program. This stage
creates two DOOG filters; one is the DOOG 1 filter and negative DOOG2filter. In first
step multivariate Gaussian distribution is used for creating Gaussian functions
because it require only two parameters to create filters,also it faster than other
methods .The Multivariate Gaussian Distribution obtain the Gaussian function. If
section 4.2.2 is examined it is seen that filter has two dimensional structure with
using X1 andX2 as input variables, µ1, µ2 means, andσ1, σ2 as standard deviations. The
multivariate Gaussian distribution is given as
1
( )
(2𝜋)𝑁/2|∑|1/2 exp (− 1 (𝑥 − µ)𝑇∑−1(𝑥 − µ))(4.35)
𝑝 𝑥𝑛 2
But the filters also have an orientation variable that provides the rotation on grid.
Rotation matrix is symbolized by O. The rotation of X 1 and X2 create dependencies.
Ġf we accept σ2 very small value, and σ1 very huge number, and then X takes close
values to horizontal axis. So the distribution of X which rotate with O matrix is close
to y=x line on coordination system. The relation is shown as y=O.x (David
Jacobs,2005).
−1
(𝑦)
Y=f(x) p(y) = p(x) |𝑑𝑥 | = 𝑝(ƒ −1 (𝑦)) |𝑑ƒ |(4.36)
𝑑𝑦 𝑑𝑦
6
𝑇
(0𝑡𝑦−𝜇) ∑−1(0𝑇𝑦−𝜇)
𝑝(𝑦) = 𝑝(𝑥 (𝑦)) = 21 1 𝑒 − =(4.37)
(2𝜋)2|∑|2 2
1
𝑒 − (𝑦 − 𝑂𝜇)𝑇𝑈∑ 𝑂 (𝑦 − 𝑂𝜇)
−1 𝑇
=
2
(2𝜋) 1. |∑| . 1
2 2 2
𝑇
) ((𝑂𝑇)−1∑𝑂−1)−1(𝑦 − 𝑂𝜇 )
1 𝑒 − (𝑦 − � =
1 𝜇𝑦 2
2 1/2 𝑇 1/2
(2𝜋)2|𝑂| . |∑|2. |𝑂 |
𝑇
(𝑦 − ) (𝑂∑𝑂 )−1(𝑦 − 𝑂𝜇 )
𝑇
1
1𝑒− � =
2 𝑇 𝜇𝑦 2
(2𝜋)2|𝑂∑𝑂 |2
1
𝑒− 𝑇
(𝑦 − ) 𝑦 (𝑦 − 𝑂𝜇𝑦)
−1
2 𝜇𝑦 2
1/2
(2𝜋)2|∑|
Where µ𝑦 = 𝑂µis the expectation of y and ∑𝑦= 𝑂∑𝑂𝑇 is the covariance matrix of
y. Also the offset parameter has to be included. It uses to change the coordinates of
mean. The First Gaussian is always located on centre that has [0,0], the other
Gaussians‘ centre is shifted by the given offset value.
µ𝑜ƒƒ𝑠𝑒𝑡 = 𝐴 𝑥 µ2 (4.38)
𝑇 −1
1 (𝑦−𝜇𝑦) ∑𝑦 (𝑦−0𝜇𝑦)
𝑝(𝑦) = 2 𝑒− (4.39)
(2𝜋)2|∑|1/2 2
6
x * h ⇐⇒ X(f)H(f)(4.40)
∞
𝑥*ℎ=∫
𝑥(𝑟)ℎ(𝑡 − 𝑟) 𝑑𝑟(4.41)
−
(a) (b)
(c)
Figure 4.5 (a) Gaussian function with (0,0) offset value, (b) Gaussian function with offset
value of (1/2. σx) (c) DOOG filter obtained by Gaussian function given in (a) and (b).
6
As might be expected X(f) and H(f ) are the frequency domain representations of
function s(t) and h(t). Images are described in discrete forms(William H. Press,Saul
A. Teukolsky, William T. Vetterling, Brian P. Flannery, 1988).
Equation 4.44 is the convolution obtained for image processing from equation
4.42;
𝑁−1
𝑁−1 𝑁−1
= 1∑[
∑ X[𝑛]𝑒 −i2𝜋𝑘𝑛/𝑁
][ ∑ 𝐻[𝑙]𝑒 −i2𝜋(𝑚−𝑘)𝑙/𝑁
]
1
𝑁 𝑁
𝑘=0 𝑛=0 𝑙=0
𝑁−1 𝑁−1
1
= ∑ X[𝑛] ∑ 𝐻[𝑙]𝑒−i2𝜋𝑚𝑙/𝑁 𝛿[𝑛 − 𝑙]
𝑁
𝑛=0 𝑙=0
1𝑁−1
= ∑[X[𝑛]𝐻[𝑛]]𝑒−i2𝜋𝑚𝑛/𝑁
𝑁
𝑛=0
Discrete convolution is used for different situations but in our research, there are
many fabric images with wide dimensions. So it requires many and long calculations.
However, calculation can be done speedy with Fast Fourier Transform (FFT).
4.4.2.2.1 Fast Fourier Transform (FFT).There are different ways to compute the
Discrete Fourier Transform (DFT), for example simultaneous linear equations or
correlations, etc. (William H. Press,Saul A. Teukolsky, William T. Vetterling, Brian
P. Flannery,1988).Computation of DFT is to slow. Fast Fourier transform is also a
method to compute Discrete Fourier transforms with same result as evaluating in
DFT definition and the fast computation time is the advantage of this method. The
FFT is defined as;
X𝑘 = ∑𝑁−1 𝑥𝑛 𝑒 𝑛
−i2 𝑁 𝑘 = 0, … , 𝑁 − 1(4.45)
𝑛
Let x0,x1,…, xN-1 be complex numbers. For evaluate the speed of FFT. The normal
distribution of DFT requires O.(N2) operation(Matteo Frigo, Steven G.
Johnson,2005).O is shown the maximum bounding value and N is the number of x k
required a sum of N terms. If the same operation done with Fast Fourier Transform,
it use O (N log N) operation is enough.
Fabric Images are two dimensional textures so 2D FFT is applied to convolve the
image with filters. For simplicity instead of convolution; calculations image f(x,y)
and filter s(t,u) are transformed frequency domain, and multiply them and calculate
the inverse FFT to turn into time domain. 2D FFT is same with Discrete Fourier
transformthat is extended in two directions (Steven W. Smith,1997).For the
image f(x,y), its 2D FFT F(u,v) can be found using formula
i𝑥 j𝑦
𝑀 𝑁 −j2𝜋( + )
𝐹(i, j) = ∑𝑎=0 ∑𝑏=0 ƒ(𝑥, 𝑀 𝑁 (4.46)
𝑦)𝑒
i𝑥 j𝑦
𝑀 𝑁 −j2𝜋( + )
𝑆(i, j) = ∑𝑎=0 ∑𝑏=0 𝑠(𝑥, 𝑦 𝑀 𝑁
i𝑥 j𝑦
𝑀 𝑁 −j2𝜋( + )
ƒ(𝑥, 𝑦) = ∑𝑎=0 ∑𝑏=0 𝐹(i, 𝑀 𝑁 (4.47)
j)𝑒
Fabric images and filters and their convolution process are shown in figure 4.5.
(a)
(b)(c)
.
(d)(e)
6
Figure 4.6 Show the convolution processes (a) is the original image(b) and (c) show DOOG
filters(d) Results of convolution for DOOG1 and (e) Result of negative DOOG2.
Further analyse of the filter results are also necessary for segmentation. The aim
of this process is to find the best output energy map. At the end of design and
implementation process, all the filter output is stored for analysing.
Filters are designed to create high energy responses to detect any distortions on
fabric patterns. Filters give high responses for images with aligned direction and
spread value which is similar to the defect size, but gives small responses for the
others. Here further processing is required through a histogram calculation obtained
from filter outputs. Firstly, output energy maps are shifted to the range 0 to 1.
𝑀(𝑥,𝑦)𝑛
𝐶𝑀(𝑥, 𝑦) = (4.49)
� 𝑚𝑎𝑥𝑛
SM and CM denote the shifted maps and compressed maps, respectively, M(x,y)
is the energy map,max and min show the maximum and minimum of maps and the n
shows the number of map. After the data are prepared, system determines the
histograms of fabric‘s energy maps. Histograms show visual impression of the
distribution of data. For example, afabric image is shown with its filtered result and
its histogram.
As shown in the figure, non-defected energy responses are close to the mean of
energies but the defected energy responses disrupt the order and move away from the
mean. This feature allows us to find the defected areas. But, we should separate the
defect and non-defect areas. Therefore, the non-defected fabric patterns are separated
6
(a)
(b) (c)
Figure 4.7. (a) The original image (b) The result of DOOG filter and (c) The energy histogram of
the DOOG filter output for image in (a).
7
The points are the middle values of three sections between maximum and
minimum histogram values. The two lines are draw from 1 to 3 and from 2 to 3 and
new lines generatedas their average. The final lines in each side determine the
bottom of the triangle. The equation 4.50 gives the calculation of the lines. Figure 4.7
shows the obtained triangle for the image given in figure 4.6.
𝑦2−𝑦1
𝑦−𝑦 = (𝑥 − 𝑥 (4.50)
1 𝑥2−𝑥1
Table 4.1 gives the calculation of the triangle for the image given in figure 4.6
Table 4.1 The coordinates of points that use to create an imaginary triangle.
Left points Right points
X1 36 832 101 703
X2 44 2496 83 2535
X3 54 5466 68 5491
Lines
Xline1 (X2-X1) 32 (X2-X1) 107,9072
Xline2 (X3-X1) 32.7682 (X3-X1) 105,8452
Left Line Right Line
32 106
Figure 4.8 Show the lines that create the imaginary triangle.
7
When coordinates of triangle are defined two main features are obtained. These
are; top of the histogram value and the other is the sum of the histogram values
outside of the triangle. Then two tables are generated for each feature starting from
highest to lowest value for all DOOG filter output. Then, a scoring is applied for
each one as to give highest score for the highest value. The histogram taking the
highest score for total of two features is taken as the winner to represent the best
filter for the defect.
Segmentation process is used for identifying the defects. This stage is necessary
since the output of the DOOG filter consist of defects and non-defects patterns. In
addition, the end of defined triangle may not fully separate the defected and non-
defected regions. Therefore, it is required to add a threshold parameter to the end
limits of the triangle to have a better separation. In this way triangle becomes wider,
and it increase the possibility of covering the defected parts. The part in the
histogram out of the triangle end limits corresponds to defected parts. The
experimental work has shown that threshold value of 10 is enough to separate the
defected parts. The defected parts in the output of the DOOG filter is found by
getting the coordinates of the energy levels of the best that is outside of the triangle
of the histogram. All points outside the triangle define the complete defected parts.
The experimental work has shown that the parts which were found as defected
may not correspond to actual defects. The reason for this false detection is the
lighting effects and some fabric irregularities. To reduce these effects the image is
reduced. In our work we used 100x100 new image sizes. This new image is only
applied to the DOOG filter which was chosen previously as the best. Then by
applying the defined thresholding the corresponding defected areas are defined and
7
set to 255 values and set back to original image size. Now, there are two black and
white images to compare. The overlapping white area corresponds to exact defect
regions, figure 4.8. (d).
At this point the defects are divided into two parts as exact defects and probable
defects.
i. Exact Defects
Exact defects are the regions which consist of the intersections of output DOOG
filter for the original and the reduced size image.
At this level, the defects on fabric patterns obtained with their location and their
certainty level. This is the last step of post-processing.
(a)
7
(b) (c)
Figure 4.9(a)Original Image (b) Segmented DOOG filter output for original size, (c) DOOG filter
output for reduced image size.
(d) (e)
Figure 4.9 (Cont)(d) overlap of segmented image of (b)and (c), (e) exact defects in red colour and
probable defects in green colour boundaries.
4.4.4 Classification
Now it is necessary to classify the defects into groupsby using their structural
properties. If the class or type of defect is known it is easy to find solution for the
source of problem and the experts interfere the machine faster. Different methods can
be used to make classification. In this research, the physical properties of the defect
will be used to use for classify defects. The directions, shades and length of defects
have been used as features for classification. Directions of filter shows if the defects
are a weft, warp or surface defects. The horizontal defects named as weft defects and
7
vertical defects are named as warp defects also if the defects expand in both
directions it is named as a surface defect.The dimensions of the defect define
whether the defects move through the whole thread length or just with limited length.
The shades determine the defect is a whole or bulge. The figure 4.9 gives the flow
chart for the classification of defects. The defects with similar characteristic take part
within the same class. In this study the total of 10 classes used.
Components are name of graphical items on components bar. Labels, lists, radio
buttons, pushbuttons are the examples of components. Components use for creating
connection between the user and the related part of programs.Figures are the
background screen of the user interface. All the items placed on these screen.Call-
backs are used to start the implementation of function .When a component becomes
active the call-backs are usedto activate each program that related with activated
component. If a component does not have a call-back, it becomes useless. Therefore,
the components and call-backs have strong relations with each other‘s.GUI that
designed for our FDDS is examined in section 4.5.1.
7
A GUI is added to our research to simplify the usage of the programme. The GUI
control the processes of research program as assign the parameters, start the
processes and take the results .The FDDS‘s Graphical User Interface is shown in
figure 5.2.
As shown in the figure 4.10 designed GUI is separate into 6 parts;process panel,
parameters panel, classification panel, outputs panel, figure and grid .These parts are
described in following subsections.
Processing panel is used to perform image loading, and system execution. The
related buttons are described in following subsections.
As shown in the figure 4.10 designed GUI is separate into 6 parts;process panel,
parameters panel, classification panel, outputs panel, figure and grid .These parts are
described in following subsections.
i. Load Image: Load image button is used to load the selected image to FDD
system.
iv. Post-Processing
Post processing button is to activate related pre-processing functions.
v. Classify Defects
This button performs the classification of the exact defects only.
The parameter panels use to enter the parameter values to define the standard
deviation and size of filter grid. Stan.dev.x.L shows the starting point of σxand
stan.dev.x.H shows the ending point of σxand Scale rate shows the scale factors
which identify the value of σx. Also Stan dev.y.L shows the starting point of σyand
7
Stan dev.y.H shows the ending point of σy and scale rate shows the scale factors
which identify the values of σy. The last parameter size is determining the value of
filter grid
Detected defects are classified according to 10 difference classes and the shown.
Output panel includes check boxes. The panel used to show the system outputs.
Image grid shows the input image and the output image with detected defects.
4.6 Summary
In summary, our goal is to develop a method for the accurate detection and
classification of fabric defects based on the DOOG filter. Therefore some specific
properties added to FDDS to increase the detection. The proposed FDDC method
contains the following three major parts:
ii. Post processing part isto analyse the filter results and find which filter is
the best filter. Then, the histogram threshold is used as information to
7
detect the defected regions. A new reduced image size is used to probable
defects.
i. Parameters
The FDDS need four parameters to design the DOOG filter. The parameters can
be entered manually from user interfaced or the system assigns the parameters
automatically.The parameters are; orientation, size of filter, and standard deviations
on vertical and horizontal axis. The orientation and size of filter can be entered as a
single value. However the 𝜎𝑥 and 𝜎𝑦 are entered as a set of data .In figure 5.1
parameters are set as θ= [30, 60, 90,…, 360],size =30 and the𝜎𝑥 and 𝜎𝑦 are in range
of between 4 to 20 and the scale parameter is 8. The result image is the summation of
all 12 DOOG filter outputs. The images show the energy levels for the corresponding
pixels. As seen each image reflects different energy distributions. However, only one
of them reflects the actual defects in the best way. The purpose of this illustration is
to show that the performance of the system heavily depends on the system parameter
selection.
77
7
(a)
𝜎𝑥 𝜎𝑦 Size Θ Image
4 4 30 30,60,90,…, 360
Figure 5.1(a) Original image (b) the filter results with different standard deviation
parameters.
7
(b)
Figure 5.1(Cont)
In the designed FDDS system parameters are set as θ= [10, 20, 30, ... 360],size
=30, and the standard deviations 𝜎𝑥, 𝜎𝑦=[2,4,6,…,28,30]. The parameters range can
be increased to have better result at the expense of system processing time.
ii. Filtering
The proposed FDDS use two different DOOG filters to analyse the pattern
properties, figure5.2 (b) and (c). DOOG outputs for these functions are given in
figure 5.2(d) and (e). The combined DOOG outputs are given in figure5.2 (f). As
seen two filter points the same defect and as a result the defect is emphasized.
8
(a)
(b) (c)
(d) (e)
Fig 5.2 (a) The original image, (b) and (c) two DOOG filter. (d) and (e) The energy maps.
8
(f)
Fig 5.2 (Cont) (f) The combination of
DOOG filter results.
The combined filter outputs show the energy magnitudes of patterns.The black
shades show the low energy magnitudes, whereas white shades show the high energy
magnitudes.
Following the calculation of DOOG filter outputs for various parameter sets there
are a lot of filters and their results. In this case we must decide which filter is the best
representative of the defects. Histogram analysing as described in section 4.4.3 finds
the best matched filter output. Figure 5.3 shows the selected best filter its output and
the corresponding histogram.
8
(a)
Figure 5.2 (a) An original image. (b) Various DOOG filter with different parameters, their results and the
histograms.
8
(b)
Figure 5.2 (Cont)
iv. Segmentation
After the best filter is obtained corresponding energy texture map is known.But
the texture map does not show the exact information about defects. There are also
some noises that affect the images and also the defect regions which must be
separated from fabric pattern.Thresholding and morphologic applications are usedto
obtain the defected regions. Moreover, a different DOOG filter is applied to the
reduced size image to eliminate the noise parts from patterns. Then the defected
areas in both of the images are compared to emphasize the actual defect. The figure
5.3 to 5.8 (a) shows the original image and figure 5.3-5.8 (b) shows the defects. The
red colour gives the exact defect and green colour shows the possible defect to be
further analysed.
v. Classification
(a) (b)
Figure.5.3 Show the segmentation process (a) is the original image and (b) defect detected
image that show exact and probable defects.
8
(a)
(b)
Figure.5.4 Show the segmentation process (a) is the original image and (b) defect detected
image that show exact and probable defects.
8
(a)
(b)
Figure.5.5 Show the segmentation process (a) is the original image and (b) defect
detected image that show exact defects.
8
(a)
(b)
Figure.5.6 Show the segmentation process (a) is the original image and (b) defect detected
image that show exact and probable defects.
8
(a)
(
b
)
9
(a)
(
b
)
91
In this study,a fabric defect detection system based on DOOG filters has been
obtained proposed. In experimental work 32 different images with various types of
defects were used. Some of the images are obtained from interned and some from
real defected sample pattern. The designed FDDS is applied to all images and defects
of out of these sample images have been recognized correctly. All the images with
different defects were fully satisfied. In this image all defects were correctly
detected, and no one was missed. This defect was also very thin and small size. In
general it can be said the proposed FDDS is very successful to identify defects.