Ph.D Abdel Salam

Abdel Malek

Salam

Online

Dr Bigue Laurent

The purpose of this thesis is to automate the online detection of weaving defects by a computerized system based on image processing software. Obviously, fabric inspection has an importance to prevent the risk of delivering inferior quality product. Until recently, the visual defect detection is still under taken offline and manually by humans with many drawbacks such as tiredness, boredom and, inattentiveness. Usually, after the produced fabric is doffed from the weaving machines, it is batched into large rolls and sent to the inspection department. A skilled stuff rolls the fabric at high speed on the inspection machine under sufficient light to identify all defects. Besides the mentioned drawbacks, the lag time exists between defect creation and detection causes more second choice fabric.

Fortunately, the continuous development in computer technology introduces the online automated fabric inspection as an effective alternative.

The described method in this thesis represents an effective and accurate approach to automatic defect detection. It is capable of identifying all defects. Because the defect-free fabric has a periodic regular structure, the occurrence of a defect in the fabric breaks the regular structure. Therefore, the fabric defects can be detected by monitoring fabric structure. In our work, Fast Fourier Transform and Cross-correlation techniques, i.e. linear operations, are first implemented to examine the structure regularity features of the fabric image in the frequency domain. To improve the efficiency of the technique and overcome the problem of detection errors, further thresholding operation is implemented using a level selection filter. Through this filter, the technique is able to detect only the actual or real defects and highlight their exact dimensions.

A software package such as Matlab or Scilab is used for this procedure. It is implemented firstly on a simulated plain fabric to determine the most important parameters during the process of defect detection and then to optimize each of them even considering

Dedication Dedication Dedication Dedication

To the Egyptian martyrs of freedom, who sacrificed their lives for their brothers to feel the pure pride and dignity and to move mountains thought the whole world for many centuries it' s not moving Table (2 In the manufacturing process, if the cost and just-in-time delivery represent the two lines of the right angle, the quality should be the hypotenuse that completes the right triangle of the process. It means that the quality is the most important parameter despite the increase in one or both of the other parameters (geometrical fact). Scientifically, a process quality control means conducting observations, tests and inspections and thereby making decisions which improve its performance. Because no production or manufacturing process is 100% defect-free (this applies particularly where natural materials, as textile ones, are processed), the success of a weaving mill is significantly highlighted by its success in reducing fabric defects.

List of Tables

List of Figures

For a weaving plant, in these harsh economic times, first quality fabric plays the main role to insure survival in a competitive marketplace. This puts sophisticated stress on the weaving industry to work towards a low cost first quality product as well as just-in-time delivery. First quality fabric is totally free of major defects and virtually free of minor structural or surface defects. Second quality fabric is fabric that may contain a few major defects and/or several minor structural or surface defects [1]. The non-detected fabric defects are responsible for at least 50% of the second quality in the garment industry (this figure is the result of many years of practical experience), which represents a loss in revenue for the manufacturers since the product will sell for only 45%-65% the price of first quality product, while using the same amount of production resources.

Although quality levels have been greatly improved with the continuous improvement of materials and technologies, most weavers still find it necessary to perform 100% inspection because customer expectations have also increased and the risk of delivering inferior quality fabrics without inspection is not acceptable. The key issue, therefore, is how and under what conditions fabric inspection will lead to quality improvement. To address this issue, we have to differentiate between online and offline inspection systems. Online system provides figures from current production, and is located directly on or in the production line while, offline system is located after the production line. Until recently, the fabric inspection is still undertaken offline and manually by skilled staff with a maximum accuracy of only 60%-75%.

The modern weaving Industry faces a lot of difficult challenges to create a high productivity as well as high-quality-manufacturing environment. Because production speeds are faster than ever and because of the increase in roll sizes, manufacturers must be able to identify defects, locate their sources, and make the necessary corrections in less time so as to reduce the amount of second quality fabric. This in turn places a greater strain on the inspection departments of the manufacturers. Due to factors such as tiredness, boredom and, inattentiveness, the staff performance is often unreliable. The inspector can hardly determine the level of faults that is acceptable, but comparing such a level between several inspectors is almost impossible. Therefore, the best possibility of objective and consistent evaluation is through the application of an automatic inspection system.

From the early beginning, the human dream is to improve the manufacturing techniques to achieve optimum potential benefits as quality, cost, comfort, accuracy, precision and speed. To imitate the wide variety of human functions, technology was the magic stick that advanced humanity from manual to mechanical and then from mechanical to automatic. The rare existence of automated fabric inspection may be attributed to the methodologies, which are often unable to cope with a wide variety of fabrics and defects, yet a continued reduction in processor and memory costs would suggest that automated fabric inspection has potential as a cost effective alternative. The wider application of automated fabric inspection would seem to offer a number of potential advantages, including improved safety, reduced labour costs, the elimination of human error and/or subjective judgement, and the creation of timely statistical product data. Therefore, automated visual inspection is gaining increasing importance in weaving industry. An automated inspection system usually consists of a computer-based vision system.

Because they are computer-based, these systems do not suffer the drawbacks of human visual inspection. Automated systems are able to inspect fabric in a continuous manner without pause. Most of these automated systems are offline or off-loom systems. Should any defects be found that are mechanical in nature (i.e., missing ends or oil spots), the lag time that exists between actual production and inspection translates into more defective fabric produced on the machine that is causing these defects. Therefore, to be more efficient, inspection systems must be implemented online or on-loom.

The application of digital image-processing is useful in textile manufacturing and inspection. In last two decades, it has proven to be the most promising, rapid and reliable solution for the future development of an online automatic fabric defect detection.

Considerable efforts have been done to develop and/or improve the task of online automatic fabric defect detection. This task, generally, differs from many other industrial inspection tasks in that the product is usually in web form. It also requires very highresolution imaging to enable defects as small as a single missed thread, a fine hole or stain to be detected. Plain fabric Inspection still presents a considerable challenge, on account of the variable nature of the weave. As all fabrics consist of a main unit known as fabric repeat (a set of threads appears frequently along both of warp and weft directions), therefore frequency analysis based (Fourier transform) methods present a possible way to characterise the weave.

The described method in this thesis represents an effective and accurate approach to automatic defect detection. It is capable of identifying all defects. Because the defect-free fabric has a periodic regular structure, the occurrence of a defect in the fabric breaks the regular structure. Therefore, the fabric defects can be detected by monitoring fabric structure. Fourier Transform gives the possibility to monitor and describe the relationship between the regular structure of the fabric in the spatial domain and its Fourier spectrum in the frequency domain. Presence of a defect over the periodical structure of woven fabric causes changes in its Fourier spectrum. By comparing the power spectrum of an image containing a defect with that of a defect-free image, changes in the normalized intensity between one spectrum and the other means the presence of a defect.

The fabric defect could be simply defined as a change in or on the fabric construction. Only the weaving process may create a huge number of defects named as weaving defects. Most of these defects appear in the longitudinal direction of the fabric (the warp direction) or in the width-wise direction (the weft direction). The yarn represents the most important reason of these defects, where presence or absence of the yarn causes some defects such as miss-ends or picks, end outs, and broken end or picks.

Other defects are due to yarn defects such as slubs, contaminations or waste, becoming trapped in the fabric structure during weaving process. Additional defects are mostly machine related, and appear as structural failures (tears or holes) or machine residue (oil spots or dirt). Because of the wide variety of defects as mentioned previously, it will be gainful to apply the study on the most major fabric defects. The chosen major defects are: hole, oil stain, float, coarse-end, coarse-pick, double-end, double-pick, irregular weft density, broken end, and broken pick.

A software package written for Scilab or Matlab is used for this procedure. It is implemented firstly on a simulated plain fabric, containing the same major defects mentioned previously, to understand the behaviour of the frequency spectrum, determine and optimize the most important detection parameters. To verify the success of the technique, it is implemented on real plain fabric samples containing various defects such as stains, floats, holes, coarse threads, miss-threads, and irregular density.

As the technique is fast and corresponds to the speed of the weaving machine, it could be used for online fabric defect detection. A prototype has been developed to examine the technique in real-time (during the production of the fabric on the weaving machine) that is the main object of this thesis.

Chapter 2:

Review of Literature 2.

Issues related to fabric quality

We cannot imagine a world without textiles. Their primary function is to clothe, protect, embellish and insulate the human body. In textile industry, quality is a topical issue. Therefore, all companies promote quality as the central customer value and consider it to be a critical success factor for achieving competitiveness [START_REF] Brad | Studies and researches for the implementation of quality assurance systems in the textile industry[END_REF]3]. To do that, the modern weaving industry deploys high-speed looms, as shown in figure (2.1), to produce the highest quality fabrics in the shortest amount of time possible. In addition, quality assurance systems have been developed in the aim of providing the client with a high level of trust in the producer's capacity to maintain permanently the product specifications according to standards and original technical design [4,5]. First quality fabric is totally free of major defects and virtually free of minor structural or surface defects. While, second quality fabric may contain a few major defects and/or several minor structural or surface defects [1]. The justification for fabric defects could be ascribed to the fact that no production or manufacturing process is 100% defect-free which applies particularly where natural materials, as textile ones, are processed [6]. Moreover, it is very difficult to perform 100% first quality products while in weaving process; it is an impossible task (in spite of using modern weaving technology). Thus, the utmost priority of all weaving mills is to reduce the presence of weaving defects in the final product at early stages of the production process to insure an optimized economical viability [4,[START_REF] Schneiderman | Optimum Quality Costs and Zero Defects: Are They Contradictory Concepts, Quality Progress[END_REF]. For manufacturers, some false positives (rejecting good products) are more forgivable than false negative (missing defective products) [START_REF] Sylla | Experimental investigation of human and machine-vision arrangements in inspection tasks[END_REF][START_REF] Xie | A Review of Recent Advances in Surface Defect Detection using Texture analysis Techniques[END_REF].

