Simulation and recognition of common fabric defects

Simulation and recognition of common fabric defects Maroš Tunák, Aleš Linka Abstract: This contribution deals with a procedure of recognition of defec...
Author: Merryl Davidson
5 downloads 0 Views 4MB Size
Simulation and recognition of common fabric defects Maroš Tunák, Aleš Linka Abstract: This contribution deals with a procedure of recognition of defects occurred in woven fabric. Fabric as a directional texture is characterised with high-energy frequency components, which are distributed along the straight lines in the Fourier domain image. A set of seven features based on the first-most significant frequency can be extracted from these images. The correlation between the features corresponding to window with no defective structure and features obtained from sliding window is computed. If the value is smaller then the set value the window is considered as the window contains defect.

1. Introduction Woven fabric is normally composed of two sets of mutually perpendicular and interlaced yarns. The weave pattern or basic unit of the weave is periodically repeated throughout the whole fabric area with the exception of the edges. The Fourier theorem says that any periodic function can be described as a sum of sines and cosines of different frequencies and amplitudes. Considering the periodic nature of woven fabric it is possible to monitor and describe the relationship between the regular structure of woven fabric in the spatial domain and its Fourier spectrum in the frequency domain. Presence of defect over the periodical structure of woven fabric causes changes in its Fourier spectrum. In this contribution we especially focus on recognition of common defects associated with change of weaving density or defects that appear as a thick place distributed along the width or high of an image. In this paper we will first describe algorithm for simulation of common fabric defects in plain weave, then we will test algorithm for recognition of simulated defects and finally we will show a few examples of recognition on real samples.

2. Simulation of a plain weave Convolution of an elementary unit and a pattern of repetition in the spatial domain were used for a plain weave simulation. Let h(x,y), g(x,y) and b(m,n) be the input image, output image and convolution mask, respectively, and convolution is denoted by ⊗ . At each point (x,y), the response of the mask at that point is the sum of products of the filter coefficients and the corresponding neighbourhood pixels in the area spanned by the mask [1], [2], [3]: x

y

g ( x, y ) = b( x, y ) ⊗ h( x, y ) = ∑∑ b(m, n)h( x − m, y − n).

(1)

m =0 n =0

Figure 1(a) displays image of yarn interlacing point. The yarns are represented by white, space among them by black. On the basis of input parameters can be generated warp and weft interlacing point, where pwa, pwe represent warp and weft spacing, and dwa, dwe define warp and weft diameter in pixels. Figures 1(b),(c) display warp and weft interlacing point, resp., with regard to parameter sp.

(a)

(b)

(c)

Fig. 1 (a) Yarn interlacing point, (b) weft interlacing point, (c) warp interlacing point. Woven fabric is composed of two sets of mutually perpendicular and interlaced yarns. The pattern or basic unit of the weave is periodically repeated throughout the whole fabric area with the exception of the edges. The simulated output image of a periodic structure in a plain weave g(x,y) can be simulated as a convolution of an elementary unit (pattern repeat) b(m,n) by a input image of pattern of repetition h(x,y). The result of convolution theorem can be seen in Fig. 2(c), which represents grey level image of plain weave in a spatial domain, the size of image is 200 x 200 pixels. Warp and weft

yarn diameter was set to 12 pixels, warp yarn spacing to 16 pixels, weft yarn spacing to 20 pixels and parameter sp to 1 pixel.



(a)

=

(b)

(c)

Fig. 2 (a) Convolution mask, elementary unit, (b) pattern of repetition, (c) simulated image of a plain weave with parameters in pixels, n = 200, pwa = 16, pwe=20, dwa = dwe= 12 a sp=1.

3. Simulation of common woven fabric defects According to [4] the woven fabric defects can be organized into three basic categories. The weft direction defects, the warp direction defects and defects with no directional dependence. Some of them in the weft direction are: irregular weft density, double pick, broken pick, weft yarn defect, and float; defects in the warp direction are: broken end, double end and warp yarn defect. Defects with no directional dependence involve defects: stain, hole and foreign body. Defected images were modelled by using algebraic operations on simulated images of plain weave structure, in some cases with removing some rows or columns. Position, size and shape of defects were randomly generated from uniform distribution. The algorithm and graphical user interface in MATLAB software language was created for realization. A few examples of simulated common fabric defects in a plain weave can be seen in Figure 3 (b) – (l), Fig. 3 (a) display structure without defect.

