Analysis on the Application of Image Processing Technology in Clothing Pattern Recognition

2020-09-23 02:39LIUJingZHUANGMeiling庄梅玲AIRongyu艾容羽GAOTing

LIU Jing(刘 静),ZHUANG Meiling(庄梅玲), AI Rongyu(艾容羽),GAO Ting(高 婷)

College of Textile and Clothing,Qingdao University,Qingdao 266071,China

Abstract: A clothing pattern is a significant embodiment of regional culture and national characteristics. The recognition of clothing patterns could be realized objectively and accurately by using digital image processing technology. The researches on the extraction techniques of various pattern elements were compared and analyzed. Then the researches on clothing pattern color,outline and fabric texture extraction were summarized. And the core technology chain model of clothing pattern extraction was constructed. The research status,the core technology and the development trend of pattern element extraction technology based on two-dimensional images were obtained. What’s more,a reference for the follow-up research of clothing patterns and the technology upgrading of textile and clothing industries were provided.

Key words: image filtering; color space; color clustering; edge detection; clothing pattern

Introduction

A clothing pattern is the most representative image record of regional culture,and the study of the clothing patterns is an important auxiliary means for the study of sociology,history,religion,archaeology,art,anthropology,folklore and geographical differences[1]. In the traditional clothing industry,clothing pattern recognition mainly depended on manual work,which had strong subjectivity and low efficiency,and manual identification was unable to meet the needs of large-scale production of textile and clothing industries. The intelligent recognition of clothing patterns by using digital image processing technology can not only improve the efficiency and the accuracy of element extraction,but also facilitate the systematic arrangement and the analysis of pattern elements.

In recent years,the application of image processing technology in clothing pattern extraction mainly focused on three aspects: color,outline and fabric texture. In the color recognition of clothing patterns,the technical path adopted is mainly the clustering analysis of different color spaces,in which the research of various clustering algorithms is the core. At present,the widely used clustering algorithms areK-means clustering[2],fuzzy C-means clustering (FCM)[3]and mean-shift[4]clustering. Edge detection technology is the core algorithm in contour recognition,which mainly identifies the edge contour information in the image through the abrupt change (discontinuity) of pixel values. The commonly used edge detection algorithms in clothing image processing are the first-order differential operator[5],the second-order differential operator[6]and the Canny operator[7]. For the diversity and complexity of clothing image texture,the definition of clothing image texture is not particularly accurate,and the texture analysis method used is also based on different understandings of texture[8]. Therefore,it is impossible to sum up the core algorithm that is generally applicable. According to different types of fabrics, the research techniques used in texture recognition of woven fabrics, knitted fabrics and leather fabrics are analyzed respectively.

By analyzing the related technologies of clothing pattern extraction,a core technology chain model for the extraction of elements in clothing patterns was constructed,including three processing modules,namely image filtering,coversion of colour spaces and target recognition. The clothing image types applicable to the algorithms of different modules are summarized. On the basis of this model,the image processing techniques used in each link are analyzed and compared in detail. The deficiency and the development trend of this research technology were pointed out,which provided a reference for the follow-up research of clothing pattern extraction. The core technology chain model of this article is shown in Fig. 1.

Fig. 1 Research framework

1 Image Filtering

The purpose of image filtering is to avoid the interference of noise in the image. In the process of clothing pattern extraction,due to the influence of fabric texture or the noise generated in the process of image acquisition and transmission,it is necessary to filter and reduce the noise of the image. The existence of noise will also affect the subsequent image segmentation and recognition,so it needs to be filtered before image segmentation or image feature recognition.

1.1 Mean filtering

The mean filtering is to sum the pixel values in the neighborhood and calculate the arithmetic average,which has a good effect on dealing with random noise such as Gaussian noise,Poisson noise and so on. Wu[9]carried out mean filtering on the obtained clothing image before image segmentation in order to eliminate random noise,and a good smoothing effect was obtained.

Although the mean filter can suppress noise,it is also easy to blur the edge of the image and produce a ringing phenomenon. Therefore,this filter is not suitable for the clothing pattern filtering which emphasizes the edges.

1.2 Gaussian filtering

The Gaussian filtering is the weighted average of all the pixel values in the spatial template,and the template center value (target pixel) has the highest weight. It is a linear smoothing filter that selects weights according to the shape of the Gaussian function[10]. Zhouetal.[11]filtered the rewoven fabric images by setting the allowable values of color difference and changing the Gaussian weights on the basis of the Gaussian filtering. It is to say that the Gaussian filtering algorithm not only smooths the pixel values in the region,but also effectively maintains the edges between different color yarns.

