| Fabric defects detection is an essential step in the textile industry.Due to the high error rate and low detection efficiency of traditional manual fabric inspection,it is of great significance to the textile industry to apply machine vision in the traditional fabric inspection machine.In this thesis,the detection and classification of fabric defects with regular patterns are mainly carried out.The research mainly includes the system design of automatic detection of defects,the research on the defect detection algorithm of the patterned fabrics and the application of the fabric defect classification algorithm.Aiming at the defect detection algorithm of patterned fabric,the main research work of this thesis is as follows:(1)Firstly,the collected fabric images need to be pre-processed.Considering that the image quality is vulnerable to light and noise under industrial conditions,in our research we used the Retinex algorithm based on multi-scale Gaussian function to correct the uneven illumination image and then reduces the noise in the image by using the average filtering method.(2)An improved visual saliency model is applied to detecting the defects of textured images.The model combines the context-aware saliency model and the principal component analysis.The local contrast,the global contrast and the spatial location are taken into consideration to generate the saliency map with the high-salient defects area and low-salient fabric background.The experimental results show that the method proposed in this thesis can effectively detect the fabric defects and retain the original shape of the defects,and it also has pretty versatility and real-time performance.(3)The adaptive Otsu algorithm is adopted to segment the defective regions from fabric image.In the previous step,the saliency map is generated to highlight the defect area.In this step,the saliency map is processed by adaptive Otsu algorithm,and then a binary image will be obtained with defect shape.This step is also a preparation for the following defect classification.(4)A comparative experiment is conducted to evaluate the effectiveness of the detecting model and the segmentation.In the experiment,the effect of fabric flaw detection in this thesis is compared with that of the other three saliency models.The recall index and the accuracy rate are used to describe the evaluation index of the fabric defects detection effectiveness.The results show that the average accuracy of the algorithm proposed in this thesis is 92.2%,and the overall effect is superior to other models.(5)Aiming at the research of fabric defect classification,in this thesis we constructed multiple SVM classifiers to classify fabric defects.For the training of the SVM classifier,the image segmentation needs to be processed before extracting the image features.Then consider the use of grayscale co-occurrence matrix to extract the texture features of blemish,defect area,Hu invariant moments and other statistics to extract texture features.And using principal component analysis to extract nine of the main features of which components.Finally,we use some samples to train the SVM classifier to construct a one-to-one multi-class classifier.In the experiment of classification,five kinds of fabric images with different flaw types were used as the test dataset,and 10 kinds of classification experiments were carried out by cross-validation method.The accuracy of the experiment was 86.97%.Compared with the random forest classifier,the SVM classifier trained in this thesis has a better classification effect. |