(a)

(b)

(c)

(d)

(e)

(f)

(g)

(h)

(i)

(j)

(k)

(l)

Fig. 3 Simulated defects in a plain weave. (a) Structure without defect, (b) hole, (c) stain, (d) float, (e),(f) weft and warp yarn defect, (g),(h) double pick, double end, (i) irregular weft density (insufficient), (j) irregular weft density (excessive), (k) broken pick, (l) broken end.

4. Algorithm for defect recognition The Fourier spectrum is useful to describe periodic patterns in grey level images. Information about major structural direction lines in the spatial domain is concentrated in the Fourier domain image as a direction of high-energy peaks. Detecting corresponding highenergy frequency components in Fourier domain image and setting them to zero remove one set of yarns in spatial domain image. Finally, inverse Fourier transforms (FT), back-transformed data to the spatial domain image. Only one set of yarns information remains in the restored image. The structural lines in the spatial domain image and its transformations are mutually perpendicular. A change or presence of a defect in the weft or warp direction in the woven fabric image causes changes of corresponding high-energy frequency components in Fourier domain image. The discrete 2DFT and its inverse is given [1]:

F (u , v ) =

M −1 N −1

∑ ∑ f ( x, y )e

− j 2π ( ux / M + vy / N )

(2)

,

x =0 y =0

f ( x, y ) =

1 MN

M −1 N −1

∑∑ F (u, v)e

j 2π ( ux / M + vy / N )

,

(3)

u =0 v =0

Information about the set of weft yarns appears in the vertical direction (fy) in the Fourier spectrum and warp set of yarns appears in the horizontal direction (fx). Two diagrams along the fx and fy direction (|F(fx,0)| and |F(0,fy)|) were extracted from the Fourier frequency spectrum. A set of seven features based on the first-most significant frequency can be extracted from these diagrams, for more information see [3], [6]:

v1 =| F (0,0) |, v 2 =| F ( f x1 ,0) |, v3 = f x1 , v 4 =

f x1

∑| F( f

xi

,0) |,

f xi = 0

(4)

f y1

v5 =| F (0, f y1 ) |, v6 = f y1 , v7 =

∑ | F (0, f

yi

) |.

f yi = 0

where v1 represents average light intensity. Features v3=fx1 and v6=fy1 correspond to the first most significant harmonic frequency in

the fx and fy direction and can be used for weaving density evaluation [7]. Features v2, v3 and v4 are for detecting changes in the warp set of yarns, whereas v5, v6, v7 monitor the weft set of yarns. The features v4 and v7 analyse the region between the central peak and first peak. Figure 4(a) shows example of a simulated structure in a plain weave contains weft yarn defect, Fig. 4(d) display Fourier frequency spectrum as an intensity image scaled to 256 grey levels. Two diagrams along the fx and fy direction (|F(fx,0)| and |F(0,fy)|) extracted from the Fourier frequency spectrum can be seen in Fig. 4(b),(e) (the other components in frequency spectrum were setting to zero). Figures 4(c),(f) represent restored images after inverse Fourier transform. As can be seen from restored image in spatial domain in Figure 4(c) central frequency spectrum in fx direction contains sufficient information about the warp set of yarn, whereas frequency spectrum in fy direction about the weft set of yarns and about the defect, imperfection too.

(a)

(b)

(c)

(d)

(e)

(f)

Fig. 4 (a) Simulated structure with weft yarn defect, (d) Fourier frequency spectrum, (b),(e) F(fx,0)|, |F(0,fy)|, (c),(f) restored images after IFT.