There are several reported works [1,[START_REF] Behera | Automatic fabric inspection systems[END_REF][START_REF] Dorrity | Real-time fabric defect detection and control in weaving processes[END_REF][START_REF] Dorrity | Real-time fabric defect detection and control in weaving processes[END_REF][START_REF] Kumar | Computer vision-based fabric defect detection: a survey[END_REF][START_REF] Mahajan | A review of automatic fabric defect detection techniques[END_REF][START_REF] Mitropoulos | A real-time vision system for defect detection and neural classification of web textile fabric[END_REF][START_REF] Sengottuvelan | Automatic Fault Analysis of Textile Fabric Using lmaging Systems[END_REF][START_REF] Su | Grey Relational Analysis of an Automatic Identifying System for Clothing Texture[END_REF] discuss the influence of fabric defects on textile industry. Most of these works discussed the effect from commercial aspects. Beside a considerable extra cost due to defect detection process, it is found that, defects are responsible for nearly 85% of the defects found in the garment industry which represents a loss in revenue for manufacturers since the second quality product will sell for only 45%-65% the price of first quality fabric.

It is, however, worthwhile to recall that fabric defects are loosely separated into two types [START_REF] Mahajan | A review of automatic fabric defect detection techniques[END_REF]; one is global deviation of colour (shade). The other is local textural irregularities which is the main concern for our study. The process at which these defects are detected is called fabric inspection.

Fabric inspection

Product inspection is an important aspect in modern manufacturing industries such as in case of electronics, automotive and medical industries. This process is a preventive one that could be broadly defined as the process of determining if a product deviates from a given set of specifications [START_REF] Newman | A Survey of Automated Visual Inspection[END_REF]. Mainly, fabric defect detection has two distinct possibilities [START_REF] Kumar | Computer vision-based fabric defect detection: a survey[END_REF]. The first one is the product or end (offline) inspection in which the manufactured fabric has to be inspected through fabric inspection machines [START_REF] Anagnostopoulos | High performance computing algorithms for textile quality control[END_REF][START_REF] Anagnostopoulos | A Computer Vision Approach for Textile Quality Control[END_REF]. The second possibility is the process inspection (online) in which the weaving process (or its parameters) can be constantly monitored for the occurrence of defects. Our survey focuses on both methods to explain the procedure, the advantages, and the drawbacks as well of each one.

Visual (Traditional) fabric inspection

Fabric like many intermediate products is available in a web form (continuous rolls) where a typical fabric web is 1.5-2 meter wide. In addition, defects to be detected by inspection are numerous and present complex appearance [4]. Consequently, industrial web inspection [START_REF] Kumar | Defect detection in textured materials using optimized filters[END_REF] has extremely high requirements and is most challenging as compared to other inspection problems. As it is a textured web, the concept of fabric inspection consists of grading the materials based on their overall texture characteristics such as material isotropy, homogeneity and coarseness [START_REF] Kumar | Computer vision-based fabric defect detection: a survey[END_REF] or the severity of its defects [START_REF] Mahajan | A review of automatic fabric defect detection techniques[END_REF][START_REF] Behera | Image-processing in Textiles, A critical appreciation of recent developments[END_REF].

Traditionally, this procedure must performed by well-trained (expert) human inspectors [START_REF] Sengottuvelan | Automatic Fault Analysis of Textile Fabric Using lmaging Systems[END_REF][START_REF] Paladini | An expert system approach to quality control[END_REF][START_REF] Nishimatsu | Difference of Eye-Movements between Experts and Non-Experts in Fabric Inspection[END_REF]. The existing methods of fabric inspection vary from mill to mill [START_REF] Behera | Image-processing in Textiles, A critical appreciation of recent developments[END_REF][START_REF] Baykut | Comparative Evaluation of Texture Analysis Algorithms for Defect Inspection of Textile Products[END_REF]. In few mills, trained labours pull the fabric over a table by hand. As shown in figure

(2.2), most mills have power driven inspection machines where the manufactured fabric rolls are removed from the weaving machines and unrolled on an inspection table (under adequate light) at a relatively higher speed of 8-20 meters per minute [START_REF] Kumar | Computer vision-based fabric defect detection: a survey[END_REF][START_REF] Sengottuvelan | Automatic Fault Analysis of Textile Fabric Using lmaging Systems[END_REF][START_REF] Baykut | Comparative Evaluation of Texture Analysis Algorithms for Defect Inspection of Textile Products[END_REF][START_REF] Baykut | Real-time defect inspection of textured surfaces[END_REF][START_REF] Kumar | Defect detection in textured materials using Gabor filters[END_REF][START_REF] Őzdemir | Markov random fields and Karhunen-Loève transforms for defect inspection of textile products[END_REF]. When the inspector notices a defect on the moving fabric, he stops the machine, records the defect and its location, and starts the motor again. For each inspected fabric roll, the number of defects per meter length is calculated and the fabric is classified. The early detection of repetitive defects and extraordinary defect rate is left to the operators or so called (roving inspectors) [START_REF] Dorrity | Real-time fabric defect detection and control in weaving processes[END_REF][START_REF] Dorrity | Real-time fabric defect detection and control in weaving processes[END_REF][START_REF] Kumar | Computer vision-based fabric defect detection: a survey[END_REF][START_REF] Baykut | Comparative Evaluation of Texture Analysis Algorithms for Defect Inspection of Textile Products[END_REF]. During the control, if the operator notices an extraordinary defect rate or repeating defects, these roving inspectors warns the production department so that appropriate measures can be taken to decrease the defect rate. Bowling et al. [START_REF] Bowling | An Empirical Study on the Effect of Arrangement on Performance of Two Inspectors[END_REF] proposed the use of two inspectors on the same machine when inspecting the fabric as another procedure to decrease this rate.

Drawbacks of visual fabric inspection

Typically, the inspection process relies strictly on the human eye and is done after the fabric formation process. According to the poet Alexander Pope "to err is human; to forgive divine". This may be the slogan in the morale sphere, but, modern manufacturing is unforgiving of error. A key fact: that even with the best-designed man-machine interface, the probability of human error cannot in practice be reduced to zero [START_REF] Sylla | Signal detection for human error correction in quality control[END_REF]. In addition, the visual inspection has worked well for many years in part because the amount of data has been small and manageable [START_REF] Anstey | Discovering novelty in time series data[END_REF]. Lastly, with the modern weaving machines, the production speeds and consequently productivity are faster than ever. The experiments show that the error rate begins to rise rapidly as information output approaches about 8 bits/s [START_REF] Sylla | Signal detection for human error correction in quality control[END_REF][START_REF] Ayres | Manufacturing and Human Labour as Information Processes[END_REF]. Therefore, the traditional visual inspection method has no ability to cope with today requirements.

Although humans can do the job better than machines [START_REF] Anagnostopoulos | A Computer Vision Approach for Textile Quality Control[END_REF] in many cases, the visual inspection suffers from many drawbacks. It is found that, each surveyed article contains only some of them. Because these drawbacks represent the main arguments for the advent of another robust inspection method, they can be gathered, summarize and discriminated as follows:

1. Human experts are difficult to find or maintain in an industry. 2. Human requires training and their skills take time to develop. 3. In some cases visual inspection tends to be tedious or difficult, even for the besttrained experts. 4. Human is slower than the machines which means that inspection is a time consuming task. 5. Human inspectors fatigue over time (get tired quickly). Therefore, visual fabric inspection is extremely tiring task, and, after a while, the sight cannot be focused (the maximum period of concentration is 20-30 min). However, the operator inevitably misses small defects and sometimes even large ones with the number of meters of the inspected fabric. 6. Human inspectors have to deal with an extensive variety of defects (there are almost 50 different kinds of flaws) either due to mechanical malfunction of the loom, or due to low-quality fibers and spreads.

7. Human inspectors make mistakes because inspection is unreliable when the fabric of 1.6-2 meters width is unfolded at a speed of 20 m/min. It is difficult for humans to keep up with these hard conditions. Because their efficiency is based on experience and even in a well-run operation, the reproducibility of a visual inspection will rarely be over 50% while the maximum detection efficiency is about 70%-80%. 8. The inspector can hardly determine the level of faults that is acceptable, while comparing such a level between several inspectors is almost impossible. 9. It is a subjective method that difficult to reproduce result. 10. The grading process is slow and varies from mill to mill. 11. Usually, there is an absence of feedback to support processes for corrective measures. 12. The low quality control speed when compared to the production speed offers a major bottleneck in the high-speed production lines. 13. It is extremely difficult to achieve100% fabric inspection with this traditional method. 14. Labour-intensive and more floor space required i.e. there is an expense of manual inspection, which is essentially a non-value added activity. 15. Traditional visual fabric inspection is cost-intensive. Even, through the incidence of serious weaving faults can be reduced by the use of modern weaving technology, fault detection in many plants still continues to create considerable extra cost (which increases with the labour cost). 16. Moreover, the problem of the visual inspection does not correspond only to the undetected defects but also, it changes the mechanical properties of the fabric under inspection. For instance, the fabric dimensions (longitudinally and width-wise) usually changed due to the applied tension on fabric roll during the inspection process. Both are not good for the customers because they pay for false materials. Moreover, the shrinkage takes place after the spreading of the fabric in cutting departments increases the probability of producing second quality garment either due to poor assembling (sewing) quality or incorrect size.

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.

Automated fabric inspection

Automatic inspection systems are designed to increase the accuracy, consistency and speed of defect detection in fabric manufacturing process to reduce labour costs, improve product quality and increase manufacturing efficiency . At ITMA' 97 in

Hannover [START_REF] Schicktanz | What can automatic fabric inspection offer us, ITMA '95 recapitulation[END_REF], the first automatic fabric inspection machine based exclusively on a laser scan system was presented to world specialists. In the last two decades, there have been several key developments in automated visual inspection technique for fabric defects where new approaches such as an ultrasonic imaging system [START_REF] Chien | On-Loom, Real-Time, Noncontact Detection of Fabric Defects by Ultrasonic Imaging[END_REF] and laser-optical systems [START_REF] Allgood | Textile laser-optical system for inspecting fabric structure and form, Machine vision applications in industrial inspection[END_REF][START_REF] Shao | Applicability of Table Reasoning Method for Fabric Defect Evaluation[END_REF] have been proposed. But, the main common alternative to human visual defect detection is the use of a computer vision system to detect differences between images acquired by a camera [4,[START_REF] Kim | Online fabric-defects detection based on wavelet analysis[END_REF]. In this process, the fabric is inspected with the resolution that is achieved by an inspection person at a distance of one metre from the fabric [START_REF] Behera | Automatic fabric inspection systems[END_REF].

Unser et al. [START_REF] Unser | Feature extraction and decision procedure for automated inspection of textured materials[END_REF][START_REF] Unser | Local linear transforms for texture measurements[END_REF] described Texture as the term used to characterise the surface of a given object or phenomenon. From the optical point of view, a fabric has the property of a texture. Therefore, fabric detection can be considered as a texture segmentation and identification problem. This means that texture analysis plays an important role in automatic visual inspection of surfaces [3,[START_REF] Mahajan | A review of automatic fabric defect detection techniques[END_REF][START_REF] Kumar | Defect detection in textured materials using optimized filters[END_REF][START_REF] Baykut | Comparative Evaluation of Texture Analysis Algorithms for Defect Inspection of Textile Products[END_REF][START_REF] Kim | Online fabric-defects detection based on wavelet analysis[END_REF][START_REF] Abouelela | Automated vision system for localizing structural defects in textile fabrics[END_REF][START_REF] Arivazhagan | Fault segmentation in fabric images using Gabor wavelet transform[END_REF][START_REF] Haindl | Texture Defect Detection, Computer Analysis of Images and Patterns (CAIP)[END_REF][START_REF] Haralick | Textural Features for Image Classification[END_REF][START_REF] Karayiannis | Defect detection and classification on web textile fabric using multiresolution decomposition and neural networks[END_REF][START_REF] Roesler | Defect detection of fabrics by image processing, Melliand Textilberichte[END_REF][START_REF] Yang | Discriminative training approaches to fabric defect classification based on wavelet transform[END_REF].

Handle et al. [START_REF] Haindl | Texture Defect Detection, Computer Analysis of Images and Patterns (CAIP)[END_REF] defined defects as either non-textured or different textured patches that locally disrupt the homogeneity of a texture image (An image is said to have a uniform texture when it gives an almost homogeneous visual impression). Since fabric faults normally have textural features which are different from original fabric features, automated defect detection in textured materials is simply performed by identifying the regions that differ from a uniform background [4,[START_REF] Xie | A Review of Recent Advances in Surface Defect Detection using Texture analysis Techniques[END_REF][START_REF] Mahajan | A review of automatic fabric defect detection techniques[END_REF][START_REF] Kumar | Defect detection in textured materials using optimized filters[END_REF][START_REF] Abouelela | Automated vision system for localizing structural defects in textile fabrics[END_REF][START_REF] Arivazhagan | Fault segmentation in fabric images using Gabor wavelet transform[END_REF][START_REF] Haindl | Texture Defect Detection, Computer Analysis of Images and Patterns (CAIP)[END_REF][START_REF] Roesler | Defect detection of fabrics by image processing, Melliand Textilberichte[END_REF]. Industrial web materials like fabrics take many forms but there is a remarkable similarity in visual inspection automation requirements [6,[START_REF] Kumar | Computer vision-based fabric defect detection: a survey[END_REF]. The operation of an automated visual inspection system can be broken down into a sequence of processing stages: image acquisition, feature extraction, comparison, and decision. It is important to note that the success of an automaticinspection system relies on the approach used.

Online automated fabric inspection

It is called also real-time fabric inspection where production and production control work together or in real time. The need for this vision system stems from the fact that fabric inspection with present methods (offline) is an inadequate task: thousands of offquality fabric meters will be produced before the problem is recognized. Thereby, the main object of this vision system is to detect the defects at an early manufacturing stage in order to prevent foreseeable fabric defects in mass production or at least to insure a corrective action during the process. If the inspection system is agreed to be online, we have to explain why it should be automated. Beside the high cost, low accuracy and very slow performance of human visual inspection, the slow fabric manufacturing speed (0.3-0.5 meters per minute) [START_REF] Kumar | Computer vision-based fabric defect detection: a survey[END_REF] is insufficient to keep a human inspector occupied and human inspection is therefore uneconomical. Also, the relatively hostile working environment near the weaving machines is not suitable for human inspection.

Behera et al. [START_REF] Behera | Image-processing in Textiles, A critical appreciation of recent developments[END_REF] have described the real-time defect detection system as an intelligent optical head assembled on a loom to acquire and analyze a huge number of images while the fabric is being produced. Frank and Ding [START_REF] Frank | Survey of robust residual generation and evaluation methods in observer-based fault detection systems[END_REF] defined the process of online detection as input and output signals. The output of the fault detection system may be simply an alarm signal that takes two values, high for defect and low for defect-free or, more sophisticatedly, knowledge of faults such as location, spectrum or amplitude. Some researchers [4,[START_REF] Behera | Image-processing in Textiles, A critical appreciation of recent developments[END_REF][START_REF] Malamas | A survey on industrial vision systems, applications and tools[END_REF] determined the essential requirements for an online automated inspection system to be reliable as follows:

1. The system must operate in real-time with good results, 2. It must reduce escape rates, 3. It must reduce false alarms, 4. It must be robust and flexible. Thus, it should adapt itself automatically and achieve consistently high performance despite irregularities in illumination, marking or background conditions and, accommodate uncertainties in angles, positions, etc., 5. It must be fast and cost efficient, 6. The system must be simple to operate and maintain.

Advantages of online automated fabric inspection

Honestly, and before discussing the advantages of an online automated inspection system, one should mention the drawbacks. Behera [START_REF] Behera | Automatic fabric inspection systems[END_REF] has mentioned the correlation between both of production and inspection speeds. Moreover, the production speed determines the inspection system so that it is not always possible to take full advantage of maximum throughput speed of the inspection system. Due to their computational costs, very few available practical systems represent another drawback [START_REF] Haindl | Texture Defect Detection, Computer Analysis of Images and Patterns (CAIP)[END_REF].

To refute these arguments, we should admit that the low speed of an online automated inspection system will not disrupt its continuous development since the need for effective quality measurement is more important than ever and there is a need for a comprehensive, consistent way to establish the quality of fabrics. Financially, Nickolay et al. [6] have shown that the investment in automated fabric inspection system is economically attractive when reduction in personnel cost and associated benefits are considered. Also, Zhang et al. [START_REF] Zhang | Fabric Defect Detection and Classification Using Image Analysis[END_REF] explained that recent advances in imaging technology have resulted in inexpensive, high quality image acquisition, and advances in computer technology allow image processing and pattern recognition to be performed quickly and inexpensively. In addition, the use of online automated systems reduces the total cost through the reduction in inspection labour costs, rework labour and scrap material.

Therefore, an efficient online automated product inspection is a key factor for the increase of competitiveness of the textile and clothing industry [START_REF] Anagnostopoulos | High performance computing algorithms for textile quality control[END_REF][START_REF] Anagnostopoulos | A Computer Vision Approach for Textile Quality Control[END_REF]. Let us mention now extra advantages of online automated visual inspection [START_REF] Behera | Automatic fabric inspection systems[END_REF][START_REF] Mahajan | A review of automatic fabric defect detection techniques[END_REF][START_REF] Sengottuvelan | Automatic Fault Analysis of Textile Fabric Using lmaging Systems[END_REF][START_REF] Su | Grey Relational Analysis of an Automatic Identifying System for Clothing Texture[END_REF][START_REF] Kumar | Defect detection in textured materials using optimized filters[END_REF]:

1. the results of such a system are reliable, reproducible and free from the subjective deficiencies of the manual fabric inspection, 2. The system can increase the efficiency of production lines and improve quality of product as well, 3. A good system means lower labour cost (the labour of the machine also operates the inspection system), 4. shorter production time, 5. Minimum floor space.

Image processing and fabric inspection

Introduction

Malamas et al. [START_REF] Malamas | A survey on industrial vision systems, applications and tools[END_REF] define the image processing operations as which transform an input image to another one having the desired characteristics (measurements). In particular, image analysis is related to the extraction and measurement of certain image features (e.g. lines, and corners) and transforms these image features to numbers, vectors, character strings, etc. Of late, intelligent image processing systems are used to control automatically the running production processes such as online fabric inspection.

The automatic inspection process [START_REF] Baykut | Comparative Evaluation of Texture Analysis Algorithms for Defect Inspection of Textile Products[END_REF][START_REF] Anstey | Discovering novelty in time series data[END_REF][START_REF] Roesler | Defect detection of fabrics by image processing, Melliand Textilberichte[END_REF][START_REF] Cheng | Vision-based Online Process Control in Manufacturing Applications[END_REF] consists of essentially two steps or phases; learning or training phase and detecting or testing phase. Within the first phase, the system is trained on surface images or image regions which are void of defects. The extreme values of the features are calculated and used for constructing a simple classifier.

During the second phase, only the features of interest are considered. These features have the values of which exceed their own scattering thresholds. Thereby, defect inspection is possible by partitioning a test image into sub windows and calculating the sufficient statistics of each one. If the sufficient statistic set within a window does not agree with that of the original training texture, then it is concluded that, there is a defective region.

Until very recently, machine vision was applied almost exclusively to the inspection of engineering components. As fabric inspection has proven to be one of the most difficult of all textile processes to automate, it has taken decades for image processing technology to develop a practical, consistent and reasonably commercial system to the market. The next part summarizes the challenges or the difficulties during the development of a machine vision system for online fabric defect detection.

Challenges and difficulties

Automated visual inspection of web materials is very complex task and the research in this field is widely open. Yet, based on vast research work [4,[START_REF] Kumar | Computer vision-based fabric defect detection: a survey[END_REF][START_REF] Anagnostopoulos | High performance computing algorithms for textile quality control[END_REF][START_REF] Brzakovic | Designing defect classification systems: a case study[END_REF][START_REF] Conci | A Computer Vision Approach for Textile Inspection[END_REF][START_REF] Anagnostopoulos | A Computer Vision Approach for Textile Quality Control[END_REF][START_REF] Haindl | Texture Defect Detection, Computer Analysis of Images and Patterns (CAIP)[END_REF][START_REF] Roesler | Defect detection of fabrics by image processing, Melliand Textilberichte[END_REF][START_REF] Stojanovic | Vision inspection of web textile fabric[END_REF], the implementation of an online automated visual inspection system for fabric defect detection may suffer from next difficulties:

1. The task is particularly challenging due to the large number of fabric defect classes. 2. There are inter-class similarity and inter-class diversity of defects. 3. Also, the characterization of defects in textured materials is generally not clearly defined. 4. There is enormous variety of fabric patterns. 5. There are stochastic (random) variations in scale. 6. The compatibility with standard production lines and economical justification are not solved. 7. The problem of quantifying visual impressions in complex situations (as in fabric manufacture). 8. This task has extremely high data flow. 9. It suffers from noise influence. 10. Unfortunately, most of the used algorithms are computationally complex for online applications. 11. Finally, due to the environment and the nature of weaving process, there is stretch and skew of fabric texture/defects predominantly.

Components of online fabric defect detection system

Because the uses of machine vision are so diverse, specific components can vary from one system to another according to the application domain that is the basic factor determines the requirements for the design and development of a successful machine vision system. Consequently, the system is related to the accomplished tasks environment, speed, etc. Essentially, an automatic inspection system has basically two main units: The first one is the image acquisition unit which is usually an input source, optics, lighting, a part sensor, a frame grabber. The second is the processing unit that has a PC platform, inspection software, digital I/O and a network [START_REF] Anagnostopoulos | High performance computing algorithms for textile quality control[END_REF][START_REF] Anagnostopoulos | A Computer Vision Approach for Textile Quality Control[END_REF][START_REF] Behera | Image-processing in Textiles, A critical appreciation of recent developments[END_REF][START_REF] Malamas | A survey on industrial vision systems, applications and tools[END_REF][START_REF] Poling | Designing a machine-vision system[END_REF][START_REF] Polukhina | Digital system for obtaining and processing information on defective products[END_REF][START_REF] Raafat | An integrated robotic and machine vision system for surface flaw detection and classification[END_REF].

We will cover these components in brief as possible in the next part.

The camera

It forms the digital image of the fabric so that the maximum level of contrast between the defects and their background is achieved [START_REF] Behera | Image-processing in Textiles, A critical appreciation of recent developments[END_REF]. Mainly, there are two common types of scanning techniques employed for the fabric inspection; line and area scan cameras.

Table (2.1) introduces some of the principle differences between the two types. This table is built based on our knowledge and some articles [START_REF] Őzdemir | Markov random fields and Karhunen-Loève transforms for defect inspection of textile products[END_REF]57,[START_REF] Pang | CAVIS: A low-cost fabric defect inspection machine based on Machine Vision[END_REF][START_REF] Roberts | A PC-based real time defect imaging system for high speed web inspection[END_REF]. Generally, one needs several pixels in order to detect a defect. On non-structured surfaces (or pre-processed images), the minimal number of pixels needed for a safe detection of a defect is 4 pixels. For a classification of various defect types more pixels are necessary. A minimum for each classification is 12 pixels and for a more precise classification about 30 pixels are necessary [START_REF] Anagnostopoulos | High performance computing algorithms for textile quality control[END_REF]. The required number of cameras to scan the fabric continuously for deviations is calculated depending on its width [START_REF] Behera | Automatic fabric inspection systems[END_REF]. The system generally has several cameras positioned in a row in order to cover the total web width with an overlap by about 5% in order to capture the entire width without gaps [START_REF] Anagnostopoulos | High performance computing algorithms for textile quality control[END_REF]. Finally, Leon [START_REF] Leon | Image processing methods are presented allowing an acquisition of high-quality macroscopic acquisition of high-quality images of surfaces and tools[END_REF] determined three main problems that cause optical systems to fail acquiring images of sufficient quality: unsuitable illumination, limited depth of focus, and visibility problems.

The lighting system

Lighting is a major issue for many machine vision and image acquisition systems where the illumination type and level has a drastically effect on the image quality [START_REF] Kumar | Computer vision-based fabric defect detection: a survey[END_REF][START_REF] Hajimowlana | An in-camera data stream processing system for defect detection in Web inspection tasks[END_REF].

Fundamentally [START_REF] Conci | A Computer Vision Approach for Textile Inspection[END_REF], a fabric image from a camera depends on two factors, illumination and the way in which the textile reflects that illumination. Behera [START_REF] Behera | Automatic fabric inspection systems[END_REF] determined three basis for the choice of an illumination type during fabric inspection; the fabric density, defect types and stage in which the inspection is carried out. Moreover, some fabric defects can be better recognised in transmitted light while other faults can be better in reflective light. The illumination module is designed in either reflect or transmit the light.

Some researchers [START_REF] Behera | Automatic fabric inspection systems[END_REF][START_REF] Kumar | Computer vision-based fabric defect detection: a survey[END_REF][START_REF] Abouelela | Automated vision system for localizing structural defects in textile fabrics[END_REF][START_REF] Farooq | A mechatronic approach for automatic inspection of deformable webs[END_REF][START_REF] Han | Statistic Learning-based Defect Detection for Twill Fabrics[END_REF] mentioned four common types of lighting schemes (configurations) used for visual inspection i.e. front, back, fiber-optic, and structured. The front lighting is used for enhancing surface texture and determining variation in shade or colour. The backlighting can be used to enhance the structure of translucent fabrics. It eliminates the shadow and glare effects. As it provides uniform illumination, it is also possible to employ fiber optic illumination for the fabric inspection.

However, it is most expensive to realize and is not economical for 6-8 feet wide textile webs.

On the other hand, Anagnostopoulos et al. [START_REF] Anagnostopoulos | High performance computing algorithms for textile quality control[END_REF] defined the dark field which are illumination as the largest significance method for the detection of surface damage because it reacts very sensitively to any changes of the surface smoothness. Moreover, the use of infrared technologies (wave length 800-950 nm) has the additional advantage that the employees that work in the area of the inspection system are not bothered by the flashing and through the use of infrared filters in front of the cameras interfering light can be suppressed. Defects that do not have an edgy kind of surface damage can be detected with the extra use of a diffused bright field light. This lighting is based on fluorescent lights and is implemented in the flash (photo) technology. While to maintain a constant (within 1%) level of illumination, Roberts et al. [START_REF] Roberts | A PC-based real time defect imaging system for high speed web inspection[END_REF] proposed a fuzzy logic control scheme to be used by the illumination controller.

The transport encoder

It is used [START_REF] Roberts | A PC-based real time defect imaging system for high speed web inspection[END_REF] to provide master timing pulses for the camera. The wheel of the transport encoder is in direct contact with fabric winder. In case of line scan cameras, the resolution of the transport encoder (i.e. number of pulses per revolution) determines the pixel resolution. The line scan cameras can acquire crisp images at any speed by slaving camera scan rate to transport velocity.

The frame grabbers

Their old object was to convert the pixel data coming from the camera into a digital image. But nowadays, with digital cameras, frame grabbers are only memory buffers.

Pang et al. [START_REF] Pang | CAVIS: A low-cost fabric defect inspection machine based on Machine Vision[END_REF] mentioned that as it is expensive to use one frame grabber unit per camera, all web inspection systems, such as the one used for fabric, have to cope with the multiple camera inputs. Some systems do this by using some kind of video multiplexer unit between the camera and the frame grabber. This permits parallel processing of image pixel data if the system is equipped with the multiple processors.

The image processing unit

The global object of the processing unit is to understand the construction of the inspected fabric to decide in real time whether it has a defect or not. Kumar [START_REF] Kumar | Computer vision-based fabric defect detection: a survey[END_REF] classified the functions of the processing unit in three main categories; defect detection and classification, camera illumination and control, and system control. In case of high speed (offline) inspection, a single general processing unit is insufficient to process high volume of image data. Therefore most systems use a single separate processor for each individual camera [START_REF] Pang | CAVIS: A low-cost fabric defect inspection machine based on Machine Vision[END_REF]. In addition, most industrial applications inspection systems must process 10-40 Mpixels/s per camera, thus requiring dedicated hardware for at least part of the system [START_REF] Silvén | Applying Texture Analysis to Industrial Inspection, Texture Analysis in Machine Vision[END_REF].

Algorithms of automated fabric defect detection 2.4.1. Introduction

After an image of the fabric under inspection is being captured by the acquisition unit, it passes through a sequence of many processes as usual in the image processing technique. This procedure may contain many processes such as image enhancement, restoration, segmentation, feature extraction and recognition. All of these stages are carried out by an adequate algorithm through the processing unit of the system.

Consequently, if the processing unit is to be considered as the head of the human, the used algorithm is the brain. Therefore, the core of an automated inspection system for fabric defect detection needs a robust detection algorithm. Due to rapidly decreasing cost of sensing and computing power, several new algorithms have been proposed in the last years. The next part of our survey discusses the most important implemented algorithms for automated fabric defect detection. For better understanding, it is gainful to start with a modified classification for these various used approaches.

Automated fabric defect inspection classification

For the two past decades, interesting surveys relevant to automated fabric inspection have been published. It is admitted that all surveys interpreted the task of detecting defects as a texture analysis problem

Statistical approaches

Gray level thresholding [START_REF] Kumar | Computer vision-based fabric defect detection: a survey[END_REF][14] [START_REF] Zhang | Fabric Defect Detection and Classification Using Image Analysis[END_REF][67] Cross-correlation [START_REF] Kumar | Computer vision-based fabric defect detection: a survey[END_REF] [START_REF] Mahajan | A review of automatic fabric defect detection techniques[END_REF] Statistical moments [START_REF] Anagnostopoulos | A Computer Vision Approach for Textile Quality Control[END_REF] [START_REF] Abouelela | Automated vision system for localizing structural defects in textile fabrics[END_REF] Multilevel thresholding [START_REF] Behera | Image-processing in Textiles, A critical appreciation of recent developments[END_REF] Histogram properties [START_REF] Xie | A Review of Recent Advances in Surface Defect Detection using Texture analysis Techniques[END_REF] [START_REF] Zhang | Fabric Defect Detection and Classification Using Image Analysis[END_REF][26] [START_REF] Stojanovic | Real-Time Vision-Based System for Textile Fabric Inspection[END_REF] Rank-order functions [START_REF] Kumar | Computer vision-based fabric defect detection: a survey[END_REF][70] [START_REF] Thilepa | A Paper on Automatic Fabrics Fault Processing Using Image Processing Technique in MATLAB[END_REF] Fractal dimension [START_REF] Kumar | Computer vision-based fabric defect detection: a survey[END_REF] Combination of computational methods [START_REF] Roesler | Defect detection of fabrics by image processing, Melliand Textilberichte[END_REF] Comparative studies [4]

Structural approaches

Structural approaches assume that the textures are composed of primitives [START_REF] Kumar | Computer vision-based fabric defect detection: a survey[END_REF][START_REF] Mahajan | A review of automatic fabric defect detection techniques[END_REF]. These primitives can be as simple as individual pixels, a region with uniform gray levels, or line segments. Consequently, the main objects of these approaches are firstly to extract texture primitives, and secondly to model or generalise the spatial placement rules. The placement rules can be obtained through modelling geometric relationships between primitives or learning statistical properties from texture primitives [START_REF] Xie | A Review of Recent Advances in Surface Defect Detection using Texture analysis Techniques[END_REF][START_REF] Mahajan | A review of automatic fabric defect detection techniques[END_REF]. However, these approaches were not successful on fabric defect detection, mainly due to the stochastic variations in the fabric structure (due to elasticity of yarns, fabric motion, fiber heap, noise, etc.) which poses severe problems in the extraction of texture primitives from the real fabric samples [START_REF] Kumar | Computer vision-based fabric defect detection: a survey[END_REF][START_REF] Mahajan | A review of automatic fabric defect detection techniques[END_REF].

Statistical approaches

They measure the spatial distribution of pixel values [START_REF] Xie | A Review of Recent Advances in Surface Defect Detection using Texture analysis Techniques[END_REF][START_REF] Mahajan | A review of automatic fabric defect detection techniques[END_REF] while their main object [START_REF] Kumar | Computer vision-based fabric defect detection: a survey[END_REF] is to separate the image of the inspected fabric into the regions of distinct statistical behaviour. An important assumption in this process is that the statistics of defect-free regions are stationary, and that these regions extend over a significant portion of inspection images [START_REF] Kumar | Computer vision-based fabric defect detection: a survey[END_REF][START_REF] Mahajan | A review of automatic fabric defect detection techniques[END_REF]. Based on the number of pixels defining the local features, Mahajan et al. [START_REF] Mahajan | A review of automatic fabric defect detection techniques[END_REF] classified these approaches into first order, second order and higher order statistics. The first order statistics estimate properties like the average and variance of individual pixel values, ignoring the spatial interaction between image pixels, second and higher order statistics on the other hand estimate properties of two or more pixel values occurring at specific locations relative to each other. Clearly, the use of statistical approaches is well distinguished in the field of computer vision and has been extensively applied to various tasks. The most used approaches are:

Gray level thresholding approach

Studies of fabric defect detection have been based primarily on gray level statistical approaches [START_REF] Zhang | Fabric Defect Detection and Classification Using Image Analysis[END_REF].These approaches are direct and simple mean to detect high contrast fabric defects. The principle depends on the signal variation (peak or trough) due to the presence of high contrast defect. Moreover, it compares the gray level of each image area with a reference threshold. If its gray level is greater than the threshold, this area has a defect and otherwise, it is a defect-free one. Stojanovic et al. [START_REF] Malek | Automatic Fabric Inspection: invention or innovation?[END_REF] have developed a fabric inspection system that uses thresholding, noise removal followed by local averaging to identify eight categories of defects with 86.2% accuracy and 4.3% of false alarm. The advantages of such a technique [START_REF] Kumar | Computer vision-based fabric defect detection: a survey[END_REF][START_REF] Mahajan | A review of automatic fabric defect detection techniques[END_REF] lie in its ease of implementation. Otherwise, it fails to detect the defects which appear without altering mean gray level in defect-free areas.

Normalized cross-correlation approach

Normally, correlation is used to locate features in one image that appear in another one and the correlation coefficient can generate a correlation map for defect declaration.

The cross-correlation function provides a direct and accurate measure of similarity between two images. Any significant variation in the value of this measure indicates the presence of a defect [START_REF] Kumar | Computer vision-based fabric defect detection: a survey[END_REF][START_REF] Mahajan | A review of automatic fabric defect detection techniques[END_REF].

Statistical moments approach

Mean, standard deviation, skewness and kurtosis provide statistical information over a region while the values are used for image segmentation. In these techniques, rather large windows are preferred, so that a statistical sample is gathered. Abouelela et al. [START_REF] Abouelela | Automated vision system for localizing structural defects in textile fabrics[END_REF] proposed a method of obtaining texture features directly from the gray-level image by computing the moments in local regions. The used algorithm has successfully segmented binary images containing textures with iso-second order statistics as well as a number of gray level texture images. Due to the influence of non-uniform illumination conditions on the image, statistical moments reveal the necessity of a pre-processing step to correct the image illumination in-homogeneities. The main advantage of these techniques is their computational simplicity [START_REF] Anagnostopoulos | A Computer Vision Approach for Textile Quality Control[END_REF].

Multilevel thresholding approach

This approach is applied mainly to inspect uni-coloured fabrics without consideration of texture where, the defective regions are segmented perfectly by using two thresholding methods. Rather than the fact that threshold approach is subjective, it has other limitations; one should ensure that all imaging conditions are always constant and that the non-defective fabric samples are all identical. Moreover, dust particles, lint, and lighting conditions on the test sample may introduce false alarms [START_REF] Behera | Image-processing in Textiles, A critical appreciation of recent developments[END_REF].

Histogram properties approach

Histogram analysis is done rather than a point-to-point analysis. Since different images usually become more comparable to one another after histogram equalization, since their brightness and contrast are more similar, equalization is usually performed. In many cases, histogram equalization provides an image with structural detail that is more discernible to the human eye than original image areas where small brightness gradients exist. Thus, Zhang and Bresee [START_REF] Zhang | Fabric Defect Detection and Classification Using Image Analysis[END_REF] used histogram equalization that reassigns gray level values of pixels to achieve a more uniform gray level distribution in an image. During this process, individual pixels retain their brightness order, but a more flattened histogram is produced so the brightness and contrast of images are altered. Also, Thilepa [START_REF] Stojanovic | Real-Time Vision-Based System for Textile Fabric Inspection[END_REF] applied noise filtering, histogram and thresholding techniques using Matlab to detect fabric defects with 85% overall efficiency. Despite their simplicity, histogram techniques have proved their low cost and high detection accuracy [START_REF] Xie | A Review of Recent Advances in Surface Defect Detection using Texture analysis Techniques[END_REF][START_REF] Behera | Image-processing in Textiles, A critical appreciation of recent developments[END_REF].

Rank-order functions approach

An image rank-function is a simple statistical approach for defect detection based on histogram analysis. It is given by the sequence of gray levels in the histogram when this sequence is sorted in the ascending order [START_REF] Kumar | Computer vision-based fabric defect detection: a survey[END_REF]. There exists 1:1 correspondence between the rank function and the related histogram, which does not exist between histogram and the image. Therefore the histogram and the rank function provide exactly the same information. However, rank functions are used instead of histograms due to the existence of very efficient definition of rank distances which can be efficiently computed.

The median filter and other rank-order filters [START_REF] Tunák | Planar anisotropy of fibre systems by using 2D Fourier transform[END_REF] like minimum or maximum are the best known examples of order statistics based filers. These nonlinear filters are especially useful because of their robustness toward the modifications of the image local properties.

The use of local information gives also the possibility of performing other operations like adaptive modifications of local histograms. Harwood et al. [START_REF] Thilepa | A Paper on Automatic Fabrics Fault Processing Using Image Processing Technique in MATLAB[END_REF] found that, local rank-order correlations of images with Laws' masks could perform better than the basic convolutions, for suitable image and mask sizes. These more robust measures of correlation are less sensitive to local random pattern and grey-scale variabilities which are everywhere apparent in large textured images.

The fabric texture information regarding spatial distribution and orientation, etc., is not uniquely determined from the knowledge of rank-order functions. Due to such drawbacks the approaches based on rank-order functions or classical histogram analysis have failed to generate any further interest for fabric defect detection.

Fractal dimension approach

Fractal image analysis or fractal dimension (FD) can be used occasionally to discriminate between texture defective areas [START_REF] Anagnostopoulos | A Computer Vision Approach for Textile Quality Control[END_REF][START_REF] Behera | Image-processing in Textiles, A critical appreciation of recent developments[END_REF][START_REF] Gedziorowski | Programmable optical digital processor for rank order and morphological filtering[END_REF][START_REF] Harwood | Texture classification by center-symmetric auto-correlation, using Kullback discrimination of distributions[END_REF]. Conci and Proença [START_REF] Gedziorowski | Programmable optical digital processor for rank order and morphological filtering[END_REF] implemented the differential box counting method with few modifications so as to minimize computational complexity and to enhance efficiency. The detection accuracy was 96% for eight types of fabric defects [START_REF] Kumar | Computer vision-based fabric defect detection: a survey[END_REF][START_REF] Mahajan | A review of automatic fabric defect detection techniques[END_REF][START_REF] Behera | Image-processing in Textiles, A critical appreciation of recent developments[END_REF][START_REF] Gedziorowski | Programmable optical digital processor for rank order and morphological filtering[END_REF]. Based on a wide variety of methods for fractal dimension (FD) evaluation, some drawbacks have been found. In many cases, this method does not cover all possible (FD) ranges for textiles, that is, any value from 2.0 to 3.0, therefore it is not applicable to many types of textiles. Moreover, the method has a poor efficiency and high false alarms rate [START_REF] Kumar | Computer vision-based fabric defect detection: a survey[END_REF][START_REF] Mahajan | A review of automatic fabric defect detection techniques[END_REF][START_REF] Conci | A Computer Vision Approach for Textile Inspection[END_REF][START_REF] Anagnostopoulos | A Computer Vision Approach for Textile Quality Control[END_REF].

Edge detection approach

Edge detection is a traditional technique for image analysis. The distribution of edge amount per unit area is an important feature in the textured images. The amount of gray level transitions in the fabric image can represent lines, edges, point defects and other spatial discontinuities. Thus these features have been largely employed for conformity testing, assembly inspection and fabric defect detection. It is mainly suitable for plain weave fabrics imaged at low resolution. But, the difficulty in isolating fabric defects with the noise generated from the fabric structure results in high false alarm rate and therefore makes them less attractive for textile inspection [START_REF] Kumar | Computer vision-based fabric defect detection: a survey[END_REF][START_REF] Mahajan | A review of automatic fabric defect detection techniques[END_REF][START_REF] Conci | A Computer Vision Approach for Textile Inspection[END_REF][START_REF] Unser | Feature extraction and decision procedure for automated inspection of textured materials[END_REF][START_REF] Conci | A fractal image analysis system for fabric inspection based on a box-counting method[END_REF].

Morphological operations approach

The mathematical morphology helps describing the geometrical and structural properties of an image [START_REF] Tunák | Planar anisotropy of fibre systems by using 2D Fourier transform[END_REF]. Moreover, morphological image processing has relevance to conditioning, labelling, grouping, extracting, and matching operations on images [START_REF] Vergados | An Evaluation of Texture Segmentation Techniques for Real-Time Computer Vision Applications[END_REF]. For instance, this approach can filter out the periodic structure of fabric in the optical domain by inserting a Fourier lens after proper spatial filtering (in this case, it is only suitable to detect the defects of periodic structures). Since the morphological operations are one of the ideal tools for removing noise, the technique can be profitably exploited for noise removal in spatially filtered images of fabrics. Mallik-Goswami and Datta [START_REF] Vergados | An Evaluation of Texture Segmentation Techniques for Real-Time Computer Vision Applications[END_REF] illuminated the inspected fabric by a collimated laser beam to obtain its diffraction pattern while the spatially filtered noisy image is recorded by a CCD camera and converted to a binary one.

The noise is then removed using suitable morphological operations with a critically selected structuring element. However, the presented experimental results are on obvious defects [START_REF] Kumar | Computer vision-based fabric defect detection: a survey[END_REF]. Kwak et al. [START_REF] Jasper | Image Analysis of Mispicks in Woven Fabric[END_REF] described the development of an automated vision system to identify and classify visual defects on leather fabric. The defects are identified through a two-step segmentation procedure based on thresholding and morphological processing with an overall classification accuracy of 91.25%. The practical utility of this approach is limited as most of the commonly occurring fabric defects will be missing from the binary image generated from the simple thresholding operation [START_REF] Mahajan | A review of automatic fabric defect detection techniques[END_REF].

Eigenfilters or Independent Component Analysis approach

The eigenfilter-based approaches are useful in separating pair-wise linear dependencies, rather than higher-order dependencies, between image pixels [START_REF] Kumar | Computer vision-based fabric defect detection: a survey[END_REF]. As these filters are of particular interest because they adapt automatically to the class of texture to be treated, Unser and Ade [START_REF] Unser | Feature extraction and decision procedure for automated inspection of textured materials[END_REF] suggested a flexible texture inspection system based on the evaluation of a sequence of local textural features. The measured energy at the output of eigenfilters bank is considered. Their system presents accurate defect detection with an extremely low probability of false alarms.

Monadjemi [START_REF] Mallik -Goswami | Detecting Defects in Fabric with Laser-Based Morphological Image Processing[END_REF][START_REF] Kwak | Automated defect inspection and classification of leather fabric, Intelligent Data Analysis[END_REF] introduced the usage of structurally matched eigenfilters to overcome the practical drawbacks of traditional approaches which require an extensive training stage. The proposed algorithm reconstructs a given texture twice using a subset of its own eigenfilter and a subset of a reference banks, and measures the reconstruction error as the level of novelty. The improved reconstruction is generated by structurally matched eigenfilters through rotation, negation, and mirroring. Sezer et al. [START_REF] Monadjemi | Towards efficient texture classification and abnormality detection[END_REF] developed a new methodology for defect detection based on the independent component analysis (ICA). This method extracts the feature from the non-overlapping sub-windows of texture images and classifies a sub-window as defective or non-defective according to Euclidean distance between the feature obtained from average value of the features of a defect free sample and the feature obtained from one sub-window of a test image. (ICA) has very low real time computational requirements, since the online part of the computations involves just a simple matrix multiplication. It gives good detection results with 96-97%.

Gray level co-occurrence matrix approach

The co-occurrence matrix is one of the most popular statistical texture analysis tools for fabric defect detection [START_REF] Xie | A Review of Recent Advances in Surface Defect Detection using Texture analysis Techniques[END_REF][START_REF] Kumar | Computer vision-based fabric defect detection: a survey[END_REF]. It is known also as the spatial gray-level dependence [START_REF] Mahajan | A review of automatic fabric defect detection techniques[END_REF][START_REF] Monadjemi | Restructured eigenfilter matching for novelty detection in random textures[END_REF]. The principle is based on repeated occurrences of different grey level configurations in a texture. The co-occurrence matrix contains information about the positions of pixels having similar gray level values [START_REF] Anagnostopoulos | A Computer Vision Approach for Textile Quality Control[END_REF]. These second order statistics approximate the probability distribution function of the given texture [START_REF] Baykut | Comparative Evaluation of Texture Analysis Algorithms for Defect Inspection of Textile Products[END_REF]. To do that, [START_REF] Xie | A Review of Recent Advances in Surface Defect Detection using Texture analysis Techniques[END_REF] it is accumulated into a set of 2D matrices, each of which measures the spatial dependency of two gray-levels, given a displacement vector. Texture features, such as energy, entropy, contrast, homogeneity, and correlation, are then derived from the co-occurrence matrix.

Harlick et al. [START_REF] Haralick | Textural Features for Image Classification[END_REF] derived 14 features from the co-occurrence matrix and used them successfully for characterization of textures. However, only two of these features have been used for the defect detection on fabrics. Balakishnan et al. [START_REF] Sezer | Independent Component Analysis for Texture Defect Detection[END_REF] developed a vision system to identify and classify fabric defects (FDICS) using the co-occurrence matrix with a total cost around $ 5,300. Other research works [START_REF] Jeong | Applying Image Analysis to Automatic Inspection of Fabric Density for Woven Fabrics[END_REF][START_REF] Balakishnan | FADICS: A Vision-based System for the Identification and Classification of Fabric Defects[END_REF] proposed the gray level cooccurrence matrix approach as a base to develop an automated fabric inspection system. Despite it is very popular and many studies exploited it as highly accurate technique, the co-occurrence matrix features suffer from many drawbacks [START_REF] Xie | A Review of Recent Advances in Surface Defect Detection using Texture analysis Techniques[END_REF][START_REF] Kumar | Computer vision-based fabric defect detection: a survey[END_REF][START_REF] Mahajan | A review of automatic fabric defect detection techniques[END_REF][START_REF] Anagnostopoulos | A Computer Vision Approach for Textile Quality Control[END_REF]. It is time consuming while there is no generally accepted solution for optimising the displacement vector. In addition, the number of gray levels is usually reduced in order to keep the size of the co-occurrence matrix manageable. For a given displacement vector, a large number of features can be computed, which implies dedicated feature selection procedure. Moreover, this technique is computationally expensive for the demands of a real time defect inspection system. Finally, the portioning of co-occurrence space and the description of multi-pixel co-occurrence are inefficient, which should be addressed to achieve the best possible performance for online fabric inspection.

Local linear transforms approach

This approach is closely related to filter bank analysis methods. It gives a statistical justification for the extraction of texture properties by means of convolution operators (masks). These masks may be considered as local detectors of elementary structures such as defects. Several popular bi-dimensional transforms such as Discrete Cosine Transform (DCT), Discrete Sine Transform (DST), Karhunen-Loève (KL), or Discrete Hadamard Transform (DHT) can be used for the extraction of local texture properties [START_REF] Kumar | Computer vision-based fabric defect detection: a survey[END_REF][START_REF] Mahajan | A review of automatic fabric defect detection techniques[END_REF][START_REF] Harwood | Texture classification by center-symmetric auto-correlation, using Kullback discrimination of distributions[END_REF].

The important information in most fabric textures is contained in higher order relationships among image pixels. Therefore, Unser [START_REF] Unser | Local linear transforms for texture measurements[END_REF] proposed a method which gives an access to higher order statistical information by means of simple histogram or moment computation along selected axes in the space of pixel values in a specified neighbourhood. He derived optimal and sub-optimal linear operators for texture analysis and classification.

Artificial neural-networks approach

Artificial neural-networks are among the fastest and most flexible classifiers used for fault detection due to their non-parametric nature and ability to describe complex decision regions composed of a number of similar elementary processing units (neurons) connected together into a network [START_REF] Xie | A Review of Recent Advances in Surface Defect Detection using Texture analysis Techniques[END_REF][START_REF] Kumar | Computer vision-based fabric defect detection: a survey[END_REF][START_REF] Mahajan | A review of automatic fabric defect detection techniques[END_REF][START_REF] Kuo | Gray Relational Analysis for Recognizing Fabric Defects[END_REF][START_REF] Tunák | Directional Defects in Fabrics[END_REF][START_REF] Malamas | A survey on industrial vision systems, applications and tools[END_REF]. These neurons are arranged in layers with the input data initializing the processing at the input layer. The processed data of each layer passes through the network towards the output layer. It has been used for many years in the manufacturing industry for monitoring and control mainly because of their ability to learn patterns in data from experience (not from explicit mathematical models of the data). It is applied when the underlying mathematical models are too complex or too costly to be determined by traditional means. For small problems neural networks work quite well. However, they do not scale well to massive datasets [START_REF] Anstey | Discovering novelty in time series data[END_REF].

The problem of fabric defect segmentation using feed-forward neural networks (FFN) has been investigated in [START_REF] Castilho | NN Automated Defect Detection Based on Optimized Thresholding[END_REF]. Recently, Shi et al. [START_REF] Jia | A tolerance method for industrial image-based inspection[END_REF] described an adaptive image segmentation method based on a simplified pulse-coupled neural network (PCNN) for detecting fabric defects. They introduced a new parameter called the deviation of the contrast (DOC) to describe the contrast difference in row and column between the analyzed image and a defect-free image of the same fabric. Castilho et al. [START_REF] Kumar | Neural network based detection of local textile defects[END_REF] implemented a real-time fabric defect detection based intelligent techniques. They used Neural networks (NN), fuzzy modelling (FM) to obtain a clearly classification for defect detection. The experimental results stated that (NN) has a faster performance. The used algorithms can be easily online implemented and may be adapted to industrial applications without great efforts. They also proposed new methods for determining threshold values for fabric defect detection using feed-forward neural networks. Behera and Mani [START_REF] Shi | A Simplified pulse-coupled neural network for adaptive segmentation of fabric defects[END_REF] used back propagation based neural network coupled with the (DCT) technique to characterize and classify woven fabric defects. The method has a comparatively high prediction error in one or two cases due to the insufficient information about the particular defect from the coefficients of that defect. Furferi and Governi [START_REF] Castilho | Intelligent Real-Time Fabric Defect Detection, Image Analysis and Recognition[END_REF] described an artificial vision inspection (AVI) system for real-time detection and classification of raw material defects. This system based on an artificial neural network (ANN) approach with 90% detection reliability and an adequate computational time. Many other research works [START_REF] Mitropoulos | A real-time vision system for defect detection and neural classification of web textile fabric[END_REF][START_REF] Karayiannis | Defect detection and classification on web textile fabric using multiresolution decomposition and neural networks[END_REF][START_REF] Behera | Characterization and classification of fabric defects using discrete cosine transformation and artificial neural network[END_REF][START_REF] Furferi | Machine vision tool for real-time detection of defects on textile raw fabrics[END_REF][START_REF] Islam | Automated Textile Defect Recognition System Using Computer Vision and Artificial Neural Networks[END_REF][START_REF] Islam | A Suitable Neural Network to Detect Textile Defects[END_REF][START_REF] Kuo | A Back-Propagation Neural Network for Recognizing Fabric Defects[END_REF][START_REF] Kuo | Using a Neural Network to Identify Fabric Defects in Dynamic Cloth Inspection[END_REF][START_REF] Mursalin | Fabric defect inspection system using neural network and microcontroller[END_REF][START_REF] Schmalfuss | Automatic Fabric Inspection on the Loom, Melliand Textilberichte[END_REF][START_REF] Shiau | Classifying Web Defects with a Back-Propagation Neural Network by Color Image Processing[END_REF] implemented also (ANN) approach to detect automatically the fabric defects.

Autocorrelation function (ACF) approach

Autocorrelation is a technique that combines all parts of an image and may be used to characterize repetitive structures [START_REF] Zhang | Fabric Defect Detection and Classification Using Image Analysis[END_REF]. It measures the correlation between the image itself and the image translated with a displacement vector. As autocorrelation measure regular textures, it exhibit peaks and valleys. Autocorrelation function is closely related to the power spectrum of the Fourier transform [START_REF] Xie | A Review of Recent Advances in Surface Defect Detection using Texture analysis Techniques[END_REF]. Tolba and Abu-Rezeq [100] applies a selforganizing feature map (SOFM) to detect and classify automatically the textile defects.

They first extracted feature vectors from the one-dimensional autocorrelation function (ACF). This extracted feature is immune to both continuous variations in the illumination intensity and noise as a result of the noise-rejection property of the (ACF). Then, they used the two-point correlation function to compute the probability of finding a given difference in feature values for any randomly chosen pair of points within the feature space [START_REF] Fatemi-Ghomi | performance evaluation of texture segmentation algorithms based on wavelets[END_REF].

Local binary patterns (LBP) approach

Usually, a simple local contrast measurement is calculated as a complement to the (LBP) value in order to characterise local spatial relationships. The (LBP) operator is computationally simple, gives good performance in texture classification and is relatively invariant with respect to changes in illumination and image rotation [START_REF] Mallik -Goswami | Detecting Defects in Fabric with Laser-Based Morphological Image Processing[END_REF]. For instance, Ojala et al. [101] described the local binary patterns as a shift invariant complementary measure for local image contrast. It uses the gray level of the centre pixel of a sliding window as a threshold for surrounding neighbourhood pixels. Its value is given as a weighted sum of thresholded neighbouring pixels.

Optimal filter design approach

It concerns the determination of a filter that provides the largest discrimination between two textures [START_REF] Anagnostopoulos | A Computer Vision Approach for Textile Quality Control[END_REF]. Zhang and Bresee [START_REF] Zhang | Fabric Defect Detection and Classification Using Image Analysis[END_REF] considered two approaches to detect and classify knot and slub defects: statistical and morphological methods. The classifications were made on the basis of either gray level statistics or morphological operations. The autocorrelation function was used to identify fabric structural-repeat units to carry out either statistical or morphological computations. They first equalized all acquired images histogram to obtain more clearly identifiable Autocorrelation maxima and minima. In addition, the images are more comparable after equalization since their contrast and brightness are more closely similar.

Spectral approaches

Based on spatial-frequency domain features which are less sensitive to noise and intensity variations than the features extracted from spatial domain, spectral approaches occupy a big part of the latest computer vision research work. It simulates the human vision system where the psychophysical research has indicated that human visual system analyzes the textured images in the spatial frequency domain. Spectral approaches require a high degree of periodicity thus, it is recommended to be applied only for computer vision of uniform textured materials like fabrics. For automated defect detection, such approaches are developed to overcome the efficiency drawbacks of many low-level statistical methods. Therefore, these approaches were rendered as a robust solution for online fabric defect detection. The primary objectives [START_REF] Mahajan | A review of automatic fabric defect detection techniques[END_REF] of these approaches are firstly to extract texture primitives, and secondly to model or generalise the spatial placement rules.

In the following part, a survey of the most popular spectral approaches is presented.

Fourier analysis (transforms) approach

Fourier analysis is a global approach that characterizes the textured image in terms of frequency components. Fourier techniques have desirable properties of noise immunity, translation invariance and the optimal characterization (enhancement) of the periodic features [START_REF] Kumar | Computer vision-based fabric defect detection: a survey[END_REF][START_REF] Mahajan | A review of automatic fabric defect detection techniques[END_REF]102]. They can be used to monitor the spatial-frequency spectrum of a fabric and compare the power spectrum of an image containing a defect with that of a defect-free one. When a defect occurs, the fabric regular structure is changed, so that the corresponding intensity at some specific positions of the frequency spectrum will also change which could signify the presence of a defect. Many researchers [1,[START_REF] Sengottuvelan | Automatic Fault Analysis of Textile Fabric Using lmaging Systems[END_REF][START_REF] Henry | Automated fabric defect detection-A review[END_REF]103,104,105,106,107,108] proposed a simulated fabric model to understand the relationship between the fabric structure in the image space and that in the frequency space.

To implement Fourier analysis for fabric defect detection, various methods are available; Optical Fourier Transforms (OFT) obtained in optical domain by using lenses and spatial filters can be used, but most techniques, digitally implemented, are derived from Discrete Fourier Transforms (DFT) and/or its Inverse (IDFT) which recovers the images in the spatial domain: classic Fast Fourier Transforms (FFT) or Windowed Fourier Transforms (WFT) versions which have the ability to localize and analyze the features in spatial as well as frequency domain.

As they are very popular approaches, a huge research work based on Fourier transforms was developed to obtain an effective fabric defect detection systems. Tsai and Heish [109] detected fabric defects using a combination of DFT and Hough transform. The line patterns of any directional textures in the spatial-domain image are removed by detecting the high-energy frequency components in the Fourier-domain image by using a one-dimensional (1D) Hough transform, setting them to zero, and finally back-transforming to a spatial-domain image. In the restored image, the homogeneous-line region in the original image will have an approximately uniform gray level, whereas the defective region will be distinctly preserved. Based on a global image reconstruction scheme using the Fourier transform, Tsai and Huang [102] presented a global approach for the automatic inspection of defects in randomly textured surfaces as sandpaper. In the restored image obtained by IFT, the homogeneous region in the original image has an approximately uniform gray level, and yet the defective region will be distinctly preserved.

Because OFT is relatively easy to implement and fast [START_REF] Kumar | Computer vision-based fabric defect detection: a survey[END_REF], Mallik-Goswami and Datta modulated the luminous intensities of the zero-and the first-order diffraction patterns by the existence of fabric defects [START_REF] Vergados | An Evaluation of Texture Segmentation Techniques for Real-Time Computer Vision Applications[END_REF]. Therefore, Castelliniet al.

[110] developed a defect detection system using the measurements of the first-and the zero-order intensities. Also, Ciamberlini et al. [111] developed an optical configuration for fabric defect detection based on OFT. Through this system, the examination of the Fourier pattern relative to a set of selected samples of cotton and wool fabric shows, in the case of defective fabric, the increase of light intensity between the main peaks.

The DFT and OFT based techniques are suitable for both global and local defects. Furthermore, The DFT based approaches are not effective in the fabric images in which the frequency components associated with the homogenous and defective regions are highly mixed together in Fourier domain. It is due to the difficulty in manipulating the frequency components associated with homogenous regions without affecting the corresponding components associated with the defective regions. The relevant limitation to OFT approach is the laser beam diameter employed to generate the image of the moving fabric. It cannot be too large relative the spacing of weft and warp yarns in the fabric.

Consequently, multiple optical systems are required to cover the width of fabric, which is very costly and complex [START_REF] Kumar | Computer vision-based fabric defect detection: a survey[END_REF].

Moreover, Fourier transform is known to be a computationally expensive method. For instance, the time of two-dimensional DFT is proportional to the square of the image size. Therefore, in order to reduce the computation time, FFT is used. It is a discrete Fourier transform with some reorganization that can save an enormous amount of time. In this case, the computational time is proportional to 2N 2 log 2 N for [1,[START_REF] Sengottuvelan | Automatic Fault Analysis of Textile Fabric Using lmaging Systems[END_REF], while providing exactly the same result.

Chan and Pang [1] used DFT and IDFT to extract seven significant characteristic parameters from the central spatial frequency spectrums. These parameters are then applied using FFT to detect fabric defects [START_REF] Sengottuvelan | Automatic Fault Analysis of Textile Fabric Using lmaging Systems[END_REF][START_REF] Balakishnan | FADICS: A Vision-based System for the Identification and Classification of Fabric Defects[END_REF]107]. In addition, Cardamone et al. [104] developed and tested a fully automatic system to inspect a variety of fabrics and defects. The method is achieved by applying Fourier analysis to the image of the sample under inspection, without considering any reference image so that, no prior information about the fabric structure or the defect is required. The extracted structural features are used to define a set of multi-resolution band-pass filters, adapted to the fabric structure, that operate in the Fourier domain. Inverse Fourier transformation, binarization, and merging of the information obtained at different scales lead to the output image that contains flaws segmented from the fabric background. Based on FT, Weng and Perng

[116] detailed a reliable and computationally efficient two-dimensional (2-D) convolution mask to detect irregularities and defects in a periodic two-dimensional signal or image.

Gabor filters approach

The classical way of introducing spatial dependency into Fourier analysis is through the windowed Fourier transform. If the window function is Gaussian, the windowed Fourier transform becomes the well-known Gabor transform, which can arguably achieve optimal localisation in the spatial and frequency domains [START_REF] Xie | A Review of Recent Advances in Surface Defect Detection using Texture analysis Techniques[END_REF][START_REF] Mahajan | A review of automatic fabric defect detection techniques[END_REF]117 The fabric defect detection uses optimal Gabor filter has been demonstrated in [120].

Whereas, many inspection systems using a bank of symmetric and asymmetric Gabors filters has been detailed in [START_REF] Arivazhagan | Fault segmentation in fabric images using Gabor wavelet transform[END_REF]109,121,122,123,124,125,126,127]. The main drawback of this approach comes from the non-orthogonality of Gabor functions which results in many correlations of features between the scales.

Optimized Finite Impulse Response (FIR) filters approach

Some fabric defects that produce very subtle intensity transitions may be difficult to detect using above-mentioned spectral approaches. A potential solution to detect such defects is to employ optimal finite impulse response (FIR) filters. A FIR filter has generally more free parameters than an IIR filter or a Gabor filter and thus offers added advantage of computational ease. Therefore, it offers a large feature separation between the defect-free and the defective regions of the filtered image [START_REF] Kumar | Computer vision-based fabric defect detection: a survey[END_REF][START_REF] Kumar | Defect detection in textured materials using optimized filters[END_REF]128]. The biggest advantage of FIR filters is that they can implement any impulse response, provided it is of finite length. Kumar [128] emphasized on smaller spatial masks, as compared to those from optimal Gabor filters, and demonstrated fabric defect segmentation with optimal FIR filters as small as 3 × 3 or 5 × 5 mask size. Also, Kumar and Pang [START_REF] Kumar | Defect detection in textured materials using optimized filters[END_REF] proposed a linear FIR filter with an optimized energy separation. They investigated the approach performance with the size variation of both optimal and smoothing filters. They concluded that the size of optimal filter has appreciable effect on the performance for the defect detection. These filters can be used to supplement the performance of the existing inspection systems that fail to detect a class of specific defects.

Wigner distributions approach

The Wigner distribution function is Fourier-like but offers better co-joint resolution than Gabor or difference of Gaussians for co-joint spatial and spatial-frequency image representation. This algorithm is effective when implemented for online fabric defect detection but its computation time is prohibitive. However its utility for unsupervised fabric inspection, in simultaneously detecting defects from a large number of classes, is yet to be demonstrated. The major drawback of this technique [START_REF] Kumar | Computer vision-based fabric defect detection: a survey[END_REF] is the presence of interference terms between the different components of the image.

Wavelet analysis (transform) approach

The concept of wavelet analysis was proposed in 1982 by Jean Morlet, a French engineer working on seismological data for an oil company, to reach automatically the best trade-off between time and frequency resolution [START_REF] Truchetet | Wavelets in industrial applications: a review[END_REF]. With multi-resolution analysis, and other space frequency or space scale approaches, the wavelet transform is now considered as a standard tool in image processing. A wavelet function is a compact, finite duration signal that can form by dilation an orthonormal basis for the signal subspace.

Thereby, it can be used for fabric defect detection. Mainly, wavelet transform is explored for image compression applications due to its ability to avoid the drawbacks resulted from the other spectral approaches such as Wigner distributions or Gabor functions [START_REF] Kumar | Computer vision-based fabric defect detection: a survey[END_REF][START_REF] Anagnostopoulos | A Computer Vision Approach for Textile Quality Control[END_REF][START_REF] Truchetet | Wavelets in industrial applications: a review[END_REF].

It employs short windows at high frequencies and long windows at low frequencies [START_REF] Kim | Online fabric-defects detection based on wavelet analysis[END_REF].

In the recent past, the use of wavelets has increased enormously in various problems related to computer vision [START_REF] Fatemi-Ghomi | performance evaluation of texture segmentation algorithms based on wavelets[END_REF]129]. For instance, to achieve the best performance in fabric defect detection, a design of adaptive orthonormal wavelet bases has been shown in [START_REF] Yang | Discriminative training approaches to fabric defect classification based on wavelet transform[END_REF]. Dorrity et al. [START_REF] Dorrity | Real-time fabric defect detection and control in weaving processes[END_REF][START_REF] Dorrity | Real-time fabric defect detection and control in weaving processes[END_REF] developed a real-time fabric defect and control system based on fuzzy wavelet analysis. Tsai and Hsiao [130] detailed with some experimental results an approach based on selective wavelet coefficients to reconstruct the fabric image. It enhances the defects to be detected by thresholding in another step. Recently, Sari-Sarraf and Goddard [131] developed a fabric defect detection system to detect defects as small as 0.2 inches with an overall detection rate of 89 %.

The articles [START_REF] Su | Grey Relational Analysis of an Automatic Identifying System for Clothing Texture[END_REF][START_REF] Kim | Online fabric-defects detection based on wavelet analysis[END_REF]129,132,133,134,135] may interpret the contribution of wavelet transform in automated fabric defect detection. But, after surveying of numerous wavelet-based research works, Truchetet and Laligant [START_REF] Truchetet | Wavelets in industrial applications: a review[END_REF] concluded that, wavelet cannot solve all the problems and that there are still a lot of limitations inherent to wavelet transform. Also, it suffers from either image components interference or features correlations between the scales [START_REF] Kumar | Computer vision-based fabric defect detection: a survey[END_REF].

Model-based approaches

Model-based texture analysis methods try to capture the process that generated the texture. They try to model the texture by determining the parameters of a pre-defined model [START_REF] Malamas | A survey on industrial vision systems, applications and tools[END_REF]. Particularly, model-based approaches are suitable for fabric inspection when the statistical and spectral approaches have not yet shown their utility [START_REF] Kumar | Computer vision-based fabric defect detection: a survey[END_REF][START_REF] Mahajan | A review of automatic fabric defect detection techniques[END_REF][START_REF] Baykut | Comparative Evaluation of Texture Analysis Algorithms for Defect Inspection of Textile Products[END_REF]136].