The Gaussian filter can not only well deal with noise with a normal distribution,but also better retain the details of the image. And clothing patterns with less noise pollution and fine edge contours are suitable for such filtering processing.

1.3 Median filtering

The median filtering is a typical nonlinear filtering based on sorting. The principle of the algorithm is to sort the pixel values corresponding to the template from small to large,and to select the median value as the filtered pixel value. Therefore,it has a good filtering effect for the noise with sudden changes of pixel values,such as salt and pepper noise,impulse noise and so on,and has been widely used. Xiangetal.[12]used the median filtering to process the printing image in the research of printing image retrieval. The noises in the fabric images are effectively filtered and the edges of the image are well preserved.

Although the median filter has characteristics of excellent image smoothing and clear edge preservation,the median filter will filter out this part of pixel values when the pixel width of the image detail is less than half the size of the filter template. It is easy to lose details of the pattern and smooth the sharp corners.

1.4 Adaptive median filtering

The adaptive median filtering solves problem that the median filtering is easy to lose the pattern details when smoothing the image. This method can change the size of the filter window according to the needs. If the target pixel value to be processed is between the maximum and the minimum pixel values in the corresponding neighborhood of the template,the target pixel value is directly output as the filtered result value,otherwise,the median value of the ordered pixels in the neighborhood (including the target) is output. Sunetal.[13]used the adaptive median filtering to filter out the hairiness in the yarn and obtained a clear image of the yarn.

The adaptive median filter not only removes the noise,but also retains the contour texture information in the clothing pattern,which does not cause excessive smoothing. It is helpful for the edge extraction of subsequent patterns. However,for the clothing image which emphasizes the image smoothing effect,such as filtering out the influence of the fabric texture in the image,the median filter has a better application effect.

1.5 Comparison of four filtering algorithms

The four filtering algorithms show different characteristics in the research of dealing with clothing patterns,and the influencing factors of each filtering algorithm are also slightly different. A comparative analysis from three aspects has been made,including influencing factors,main characteristics and applicable scenarios of the four filtering algorithms,as shown in Table 1.

Table 1 Comparison of four filtering algorithms

(Table 1 continued)

2 Conversion of Color Spaces

A color space (color model) is an abstract mathematical model used to represent colors. In the clothing pattern segmentation,the selection of color spaces has a significant impact on the segmentation effect. Nowadays,the color space of equipments commonly used in the clothing image processing can be divided into hardware-oriented and visual perception-oriented[14]ones.

2.1 Color space for hardware devices

RGB color space is the most widely used color space in the hardware-oriented color spaces. Xiangetal.[7]compared the smoothing effect of the printed fabric texture in the four color spaces of CIE Lab,HSI,HSV and RGB. For the conversion of color spaces leading to the destruction and loss of some data,it is concluded that the smoothed fabric image has varying degrees of blur and defects in the first three spaces. There is no need for space conversion in the RGB color space,so blur and defects can be avoided effectively.

The deficiency is that the three color channels in the RGB color space are highly related. Each color in the space is mixed by different proportions of the three colors,so it is not suitable to distinguish and measure the difference between colors.

2.2 Color space for visual perception

The color space for visual perception is mainly set according to the human visual perception of color,has nothing to do with the use of the device,and does not change with the change of the device. There are two kinds of color spaces commonly used in textile and clothing image processings: CIE Lab and HSV color spaces.

2.2.1CIELabcolorspace

The CIE Lab color space is an international standard color model developed by the International Commission on Illumination[15]. It is a kind of color space with uniform visual perception of human eyes. Wangetal.[16]transferred a color tufted carpet image from the RGB color space to the CIE Lab color space,and then counted the number of each color. The chromatic aberration formula is used to quantify the original color to a similar color,which reduces the color types of the image without changing the visual perception of human eyes. The measurable characteristics of color difference in the CIE Lab color space have been applied.

Because the chromatic aberration in the CIE Lab color space can be expressed by Euclidean distance,it is often used to calculate the color differences of image color.

2.2.2HSVcolorspace