5. Defect recognition in simulated structures On the base of relations (4) we evaluated a set of seven features for images of structure without defect. We observed correlation coefficient between the features of two randomly placed windows of size 50 x 50 pixels. Correlation between them did not fall under the value 0.996. Then we evaluated correlation coefficient between the features obtained from window without defect and sliding window moved over the whole image. If the correlation coefficient was smaller then the set value the window was considered as the window contains defect. Size of images was set to 501 x 501 pixels; Gaussian noise of mean 0 and variance 0.0025 was added to images. Sliding window of size 50 x 50 pixels was moved by the step of size 25 pixels. Windows with detected defect or imperfection remained in image and were displayed with white colour. Correlation coefficient was setting to 0.975. Total time of detection with the visualisation was about 1 minute, about 10 seconds without visualisation (for these parameters detection involve inspection of 361 windows). Figures 5 (a) – (l) display result of applied algorithm to simulated images of defects from Fig. 3(b) – (l). As we can see from figures, process is suitable for simulated images of contrast defects.

(a)

(b)

(c)

(d)

(e)

(f)

(g)

(h)

(i)

(j)

(k)

(l)

Fig. 5 Result of the applied algorithm on simulated samples, where white window indicate defect, imperfection.

6. Examples of defect recognition in real structures The samples of a real fabric’s defects in a plain and twill weave were captured by flat scanner with resolution 400 dpi in 256 grey levels and stored in an image matrix of size 501 x 501 pixels. Equalization was used for contrast enhancement. Figures 6 (a) – (g) show a few examples of recognition of defects in real structures. By reason of different structures (weave, density) every structure is sensitive to different value of correlation coefficient. Examples 6 (a) - (c) represent real defects hole, stain and foreign body, size of sliding window was setting to 50 x 50 pixels and correlation coefficient to value 0.7. The size of sliding window 100 x 100 pixels was setting for another examples. The correlation coefficient was 0.7 for examples (e),(f) and 0.85 for defect irregular weft density (insufficient).

(a)

(b)

(c)

(e)

(f)

(g)

Fig. 6. Result of the applied algorithm on real samples, where white window indicate defect, imperfection.

7. Conclusion Recognition algorithm based on features extracted from Fourier frequency spectrum is useful for simulated samples of common woven fabric defects. By using this method we can detect defects associated with change of weaving density or defects that appear as a thick place distributed along the width or height of an image and for no directional defects too. Algorithm is also suitable for real samples, but different parameters of recognition (size of sliding window, correlation coefficient) were used according to different structures of fabrics. The advantages of automated visual inspection are objectivity and independence on the human inspectors. This method is relatively fast and it could be used as online visual inspection of quality. 8. Future work It will be reasonable to devise an optimised method, which define appropriate parameters for given certain structure (size of window,

value of correlation). It means that the algorithm will detect the parameters on the training data set and then these parameters will be used for defect detection in real fabric structure. Other approaches (i.e. statistical, structural) can be tested as well.

References [1] Gonzales R. C., Woods R. E.: Digital Image Processing. 2nd edition, Prentice-Hall, 2002. [2] Escofet, J., Millán, M. S. Ralló, M.: Modeling of woven fabric structures based on Fourier image analysis. Applied Optics, Vol. 40, No. 34, December 2001. [3] Chan Chi-ho., Pang G. K. H.: Fabric Defect Detection by Fourier Analysis. IEEE Trans. on Industry Applications, Vol. 36, No. 5, September/October 2000. [4] Catalogue of types of fabric defects in grey goods. 3rd edition, ITS Publishing, Switzerland, 1996. [5] Tsai, D.-M., Huang, T.-Y.: Automated Surface Inspection For Directional Textures. Image and Vision Computing, 18, 49 – 62. 1999. [6] Tunák, M., Linka, A.: Fourier Analysis of Woven Composite Structures. ICCE 12 Proceeding. Tenerife, 2005. [7] Tunák M., Linka A.: Applying spectral analysis to automatic inspection of weaving density. STRUTEX, Liberec, 2004.

Author´s address: Doc. RNDr. Aleš Linka, CSc. Technical University in Liberec, Department of Textile Materials; Hálkova 6, Liberec 46117, Czech Republic, e-mail: [email protected] Ing. Maroš Tunák, Technical University in Liberec, Department of Textile Materials; Hálkova 6, Liberec 46117, Czech Republic, e-mail: [email protected]

Acknowledgement: This work was supported by the project MSMT CR No. 1M06047.

Suggest Documents