These approaches often require that the image features at different levels of specificity or detail match one of possible many models of different image classes. This task is very difficult and computationally intensive if the models are complex and if a large number of models must be considered [START_REF] Malamas | A survey on industrial vision systems, applications and tools[END_REF]. The most used three models will be discussed in the following part.

Gauss Markov Random Field (GMRF) model approach

As the brightness level at an image point is dependent on the brightness levels of the neighbouring points unless the image is simply random noise, Markov random fields use a precise model of this dependence. They are able to capture the local (spatial) contextual information in an image. These models assume that the intensity at each pixel in the image depends on the intensities of only the neighbouring pixels. The theory provides a convenient and consistent way for modelling context dependent entities such as pixels, through characterising mutual influences among such entities using condition MRF distribution [START_REF] Xie | A Review of Recent Advances in Surface Defect Detection using Texture analysis Techniques[END_REF][START_REF] Kumar | Computer vision-based fabric defect detection: a survey[END_REF][START_REF] Mahajan | A review of automatic fabric defect detection techniques[END_REF][START_REF] Baykut | Real-time defect inspection of textured surfaces[END_REF].

Cohen et al.

[136] used the Gaussian Markov random field to model the texture image of a non-defective fabric. The image of the fabric patch to be inspected was partitioned into non-overlapping windows of size N * N, where each window was classified as defective or non-defective on the basis of a likelihood-ratio test of size x. The test was recast in terms of the sufficient statistics associated with the model parameters. Fabric defect detection results using a similar approach have also been shown in [START_REF] Őzdemir | Markov random fields and Karhunen-Loève transforms for defect inspection of textile products[END_REF]136].