According to the three attributes of colors,the HSV color space has been divided into three channels: hue (H),saturation(S) and value (V). Its hue and saturation are closely related to human visual perception,and the spatial distance of colors is also in line with the perceptual characteristics of human eyes. In the field of textile and clothing,a large number of researchers chose the HSV color space for image processing for the following reasons.

(1) For the objects with low correlation degree of the image information of each channel,the color space can be used to process separately. For example,Lietal.[17]systematically analyzed the clothing color of dragon robes of the eldest direct descendants of Confucius in the Ming dyansty and the Qing dynasty,with the help of the differences in hue,saturation and lightness in the HSV color space.

(2) The distance between the two colors in the color space is in line with human visual perception,which is more convenient for later image segmentation. For example,Lu and Gao[18]transferred the color matching textile image to the HSV color space,then carried out FCM clustering processing in the V component and the H component respectively,and achieved ideal classification results.

2.3 Comparison of three color spaces

Through the application of different color spaces in the study of clothing patterns,it is found that each color space has its own characteristics and applicable pattern research direction. The color components,characteristics and applications of the three kinds of color spaces are summarized and compared in Table 2,in which a reference for the selection of color spaces in the follow-up clothing image research has been provided.

Table 2 Comparison of three color spaces

3 Target Recognition

There are three elements of clothing design,namely color,style and material. They are not only the basic feature information in the clothing image processing,but also the main direction of the current textile and clothing pattern research. And the related research and technology would be analyzed from three aspects: color,outline and fabric texture of the pattern.

3.1 Pattern extraction with color as target

A color not only plays an important decorative role in clothing,but also reflects the folklore and culture contained in clothing. The pattern recognition technology with color as the target is mainly to segment the image according to the color difference (similarity),so as to achieve the purpose of pattern recognition. The core algorithm of this part mainly focuses on the image clustering segmentation algorithm.

3.1.1K-meansclusteringalgorithm

TheK-means clustering algorithm is a typical local distance clustering algorithm[19]. The purpose of dividingnsamples intoKclusters is achieved by minimizing the sum of the distances betweennsamples and the cluster centerCK,where the distance usually refers to the Euclidean distance. The most commonly used method is to segment the image based on the color distance in the color space where the color is uniform (such as HSV and CIE Lab). Zhangetal.[20]chose to cluster the interwoven polychromatic yarn fabrics in the CIE Lab color space by theK-means clustering algorithm to identify different color yarns automatically and accurately. Sun[21]usedK-means clustering algorithm to effectively identify and mark different fabric structure regions.

K-means clustering algorithm has become one of the most widely used clustering analysis algorithms because of its high efficiency and simplicity. The deficiency is that the setting of the number of clusters needs to be given artificially and which is highly subjective. The artificial discrimination of complex color images is time-consuming,and the randomly selected initial clustering centers are easy to cause the instability of clustering results.

3.1.2FCMclusteringalgorithm

The FCM clustering algorithm introduces fuzzy theory in the clustering process,which avoids the hard division of target elements inK-means clustering. The FCM clustering algorithm divides the elements into different classes according to the membership degree,and redistributes the elements by iterating the objective function to get the optimal solution. The algorithm can be used for the classification of objects with certain fuzziness and uncertainty,and has been widely used in the field of textiles and clothing. Lu and Gao[18]used the FCM clustering algorithm to separate the mixed color fiber image,and achieved a good image segmentation effect. Leeetal.[3]used the FCM clustering algorithm to cluster a variety of popular colors,and similar colors were clustered into the same cluster,which was ready for further clothing fashion color prediction.

Like theK-means clustering algorithm,the FCM clustering algorithm also needs to give the clustering numberKin advance. But in many cases,it is difficult to determine the optimal clustering number artificially. When usingK-means clustering algorithm to segment fabric patterns,Li and Liang[2]objectively evaluated the number of clusters by using the Calinski-Harabasz (CH) index,and obtained the best clustering number. The study solved the problem of non-objectivity of manually setting the number of clusters.

3.1.3Mean-shiftclusteringalgorithm

By repeatedly calculated the mean and the offset,the mean-shift clustering algorithm converges the target to a point with the highest probability density,and the pixels with the same maximum density are grouped into the same cluster to achieve the purpose of image segmentation. Xingetal.[4]used the mean-shift clustering algorithm to cluster the cloud shoulder image and extracted the main color of the cloud shoulder image effectively.