Őzdemir and Erçil [START_REF] Őzdemir | Markov random fields and Karhunen-Loève transforms for defect inspection of textile products[END_REF], Baykut et al. [START_REF] Baykut | Comparative Evaluation of Texture Analysis Algorithms for Defect Inspection of Textile Products[END_REF][START_REF] Baykut | Real-time defect inspection of textured surfaces[END_REF] implemented GMRF based defect detection system. They showed that the fifth-order GMRF based defect detection scheme runs at about 10 times faster than that based on Karhunen Loeve (KL) transform.

Poisson's model approach

The stochastic models of some randomly industrial textured materials are based on the nature of the manufacturing process [START_REF] Kumar | Computer vision-based fabric defect detection: a survey[END_REF]. One example of such material is the fibrous, non-woven material used for air filtration that is manufactured through adhesive technology. Brzakovic et al. [START_REF] Brzakovic | Designing defect classification systems: a case study[END_REF] investigated the problem of defect detection in such randomly textured surfaces. It was shown that the difference between the theoretical estimated model and actual measurements from the defect-free images is within 10 %.

Thus a statistical hypothesis testing between these two measurements can also be used to detect the fabric defects.

Model-based clustering approach

The problem of locating possible clusters in a data set (image) is a recurrent one with a long history. Campbell et al. [117,137] combined image-processing techniques with a powerful new statistical technique to inspect denim fabrics. The approach employs modelbased clustering to detect relatively faint aligned defects. In order to assess the evidence for the presence of a defect, Bayesian information criterion (BIC) is used.

Combination of computational methods

From the previous survey, one may conclude that it is rather difficult to perform a robust individual approach that detects all fabric defects with high accuracy. It is mainly due to the fact that each technique has some advantages but, in the same time its drawbacks. Therefore, many researchers combined two or more different approaches to give better results, than either one individual one. The main object is to minimize the computational complexity and enhance the detection capability.

For instance, Sari-sarraf and Goddard [131] described an online automated fabric defect detection system with 100% coverage. The relatively low cost system is synchronized with the loom motion and produces high quality fabric images with either front or back lighting. The acquired images were then processed by a segmentation algorithm that combines wavelet transform, image fusion, and the correlation dimension.

The approach overall detection rate under realistic conditions was found to be 89%, with 0.2 in. minimum defect size and a false-alarm rate of 2.5%. Rösler [START_REF] Roesler | Defect detection of fabrics by image processing, Melliand Textilberichte[END_REF] used a combination of two statistical approaches; histograms and co-occurrence matrices to develop a real fabric defect detection system. About more than fifty defective samples were recognizable up to 95%. These defects were unicoloured with a size larger than 1 mm 2 . Haindle et al. [START_REF] Haindl | Texture Defect Detection, Computer Analysis of Images and Patterns (CAIP)[END_REF] presented a fast multi-spectral texture defect detection method based on the underlying three-dimensional spatial probabilistic image model. The model first adaptively learns its parameters on defective samples and subsequently checks for texture defects using the recursive prediction analysis. This method has promising results whereas fails to inspect highly structured textures due to limited low frequencies modelling power of the underlying probabilistic model. Chen and Libert [138] to developed a real-time automatic visual inspection (AVI) system for high speed plane products. The implemented algorithm combines the connected component labeling, the moment calculation and the pattern recognition. This system is flexible so that inspection algorithms are reusable and new algorithms can easily be evaluated regardless of its hardware. Han and Xu [START_REF] Han | Statistic Learning-based Defect Detection for Twill Fabrics[END_REF] presented an efficient and effective novel approach to detect the small fabric defects based on a combination between template matching methods and judgment threshold. The method learns from statistical information of fabric surface to modify the template. Stojanovic et al. [START_REF] Stojanovic | Vision inspection of web textile fabric[END_REF] implemented simple and fast binary and statistical algorithms in combination with neural networks to improve fabric inspection process for reduced number of defect classes under real industrial conditions, where the presence of many types of noise is an inevitable phenomenon.

Comparative studies for different approaches

Due to the huge number of fabric defect detection algorithms and techniques, the need of effective methods to compare between these approaches is very important than before. The comparative studies have a vital importance and may be considered as a research guide. This guide enables the researchers to learn and understand the differences between the various used algorithms or approaches based on its feasibility and reliability.

Fatemi-Ghomi et al. [START_REF] Fatemi-Ghomi | performance evaluation of texture segmentation algorithms based on wavelets[END_REF] evaluated a variety of different methods for texture segmentation based upon wavelets. The two-point correlation function was proposed as performance measure. They found that, this function is a useful tool appropriate for both the visualization of the presence (or lack of) structure in any feature space of high dimensionality. Further, the two-point correlation function can be used as a tool for choosing the best features to be used in the detection process. Also, Zhang and Bresee [START_REF] Zhang | Fabric Defect Detection and Classification Using Image Analysis[END_REF] studied and compared two software approaches for detecting and classifying knot and slub defects in solid-shade, unpatterned woven fabrics. The approaches were based on either gray level statistics or morphological operations. The autocorrelation function was used for both methods to identify fabric structural repeat units, and statistical or morphological computations were based on these units. It was found that, both methods exhibited similar performance. While due to the gray level approach was more noise tolerant, fewer defect-free specimens were falsely determined as defective.

Bodnarova et al.

[143] developed a comparative study to examine the suitability of four different detecting algorithms. Gray level co-occurrence, normalized cross-correlation, texture-blob detection and spectral approaches were applied in this study. The correlation approach appeared to be the most promising method for a real time, high accuracy defect detection algorithm. Conci and Proença [4,[START_REF] Conci | A Computer Vision Approach for Textile Inspection[END_REF]144] compared the Sobel edge detection with those based on thresholding and fractal dimension and found it both robust and fast method to detect twelve fabric defects. They found that the use of fractal dimension method gives the most reliable results because it correctly detects all defect types with only 2% false alarms while it is faster than the other approaches. Ozdemir and Erçil [START_REF] Őzdemir | Markov random fields and Karhunen-Loève transforms for defect inspection of textile products[END_REF] compared six texture algorithms: MRF, KLT, 2D lattice filters, Laws filters, Co-occurrence matrices, and FFT, for fabric defect detection. They concluded that, the 9th order MRF model gives the best results. Dimension algorithms. The results showed a similar or superior performance to more complex approaches but with greatly saving computational cost. Finally, Vergados et al.

[73] detailed a description of the state of the art techniques for texture segmentation as well as an evaluation of experimental research and results on the basis of selected algorithms suitable for real-time applications. They concluded that the efficiency of the various methods is strongly related to the nature of the inspected image while an algorithm for real-time applications should be specially designed on the basis of fast computational approaches.

Summary of literature review

From our survey, it is concluded that the need for a comprehensive, consistent way to produce first quality or defect-free fabrics has an utmost priority than ever. To insure this quality level, we must perform 100% inspection. But, due to the huge drawbacks of the traditional visual offline systems, it is an impossible task. Consequently, the online automated fabric inspection is presented as a robust alternative. Such system must operate in real-time, produce a low false alarm rate, and be flexible to accommodate changes in the manufacturing process easily.

The research work relevant to the automation of fabric defect detection is very vast and diverse. It is reasonable to believe that, the results of an automated inspection system rely on its implementation where, the better approach for defect detection is related to the expected defect types. Mainly, all researchers consider this task as texture segmentation and identification problem. In this review, the texture analysis problem is categorised into six approaches according to the used algorithm; statistical, structural, spectral, modelbased approaches, combination of computational methods, and finally, comparative studies. The used algorithm is the core of all approaches. It should be fast and designed on a basis to process the data in a way that minimizes computational complexity and enhances the detection capabilities.

For each approach, the basic principles and methodologies along with their advantages and drawbacks are discussed. Surprisingly, it was found from the different studies that, a perfect approach that detects all fabric defects does not exist yet. Moreover, because the used systems are still to be considered as very expensive, only few automated fabric inspection systems are currently available in the market.

In fact, the ability of structural approaches to detect fabric defects is very restricted mainly due to the stochastic variations in the fabric structure. Besides, despite they are very popular, simple-order statistics based approaches (e.g. classical histogram, morphological operations, gray level statistics, and gray level thresholding) often yield inadequate results and relatively invariant with respect to changes in illumination and image rotation. On the other hand, methods based on higher-order statistics, (e.g. cooccurrence matrices or artificial neural networks) are extremely time consuming or do not scale well to massive datasets. In addition, Model-based approaches are very difficult and computationally intensive especially where a large number of models must be considered.

It is also notable that, spectral approaches simulate the human vision system and render heralded methods for automated fabric defect detection. But as a result of the nonorthogonality of Gabor functions, when applying Gabor filters there are many correlations of features between the scales. Wigner distributions suffer from the presence of interference terms between the different components of an image. Moreover, wavelets cannot solve all problems and there are still a lot of limitations inherent to wavelet transform. Also, wavelet transform-based techniques suffer from either image components interference or features correlations between the scales. Therefore, it is reasonable to find an approach that combines most advantages with lower drawbacks to be implemented as the base of constructing an effective and accurate method to detect automatically fabric defects during the manufacturing (weaving) process.

In our thesis, Fast Fourier Transform (FFT) is the selected approach. As one of the spectral approaches, it corresponds to the fabric high degree of periodicity and the speed of the weaving machine as well. Also, it is simple, fast and has low computational complexity.

3.

Chapter 3: Proposed Approach

Research methodology

It is desirable to have a generalized system for online automated fabric inspection that should be able to cope with the wide variety of fabrics and defects. As mentioned previously, the task of fabric inspection is a texture segmentation and identification problem and therefore, fabric defects can be detected by monitoring its structure. By considering the periodic nature of woven fabrics, the image in the Fourier domain is decomposed into its sinusoidal components. Consequently, it is easy to examine or process certain frequencies of the image corresponded to the geometric structure in the spatial domain. Therefore, we can implement Fourier transform to study the construction characteristics of a spatial domain image for the woven fabric. This algorithm is simple, fast and has an optimized computational complexity and noise sensitivity as well.

Research objectives

The global objective of our research is to prove that an automated online defect detection system based on image processing technique introduces a robust alternative to traditional offline human-based systems. The achievement of this general goal means that the following other sub-objectives have been consequently achieved:

1. Improving the fabric quality level by detecting all defects immediately during the production to reduce the cost and meet the manufacturers' needs. 2. Elimination of human drawbacks such as errors and/or subjective judgement. 3. Creating a timely statistical product data that enables the manufacturers to design and improve the mill future plans. 4. Increasing the manufacturer's credibility. 5. Designing and developing a robust tool for scanning the textile images. 6. Developing a methodology to extract defect features from various fabrics using Fast Fourier Transform and cross-correlation techniques. 7. Identifying and optimizing the main parameters which affect on defect detection process. 8. A computer demonstration of a sequence of steps from the pre-processing through the final detection. 9. Design and construct a system to demonstrate the utility of the developed methodology.

10. Testing the developed system online or in real-time to generate the knowledge base for the expert system and to provide real time unsupervised adaptive capabilities to make the system more robust.

Research approach

To achieve the objectives of this research, the following tasks are carried out:

1. Development of a fabric defect map to determine the most major defects which should be considered during the pre-processing step. 2. Acquisition or generation of a sufficiently large fabric database or images with and without defects at different resolution levels. 3. Development of a suitable procedure using a software package (Scilab or Matlab)

to implement the proposed technique (fast Fourier transform and the crosscorrelation). 4. Training the technique firstly on the simulated fabric images containing the chosen major defects to understand the behaviour of the frequency spectrum, determine and optimize the most important detection parameters. 5. Test and verify the success of the technique using real plain fabric samples containing the same simulated defects. 6. Design and development of a prototype to examine the technique in real-time (during the production of the fabric on the weaving machine) that is the main object of this thesis. 7. Generate knowledge base for the expert system to provide online adaptive capabilities to improve the system efficiency. A fabric is a flat structure consisting of fibrous materials, either natural or man-made.

It is well known that, according to the technologies used during manufacturing, there are various kinds of fabrics such as woven, knitted and nonwovens. We will deal exclusively with the woven fabrics that are produced by weaving (i.e. interlacing according to a determined repeat or pattern) two perpendicular elements: warp and weft threads. The warp represents the threads placed in the fabric longitudinal direction, while the weft represents the threads placed in the fabric width-wise direction. The weave pattern or basic unit of the weave is periodically repeated throughout the whole fabric area with the exception of the edges. The plain weave is the most made weave in the world. It is relatively inexpensive, easy to weave and easy to finish. Therefore, we choose this structure as the fabric type on which our study will be implemented.

Definition and sources

The fabric defect could be simply defined as an abnormality in or on the fabric construction. The term construction here refers to both of yarn spacing (fabric density i.e. number of threads per unit length in both of warp and weft directions) and yarn interlacing (fabric structure). When there is any undesired abnormality inside the fabric construction during the manufacturing process, it results in a mechanical defect. As the woven fabric is a finished product of many accumulated manufacturing processes starting from the fibre, it can show various kinds of defects ascribed to the processes which follow one another till the realization of the fabric. Therefore, the source of the fabric defect has a vital importance to differentiate between and/or explain these defects. this figure, it is understood that, the defective product found after each manufacturing process is the total sum of raw material defects and the defects attributed to the process itself.

Types and reasons

As it is called woven, should any defect assigned to the weaving operation represent the first reason of woven fabric defects. Therefore, most defects in fabric occur while it is woven on the loom. Some of these fabric defects are visible, while others are not.

However, some fabric defects may be rectified during weaving and after weaving while others are not. The following tables summarize the most common fabric defects, their reasons and degree of severity as well. The tables are constructed on the base of defect direction or the area where the defects are extended.

According to the mentioned base, the most common fabric defects are presented in the following three tables where tables (4.1), (4.2) and (4.3) present the most common fabric defects appearing in more or less extended areas, warp and weft directions. In addition, figures (4.2), (4.3), (4.4) and (4.5) illustrate the defects of each table respectively. Because of the wide variety of defects as mentioned previously, it is too difficult to study all defect types, therefore, it is gainful to detect firstly the most famous fabric defects and then apply the procedure to detect all possible fabric defects. The chosen famous defects are: hole, oil stain, float, coarse-end, coarse-pick, double-end, double-pick, irregular weft density, miss-end, and miss-pick. These defects represent all possibilities regarding the expected defect type, size, direction i.e. warp direction, weft direction and/or both (as an area). In the same time, the defects are randomly distributed through all fabric images whereas the defects exist in the top, bottom, right or left side of the image.

Miss-pick Irregular pick density

Coarse-pick Tight weft thread

Fabric images 4.2.1. Image quality

In fact, because the main global object of this thesis is to detect fabric defects using image processing technology, the digital image of the inspected object (the fabric)

represents the core of our work. As far as possible, good-quality images must be used.

Such a quality facilitates a correct feature extraction which consequently enhances the analysis stage. To do that, we should serve some vital criterions. Moreover, to prevent acquiring blurry fabric images, the following points should be considered:

1. High resolution.

2. Suitable format.

3. High contrast. 4. Minimum noise. 5. Focused. 6. Free of rotation.

The most important parameter that should be adapted to set-up an adequate acquisition of fabric images is the resolution. We can refer to the resolution of an image either by the size of one pixel or the number of pixels per inch (ppi). In fact the term (dpi) which means dots per inch are commonly used than (ppi) although it is not 100% technically correct. It is well known that the lower the image resolution, the less information is saved about that image and therefore available for the later processing. Moreover, higher resolution means more saved information but also larger memory size required to store and process the image. As human vision is approximately 300 dpi at maximum contrast, the scanning of fabric images in our thesis begins from 300 dpi resolution to simulate human vision. After that, the resolution level will be increased gradually till we obtain the optimum one.

Once an image is captured, it can be saved in various formats. One main difference between these formats is whether the information used to describe the image is compressed with a lossy algorithm (to save space) or saved uncompressed (or with a lossless compression algorithm) where the file size is large but all the information is retained. Format such as 'jpeg' is not recommended to use because it is basically a lossy one. It means that to reduce the file size, some image data is actually thrown away. In the contrary, 'bmp' or 'tif' formats do not compress the image. Thus, we are choosing between a highly compressed image (small size, low quality), or a less compressed image (larger size, higher quality). TIFF 'tif' is a lossless format providing an acceptable size. In our thesis, all images are stored in 'tif' format.

After choosing the image format, there are two possibilities to store it either in coloured or grayscale. Coloured scale images usually have a large size which needs a large hard disk size to be stored and processed especially with the huge number of acquired images. On the other hand, a grayscale image does not suffer from such drawback. In our trials it was found that a 500 × 500 coloured fabric image scanned at 1000 dpi resolution has a size of 552 kilobytes. The required memory size for the same image is reduced to only 176 kilobytes if it is stored in grayscale.

Often, grayscale intensity is stored as an 8-bit integer giving 256 possible different shades of gray from black (0) to white (255). These images are very common, in part because much of today's display and image capture hardware can deal with it easily. In addition, grayscale images are entirely sufficient for many tasks. We assumed and verified that with 256 shades in the grayscale there were enough increments to make fine distinctions between target objects and backgrounds.

In fact, all above mentioned parameters to capture a high quality image are mutually interrelated so that each one affects the others. Broadly, fabric images should be clear and focused to obtain sharp pixels. In addition, by applying a correct fine-tuning for lighting settings, we can produce a good image with minimal loss in clarity while the time and complexity of processing operations will be avoided as well. Actually, it is not easy due to the expected vibration during the running of weaving machines. In addition, as fabric units (threads) are orthogonally set, we should keep the same property in the acquired fabric image. But because of the material elasticity and the tension of the weaving machine parts, it is very difficult to maintain.

Later, we will discuss in details some parameters such as image resolution, noise and rotation to explain the different settings for each one. Moreover, we will give arguments for the choice of these settings and to present the implemented procedure to adapt and/or optimize each one.

Before applying the detection technique on real fabric images, it is gainful to implement it firstly on synthetic images. So, we will simulate various plain fabric images to determine and optimize the most important detection parameters. The synthetic (simulated) images comprise firstly an image free of defects. From this image will simulate the other images which contain the most major defects such as holes, stains, floats, coarse threads and miss-threads defects. The used procedure to simulate the plain structure images with and without defects will be presented in the next part.

Synthetic (simulated) images

As mentioned previously, the woven fabric is composed of a main basic unit which is repeated in both directions (warp and weft) to cover all fabric area except the selvedge.

Therefore, we should first construct or build the repeat of the simple plain structure. Some basic assumptions should be considered when constructing such repeat:

1. It comprises of two warp threads and two weft threads with four points of intersections or interlacing (two in each directions). 2. Both warp and weft threads have the same count i.e. the same diameter. 3. These threads are perpendicular on each other. 4. As the applied tension on both warp and weft threads is not the same (it is higher in warp direction than the other one), the warp spacing (number of warp threads per unit length) is higher than weft spacing (number of weft threads per unit length). 5. Because both words 'weft' and 'warp' begin by the same letter, we will use 'x' and 'y' to refer to the two sets of threads respectively. 6. Consequently, as shown in figure (4.6), S x and S y represent the length and the width of the repeat basic unit respectively. While Ø x and δ x are the weft thread diameter and the distance between two neighbouring weft threads. Also, Ø y and δ y are the warp thread diameter and the distance between two neighbouring warp threads. 7. The dimensions of the previous settings in pixels are: S x = 38, S y = 32, Ø x = 14, δ x = 6, Ø y = 14, δ y = 2 pixels respectively. From these dimensions, it is notable that δ x > δ y and consequently S x > S y .

1-Using concatenation principle:

This method is implemented based on two facts. The first one is that an image could be represented as a matrix whereas the process of joining one or more matrices to make a new one is defined as image concatenation. The second fact is that Matlab is a matrixbased computing environment where all input data is stored in the form of a matrix or a multidimensional array.

By considering:

ƒ(x)= the image of the repeat unit is a two dimensional matrices of pixel data, g(x)= the repetition image of the plain structure, h(x)= the concatenated image of A and B (the plain fabric image), Thus h = [ƒ g] is the horizontally concatenation while h = [ƒ; g] is the vertically concatenation.

2-Using the convolution mask:

Broadly, convolution is a mathematical operation on two functions ƒ(x) and g(x), producing a third function h(x) which is a modified version of one of the original functions.

Mathematically, linear convolution is defined as follows:

( ) ( ) ( ) ( )da a x g a f x g x f - = ⊗ ∫ ∞ ∞ - , ⊗ ⊗ ⊗ ⊗ denotes the convolution. (1)
In discrete convolution, the integral is replaced by summation, the integration variable becomes an index while each displacement takes place in discrete increment.

To implement this theory in simulating a plain fabric structure in the spatial domain, the plain fabric image h(x, y) is described as a convolution of a basic unit ƒ(a, b) by a pattern of repetition g(x, y).

( ) ( ) ( )

y x g b a f y x h , , , ⊗ = (2)
At each point (x, y), the convolution is the computation of weighted sums of the image pixels with the convolution mask, which is shown as follows:

Creating defects

Using any method of the previously used to simulate the defect-free plain fabric image, we can generate different images with defects. The chosen defects in our thesis have directional dependence or not. Also, it should be major defects and randomly located inside the images. Figures from (4 In addition a halogen lamp is used as a lighting system. The image was captured in 256 grey levels and stored in an image matrix of size 500 x 500 pixels as shown in figure To do that, we used a flat scanner to capture various plain fabric samples containing different types of defects. Firstly, we examined three different resolution levels 175, 375 and 700 dpi) to determine the minimum level which should be considered. Such level was determined as 300 dpi. Then, it was increased gradually by a step of 100 dpi till 1200 dpi as a maximum resolution. Finally after acquiring all fabric samples at different resolutions and in 256 gray levels, the images are stored as usual in matrices of size 500 x 500 pixels. Because the previous images were captured from different fabric samples, there are slight appearance differences in between. This will not affect the detection process as each image containing a defect will be compared with a reference one free of defects captured from the same fabric sample. Also, due to the nature of fabric structure, there are some images containing defects such as tear, snarl and contamination do not exist in the images of simulated fabrics.

Defect detection technique 4.3.1. Background knowledge

Our basic tool will be the Fourier transform. From an image expressed in the direct space, in spatial coordinates, Fourier transform gives an image in the Fourier space which is a frequency space: in this space, the coordinates are spatial frequencies. Please note that contrary to well known 1D situation of temporal signals (for instance audio signals), the Fourier space in our case has nothing to do with time. We deal with spatial frequencies, not temporal frequencies.

According to Fourier theorem, any signal can be represented by the sum of sine and cosine waves with various amplitudes and frequencies. The tool to do that is well known as Fourier Transforms (FT). The input of the transformation represents the image spatial domain while the output of the transformation represents the image in the Fourier or frequency domain where each point represents a particular frequency contained in the spatial domain image. The important property is that regular spatial pattern information becomes obvious in Fourier-transformed images. It is clear from the above equation that the value of F(a,b) is a complex number which means that it can be put in the following form:

Description of the used algorithm

( ) ( ) ( ) y x y x f f j e f f F b a F , , , θ = (5)
It is essentially here referring to some of the most frequently used terms when implementing Fourier transform. For instance, the value of the modulus in the previous equation │F(f x ,f y )│is known as Fourier or frequency spectrum of ƒ(x,y) whereas, the value │F(f x ,f y )│ 2 is called the power spectrum of ƒ(x,y). The utility of Fourier spectrum comes from our ability to plot it easily in a 2D plane.

In our case, one of the most important advantages of the frequency spectrum appears during the online detection of fabric defects or during the weaving process. It is well-known that the produced fabric moves forward as a result of the take-up mechanism of the weaving machine. As mentioned previously, the magnitude of Fourier spectrum is an absolute value i.e. it does not change due to the fabric movement for distances x 1 in x direction and/or y 1 in y direction. This means that, the frequency spectrum only changes if fabric structure changes and consequently is suitable for online automated inspection.

Chan and Pang [1] explained mathematically such principle through the next form:

( ) ( ) ( ) N f f j y x y x y x e f f F y y x x f / 2 . 1 . 1 , , 1 1 + - × ⇔ - - π (6)
Another important property of 2DFT is its ability to restore the processed image from the frequency domain to its spatial domain. This is usually done using Inverse Discrete Fourier Transform (IDFT). Thus, in similar way to the previous equation, the Fourier image can be re-transformed to the spatial domain using (IDFT) as follows:

( ) ( )