The algorithm has good segmentation stability and does not need to determine the number of clusters in advance. It is widely used in color-based clothing image clustering. The deficiency is that the complexity of the algorithm is higher and the speed is slower than the former two.

3.1.4Comparativeanalysisofthreeclusteringalgorithms

The three clustering algorithms all show different advantages in the application of the pattern color recognition. The influencing factors,algorithm characteristics and applicable scenarios of the three commonly used color clustering algorithms are summarized as follows.

Table 3 Comparison of three clustering algorithms

3.2 Pattern extraction based on contours

A style is the embodiment of the clothing structure,which is often expressed in outline. The outline information in the clothing pattern is more stable than the color information,and the closed contour plays an important role in image segmentation. In the pattern contour recognition,the edge detection technology is the core algorithm of this part. The following is the analysis of the edge detection algorithms used in clothing researches in recent years.

3.2.1First-orderdifferentialoperator

The first-order differential operator mainly locates the local image edge by finding the maximum of the gradient amplitude. The Sobel operator is a typical first-order differential operator,which can detect the direction and the amplitude of image edges. For an imagef(x,y),the gradient amplitudeGand directionθat the coordinates (x,y) are

(1)

(2)

In practical application,the Sobel operator obtains the approximate value of the image gradient by convolution with the image through two groups of 3×3 templates (shown in Table 4) horizontally and vertically. Then the edge is judged according to the appropriate threshold. Lin and Zhang[5]used a two-direction Sobel operator to convolute the tie pattern image and extract the outline of the tie pattern image.Gx,Gyandθof the edge pixel in the horizontal and the vertical directions are calculated and quantized as edge eigenvalues.

Because of the simple and efficient operation of the Sobel algorithm,it has been widely used in the contour extraction of clothing images. Although the Sobel operator has certain image smoothing function,it can also cause image blur. The phenomenon of over-segmentation is easy to occur,and the connectivity of the detected edge of the pattern is poor.

3.2.2Second-orderdifferentialoperator

The second-order differential operator locates the image edge by finding the zero-crossing point of the second derivative of the image. The Laplace operator is a commonly used second-order differential operator,but it cannot be directly used for edge detection because of its sensitivity to noise. The Laplacian of Gaussian (LoG) operator is the deformed form of the Laplace operator. Gaussian function is introduced on the basis of the Laplace operator to smooth the image in edge detection and achieve the purpose of reducing noise.

Compared with the first-order differential operator,the LoG operator achieves a better effect of noise suppression and can produce closed and connected contours. However,due to the rotation invariance of the second-order differential operator,the image edge detected by the LoG operator is not directional,and the template size of the LoG operator is relatively large,which takes a long time. There are few applications in the outline recognition of clothing patterns. Yangetal.[6]took the surface pattern of cotton textiles as the research object and compared three typical edge detection operators: Sobel,Laplace and LoG operators. The experimental results show that the gray information entropy of the image obtained by the Sobel operator is the minimum,which is more beneficial to the recognition of pattern geometric information. Moreover,the Sobel operator is not sensitive to the texture of fabric surface and background area,so it is suitable for edge detection of fabric surface images.

3.2.3Cannyoperator

The Canny operator uses the Gaussian filtering for smoothing and locates the local image edge on the basis of the first-order differential operator. It is an edge detection operator gradually derived according to the demand. It can obtain good edge detection effect while suppressing noise,which is one of the most commonly used edge detection algorithms at present. Xiangetal.[7]compared many kinds of edge operators,such as Sobel,LoG and Canny operators,to explore the best algorithm for pattern edge detection of printed fabrics. It is found that the Canny operator can detect the real weak edge,and the outline is clear,complete and accurate. Thus,the Canny operator is selected for pattern edge detection.

The unique double threshold processing of the Canny operator can obtain the connected contour of single pixel width,which is suitable for clothing pattern contour extraction with high edge detection effect (connectivity,pixel width,etc.).

3.2.4Comparativeanalysisofthreeedgedetectionalgorithms

Through the above analysis,it is found that the three edge detection algorithms show different characteristics in the research of dealing with clothing patterns,and the types of patterns applicable to each edge detection algorithm are not the same. Three edge detection algorithms are summarized and compared from the characteristics of edge detection algorithms,common templates and applicable scenarios,as shown in Table 4.

Table 4 Comparison of three edge detection algorithms

3.3 Fabric texture recognition based on pattern

A fabric texture is a unique feature of clothing patterns. The texture of textile images not only reflects the fabric structure,but also plays an important role in the analysis of yarns and fabrics. The research techniques used in the identification of three different fabric types (woven fabrics,knitted fabrics and leather fabrics) are analyzed in this part.

3.3.1Texturerecognitionofwovenfabrics

The automatic identification of fabrics can provide a valuable scientific basis and technical parameters for fabric design,reference,innovation and imitation[22]. It is of great significance to improve the level of computer application and automation in the textile industry and to promote the technological development of the whole textile industry. Sun[21]organically combined the idea of maximization,K-means clustering and the opening and closing operation of morphology. The automatic extraction of histomorphology from the actual fabric weave chart has been realized successfully. Firstly,the fabric image was processed by the Gaussian filtering,and then the number of tissue structure was given through human-computer interaction. Secondly,theK-means clustering algorithm was used to identify and mark a variety of tissue structure regions,and the identified regions were stored in the form of binary images. Finally,the idea of maximization was introduced to automatically obtain the maximum inscribed submatrix,so as to complete the automatic location and extraction of organizational blocks.

3.3.2Texturerecognitionofknittedfabrics

The weft-knitted fabrics in knitted fabrics are divided into single-sided weft-knitted fabrics and double-sided weft-knitted fabrics,and the appearances of single-sided and double-sided fabrics are quite different. Hua[23]proposed a fabric structure recognition algorithm based on the learning vector quantization (LVQ) neural network after analyzing six kinds of structure and texture of one-sided weft-knitted fabrics. Firstly,the two-dimensional wavelet transform is used to extract the low-frequency and high-frequency part of the image. Secondly,the gray co-occurrence matrix is used to describe the angular second moment,entropy,contrast and correlation of six kinds of fabric textures for the characterization of fabric structures,and then the LVQ neural network is used to classify the fabrics. Finally,the automatic identification of fabric structure is achieved. Similarly,Suetal.[24]used wavelet transform to obtain the hue and numerical values of the image as image features,and used back propagation neural network fuzzy clustering analysis to identify the texture types of textiles. The designed system has a good recognition effect for plain weave,twill weave and satin weave in woven fabrics,one-sided and double-sided knitted fabrics,and nonwoven texture in nonwovens.

3.3.3Texturerecognitionofleatherfabrics

Animal leather texture is randomly generated in the natural state,its structure is complex and fine,and each has its own characteristics,so it is difficult to extract texture manually. Luoetal.[25]used the differential operator,the Canny operator and the watershed segmentation algorithm to extract the surface texture of the animal leather. The experimental results showed that the Canny operator could effectively extract the trunk texture of the leather surface,and the watershed segmentation algorithm would fully express the texture details.

Based on the texture recognition technology of different fabrics,the research on the texture of clothing pattern fabrics is mainly focused on the recognition and segmentation of fabric structures. In other words,texture recognition is carried out according to the distribution rules of pixel values presented by the fabric structure on the image. Therefore,the research of this part can not only effectively identify the fabric texture,but also complete the fabric prediction function,which has high application value.

4 Conclusions

The research on color,outline and fabric texture extraction of clothing patterns based on image processing technology helps to improve the automation and computer application level of textile and clothing industries,and is very important to ensure the objectivity and the accuracy of pattern extraction. Although researchers have made important progress in the field of clothing pattern element extraction technology,there are still some research bottlenecks that need to be broken through.

(1) In terms of technical means: the accuracy of pattern recognition is not high,the image data processing program fails to be systematized,and the extracted contour information vectorization is difficult,complex and time-consuming. Future research should focus on improving the recognition accuracy of pattern elements,optimizing image data processing programs,constructing an integrated technical system of image extraction and classification,realizing the systematic arrangement of clothing pattern elements,and improving efficiency.

(2) In terms of theoretical research: the current research has not yet combined with historical and cultural characteristics of the clothing patterns,and the research on the clothing patterns is not deep enough. The combination of computer technology and art theory is not close enough to achieve the desired effect. The follow-up research should not only fully consider the characteristics of clothing patterns,but also apply computer image processing technology for extraction and analysis. The research should be guided by the close combination of clothing cultural connotation and modern technology,so as to create a new technology theory suitable for the clothing industry.

In a word,the research on the extraction method of clothing pattern elements based on image processing technology is the main direction and trend of clothing pattern element extraction,prediction,classification and reorganization design in the future.