N by ax j N b N a e b a F N y x f / ) ( 2 1 0 1 0 2 , 1 , + - = - = × = ∑ ∑ π (7)
What is important here is that the pronounced difference between DFT and IDFT is the sign of the exponential function and the normalization term Despite its numerous advantages, DFT has an important drawback: its long computation time. One-dimensional DFT has N 2 complexity. This can be reduced to (N log 2 N) if we employ the Fast Fourier Transform (FFT), which provides the same results. FFT is a discrete Fourier transform with some reorganization that can reduce the complexity of the DFT and save an enormous amount of time. Similarly, the complexity of two-dimensional DFT is proportional to 2N 3 while using FFT reduces it to (2N 2 log 2 N).

Therefore, during our application, we will implement FFT. As it is anticipated, the simulated structure presents the regularity of the structure in its ideal and optimum level. The value of each point in the frequency spectrum determines the amplitude of the corresponding frequency. In addition, the vertical and horizontal lines corresponding to the warp and weft threads in the original images can be identified.

Feature extraction (Cross correlation technique)

As mentioned in the review part, by considering the periodic nature of woven fabric, it is possible to monitor and describe the relationship between the regular structure of the fabric in the spatial domain and its Fourier spectrum in the frequency domain. Presence of a defect over the periodical structure of woven fabric causes changes in its Fourier spectrum. By comparing the power spectrum of an image containing a defect with that of a defect free image, the shifts in the normalized intensity between one spectrum and the other could signify the presence of a defect.

In our thesis, we derived our implemented procedure from references [1, 16 and 109]. The basic principle is to compute a set of textural features in a sliding window (subimage). Then, we search for the significant local deviations in the feature values from the entire image. These textural features are seven and were extracted from the weft and warp diagrams of Fourier frequency spectrum of the sub-image as shown in Ref. [1 and 109].

As the information about weft yarns appears in the vertical direction f y while the information about warp yarns appears in the horizontal direction f x , the seven features are extracted as follows:

( ) Where feature P 1 represents the image average light intensity that characterizes the fabric structure (density) irregularity. Features P 2 , P 3 and P 4 are for detecting changes in the vertical or warp direction, whereas P 5 , P 6 , P 7 detect changes in the horizontal or weft direction. The features P 4 and P 7 analyse the region between the central peak (first harmonic frequency) and first peak because higher harmonic frequency components are significantly distorted in real environment.

0 , 0 1 F P = (8) ( ) 0 , 1 2 x f F P = (9) 1 3 x f P = (10) ( ) ∑ = = 1 4 0 0 , x xi xi f f f F P (11) ( ) 1 5 , 0 y f F P = (12)
Then, the average feature correlation coefficient of a fabric image free of defects is calculated. We have then reference figures. After that, a possibly defective image is scanned: we sample it in sub-images of determined size and step. Again, the average feature correlation coefficient of each sub-image is also calculated. If the calculated value of the sub-image feature correlation coefficient is smaller than that of the defect-free image, it means that this sub-image has a defect. For instance, we can represent it on the original image with a red overlay.

Modification made

The implementation of all researchers using FFT and/or cross-correlation (sliding window) to detect woven fabric defects was found to be very similar. The obtained results were usually poor with various false alarms. Also, regardless the rare high quality simulated image (only one article), the images of the real fabric had always poor quality. In addition, there are fuzziness and confusion during the mathematical calculations of some important detection factors such as the coefficient of feature correlation. Moreover, there was no answer to different important questions related to the parameters which should be considered during defect detection. For instance, what are these parameters? Is it possible to optimize them? What about noise?

In our thesis, the major improvement or modification is that we introduce a comprehensive study fabric defect detection using FFT and cross-correlation to obtain robust detection results, remove any confusion and answer the previous questions as well.

To do that, we first determine the most important parameters during the process of defect detection and then optimize each of them even considering noise. Also, major mathematical modifications and improvements should take place to minimize as possible the false alarms and to obtain acceptable results of the process of defect detection.

Strategy of implementation

The explained basic algorithms and technique require robust strategy to be implemented. Figure (4.35) presents the flow-chart of this strategy along with the different steps. Such strategy revolves around the detection principle that describes textures in fabric images by a series of features derived from their fast Fourier transform at different levels of resolution. The defect-free image contains only one texture. It means that its all defect-free sub-images will contain the same important or significant information as the original image. Otherwise, the sub-image has a defect.

The input images are first cropped into many sub-images. Each of these images is Fourier-transformed and then a set of local statistical measures (features) is computed as local energies (peak values) which represents the first step. These values correspond to the power contained in a certain frequency range in the image.

The previous procedure is implemented firstly on the simulated fabric images to determine and optimize the most important detection parameters. Then, it is implemented on different images of real fabric which contain the same pre-determined defects of simulated images. The object here is to prove the utility of the technique to detect defects in case of a real fabric and in case of a simulated one.

To improve the credibility of the technique and overcome the problem of detection errors, a second step is implemented using a level selection filter. Through this filter, the technique is able to detect only the actual or real defects and highlight its exact dimensions.

In all previous steps all used images have pre-determined defects. We need to obtain unsupervised defect detection in which any defect should be highlighted regardless it is considered in the training stage or not. Therefore, several images containing some random defects will be used to confirm the ability of the technique in the unsupervised conditions. The last step is to examine the technique during the weaving process i.e. in real conditions. In addition, the detection results could be used to develop daily reports of defective products or any other quality reports. Also, we can mark the selvedge of fabric roll at a place parallel to the existed defect as usual.

This strategy is summarized in the next flow-chart whereas some steps have to be introduced with more details to describe how it actually takes place. The next part of the chapter addresses these step the strategy.

Reliability of detection technique

The reliability of our defect detection technique is very important as it determines the performance or the efficiency of the system. In this thesis, we will use the false alarm rate to characterize such reliability. As we mentioned before, the false alarm (positive false) occurs when our technique highlights a fabric or image area and/or considers it as a defect while it is not. Moreover, the negative false occurs when the technique fails to highlight an existing defect. Both cases decrease the reliability of the implemented technique. Thus, the false detection rate we will be used in order to express the success of our technique.

False detection rate will be calculated as the total number of images containing false results divided by the total number of processed images. Usually, insufficient detection reliability is obtained due to two main reasons:

1. The first reason is related to the implemented technique itself. Each detection technique has its own key factors or parameters which have great influence if they are not well set or fine tuned on the technique global reliability. In next parts, we will study these parameters and the method to adapt and optimize each one to obtainas possible -perfect detection. 2. The second reason is related to the surrounding conditions or environment. For instance, the poor illumination and/or machine vibration during weaving process usually results in noisy images which increases the detection errors.

Another effective solution to increase the technique reliability rather than what is mentioned above could be obtained by implementing a further filter. It is considered as a second threshold step to decide exactly whether the inspected fabric (image) has a defect or not. Because such filter represents a part of our detection technique body, we explain its principle in the following separate part.

Level selection filter

For the sake of clarity, implementation of the level selection filter will be described considering the actual graphical output of our program. During the process of defect detection, as explained before, if there is a defect, it will be highlighted by overlapping red square overlays. Each square corresponds to the test of one sub-image. The main drawback is always the positive falses (to reduce negative falses, we lower the threshold).

To avoid this problem, a level selection filter is proposed to be implemented.

We are supposed to get redundant information, provided that original images are sampled with overlapping sub windows. With a proper choice of the sample step, each pixel appears in four sub-images. Our filter consists in counting in how many defective sub-windows the pixel appears. It can appear from 0 times to 4 times. Therefore, we can obtain 4 levels:

Level 1: an area is scanned and consequently counted one time.

Level 2: an area is scanned and consequently counted two times.

Level 3: an area is scanned and consequently counted three times.

Level 4: an area is scanned and consequently counted four times. Based on the filter, fine tuning takes place to determine the degree of accuracy for defect detection. For instance, if level 4 is considered, we are sure that the area has a defect while level 1 could be considered as false alarm. The area in level 3 is to be considered also as a defect whereas the area in level 2 needs more training to decide if it will be considered as a defect or not.

The main advantage of this filter is to reduce the detection errors where only one sub-window out of four appears defective: such area will be considered as defect-free. In addition, the highlighted area surrounding each defect will be optimized. Figure (4.37) shows the implementation of the filter on a simulated fabric image containing a stain while figure (4.38) illustrates the colour map of the filter result. Each sub-image has different colour. The overlapping between two or more sub-images results in another different colour (usually darker). Thus, the higher the level of overlapping, the higher probability of detect existence. From this figure, it is obvious that the stain has an exact highlighting.

Software package

Our proposed algorithm, technique and their all optimizations were accomplished during this study by implementing several Matlab and Scilab scripts (see appendixes).

Stages of implementation

In our thesis, the procedure of performing the proposed defect detection technique passes through three stages or phases to ensure robust final results. These stages are:

Training stage

It is known also as the learning phase. Within this first stage, an inspection of fabric image without any defects takes place. We will use simulated fabric images because the features and the periodicity of the structure are extremely pronounced. The main object here is to calculate the feature important parameters (for instance, its extreme values or peaks). Then, these values are used to choose the first threshold.

Testing stage

It is the phase when looking for defects. During this phase, several fabric images having pre-determined defects are used. The procedure of defect detection is implemented to highlight the well known existing defects. In addition, only the features of interest (the seven features) are calculated. The amount by which these features lie below the value of the chosen threshold in the training stage is considered as a measure of the defect. Rather than it is used in the beginning of this stage as an evidence for the existence of defects, simulated images are simultaneously used for later optimization of the factors which affect the detection process. Then these optimized values are used (with another fine tuning) for real fabric images (containing defects and free of defects) to show the success of the technique

Unsupervised stage

In the two previous stages, we use images containing pre-determined defects. It means that the severity, the dimension and the orientation of all defects are well known.

But as fabric defects are generated randomly and dynamically, a perfect robust automation of visual inspection process requires unsupervised defect detection. In our thesis, the term (unsupervised defect detection) refers to the detection of unknown class of defects for which there is no training. Therefore, in this stage the object is to detect all types of defects regardless their size or position inside the fabric. Also, the technique will be examined with plain fabrics of different colours rather than with a white fabric. In addition, both simulated and real fabric images could be used during the implementation.

Main defect detection parameters

As stated before, one of the basic modifications created through our research work is the determination and optimization of the factors or parameters which affect the defect detection process. It has been found after the first few attempts of implementation that some parameters have a direct effect on the success of the technique. These parameters are considered as parts or steps of our Matlab scripts. Image acquisition resolution, the size of the sub-image, the step at which the sub-image scans the main fabric image and the threshold of features correlation coefficient are examples for these direct parameters.

In addition, there are other important parameters such as the required time for detection and the defect type which have indirect effect on the process. It is not considered as a part of Matlab scripts but it affects to great extent on the global performance of our technique.

This part of our thesis helps us developing an appropriate method for choosing parameter settings and fine-tuning the performance of the used algorithm. Such parameters along with its optimization methods are demonstrated as follows:

Acquisition resolution

It is well known that we cannot obtain high quality products from poor raw material.

The digital image of the fabric is to be considered as the raw material of our whole work.

The importance of this parameter stems from:

1. The image resolution is responsible for demonstrating the statistical features differences. For instance, the statistical features of the defective region (especially in case of minor defects) of low resolution images can not show significant difference with respect to neighbouring area. To avoid this problem, the image resolution should be high enough. 2. It determines also the total number of sub-images required to scan the whole image area and consequently the time of inspection. 3. It determines also the minimum defect size that could be detected. 4. This item in relation to fabric width determines the number of cameras required for online detection systems. For example, the structure periodicity, the defect rational area with respect to the total area of the image, the defect background and the total number of structure repeat units. appropriate resolution level, it will be fine tuned where we will study the resolution around this level with a step of only 100 dpi.

Sub-image size

This parameter may be considered as the most important one because it represents from one hand the segmentation stage in our image processing procedure, whereas from the other hand, we found during our first trials that it has a great effect on the technique performance. The next criteria present some critical considerations during the determination and/or optimization of the suitable sub-image size:

1. Both minimum and maximum size (in pixels) which we have to start with.

2. The relationship between the size in warp direction and that of weft direction.

3. How can we move between the minimum and maximum sizes? 4. What about defect type?

In fact and during our first trials, we had to start from where others ended (logical scientific consideration). In Ref.

[109] the size of 50 x 50 pixels was determined to detect fabric defects. Therefore, it is estimated that this value could be considered as an average for the sub-image size (although with such mentioned values there are many detection errors). In addition, the average equals to (N/10) where N=500 pixels. Consequently, both minimum and maximum values could be considered as functions of N so that the maximum value is N/5 and the minimum is N/15. The decision has been made based on approximately doubling and halving the average value. Also, when the sub-window size is out of those selected limits, the performance of defect detection is very poor.

The relation between the size in warp and that in weft direction is another important factor during the sub-image selection. In fact, there are two possibilities: either they are equal or not. It is mentioned before in the literature review part that Fourier transform is a basically power of two transform. Thus, the image sizes in both directions should be equal to obtain good results. During our first trials, we implemented some different sizes in both directions but we obtain many detection errors rather than the huge number of resulted images.

As the higher and lower limits of the sub-window that scans the main image are determined in warp and weft directions, the step of movement between each two successive sizes has also to be determined. The main purpose is to prevent any loss of image information during this stage (segmentation process). To do that, the main image should be sub-imaged so that the difference between sizes is an equal integer in both weft and warp directions. Finally, the suitable sub-mage size will be optimized for each defect type and then for all types simultaneously.

All previous criteria are used to optimize automatically the suitable sub-window size through the following steps:

1. We first implement our technique on the reference (free of defect) image to locate the limits where the suitable size in weft direction exists. It is determined according to the calculation results of both sub-window size and feature correlation coefficient. The same step is done in warp direction. 2. We draw the relation between the two limits to obtain the area of intersection. All points of such area represent suitable sub-window sizes. 3. The previous two steps are created for the image containing a defect to obtain and draw also the area of intersection between the limits of suitable sizes in warp and weft directions. 4. The last step is for more certainty where we calculate the ratio between the values obtained in case of the image containing a defect and the reference one.

Scanning step

Our object during scanning the main fabric image is to cover the whole area of the image. This could be achieved for all step values from 1x1 pixels till those values when the scanning step is equal to the sub-image size. From first trials, it was found that the chosen step has a great effect on the detection results. In addition, there is a significant relationship between the values of scanning step and sub-image size. Logically, the optimization here means the choice of the higher step value to minimize the total time of the detection process and the intensive overlapping as well. In addition, the step limits during the optimization are related to the limits of sub-window size. Therefore, for each defect type, the scanning step and the sub-image size will be optimized simultaneously. In addition, the lower step limit equals to the minimum sub-window size while its higher limit cannot exceed for sure the maximum sub-window size. Also, we will study the relationship between the two parameters to determine mathematically (if it is possible) the shape of this correlation.

Noise level

In weaving process, it is vibrations will result in slightly be rather sharp which influenc

Feature correlation coefficient value

This parameter assesses how good a set of features is for implementing our technique. It is estimated that the maximum used value should be smaller than 1.0 (the case of exact correlation). In our literature review, it was found that the value of coefficient correlation changes according to each defect type and/or size so that various values are used to ensure good results. In addition, such a value changes also when detecting defects of simulated and/ or real fabric images. Thus, different coefficient correlation values (0.7, 0.75, 0.8, 0.85, 0.9, 0.95 and 0.99) are used during the optimization of this parameter. As it is found that very fine tuning has no effect on detection credibility, the step between each two used coefficient values is 0.05. Our object as usual is to define only one value suitable for all detection circumstances.

Defect type and size

In our thesis we started firstly to detect major defects in simulated and then real fabric images. All above mentioned parameters will be optimized for each individual defect. As shown in figure (4.45), the camera is installed in the middle of the loom at 10cm distance from the fell of the cloth and 75 cm in height of the loom with 90° angle against the produced fabric. In addition, the camera and lighting unit are delivered in a stable frame. The housing also contains modules for the synchronisation of the camera and lighting as well as video signal adapters for the fibre optic transfer.

The scan speed is around 1000 lines/second while the scanning line is around 300mm wide. Fabric surface images are obtained at a resolution of 1000 dpi along the scanning line. Images are digitized with 500 X 500 pixels and stored in a computer as 8-bit grayscale data for image analysis.

The next chapter of the thesis introduces the results of the experimental setup.

Introduction

In this chapter we present and discuss the various experiments which have been performed to ascertain our proposed procedure effectiveness. Basically, it comprises two main parts; the first one deals with the results of defect detection for simulated fabric. The second part presents the results of detection for real fabric. Obviously, both have intersimilarity. Moreover, the results of defect detection in simulated fabric are to be considered as entrance to detect and optimize the most important parameters which affect the detection performance in case of real fabric.

It is well known that the results of the experiments when implementing the technique are images (either the defects are detected or not). Because the total number resulted from each experiment is huge (more than 350000 images that is impossible to display in this chapter), we have to quantify the parameter's effectiveness with its influence on global recognition performance as well. For each detection parameter, one figure gathering the detection results is presented. This figure also compares the detection results for all defect types. Finally, few images will be presented when needed either to confirm and/or to display an idea particularly if the text alone is not enough.

Defect detection for simulated fabric

It is expected that detection results and consequently the optimization of various detection factors for simulated structure are better than that of real structure. Such relative ease is due to the ideal or perfect periodicity of these structures. The main difficulty (for both structures) arises from the influence between the detection parameters to the extent that we cannot study and optimize each one without referring to one or perhaps more than other detection parameters. In addition, we should always put into our consideration that detection of simulated defects is not an object itself but it helps us understanding the behaviour of the detection technique and gives indications to what should take place for real detection.

Optimization of sub-image size

The size of the sub-image which scans the main fabric image is very important. This size determines the minimum possible defect size that could be detected by our technique.

To optimize the size with which we can obtain 100% detection rate for all defect types we summarize firstly the detection results for all sizes from the minimum to the maximum levels mentioned in the experimental setup. The reason to do that is the huge results obtained at each size whereas we need to precise only one tight suitable range for all defects. Inside this range it is expected to find the best sub-window size which will be reoptimized in a second step. From this figure it is found that relevant sub-image dimensions vary between approximately 45x45 pixels and 70x70 pixels according to the defect size and direction.

For instance, for small defects such as holes and floats this area is around 50x50 pixels that is close to the lower determined limit. In addition, the defects existing in fabric weft direction have areas of intersection around 60x60 pixels which is near to the higher determined limit. Up to this point, besides determining a narrow range contains the best sub-image size for all defect types, It is meaningful also to show that the defect size and direction have an influence on this size and consequently on the detection performance.

Secondly, to determine the value at which the sub-image size for each defect type is set during the implementation of the technique, we will study the detection rate at each point starting from 50x50 pixels till 65x65 pixels. Also, other sizes smaller than the chosen level such as 33x33 and 40x40 pixels are included while again other values larger such as 70x70, 80x80 and 90x90 pixels are also included. This wide range covers all possibilities especially we cannot neglect the sizes outside the pre-optimized range due to its valuable detection results.

All detection results for all defect types are gathered in Figure (5.2). For each defect type we draw the relation between the detection rate percentage and the implemented sub-image sizes during the detection process. It is essential to re-emphasize that we cannot always get 100% as maximum detection rate at a certain size because other parameters remained fixed and were not optimized at this point. Therefore, we look for the the sizes at which the implemented technique gives best results. At these sizes the defects are completely detected but the results of the other detection parameters should not be considered. From figure (5.2) it is found that the values of the sub-image which gives higher detection rate are as follows:

1. From 57x57 pixels up to 60x60 pixels for holes, stains, miss-picks, double-picks, coarse-picks and the open-picks (irregular weft density). 2. From 50x50 pixels up to 53x53 pixels for miss-ends, double-ends, weft and warpfloats coarse-ends and the jammed-picks (irregular weft density). 3. Some defects such as holes, stains and coarse-picks are easily to be detected at various sizes outside these limits. 4. Irregular weft density (jammed-picks) is only detected at 50x50 pixels. Otherwise, the detection rate is zero. 5. Weft and warp-floats are hardly detected mainly due to their small sizes (it is the nature of such defects). It is only detected at small values of sub-window sizes which emphasize the relationship between the defect size and the value of the scanning parameters.

When the sub-image has small size, there will not be enough textural information to separate such image into different categories of interest. While very large sub-image sizes may have objects belonging to several different categories that is resulted in confusion and consequently detection errors. Moreover, the highlighting quality around the defect corresponds also to the relation between the sub-image size and the defect size. So that when the sub-image size is either too small and/or too large than the defect size, it results in very bad detection performance. Besides what is mentioned above, it is found that the longitudinal defects such as miss-ends and double-ends are hardly detected than the defects exisist in weft direction.

In addition, most detection errors (more than 95%) which decrease the detection rate are negative false alarms (there is no highlighting for the defect) that occurs especially when the sub-window size is set to high values. It is mainly due to the absence of actual variation in the periodical effect of Fourier spectrum which consequently results in only variation of the maximum and minimum values of Fourier frequency as shown in figure (5.3). This sketch presents a comparison between Fourier frequency of a defect-free image and that of a longitudinal defect to illustrate the change of maximum and minimum Fourier frequency values due to the presence of such defect type.

Figure 5.3: Effect of longitudinal defect on Fourier frequency

Eventually, there is no sub-image size allows detection of all defect types. Therefore, it is useful to use more than one size (two sizes are enough) to improve the overall detection rate and to enable the technique to detect all defects simultaneously particularly the defects of small sizes. Therefore, the sub-image will be set to 50x50 pixels and 60x60 pixels to detect all defects in case of simulated fabric.

Defect-free

Longitudinal defect

Optimization of scanning step

Scanning step represents the second important factor influencing the defect detection process. The importance of the scanning step stems from its role in covering the whole area of the fabric image. Therefore, it is also closely related to the size of the subimage. Rationally, the sub-window size and the scanning step determine the highlighting of detected defects. For instance, when both of them are small, the defect highlighting is not correct so that a part of the defects is only highlighted. In addition, in some cases, some regions inside the fabric image (usually besides the edges) are not scanned and consequently are not highlighted if they contain a defect. This occurs when a part of the last sub-window lies outside the main image either because of its size and/or the value of the scanning step. The value of feature calculations for this sub-image is then equal to zero and will not be compared with the defect-free one. These regions shall not be taken into account. Thus, not only the scanning parameters are coherent but also the size of the main fabric image and for sure the defect size as mentioned previously.

The detection time is another important factor related to the value of the scanning step (although it is not a detection parameter). For the same sub-window size, the higher the value of the scanning step, the lower the detection time required to scan the main fabric image and the lower overlapping around the detected defect (if there is any).

Actually there are many possibilities when choosing the scanning step value. It begins from 1x1 pixels up to (the sub-window size -1) x (the sub-window size -1) pixels (please note that we deal only with integers as mentioned in experimental setup). Our proposed technique will be implemented while the scanning step value varies between two limits; 15x15 pixels and 50x50 pixels (see the experimental setup). Between the two intervals the scanning step is set to 15x15, from 20x20 up to 30x30 successively, 35x35, 40x40, 45x45 and finally 50x50 pixels respectively. These values emphasize the area of interest while the outliers are not forgotten. Defect detection rate at each step value for all defect types is calculated. Figure (5.4) summarizes and compares these results for all defect types simultaneously. From this figure (5.4) it can be concluded that the scanning step has less influence on the detection results than the sub-image size. As mentioned before, it is quite difficult to discuss each parameter separately. Also, there is no step value at which the detection rate is 100%. This means that we will choose the step value that corresponds to the subwindow size which gives perfect detection. It is found that the values of the scanning steps which gives the best detection rate are as follows:

1. For the defects (holes, stains, miss-picks, double-picks, coarse-picks and the openpicks (irregular weft density)) which are detected when the sub-window size is set to 57x57 pixels up to 60x60 pixels, the scanning step values which give higher detection rate are between 28x28 pixels and 30x30 pixels. 2. For the defects (miss-ends, double-ends, weft and warp-floats coarse-ends and the jammed-picks (irregular weft density)) which are detected when the sub-window size is set to 50x50 pixels up to 53x53 pixels, the scanning step values which give higher detection rate are between 25x25 pixels and 27x27 pixels.

From these results it is found that the scanning step is approximately half of the subimage size which gives a satisfactory result. From one hand it insures an optimum overlapping and defect highlighting whereas from the other hand the detection time still remains within the acceptable limits.

Optimization of feature correlation coefficient

The feature correlation is the judge who sentences whether the sliding sub-window contains a defect or not. After the optimization of sub-window size and scanning step, it is found that the optimized values are intermediate i.e. are not very high or low. This provides enough textural information so that at many coefficient values it is easy to extract these seven features and then calculate their average for each sub-image.

To optimize the coefficient of feature correlation, the detection technique is implemented while it is set to 0.7 and 0.99 as minimum and maximum limits whereas in between it is increased by a step of 0.05. As usual the detection rate at each coefficient value is calculated to find the feature correlation coefficient which gives the higher detection rate (certainly the other detection parameters are considered during this choice).

The same work is repeated for all defect types where all results are presented in figure (5.5).

Generally, it is found that for all defects the lower the correlation coefficient threshold, the lower the detection rate. Then defect detection performance is improved with the increment of coefficient value till it reaches its maximum value. After that and with the continuous increment of the correlation coefficient value, the detection performance remains at its optimum level for some defect types and/or decreases for other defect types. Moreover, the defects of detection difficulties such as floats still have the lower detection rate at all coefficient correlation values. In addition, the detection rate for defects in weft directions such as miss-pick and double-picks is always higher than that of defects in warp direction as usual. The only exception is the irregular weft density (jammed-picks) which shows lower detection performance because it is detected at lower sub-window sizes. These sizes are not suitable for all values of correlation coefficient due to the presence of detection errors. For such a defect type, the suitable maximum size which provides accepted level of detection is 50x50 pixels.

Also, it is found that scanning step has no relationship with the coefficient of feature correlation. It means that there is no relationship between the correlation coefficient and the overlapping of sliding windows. Finally, for all defect types, it is found that when the feature correlation coefficient is set to 0.8 while the sub-window size and the scanning step are set to their previously optimized values the detection rate is 100%.

Effect of noise

To simulate the real weaving circumstances (loom noise,vibrations,..etc.), it is estimated when capturing fabric images that we may obtain noisy images. Thus during our research work four different levels of random Gaussian noise are added on all simulated images during the implementation of our procedure. To add these four levels, the noise index is set in our developed Matlab script to 0.001, 0.0025, 0.005, and 0.01 respectively.

We aim to illustrate the ability of the detection technique to detect fabric defect even under the presence of noise. Surprisingly, It is found that the adding noise to the simulated fabric images has no effect on defect detection results. Moreover, defect highlighting is exactly the same at all noise levels i.e. the same regions of the image are highlighted by the same red squares. The reason for such important result is that the similarity between the image background and the nature of the added noise (both has white colour or nature).

To know if detection result changes when the noise level increases, we choose three images containing three different defect types (hole, coarse-pick and coarse-end). These defects represent the possible sizes and directions of fabric defects. Then we applied the detection procedure on these images whereas the noise level is increased 10 times compared to the higher level used during the previous step. Surprisingly again, we obtained the same results which prove that all added noise levels have no effect when detect fabric defects in case of simulated images. Figure (5.7) illustrates the detection results when applied the increased noise level on the images contain the chosen defect types. Actually, it is important to understand that it is not a must to receive the same detection results for real fabric images when adding noise. This is because defect detection in case of simulated structure is easier than that of real structure.

As the most important defect detection parameters of our technique are optimized, we have to prove the utility of these optimized factors together to detect all defects with 100% detection rate. Figure (5.8) shows the success of the technique in detecting all defect types in case of simulated plain structure when all parameters are set to their optimized values (the sub-window size is set to 50x50 and 60x60 pixels, the scanning step is set to 25x25 and 30x30 pixels, and the feature correlation coefficient is set to 0. From the detection results it is found that:

1. For defects like hole, double-pick, coarse-pick and irregular weft density (openpicks), defect detection rate is to be considered as approximately constant. It means that the detection of these defects is accurate and has the lower detection errors. 2. For defects as stain, miss-pick, miss-end, double-end, wet-floats, warp-floats and coarse-end, the detection rate is decreased with the continuous increment of the implemented filter level. Most of these defects have relatively low detection rate (in general) before implementing the filter. In addition, the filter does not consider some defective highlighted areas especially when increasing the selection level. This transfers the correct detection to negative false alarms and accordingly reduces the detection performance. To summarize the effect of implementing our proposed filter on defect detection performance of simulated fabric, the percentage of global or overall detection rate for all defect types at each selected level is calculated and presented as shown in figure (5.10).

Conclusion of defect detection for simulated fabric

From all previous results of defect detection for simulated fabric it is concluded that:

1. Generally, the results are satisfactory and illustrate the potential of utility and applicability of our procedure to detect all simulated fabric defects. 2. From a large number of experiments that we performed, we established that for various simulated fabric, the optimized values of various detection parameters suitable to calculate FFT, the average of the seven extracted features and consequently provides perfect detection rate are: 3. The sub-image size is set to 50x50 and 60x60 pixels. 4. The scanning step is set to 25x25 and 30x30 pixels. 5. The feature correlation coefficient is set to 0.8. 6. Within reasonable limits compatible with our application, the noise has slight effect on defect detection rate for all defect types at all values of detection parameters. 7. Increasing the sliding sub-window size improves the detection performance because it provides sufficient area for feature calculations till the limit after which the performance is decreased due to interference with textures of neighbouring subwindows which is results in positive false alarms. 8. There is a relation between the size of the main image, the sub-image size, the scanning step and the defect size. These parameters should be adapted together to obtain a perfect detection rate. 9. The optimum scanning step is usually equal to half of the optimum sub-image size. 10. Fabric defects existing in weft (warp) direction are hardly detected when compared with the defects existing in warp directions. 11. The detection errors usually occur when the detection parameters are set to values close to the outliers of each one (very small and/or big values). 12. Generally, the main part of detection errors is positive false alarms. 13. The level selection filter does not improve the detection performance when implemented on simulated fabric. In the contrary, it reduces the detection rate especially at higher selection levels.

Defect detection for real fabric

Obviously, defect detection of real fabric is the main object of our research work.

Therefore, all previous work is considered as a preparation stage for such object. As shown in the previous part, our proposed technique proved its utility to detect all simulated fabric defects. Now, we have to verify the success of the technique in reality. The procedure of defect detection is implemented on various samples of real plain fabric contain approximately the same defects as the simulated structure. The previous work will not be exactly repeated but the optimized detection parameters will be fine tuned for the real plain structure. Other important factors will be included in this part; the resolution at which the fabric should be scanned to capture images as close as possible to the simulated fabric images. It is mainly to clear the structure periodicity that plays a vital role in our technique. Also, detection time should be measured to indicate the suitability of the technique for online fabric inspection. We begin firstly by the optimization of image resolution.

Optimization of scanning resolution

If fabric image is the raw material which will be processed using the detection technique to obtain the detected defects as a final product, the quality of the raw material From this figure it is found that at low resolution levels the detection rate is very low.

In addition, the global detection rate for all defect types increases when the level of image resolution is increased till certain limit where the detection rate decreases. It is a result of improving the appearance of fabric periodicity which becomes sufficiently pronounced in the scanned images (please, do not forget the dependency of our implemented technique on such periodicity). Moreover, the statistical features of the defective region at low resolution do not show significant difference with respect to neighbouring area. To avoid this problem, the image resolution should be sufficient enough (usually high). There are two causes to explain the decreasing in detection rate at very high resolutions:

1. The fabric threads occupy a big part of the sub-image which decreases the total number of intersections between these threads that consequently decreases the appearance of structure periodicity. 2. Some very small yarn imperfections (they are not fabric defects) begin to show textural differences with respect to the defect-free region which increases the detection errors.

The optimum resolution level which ensures maximum overall detection rate varies according to the defect type. For instance, this level is 1000 dpi for most defect types whereas defects such as stain (particularly if it has big size) has a lower optimum level (700 dpi) and defects like miss-pick has a higher optimum level (1100 dpi). Rationally, the optimum level variation indicates and explains to some extent why the various fabric defects do not show the same difficulties during the detection process.

Although the detection performance of most fabric defects decreases after the optimum resolution level, it does not have the same behaviour for some other defects.

Detection rate remains constant at the same value for defects as miss-picks and irregular

weft density (open-picks). Moreover, in case of warp-floats, the detection rate increases continuously and does not show the usual relationship with resolution level.

Therefore, the suitable resolution which provides the higher detection rate for all defect types simultaneously is 1000 dpi. At such high resolution level, there are some positive false alarms besides the detected defects. This draw-back could be avoided as follows:

1. Fine tuning of the optimized detection parameters. 2. Decreasing (if it is possible) the value of feature correlation feature.

3. Implementing the level selection filter as it is developed mainly for this purpose.

In the next part of the chapter we illustrate how the proposed solutions are implemented to obtain the best possible defect detection for real fabric. Finally, it is important to remind that the importance of scanning resolution is not restricted only to its contribution in improving the process performance but also it is used to calculate the total number of digital cameras required to cover the whole fabric width when it is produced on the weaving machine. Such calculations are presented at the end of the chapter.

Optimization of sub-image size

To determine the effective size of the random sub-image which scans the acquired fabric image (at 1000 dpi), the optimized detection parameters for simulated fabric are used. Thus, defect detection rate is calculated for real fabric images containing the same defect types as those present in simulated fabric. In fact, all possible sizes between the maximum optimized value 60x60 pixels and 50x50 pixels are considered. The object is to study the detection behaviour to find out whether the optimized sub-window sizes are suitable for real fabric inspection or not. Figure (5.13) shows the relation between detection rates at those sub-image sizes for all defect types.

From this figure it is found that the maximum detection rate is increased when compared with that of simulated fabric. Actually, it is due to the exclusion of outlier values of various parameters and thus the very low detection rates are also excluded. Therefore, we can obtain 100% detection (at least twice) for all defects. Always, such perfect detection exists near the outliers while in-between there is significant variation.

It is found also that most defects are perfectly detected when the size of the subimage is set to 50x50 pixels. But only, defects in weft direction are perfectly detected when this size is set to 60x60 pixels. Two defect types (holes and double-ends) are detected in both previous cases. These results resemble that of simulated defect detection which means that the defects in weft direction need larger size of sub-image to be detected.

Such sizes provide sufficient textural information to enable the implemented technique to discover the frequency variations due to the presence of the defect even if it is coherent only to frequency magnitude as explained in case of simulated fabric.

Finally, weft-floats have the lower detection rate because on one hand, they are small defects and on the other hand, they exist in weft directions. Both difficulties reduce the global detection rate at all sub-window sizes. With the fine-tuning of the other detection factors, their detection rate is improved.

Optimization of scanning step

It was shown in simulated fabric defect detection, that the optimum scanning steps are located between 20x20 and 30x30 pixels. It was shown also that the step size is related to the optimized step size where the step size is approximately half of the subwindow size. As that optimized size for real fabric either 50x50 or 60x60 pixels, it is rationally expected that the optimized step size lies between 25x25 and 30x30 pixels.

Therefore, the detection technique is implemented on the real fabric images as usual where the scanning step is set to the précised values. The detection rate is calculated for all defect types and all results are gathered in figure (5.14).

From this figure it is found that the detection rate for all defects at all scanning steps has increased with respect to that of simulated fabric. As stated before, we look for the step size which corresponds to the best optimized sub-image size and insures (together) 100% detection rate. Therefore, when the scanning step is set to 28x28 it is found that the detection rates for most defects (holes, stains, miss-picks, double-picks, weft-floats, coarse-picks, irregular jammed-picks and irregular open-picks) are optimum. Some of these defects could be detected correctly with other scanning-steps such as 30x30 pixels.

Effect of noise

Adding different noise levels to simulated fabric images had no effect on defect detection. The same statement maintained correct even with increasing the added noise 10 times than the maximum added level. But, as we discuss defect detection for real fabric, we have to study such factor again. Thus, the four different levels of random Gaussian noise are added on all acquired real fabric images during the implementation of our procedure. In addition, the various detection parameters are set to their last optimized settings. For all defect types, it is found that the two lower levels of applied or added noise to the real fabric images have no effect on defect detection results. Moreover, the intermediate noise level has a subtle effect on the detection performance for only few defects. Such noise level has no influence on the detection rate of most defects in weft direction such as miss-picks, double-picks, coarse-picks and weft-floats. The two higher added levels began to affect significantly defect detection rates. The only exception is also the defect in fabric weft direction.

Actually, there are many methods to remove the noise from the acquired fabric image

[149]. One of these methods could be implemented to enhance the image quality before implementing our detection technique. Moreover, the acquisition tools of the system should be designed and adapted to avoid or at least reduce such expected noise to the lowest possible level. For instance, this part of online detection system should not be connected directly to the body of the weaving machine to prevent the vibrations resulting from the different moving parts of the machine (as shown in our proposed online prototype).

The important conclusion from the above results is that the defect detection technique is able to detect real fabric defects even under the presence of some noise.

Detection time for real fabric defect detection

After optimization of all detection parameters as illustrated previously, the detection time required to implement our defect detection technique on real fabric images is measured. In fact, such time has a relative importance as it depends on the hardware of the used system. For instance, the PC that is used to implement the technique. In addition, there are other means to reduce the required time. But measuring the time at this stage is important to give an indication the capability of our proposed technique to detect real fabric defects in a short time even with a normal PC (its specification mentioned in the experimental setup). In addition, we should calculate if the measured time corresponds to the speed of the modern weaving machines or not.

Usually there are two optimized values for each main detection parameter. Thus, all values provide two levels; maximum level which includes all maximum parameter's values and minimum level that includes the lower optimized values. Therefore, when measuring the time required to implement the technique, we obtain also two values of time for each defect type; the maximum and minimum measured time. Table (5.3) and figure (5.18) present and compare between the measured times for all defect types at the two mentioned levels. Each value presented is the average measured time when implementing the technique 10 times.

From these results, it is found that there is no significant difference between the maximum and the minimum measured times. This means that any tuning applied to the technique settings has no influence on the time needed to implement the technique. It is found also that defect type has no influence on this time. Broadly, such time is around 0.7 second for all defect types. During this time, an image of 500 x 500 pixels acquired at 1000 dpi is scanned which is equivalent to 1.27 cm of fabric. Consequently, the detection technique is able to inspect at least one meter of fabric each minute. Industrially, high speed weaving machines run at 1000 picks/min while most plain fabrics are produced at 25-30 picks/cm weft density. This means that the productivity of the weaving machine is 33-40 cm/min. Therefore, the speed of the technique is 2-3 times the machine productivity.

Which means that it is fast and consequently could be implemented for the online fabric inspection.

Optimization of level selection filter

As presented before, fabric images should be acquired at high resolution to ensure high performance of defect detection. With this high resolution, all defects are detected but unfortunately with some positive errors. These errors are reduced through the optimization of all important settings of the implemented technique. Also, using another lower value of feature correlation coefficient besides the original one improved significantly the detection results. But, we are still in need of avoiding definitively the presence of any detection errors to increase the technique credibility and flexibility as well. Such object could be obtained by implementing the level selection filter.

Nevertheless the implementation of such filter for simulated defect detection did not give encouraging results. On the contrary, the detection performance has been reduced

especially when the implemented level is increased. But, the obvious positive detection errors in real defect detection impose the need for such filter. Therefore, the four filter's levels are implemented on all real fabric images containing the usual studied defect types.

The technique settings are set to the same range of values used during optimization. The percentage of defect detection rate is calculated for each defect type and each selection level. Table (5.4) and figure (5.19) present the detection results of all filter levels. From the detection results it is found that:

1. Generally, implementing the first and second filter's levels for most defects has no influence on detection rates. These rates are increased when implementing the third level while they are decreased again when the fourth level is implemented. 2. There was no effect for the application of any level of the filter on some defects such as miss-picks and miss-ends. 3. When increasing the filter selected level, the detection rate is slightly improved for some defects (holes, stains, double-picks, double-ends and irregular jammed-picks) whereas the improvement is pronounced for other defects (weft-floats, warp-floats, coarse-picks, coarse-ends and irregular open-picks). To summarize the effect of implementing the four filter's levels on the detection performance of real fabric, the average percentage of the global or overall detection rate for all defect types at each selected level is calculated and presented as shown in figure

(5.20).

Unsupervised defect detection

In all previous stages, our technique succeeded in detecting the pre-determined defects either when implemented for simulated or real defect detection. Thus, the dimension and the orientation of all defects inside the images were well known. The object at this situation was confined to distinguish the presence of these defects which is considered as a training stage for our technique. Because fabric defects are generated randomly and dynamically distributed, a perfect robust automation of visual inspection process requires unsupervised defect detection which refers to the detection of unknown class of defects for which there is no training. Therefore, to verify the success of the technique in detecting all defect types and sizes, the procedure of defect detection is implemented on various images of real plain fabric. Moreover, it will be examined on images acquired for plain fabric of another colour (black) rather than with a white or gray fabric.

Unsupervised defect detection for gray fabric

Rationally, we begin the unsupervised defect detection with a fabric that has a gray or white colour to cope with the same fabric background as in the training stage. To implement the detection technique, various samples of a real plain fabric were captured by a flat scanner at the same previous conditions (with 1000 dpi resolution in 16-bit grey levels and stored in an image of size 500 x 500 pixels). These images are scanned by a random sub-image of sizes 50x50 and 60x60 pixels. The scanning step is set to 25x25 and 28x28 pixels. The coefficient of feature correlation is set to 0.75 and 0.8.

Figure (5.22) shows the success of the technique in detecting all existing defects in case of real white or gray plain fabric whereas figure (5.23) shows the implementation of the third filter's level on the same fabric images. It is found that the technique introduces a successful approach for automated fabric inspection. The detected defects have great differences when compared with those have been studied in previous stage. For instance, some defects exist in weft and warp directions simultaneously. Other defects have either very small and/or large size. In addition, the defects are detected correctly even the same acquired image has various separated minor defects.

Conclusion of detection for real fabric

From the results of training and unsupervised stages of real fabric defect detection it is concluded that:

1. For automated fabric inspection, fabric images should be acquired at 1000 dpi to ensure perfect defect detection. 2. Besides such resolution level, it is found that the technique settings should be optimized and adapted to values suitable to calculate FFT, the average of the seven extracted features and consequently provides the best possible detection rate as follows: 3. The sub-image size is set to 50x50 and 60x60 pixels. 4. The scanning step is set to 25x25 and 28x28 pixels. 5. The feature correlation coefficient is set to 0.75 and 0.8. 6. Only the higher noise levels have an influence on defect detection for real fabric while our technique shows no sensitivity to low and intermediate noise levels. 7. As in simulated defect detection, there is a relation between the size of the main image, the sub-image size, the scanning step and the defect size. These parameters should be adapted together to obtain a perfect detection rate. For instance, the optimum scanning step is usually equal to half of the optimum subimage size. 8. The detection errors mostly occur as positive falses where defect-free fabric area is highlighted as a defect. These errors are finally avoided through: 9. Setting the detection parameters to its optimized values. 10. Reducing the value of the feature coefficient correlation to the lower possible limit. 11. Implementing the level selection filter. 12. The speed of the proposed approach (technique) is 2-3 times the machine productivity. Which means that it is fast and consequently could be implemented for the online fabric inspection. 13. Eventually, the results are satisfactory and illustrate the potential of utility and applicability of our procedure to detect all real fabric defects.

Online defect detection results

Our online defect detection technique is evaluated through the developed prototype which is described in the chapter of experimental setup. The prototype grabs fabric images continuously using one line scan camera that, with the provided optics, has an ability to acquire a 1.2288 meter wide image at 254 dpi (100 microns) resolution.

When we optimized the resolution level at which real fabric images should be acquired to ensure optimum defect detection, it was found that such optimum level was around 1000 dpi. Therefore, to obtain such high resolution from the used system its ability is increased four times which consequently reduces the captured fabric width to 0.30 meter approximately. In such a case, the online defect detection system needs several (five) cameras located in one row in order to cover the entire fabric width (1.5 meters). But we prefer to design a more secure system with one extra camera to cope with the 5% overlapping necessary to prevent any acquisition gaps (fabric area which would have not been acquired).

In our research work, the various images of woven plain fabric are digitized with 500 X 500 pixels and stored in a computer as 8-bit grayscale data. Actually, the first preprocessing is implemented on the acquired fabric images to normalize them, to correct the inhomogeneous lighting conditions, to remove the noise and finally to convert the acquired digital (RGB) images to grayscale images. After this pre-processing step, our defect detection procedure is implemented for final evaluation. Moreover, a number of fabric images are firstly acquired to provide the reference (defect-free) image.

During such implementation, the main defect detection parameters are set to their optimized values. It means that the fabric images are scanned by a random sub-image of sizes 50x50 and 60x60 pixels with 25x25 and 28x28 pixels scanning steps. In addition, the coefficient of feature correlation is set to 0.75 and 0.8.

It is found that our online automated fabric inspection prototype is capable of identifying the existing fabric defects. Figures (5.

Conclusions

The starting point of our thesis is the fabric inspection as a part of surface inspection.

The aim of this study is the development of an efficient automated fabric inspection (defect detection) method that could be implemented online. Through the review part of our thesis, it is concluded that:

1. The need for a comprehensive, consistent way to produce first quality or defect-free fabrics has an utmost priority than ever. 2. To ensure this quality level, we must perform 100% inspection. But, due to the huge drawbacks of the visual offline systems, it is an impossible task. 3. The continuous development in computer technology introduces the online automated fabric inspection as an effective alternative. Such system must operate in real-time, produce lower possible detection errors. 4. As the work relevant to this object is vast and diverse, we improved the existed classifications for the automated fabric inspection approaches. Through our improved classification, the texture analysis problem is categorised into six approaches according to the used algorithm. These are statistical, structural, spectral, model-based approaches, combination of computational methods, and finally, comparative studies. 5. Unfortunately, with these huge implemented approaches, the perfect approach does not exist yet. Each of them has some advantages while at the same time, it has also its drawbacks.

Therefore, the second point was to choose the suitable approach that could be implemented to achieve the principle objective of the thesis. In industrial applications however, a compromise between accuracy, speed, and practicality was of interest. In addition, dealing with high resolution images requires fast algorithms to compensate their heavy data processing. Therefore, we proposed the Fast Fourier Transform (FFT) approach. The choice was based on the following considerations:

1. It is an approach that combines most advantages with lower drawbacks to be implemented as the base of constructing effective and accurate online automated fabric defect detection. 2. Moreover, such an algorithm, as one of the spectral approaches, corresponds to the fabric high degree of periodicity and the speed of the weaving machine as well. 3. In addition, the described algorithm is extremely simple which makes it easy to understand. Still it performs quite well in the difficult problem of high dimensional data analysis, such as surface defect image detection.

The implementation of this algorithm takes place through the technique of crosscorrelation, i.e. linear operations. They examine the structure regularity features of the fabric image in the Fourier domain using a random sub-image scans the main fabric image. To ensure the success of the technique, following rational steps are considered:

1. We developed a fabric defect map. From this map, twelve defect types are determined as the major defects which should be considered during the preprocessing step. 2. We developed simulated plain fabric images either free of defects or containing these twelve defect types. The objective of this step is to understand the behaviour of the technique and to determine and then optimize the most important factors or parameters which affect on the process. 3. To verify the success of the technique in reality, it is then implemented on real fabric images containing the same defects types as in case of simulated images.

From the implementation of the technique on both simulated and real fabric images we have discovered that:

1. The results of defect detection were satisfactory and illustrated the potential of utility and applicability of our procedure to detect all fabric defects. 2. From a large number of experiments that we have performed, we discovered that the important detection parameters which affect the detection results are the size of the random sub-image which scans the main image, the scanning step and the feature correlation coefficient threshold. We succeeded in optimizing each parameter and obtained 100% detection rate for all defects. 3. Besides these parameters, image resolution represents an important parameter for automated real fabric inspection. It is found that fabric images should be acquired at 1000 dpi to ensure perfect defect detection. Experimentation also revealed that at such high resolution level, real fabric images have sufficient true symmetry when compared with simulated images. 4. For simulated fabric structure, the added noise has slight effect (even when such added level is very high) on defect detection rate. 5. For real fabric structure, only higher noise levels have an influence on defect detection for real fabric while our technique shows no sensitivity to low and intermediate noise levels. The high added noise develops and adds higher confusion to the image features which is resulted in detection errors. This confusion is not pronounced in simulated images due to the similarity between the image background and the nature of the added noise (both has white colour or nature). 6. Furthermore, it is found that there is a relation between the size of the main image, the sub-image size, the scanning step and the defect size. These parameters should be adapted together to obtain a perfect detection rate. For instance, the optimum scanning step is usually equal to half of the optimum sub-image size. In addition, fabric defects exist in weft direction are hardly detected when compared with the defects exist in warp directions. 7. The detection errors mostly occur as positive false alarms (defect-free fabric area is highlighted as a defect). We succeeded in avoiding these errors through: a. Setting the detection parameters to their optimized values. b. Reducing the value of the feature correlation coefficient threshold to the lower possible limit. c. Implementing the level selection filter that is developed particularly for this object. 8. This level selection filter does not improve the detection performance when implemented on simulated fabric. In the contrary, it reduces the detection rate especially at higher selected levels. But, when implemented for real defect detection the detection rate is significantly improved especially when the third level is selected. 9. The technique is implemented also for unsupervised real defect detection. All existing defects larger than 1.2 mm are 100% detected regardless their types and/or orientation inside the acquired fabric image of different colours. 10. It is found that the speed of the technique is 2-3 times the machine productivity.

Which means that it is fast and consequently could be implemented for the online fabric inspection.

In summary, the concept of implementing fast Fourier transform and cross-correlation (sliding window) technique simultaneously looks very promising to detect the structural defect of plain weaves in grey levels. In addition, though a real-time automated system that could be used for fabric inspection is rarely constructed, the results of this study could provide a strong foundation upon which to carry out further research into the use of fast Fourier transform and cross-correlation for online automated fabric inspection

Contributions

The main contributions of this study are divided into the following two main parts:

Theoretical contributions

1. The main theoretical contribution is without a doubt optimising fast Fourier transform and the principle of cross-correlation to be suitable for online automated fabric inspection. 2. Development of a suitable procedure using a software package, Matlab and Scilab, to implement the proposed technique. 3. Improving and describing an improved classification for the automated fabric inspection approaches. Through this improved classification, the texture analysis problem is categorised into six approaches according to the used algorithm. 4. Development of a fabric defect map to determine the major defects which should be considered during the pre-processing step.

Practical contributions

1. The main practical contributions of this thesis is implementing and testing the proposed approach on huge number of simulated and real fabric images to prove its utility. 2. To do that, we constructed and simulated automatically various plain fabric images (either free of defects or contain the major fabric defects). 3. In addition, we acquired or generated a sufficiently large real fabric database or images with and without defects at different resolution levels. 4. To avoid the detection errors and obtain 100%detection rate, a level selection filter is developed and implemented. 5. Finally, we designed and developed a prototype to examine the technique online or in real-time (during the production of the fabric on the weaving machine).

Future work

This thesis illustrated an effective automated fabric inspection technique which was applied on plain fabric through various procedures. Meanwhile, there are some essential aspects where the method's performance can be enhanced. We therefore propose the next points as possible outlines for further work.

1. While this work provided a new avenue to inspect and detect fabric defects either online and/or offline, the application of such inspection has yet to be expanded to other fabric structures such as twill and satin, and in addition, to some other patterns such as striped and checked fabrics. Broadly, the ultimate goal would be improve the approach to prove its utility for all fabrics despite their structure, colour and any other characteristics. 2. With more understanding of the relation between of Fourier transform and fabric properties we can try to implement the algorithm to study some other fabric characteristics rather than defects. For instance, fabric thickness, yarn spacing, fabric appearance and wrinkles. 3. Another interesting way in which this rigorous framework could be continued is the combination with other approaches or algorithms which would expand this study into other areas of textiles that has no obvious periodical structures, in particular to nonwovens. With this development, the approach ability will be improved to cope with any general surface inspection application. 4. Finally, the continuous developing and testing of our proposed approach provides various robust results which could be used to generate the knowledge base for an expert system. Such a system deals with many fabric surface quality aspects. This step can improve the capabilities to develop an online unsupervised robust system which rarely exists in textile industry.

  To my mother Karima, who gave me the ability to achieve my dreams To my wife Islam, for her ever present support and encouragementTo my children: Ziad, Saif Eldin, Omar, and Sama as a hope for their futureBiographyBorn in EGYPT, Abdel Salam MALEK received a B.Sc. Degree in Textile Engineering from Alexandria University in 1995. As he interests in garment industry, he started his industrial career in the same year. Between 1995 and 2005, he constructed several factory departments: work study, production lines, and materials quality control. Consequently, he was uplifted to the production manager. From 2005 Abdel Salam was employed by the Egyptian Government as a consultant of the TVET Reform Project. In 1998 Abdel Salam started his academic career besides the industrial one when he was employed by the Faculty of Industrial Education at Suez Canal University as a Lecturer Assistant. He earned the Master Degree in Textile Engineering from Alexandria University in 2002. Suez Canal University gave him a governmental scholarship in 2007 to obtain a Ph.D. in Textile Engineering from FRANCE where, he became a Ph.D. student at Laboratoire de Physique et Mécanique Textiles (LPMT), École National Supérirure d'Ingénieur Sud Alsace (ENSISA) at Université de Haute Alsace (UHA) in September 2007. He is currently the co-author of one book, two conference papers, and one journal article.

. 1 ) 39 Table ( 2 . 2 ) 75 Table ( 4 . 2 ) 77 Table ( 4 . 3 )

 1392275427743 : A comparison between line and area scan cameras ...............................................................................: Modified automated fabric defect inspection classification ....................................................................43 Table (4.1-a): The most common defects appear in more or less extended areas ......................................................73 Table (4.1-b): The most common defects appear in more or less extended areas ......................................................: The most common fabric defects appear in warp direction....................................................................: The most common fabric defects appear in weft direction ....................................................................79 Table (5.1): Optimization of level selection filter for simulated fabric .................................................................... 137 Table (5.2): Effect of various noise levels (indexes) on real defect detection rate ................................................... 152 Table (5.3): The measured detection time for real fabric defect detection ............................................................. 154 Table (5.4): Optimization of level selection filter (real fabric) ................................................................................. 156

Figure 2 .

 2 Figure 2.1: Modern (air-jet) looms .............................................................................................................................29

1 : 29 Figure 2 . 2 : 31 Figure 4 . 1 : 72 Figure 4 . 2 : 74 Figure 4 . 3 : 76 Figure 4 . 4 : 78 Figure 4 . 5 : 80 Figure 4 . 6 : 84 Figure 4 . 7 : 84 Figure 4 . 8 : 86 Figure 4 . 9 : 87 Figure 4 . 10 : 87 Figure 4 . 11 : 88 Figure 4 . 12 : 88 Figure 4 . 13 : 88 Figure 4 . 14 : 89 Figure 4 . 15 : 89 Figure 4 . 16 : 89 Figure 4 . 17 : 89 Figure 4 . 18 : 90 Figure 4 . 19 : 90 Figure 4 . 20 : 90 Figure 4 . 21 : 91 Figure 4 . 22 : 91 Figure 4 . 23 : 92 Figure 4 . 24 : 92 Figure 4 . 25 : 93 Figure 4 . 26 : 93 Figure 4 . 27 : 93 Figure 4 . 28 : 94 Figure 4 . 29 : 94 Figure 4 . 30 : 94 Figure 4 . 31 : 95 Figure 4 . 32 : 99 Figure 4 . 33 :Figure 4 . 34 :Figure 4 . 35 :Figure 4 . 36 :Figure 4 . 37 :Figure 4 . 38 :Figure 4 . 39 :Figure 4 . 40 :Figure 4 . 41 :Figure 4 . 42 :Figure 4 . 43 :Figure 4 . 44 :Figure 4 . 45 :Figure 5 . 1 :Figure 5 . 2 :Figure 5 . 3 :Figure 5 . 4 :Figure 5 . 5 :Figure 5 . 6 Figure 5 . 7 Figure 5 . 8 :

 129223141724274437644784580468447844886498741087411884128841388414894158941689417894189041990420904219142291423924249242593426934279342894429944309443195432994334344354364374384394404414424434444455152535455565758 Figure 2.1: Modern (air-jet) looms .............................................................................................................................29

Figure 5 . 9 Figure 5 .

 595 Figure 5.9 Optimization of level selection filter for simulated fabric ........................................................................

Figure 5 . 11 :

 511 Figure 5.11: Implementation of the filter's third selected level on simulated fabric defects ....................................

Figure 5 . 12 :

 512 Figure 5.12: Optimization of scanning resolution for real fabric ..............................................................................

Figure 5 . 13 :

 513 Figure 5.13: Effect of sub-window size on defect detection rate for real fabric (at all values of the other detection parameters considered during the optimization).....................................................................................................

Figure 5 . 14 :

 514 Figure 5.14: Effect of scanning step on defect detection rate for real fabric ............................................................

Figure 5 .

 5 Figure 5.15 Optimization of feature correlation coefficient for real defect detection ..............................................

Figure 5 . 16 :

 516 Figure 5.16: The implementation of the technique on real fabric images ................................................................

Figure 5 . 17 :

 517 Figure 5.17: Effect of various noise levels on real defect detection rate ..................................................................

Figure 5 . 18 :

 518 Figure 5.18: The measured detection time for real fabric defect detection..............................................................

Figure 5 . 19 :

 519 Figure 5.19: Optimization of level selection filter (real fabric) .................................................................................

Figure 5 . 20 :

 520 Figure 5.20: Effect of filter levels on the overall detection of real fabric ..................................................................

Figure 5 . 21 :

 521 Figure 5.21: Implementation of the filter's third selected level on real fabric defects .............................................

Figure 5 . 22 :

 522 Figure 5.22: Unsupervised implementation of detection technique on gray fabric ..................................................

Figure 5 . 23 :

 523 Figure 5.23: Implementation of the third selected level on unsupervised gray fabric defect detection ...................

Figure 5 . 24 :

 524 Figure 5.24: Unsupervised defect detection for black fabric ....................................................................................

Figure 5 . 25 :

 525 Figure 5.25: Online defect detection results (1) .......................................................................................................

Figure 5 . 26 :

 526 Figure 5.26: Online defect detection results (2) .......................................................................................................

Figure 2 . 1 :

 21 Figure 2.1: Modern (air-jet) looms

Figure 2 . 2 :

 22 Figure 2.2: Visual (traditional) fabric inspection

  [START_REF] Stojanovic | Vision inspection of web textile fabric[END_REF][63][131][138] [139][140][141][142]

  [START_REF] Conci | A Computer Vision Approach for Textile Inspection[END_REF][22][31][65][73][141][143][145]

  [112] used FFT to analyse the woven fabric construction. He et al. [113] used Fourier Transform to develop an oblique scanning method which scans the fabric surface on a running air-jet loom to estimate the fabric fluctuation in the cloth fell during weaving. Mallik-Goswami and Datta [114] used a joint transform correlator technique which is an extension of Fourier transform analysis and is extremely useful for real time pattern recognition to identify fabric defects. Based on FT Perez et al. [115] presented an automated analysis system for defect detection in the print process of flocked fabrics with repetitive patterns. Ralló et al.

  ]. Researchers have suggested that computer vision systems utilize Gabor filters to more closely mimic the texture recognition abilities of human brains [118, 119]. Images captured by the retina are decomposed into several filtered images, each containing varying intensities over a narrow band of frequency and orientation. The neurons in the brain are individually tuned to a particular combination of frequency and orientation, which denotes a channel. These channels, therefore, closely resemble Gabor functions. Kumar and Pang [30] developed a multi-channel filtering technique based on Bernoulli's rule of combination for integrating images from different channels. Physical image size and yarn impurities are used as key parameters for tuning the sensitivity of the proposed algorithm. The achieved results show that the algorithm developed is robust, scalable, and computationally efficient for the detection of local defects in textured materials.

  scheme[142] is devised in which different features, extracted from the gray level histogram, the shape descriptors, and co-occurrence matrices, are employed. These features are classified using a Support Vector Machines (SVM) based framework.

  Cuenca and Cámara [145] developed a new texture descriptor based on semi-cover concept and a simplified local measure. They evaluated their method by comparing it with Co-occurrence Matrix, Histogram, Gabor Filters, Wavelets transforms and Fractal

  Despite the fact that huge efforts have been done on developing and demonstrating the importance of automatic fabric defect detection, an adequate description for woven fabric defects is rarely carried out. This neglected point gains an increasing importance with the reality that automatic defect detection is mainly an electronic object than a textile one. It necessitates, firstly, a brief discussion to explain what is meant by a fabric defect and what are its different types and reasons.

Figure 4 . 1 :

 41 Figure 4.1: Flow chart of woven fabric defects based on its source

Figure 4 .

 4 Figure 4.1 illustrates a flow chart of woven fabric defects based on their source. From

Figure 4 . 6

 46 Figure 4.6

Figure 4 . 7 . 7 :

 477 Figure 4.7

Figure 4 . 8 :

 48 Figure 4.8: (a) basic unit, (b) convolution mask, (c) basic unit repetition, (d) simulated image of the defect-free plain fabric

Figure 4 . 22 :

 422 Figure 4.9: Hole

( 4 .

 4 [START_REF] Newman | A Survey of Automated Visual Inspection[END_REF].

Figure 4 . 23 :

 423 Figure 4.23: The first captured image

Figure ( 4 .

 4 Figure (4.24) shows real image of the defect-free plain fabric whereas figures from (4.31) tell (4.36) show real images contain different defects.

Figure 4 . 24 :

 424 Figure 4.24: Real image of the defect-free plain fabric

Figure 4 . 25 :Figure 4 . 26 :

 425426 Figure 4.25: Hole and stain

Figure 4 . 28 :Figure 4 . 30 :

 428430 Figure 4.28: Warp-float and coarse-pick

Figure 4 .

 4 Figure 4.31: Snarl

4. 3 . 2 . 1 .

 321 Fourier transform FT transforms the image encoded as luminance values of pixels. Because such values are spatially sampled, we use Discrete Fourier Transform (DFT), the digital implementation of Fourier transform. Sampled image does not contain all frequencies forming the original image, before its acquisition. In order to lose as little information as possible, Shannon theorem must be fulfilled: the sample frequency must twice as much as the higher frequency of interest. DFT transforms an M×N image into another M×N image. Without loss of generality, we will consider square images, of size N×N. (spatial domain) In our application, ƒ(x,y) is the gray level at pixel coordinates (x,y) in the original image of size N×N. For frequency variables a,b = 0, 1,...., N -2, N -1, the Discrete Fourier Transform F(a,b) is expressed by: term is the basis function corresponding to each point F(a,b) in the Fourier frequency domain. Thus, F(0,0) represents the DC-component of the image which corresponds to the average luminance while F(N-1,N-1) represents the transform at the highest frequency. It is shown that F(a,b) is periodic, with period N×N.

Figure ( 4 . 32 )

 432 Figure (4.32) is the first entrance in our thesis to understand the behaviour of the frequency spectrum when implementing FFT on fabric images. Figures (4.32-a) and (4.32-

  32-a) and (4.32b) present the images of the defect free simulated and real plain fabric in the spatial domain, while figures (4.32-c) and (4.32-d) show its Fourier frequency spectrum as intensity functions respectively.

Figure 4 . 32 :

 432 Figure 4.32: FFT implementation on simulated and real plain fabric images

Figure 4 . 33 :

 433 figure(4.34) shows the defective area inside the image while it is surrounded by red squares. Each one represents a sub-image of smaller average correlation coefficient than that of the defect-free image.

Figure 4 .

 4 Figure 4.35

Figure ( 4 .

 4 Figure (4.36) illustrates the principles of this filter where two sub-images are overlapping.

Figure 4 . 36 :

 436 Figure 4.36: The principle of the filter

Figure 4 . 37 :

 437 Figure 4.37: The filter applied on simulated fabric exhibits a stain

Figure 4 . 38 :

 438 Figure 4.38: The colour map of the filter result

Figure 4 . 39 :

 439 Figure 4.39: The filter modified results

Figure ( 4 .

 4 Figure(4.40) shows a comparison between two small fabric images of 100 x 100 pixels. Each image contains the same minor defect (fine contamination). The aim of this figure is to discriminate many differences resulting from the variation of resolution level.

Figure 4 . 40 :

 440 Figure 4.40: Effect of acquisition resolution of fabric image

Figure ( 4 .

 4 Figure(4.41) illustrates the colour plot that gives the area of intersection in case of reference image and the image containing a defect (the stain has always been chosen). In addition, figure(4.42) illustrates the ratio between the sizes of the two images.

Figure 4 . 41 :

 441 Figure 4.41: Optimization of sub-window size for a simulated image exhibiting a stain

Figure 4 . 42 :

 442 Figure 4.42: The ratio between the image containing a defect and the reference image

  Figure 4.43: The

4 . 3 . 8 . 7 .

 4387 The second step is to determine the possible minimum number of values to detect all defect types. Moreover, we look forward to achieve unsupervised defect detection by the end of our thesis. With this detection level, the technique proves its utility to detect all fabric defect types regardless the location inside the fabric (image) or the size which represent the global goal of our thesis. Another important advantage is achieved by determining the smallest (finest) defect size during the detection process to indicate the ability of our technique. Detection time Feasibility of the considered technique depends on the time it requires. Although we will implement the technique for online inspection where fabric production speeds are slow when compared with those of offline inspection. Detection time still represents an important parameter in our study. Certainly, the detection time for each case study is different and depends also on the used PC. Studying the influence of each discussed parameter on the total detection time is useful during the optimization. This parameter is the base to select one value from different suitable values during the detection process.

Figure 4 . 44 :

 444 Figure 4.44: The schematic of the vision prototype

Figure 4 . 45 :

 445 Figure 4.45: The vision prototype on reality

Figure ( 5 . 1 )

 51 Figure (5.1) gathers for various samples (reference defect-free samples and defective samples) the evolution of the correlation coefficient vs. sub-image dimensions.

Figure 5

 5 Figure 5.1: O

Figure 5 . 4 :

 54 Figure 5.4: Effect of scanning

Figure 5 . 5 :Figure 5 . 6

 5556 Figure 5.5: Effect of feature c

Figure 5 . 7 Figure 5 . 8 : 5 . 3 .

 575853 Figure 5.7 Effect of increasing the noise level on detection results

Figure 5 .

 5 Figure 5.10 Effect of filter levels on the overall detection of simulated fabric

Figure 5 . 11 :

 511 Figure 5.11: Implementation of the filter's third selected level on simulated fabric defects

(

  fabric image) determines the quality and the performance of the final product (defect detection). Acquisition resolution is an essential factor to obtain the optimum quality level for captured fabric image. To decide what is the resolution level that should be considered when capturing fabric image during online defect detection, various fabric images containing the same defects as in case of simulated are captured at different resolution levels. As stated in the experimental setup, these resolution levels are 300, 500, 700, 900, 1000, 1100 and 1200 dpi. At each level, the global detection rate for each defect type is calculated where detection parameters are set to the same values during the optimization of simulated fabric detection. The relationship between the detection rate percentage and the resolution level for each defect type is drawn. Figure(5.12) collects and summarizes such relationship for all defect types.

Figure 5 .

 5 Figure 5.15 Optimization o

Figure ( 5 Figure 5 . 16 :

 5516 Figure(5.16) shows the s of real plain fabric when the m mentioned previously.

Figure 5 . 20 :

 520 Figure 5.20: Effect of filter levels on the overall detection of real fabric

Figure 5 . 21 :

 521 Figure 5.21: Implementation of the filter's third selected level on real fabric defects

Figure 5 . 22 :Figure 5 . 23 : 5 . 8 . 2 .

 522523582 Figure 5.22: Unsupervised implementation of detection technique on gray fabric

Figure 5 . 24 :

 524 Figure 5.24: Unsupervised defect detection for black fabric

Figure 5 . 25 :

 525 Figure 5.25: Online defect detection results (1)

FeatCorrRef2D

  figure imshow(ratio,'InitialMagnification','fit') axis xy colorbar colormap(jet) axis 'on' set(gca,'XTick',1:10:maxSubImageSizeX) set(gca,'XTickLabel',minSubImageSizeX:10:maxSubImageSizeX+minSubImageSizeX-1) set(gca,'YTick',1:10:maxSubImageSizeY) set(gca,'YTickLabel',minSubImageSizeY:10:maxSubImageSizeY+minSubImageSizeY-1)

Table ( 2

 ( .1): A comparison between line and area scan cameras

Line scan camera Area scan camera (CCD)

	It utilizes a system of linear array	It utilizes a system of area array
	photo-sensors	photo-sensors
	The resolution in the vertical direction is a function of the velocity of object (fabric) movement and the scan rate at which the camera is operating	The inspection resolution in both directions is independent of the object speed
	It provides a very high resolution	It provides a high resolution
	It can inspect a large width of fabric in	It inspects only a determined width of
	the single line scan	fabric
	A transport encoder is always required
	to ensure synchronization of the	The usage of transport encoders is
	camera scan rate with the transport	optional
	velocity
	It does not generate complete image at once	It generates complete image at once
	It requires an external hardware to build up the images from multiple line scans	It does not require any external hardware to build up the images.
	The cost of a line scan camera is very	It is less expensive and commonly
	high	used.

Table ( 4

 ( .1-a): The most common defects appear in more or less extended areas The defects of the first part of table(4.1-a)

	Defect type	Definition	Reasons	Severity
	Floats	A portion of a yarn in a fabric that extends or floats, unbound, over two picks or more adjacent ends or	It is caused by missing of series of threads interlacement of two	Major fabric defect
			It is caused by
	Weft curling	A twisted weft thread appears on the surface of the fabric	inserting a highly twisted weft thread or when the weft thread	Minor fabric defect
			is running too freely
			It is caused by an
	Slubs Holes Oil stains Stitching Hole Figure 4.2: Float A local uneven fabric thickness A fabric area free of both of warp and weft threads A fabric area contains oil spots A common fabric fault in which the ends and the picks are not interlaced according to the correct order of the pattern Weft curling Oil stain Rust stain	extra piece of yarn that is woven into fabric. It can also be caused by thick places in the yarn or by fly waste being spun in yarn during the spinning process It is a mechanical fault caused by a broken machine part It is caused by too much oiling on loom parts or from other external sources As the main purpose of the loom is to interlace two sets of threads according to the correct order of the pattern, This defect is a result of any undesired motion of the main or auxiliary loom mechanisms such Slub Stitching	Minor/Major fabric defect Major fabric defect Minor/Major fabric defect Major fabric defect
			as: shedding,
			picking….etc.
			Stains are caused by
			lubricants and rust.
	Rust stains	A fabric dirty area or when	Most of the stains	Minor/Major
	/ Dirt	it contains stains	can be traced back to	fabric defect
			poor maintenance
			and material handling

Table ( 4

 ( .1-b): The most common defects appear in more or less extended areas

	Table (4.2): The most common fabric defects appear in warp direction
	Defect type	A fabric place where two Definition	Reasons	Severity
	Knots Miss-end	ends of yarn have been tied together and the tails of the knot are protruding from the surface A warp thread is absent in the fabric for a short or long distance	It is due to incorrect It is caused by tying spools of yarn ends together warping or by a broken warp thread that never replaced	Minor fabric defect Major fabric defect
			by another one
			It is caused by the It is caused by
	Temple marks / Pin holes Warp stripes	Marks or holes along fabric selvage One or more faulty threads giving rise to zones of different aspect	temples or pins scraping or rubbing which hold the fabric while it processes through tenter frame between warp threads and some parts of production	Minor fabric defect Major fabric defect
			machines or due to
			It is created due to inaccurate reeding
	Snag Tear Gouts Weft snarls Tight/Slack warp thread Double-ends Smash Miss-end group of fibres pulled from A thread segment or its normal pattern Damaged fabric portions differ from holes in that it has a random un even shape A local uneven fabric thickness differs from slubs in that they are characterized by a lumpy appearance while slubs generally are symmetrical A short length of three fold weft yarn of which two folds are inter-twisted Temple mark Moiré A warp thread or pieces of warp thread which are tighter or slacker than the other pieces/threads Two ends threaded in the same place of one Many ends or warp threads are consequently broken Figure 4.4: Some defects of table (4.2) the friction between the fabric and sharp or rough objects It is created due to the friction between the fabric and sharp or rough objects It is caused by masses of accumulated short fibre (fly) being drawn undrafted into the filling yarn during the spinning process It is caused due to insufficient twist setting which increasing the possibility of yarn severe rubbing between the shuttle and the box front plate Snag It is caused due to the incorrect tension applied on warp threads It is caused by incorrect warping or by a broken end wound on another and takes the behaviour of one thread threads 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 Warp stripe Tight warp Minor fabric defect Major fabric defect Major fabric defect Minor fabric defect Major fabric defect Major fabric defect Major fabric defect thread Figure 4.Knot Tear Gouts It is caused due to Snarl Coarse-end the presence of a A warp thread or pieces of warp thread which are coarser than the other the other warp pieces/threads warp thread that has Major fabric different count (coarser thread) than defect Double-end Smash Open reed
			picking accessories
		presence of wavy areas in It is conspicuous on
	Moiré Open reed	a periodical sequence, where crushed and the uncrushed threads reflect light differently that affects the fabric appearance fabrics that use different exposing the filling ones threads is held apart, colored threads on wrap and weft where, the wrap	It is caused due to It is caused due to a different compression of weft and/or of warp threads fabric the bent reed wires leaving a crack in the	Major fabric defect Major fabric defect

3: The defects of the second part of table (4.1-b)

Table ( 4

 ( .3): The most common fabric defects appear in weft direction

	Defect type	Definition	Reasons	Severity
			It is caused by
			incorrect picking or if
	Miss-pick	A weft thread is absent in the fabric for a short or long distance	the weaver restarted the loom after any adapting the position stoppage without	Minor/Major fabric defect
			for the new insertion
	Irregular pick density	A jammed or opened area formed in the fabric due to uneven pick density (number of picks per inch)	It is a mechanical fault caused by an irregular beating up force	Major fabric defect
	Double-picks	Two weft threads take the same place of one thread	It is caused by incorrect picking	Major fabric defect
			It is caused due to
			the presence of a
		A weft thread or pieces of	weft thread that has
	Coarse-	weft thread which are	different count	Major fabric
	pick	coarser than the other	(coarser thread) than	defect
		pieces/threads	the other weft
			threads
	Starting mark (Weft bars)	A visual light/dark effect in weft direction	It is caused by a higher or lower weft the weaving machine density caused by	Major fabric defect
	Tight/Slack weft thread	A weft thread or pieces of weft thread which are tighter or slacker than the other pieces/threads	It is caused due to the incorrect tension applied on weft threads	Major fabric defect
			It is caused due to
	Skew / Bias	When the weft threads are not square or perpendicular with warp threads	the variation of the threads beating up force value after the insertion of weft	Minor fabric defect

Figure 4.5: Some defects of table (4.3)

Table (

 ( The reduction in defect detection rate for all defects mentioned above when implementing the fourth selection level is approximately 50% from its original detection rate. 2. As weft and warp-floats has usually the lower detection rate, when implement the fourth selection level their detection rate tends to zero.

	1.	5.1): Optim imization of level selection filter for simulate ated fabric
			Level (1)	Level (2)	Level (3)	Level (4)
	Ser.	Defect type	detection	detection	detection	detection
			rate (%)	rate (%)	rate (%)	rate (%)
		Hole		93.94	96.97	100	95.46
		Stain		71.21	65.15	53.03	39.39
		Miss-pick		71.21	40.91	37.88	33.33
		Miss-end		45.46	45.46	33.33	15.15
		Double-pick		39.39	39.39	34.85	33.33
		Double-end		95.46	96.97	66.67	51.52
		Weft-float		18.18	18.18	6.06	4.55
		Warp-float		30.30	15.16	9.09	1.16
		Coarse-pick		39.39	39.39	39.39	39.39
	10	Coarse-end		85.0	78.79	56.06	28.79
	11 Jammed-picks s		13.64	10.61	10.61	15.15
	12	Open-picks		37.88	39.39	39.39	39.39
		Average		53.42	48.86	40.53	33.05
		lev level (1)	level (2)	level (3)	level (4)
		100
		90
	Detection rate (%)	20 30 40 50 60 70 80
		10
		0
				Defect types
	Figure 5.9 Optimiz mization of level selection filter for simulated ted fabric

  Table (5.2) and figure (5.17) illustrate the detection results when applying these different noise levels on the images containing all defect types.

Table (

 (

	5.2): Effect of vari arious noise levels (indexes) on real defect ct detection rate
		0.0 .000	0.001	0.0025	0.005	0.01
	Hole	100 00%	100%	83.33%	58.33%	12.5%
	Stain	100 00%	100%	91.67%	58.33%	12.5%
	Miss-pick	100 00%	100%	100%	94.44%	77.78%
	Miss-end	100 00%	100%	100%	50%	16.67%
	Double-pick	100 00%	100%	100%	100%	100%
	Double-end	100 00%	100%	100%	50%	16.67%
	Weft-float	100 00%	100%	100%	100%	100%
	Warp-float	100 00%	100%	66.67%	66.67%	0%
	Coarse-pick	100 00%	100%	100%	100%	100%
	Coarse-end	100 00%	100%	66.67%	16.67%	0%
	Jammed-picks	100 00%	100%	50%	16.67%	0%
	Open-picks	100 00%	100%	50%	16.67%	0%
	Figure 5.17: Effect o t of various noise levels on real defect dete tection rate
			Online Fabric Inspection by Image Pr Image Processing Technology

Table (

 (

	5.3): The mea
	Defect types
	Hole
	Stain
	Miss-pick
	Miss-end
	Double-pick
	Double-end
	Weft-float
	Warp-float
	Coarse-pick
	Coarse-end
	Jammed-picks
	Open-picks
	0,6
	0,55
	0,5
	Figure 5.18: The mea

0,65 0,7 0,75 Average detection time (second) Maximum op

	easured detection time for real fabric defec fect detection
	Average detection time (second) at maximum optimized values	Average dete tection time (second nd) at values minimum optim timized
	0,7216		0,7466
	0,7094		0,7438
	0,7104		0,7452
	0,709		0,7424
	0,7018		0,747
	0,7082		0,7494
	0,7132		0,7206
	0,7068		0,7524
	0,7024		0,7544
	0,7074		0,7372
	0,7086		0,7444
	0,7226		0,7388
	optimized values	Minimum optimized valu lues
	Defect types
	easured detection time for real fabric defec fect detection
	Online Fabric Inspection by Image Pr Image Processing Technology

Table (

 (

		5.4): O Optimization of level selection filter (real fa fabric)
			Level (1)	Level (2)	Level (3)	Level (4)
	Ser.	Defect type	detection	detection	detection	detection
			rate (%)	rate (%)	rate (%)	rate (%)
		Hole		65.15	92.42	100	93.94
		Stain		60.61	89.39	96.97	89.39
		Miss-pick		42.42	100	100	92.42
		Miss-end		71.21	98.49	100	96.97
		Double-pick		77.27	77.27	92.42	87.88
		Double-end		74.24	98.49	100	83.33
		Weft-float		22.73	46.97	96.97	65.16
		Warp-float		66.67	78.79	93.94	68.18
		Coarse-pick		53.03	54.55	89.39	59.09
	10	Coarse-end		42.42	81.82	96.97	62.12
	11 Jammed-picks s		28.79	93.94	100	100
	12	Open-picks		30.30	72.73	100	100
		Total		54.55	80.68	97.22	83.21
		level (1)	level (2)	level (3)	level (4)
		100
		90
	Detection rate (%)	20 30 40 50 60 70 80
		10
		0
				Defect types
		Figure 5.19: Op Optimization of level selection filter (real fa fabric)
						Image Processing Technology

lev

Online Fabric Inspection by Image Pr

  146. Bodnarova A., Bennamoun M. and Kubik K. K.: Suitability Analysis of Techniques for Flaw Detection in Textiles using Texture Analysis, Pattern Analysis and Applications, Vol. 3, No. 3, 2000, pp.254-266. 147. Conci A. and Proença C. B.: A System for Real-Time Fabric Inspection and Industrial Decision, Proceeding of ACM International Conference on Software Engineering & Knowledge Engineering, 2002, pp. 707-714. 148. Cuenca S.A. and Cámara A.: New Texture Descriptor for High-Speed Web Inspection Applications, IEEE International Conference on Image Processing (ICIP), Barcelona, Spain, September 14-18, 2003, pp. 537-540. 149. Buades A., Coll B. and Morel J.M.: Image denoising methods. Anew nonlocal principle, SIAM review, Vol. 52, No. 1, 2010, pp. 113-147.

Acknowledgements

Ph.D. thesis -Abdel Salam MALEK Acknowledgements

5.

Chapter 5: Results and Discussions

Open-picks

But, we choose the suitable size for the higher number of defects to minimize as possible the required number of values when implementing our technique. It is found also that the other defects (miss-ends, double-ends, coarse-ends and warp-floats) are correctly detected when the scanning step is set to 25x25 pixels. It is clear from the previous results that the relationship between both of scanning sub-image size and step has remained the same as the random sub-image should scan the main fabric image with an overlapping step equivalent to almost half of its size. Moreover, the defects in warp direction still need lower scanning values to ensure correct detection.

Optimization of feature correlation coefficient

The coefficient of feature correlation is optimized for real fabric defect detection based on the following important results:

1. Our defect detection technique is implemented successfully on all simulated defect types when the correlation coefficient is set to only one value (0.8). 2. Detection of real fabric defects requires an acquired fabric image at high resolution level (1000 dpi). 3. Although all defects are detected when implementing the detection procedure, each parameter should be set to only few values to ensure good results. We need a wide range of values for each factor to have a flexible detection algorithm and/or technique to cope with the real time variations even if we will choose only one or two of them for each parameter. Obviously, the implementation of the level selection filter is a user choice because as we mentioned before it is developed to improve the technique credibility. Therefore, the system can be configured to fit the requirements of the user. Finally, the smallest defect to be identified is determined according to the resolution of the camera (1000 dpi) as well as the algorithm parameters. Thus, the overall detection rate of our presented approach is found to be 100% with a localisation accuracy of 1.2 mm.

Appendixes

The study of feature correlation