Digital Image Processing Techniques: A Versatile System for Textile Characterization

Digital image processing has been utilised widely in manufacturing for accurate automated inspection. Image processing is one such technique that involves computer processing of pictures or images that have been converted to numerical form. This paper presents a critical review of the exhaustive work of digital image processing and analysis and their application to measure twist and its distribution in yarns, weave pattern, yarn colour. Techniques


Introduction
Digital image processing is the use of computer algorithms to create process, communicate, and display digital images.Digital image processing algorithms can be used to: • Convert signals from an image sensor into digital images.
• Improve clarity; remove noise, and other artifacts.
• Extract the size, scale, or number of objects in a scene.
• Prepare images for display or printing.
Digital image processing and its analysis offers the most promising avenue to the future development of a rapid and reliable instrumental method for measurement, analysis, and real time dynamic controls of numerous textile-process and textile-product characteristics.Image processing technology is especially useful in textile manufacturing and inspections, including texture evaluation and examination of textilesurface characteristics.Computerized image capture and image analysis offer promising application and very rapid, accurate, and objective measurement of a wide range of textile-material properties.
Digital image processing can be used for testing Cotton maturity, Cross section analysis, Trash content, appearance, Fiber crimp, Fiber fineness, Fiber diameter, Fiber surface property.For yarn it can test cross section, evenness, appearance, hairiness, twist, blend analysis, spinning tension.For Fabric Wrinkle, Drape, Pilling, Abrasion, Structural analysis, Non-woven structure, Knitted structure.
Twist is an important yarn parameter that affects the yarn characteristics such as strength, handle and appearance.The twist variation in a yarn creates irregular patterns on the fabric due to different dye absorption levels because low twisted regionsabsorb more dye compared with high twisted regions ,the major reason for barre effect' in fabrics.Conventionally, yarn twist is measured by removing all the twists from a certain length of a yarn and then by retwisting to the same twist as proposed by Bellinson [1] and Ozkaya [2].It is a time consuming and destructive method, which can only be performed off-line.
Recently, some computer vision techniques have been introduced to measure the yarn diameter, twist angle and hairiness in a nondestructive fashion.Aspatial technique is developed to extract the twist angle through the analysis of the yarn core image.Then, a Fourier transformation technique is applied to yarn images to measure the orientation of the fibre on the yarn surface.Finally, a hybrid method that incorporates frequency domain filtering prior to spatial analysis wasproposed.
Yarn diameter is an important determinant of many fabric parameters and properties e.g.cover factor, porosity, thickness, air permeability, fabric appearance etc.There are many methods based on different types of sensors used for characterization of yarn unevenness.These instruments differ in the principle of measuring and the logic of evaluation of yarn irregularity.It is essential to investigate more deeply which of these methods is more reliable and to establish a relationship between the results obtained from different techniques.Uster tester 4 equipped with the optical sensor OM, Lawson Hemphill Yarn Analysis System (YAS), Quick Quality Management (QQM) are used in this study.Optical microscope has been also applied using cross sectional method and longitudinal method for evaluation of yarn diameter.The present investigation focuses on analysis of the data obtained from these commercial instruments as a stochastic process.It was found that a bimodal distribution can be applied to characterize the yarn diameter.The D-yarn program developed also supports this fact and deliveries much information about the characteristics of yarn diameter.Beside many other techniques, the autocorrelation function, spectrum analysis and fractal dimension is used.
It is a very tedious and time consuming work to analyze a fabric weave structure with a teasing needle and naked human eye.Therefore, it has become necessary to develop artificial vision inspection and automation to analyze fabric weave structure, thus avoiding while providing fatigue, better reliability and improved accuracy.By using computer image processing and analysis, a system to detect both weave patterns and yarn colour designs is developed.

Abstract
Digital image processing has been utilised widely in manufacturing for accurate automated inspection.Image processing is one such technique that involves computer processing of pictures or images that have been converted to numerical form.This paper presents a critical review of the exhaustive work of digital image processing and analysis and their application to measure twist and its distribution in yarns, weave pattern, yarn colour.Techniques of spatial & frequency domain use to extract twist angle and orientation of fibre on yarn surface respectively.Characteristics of weave extracted by Obliqueness (OB) and Orthogonality (OR) and yarn color design obtained by transmitted and reflected images.

Concepts Used in Digital Image Processing
• Color quantizationIn computer graphics, color quantization or color image quantization is a process that reduces the number of distinct colors used in an image, usually with the intention that the new image should be as visually similar as possible to the original image.
• Distance metrics: A metric or distance function is a function that defines a distance between elements of a set.A set with a metric is called a metric space.
• Dithering: Dither is an intentionally applied form of noise used to randomize quantization error, preventing large-scale patterns such as color banding in images.Dither is routinely used in processing of digital video data.
• Edge detectors: Edge detection is the name for a set of mathematical methods which aim at identifying points in a digital image at which the image brightness changes sharply or, more formally, has discontinuities.
• Frequency domain: the frequency domain refers to the analysis of mathematical functions or signals with respect to frequency, rather than time.
• Grayscale images: An image in which the value of each pixel is a single sample, that is, it carries only intensity information.Images of this sort, also known as black-and-white, are composed exclusively of shades of gray, varying from black at the weakest intensity to white at the strongest • Image editing software: graphics software or image editing software is a program or collection of programs that enable a person to manipulate visual images • Idempotence: Idempotence is the property of certain operations in mathematics and computer science, that can be applied multiple times without changing the result beyond the initial application.
• Other useful concepts: Logical operators, Look up tables and colormaps, Masking, Mathematical morphology, Multi-spectral images, Non-linear filtering, Pixels, Pixel connectivity, Pixel values, Primary colors, RGB and colorspaces, Spatial domain, Structuring elements, Wrapping and saturation.

Theory
Twist in yarn plays significant role in fabric properties.Because of twist, a surface fibre makes a helix angle θ with the core axis and completes one full rotation in L units parallel to the core axis, that is, there isone rotation inserted into yarn every L units.The threedimensional structure can be unfolded into a right-angle triangle.The twist in unit length can be calculated using Equation (1).
Where the diameter d is in meters, T will give the twist in turns/ meter.Another parameter of yarn twist is the twist direction, which can be either 'S' or 'Z' .
The core assumption in developing a theoretical expectation of how twist should distribute along a yarn is that there is scope for torque to be balanced between yarn sections of different linear density.There have been a number of studies of the development of torque in yarns.
Platt [3] looked at the torque due to fibre torsion and fibre bending and deduced that the total yarn torque due to the torsion of all the fibres (M TT ), i.e. the sum of the torques arising from the twisting of individual fibres as shown in Equation ( 2).
( )(sin cos ) Where n=no. of fibres in yarn cross-section, θ=yarn surface helix angle, KG=torsional rigidity of a single fibre, R=radius of yarn.
Yarn torque due to fibre bending (M BT ), i.e. the sum of torques arising from fibres being wrapped in a helical configuration as shown in Equation (3).

(
) for moderate values of θ, where E f I f is the product of the fibre bending modulus (E f ) and fibre moment of inertia (I f ).
Mitchell [4] went on to distinguish two components of the torque (a) that due to applied tension and (b) the intrinsic torque that exists in the untensioned yarn.They found experimentally, by measuring the torque in weighted hanks of yarn, that the torque due to the applied tension increased linearly with tension and did not depend on the yarn history but only on yarn geometric factors, primarily the yarn twist and linear density, in excellent agreement with Equation (4).

MT∝PT(tex)
Where, M T is torque due to tension and P is the applied tension.
Lu [5] treated the yarn as a continuous rod of circular cross-section in which the torque is proportional to the product of the twist and polar moment of inertia.This model from Lu [5] contradicts the previous model is because it treats the yarn as a continuous rod and so excludes movement of fibres that could redistribute the load.
Recently, Phillips [6] incorporated the idea of an effective linear density into an analysis of observed torque as a function of tension.Phillips argued that for his yarns Where ELD=effective linear density and D is mean fiber diameter in µm.
This becomes, He found that such an effective linear density gave more physically realistic values of packing fraction.In weave recognition using the image processing system, noise and any inconsistencies in the image caused by nonuniform illumination are removed by Gaussian filtering and histogram equalization.Interlacing patterns of warp and weft yarns are recognized by analyzing gray levels at the crossed points.In addition, we differentiate the different colored yarns by comparing their H (hue) values afterconverting yarn color from an RGB (red, green, and blue) color model to an HSV (hue, saturation, and value) color model.
When simplifying the weave pattern of all fabrics, there are only two possible states in which the warp is interlaced over the weft or vice versa.Therefore, it would be possible to recognize all kinds of weave patterns if we could detect whether the warp was interlaced over the weft or the weft was over the warp at the crossed points with image analysis.In addition, it would no longer be a problem if a fabric contained colored yarns, so long as we could determine the color of the floating yams.with the basic concept as mentioned above: to detect warp and weft crossed points, to detect warp and weft crossed states at all crossed points, and to detect yarn colors at all crossed points.If we use two images, transmitted and reflected, to detect weave patterns, and analyzed the yarn positions from the transmitted images, from the reflected image, we can get the data for warp and weft interlacing and the arrangement of colored yarns.
Yarn appearance is one of the parameters for a yarn quality evaluation.The standard CSN divides yarn appearance into six quality classes (grades A-F) in five categories of fineness, and a photo of a yarn board is available for each yarn grade.The boards labeled by a letter A represent the best quality and subsequent letters refer to yarns of progressively lower quality.According to the standard ASTM, the yarn appearance is divided into four quality classes (grade A-D) in six categories of fineness, and a printed photo of a yarn board is available for each grade.The evaluation is dependent on the reviewer and their ability to visually compare the appearance of the yarns.Greater objectivity can be achieved by evaluation from a larger number of independent evaluators.Inherently, all yarns are subject to periodic and random variations.Many laboratory methods have been introduced to characterize yarn irregularity.Also in the market many instruments from different producers are used for characterization of yarn unevenness.These instruments differ in the principle of measuring and the logic of evaluation of yarn irregularity.

Uster evenness testers
These are widely used in textile industry for a long time.Uster tester 4 and 5 are a combination of capacitive type, and optical one.The irregularity of yarn is detected from the variations in electric capacitance generated by the movement of yarn specimen that passes through the gap of a fixed air condenser.

Zweigle OASYS
Operates with the principle of absolute optical measurement using infra-redlight.The structure of a yarnis subject to variations of a periodicor random character.The measuring system compares the yarn diameter with the constant reference mean and records variations in length and diameter.

Lawson-Hemhill YAS
Is an important technology for measuring spun and air textured yarns.This system scans and measures diameter and diameter evenness of yarn, and automatically grades the yarn for appearance.

Keisokki KET-80 and Laserspot
LST-V are two types of evenness testers based on capacitive and optical measurement principles, respectively.Like Uster Tester III, KET-80 provides a U% and CV(%), a CV(L) curve, and a spectrogram.It also provides a deviation rate DR%, which is defined as the percentage of the summed-up length of all partial irregularities exceeding the preset cross-sectional level to the test length.

The flying laser spot scanning
System consists of three parts: the sensor head, the specimen feeding device, and the data analysis system.When an object is placed in the scanning area, the flying spot generates a synchronization pulse that triggers the sampling.The width between the edge of the first and the last light segment determines the diameter of the yarn.

QQM-3 yarn quality analyzer
Is a portable device used for evaluation of yarn unevenness characteristics directly on OE & RS machines, provides measurements, analysis and data source for further investigation.It is a tool for identifying faults on spinning units, Provides measurement and analysis of CV% as well as imperfections and Spectrograph.
One of the important factors influencing the appearance of the yarn is its irregularity and it has been suggested that using selected statistical functions that have already been used for the evaluation of surface unevenness of flat textiles, could be used for the evaluation of the yarn appearance on the board.
In this work semivariograms were used for the evaluation of the appearance of yarn wound on the board.These methods are applied to standard yarn boards from the standard CSN 80 0704 as well as real yarn boards.The results are compared with the semivariograms constructed from simulated ideal yarn appearance on the board and the possibility of using this function for the objective evaluation of yarn board appearance is discussed.

Core extraction
The image-processing task for measuring the twist involves two stages.In the first stage, the core region of the yarn is extracted from the image to perform two essential tasks-the first one being the determination of diameter and the second is the definition of the area of interest in which the twist angles will be searched.Initially, two different methods were developed to determine the surface orientation angles.The first one was based on spatial analysis whereas the second used frequency domain analysis.Then, a hybrid method that combines frequency domain filtering with spatial analysis was also investigated.

Spatial analysis method to extract the twist angle
This process involves extraction of the twist angles through the analysis of the yarn core surface.To extract the relatively bright surface fibers, a Sobel filter is applied to this image at a slope threshold value of 12 and then by skeletonising, these fibres are reduced to 1-pixel-wide contours.To extract the contours resembling a line from this image, the contours are converted to a polyline structure based on 8-connected neighbourhood of pixels.The lines having angles between 10 and 80 that correspond to 'S' twist and those having angles between 100 and 170 that correspond to 'Z' twist are separated from each other, Once finding the twist direction, the weighted average of the angles of the lines in the dominant direction is calculated by multiplying the angles with the lengths and then dividing it by the total length of the lines.

Frequency domain analysis
The frequency domain analysis to measure the twist angle involves the idea that the fibres on the surface have similar spatial characteristics (thickness and brightness) that lead to similar frequency components, and because the fibres on the yarn surface are aligned in similar directions, the fibre frequencies might be expected to concentrate in a region that is directly related to the twist angle.The algorithm developed for frequency domain analysis of the yarn surface images starts by overlaying the 512-pixel-wide core portion onto a 512×512 image to enable a square Fast Fourier Transform (FFT).Two very interesting frequency components are observed in the Fourier domain: first one corresponding to a sinusoidal aligned to 45° in the image with a frequency of 0.5 cycles/pixel and the other aligned to 71° with a frequency of 0.38 cycles/pixel.The frequencies appearing at v∼=0 (vicinity of horizontal axis) mainly arise from the image edges (left and right) and u∼= 0 (vertical axis) mainly due to the sharp crossing at the bottom edge of the core in the image.If the fibre has a width of n pixels in an N ×N image, the following band pass filter can be applied in the frequency domain: . This filtering will get rid of high frequencies from different sources such as the sinusoidal noise caused by the frame grabber without altering the information from the fibres, as well as the low frequency components that mainly arise from yarn core and out of focus protruding fibres.Furthermore, frequencies can also be filtered according to the twist direction of the yarn.
The final step of the algorithm is to find the dominant direction in the frequency domain.The first approach for this is to calculate the mean magnitude along each angular direction incremented by 1 from 0° to 90° within the zone corresponding to the twist direction.
Another approach to determine the twist angle is simply to find the angle that the v axis makes with the line betweenthe pixels having the maximum magnitude in the spectrum.One can expect the twist angles calculated using these two different methods to be in good agreement with each other.However, form any images especially for those having a complicated surface structure, they did not correlate well and in such cases both measurements often gave inaccurate results.For this reason, the twist angle is taken to be the average of the twist angles calculated from these two different methods if they are within 2° proximity; otherwise, both measurements are discarded.

Hybrid method: frequency domain filtering and spatial analysis
The frequency domain filtering followed by spatial analysis would be an alternative method for yarn surface inspection.This technique worked very well even on yarn images with poor surface detail.the spatial analysis algorithm fails to detect the details with little contrast leading to inaccurate measurements.On the other hand, when the frequency domain filtering is applied, these details are significantly highlighted.The hybrid method is very successful in determining the surface fibre contours.The main disadvantage of the hybrid algorithm is the time required to process the images because the method requires two FFT operations-one in forward and the other in reverse directions.To speed up the algorithm, 64×64 windows are used rather than 512×512.

Twist distribution measurement
Marl yarns were spun on both cotton and worsted ring-spinning frames using pairs of rovings (one of each dyed black).The cotton yarn was of nominal 20 tex and 1040 turns/m and was spun on a high-draft ring-spinner using a 700-tex uncombed roving in combination with a 430-tex black dyed roving.Wool yarns of 16 to 32 tex with varying twist levels (metric twist factors of 80 to 170) were spun.The dyed and undyedrovings were of 300 tex and 240 tex, respectively, with the mean fibre diameter of the recombed wool being 20.2 µm and the mean fibre length 80 mm.The wool yarns should therefore have an average of 36 to 73 fibres in the cross-section.Fifty centimetre sections of yarn were unwound from the spinning bobbins and mounted in a twist tester under 5 g tension in a standard lab (20 ± 2°C and 65 ± 2% RH).The twist in successive 5-mm segments was determined by counting the number of turns under a magnifying glass with a graticule held against the yarn.

Recoginitionof fabric weavecharatersitics
In order to make the images easier to treat numerically, we converted them into binary images using the process of histogram equalization.This last operation is a useful tool to improve the quality of certain images (bad contrast, too dark or too clear images, bad distribution of the intensity levels etc.

Obliqueness (OB)
The remarkable common feature between all twill woven fabrics is the line skew (obliqueness).Thus, we decided to make this parameter outstanding to distinguish the twill armour from the other types.
To transform this property of visual appearance to a measurable parameter of the image, we adopted the following equations: = number of neighboring pixels inclined in same direction and having same color OBi total number of pixels in the same image We admit that in each woven fabric, we have two directions of slope.Thus, we define the obliqueness as follows: OB=Max (OB1,OB2)

Orthogonality (OR)
Orthogonality is defined as being the property of an image to present horizontal and vertical bands (i.e. in the direction of warp and in the direction of weft).
For each image, we defined: Black_Pix: the number of adjacent black pixels in a given direction.
White_Pix: the number of adjacent white pixels in a given direction.L:number of pixels in a direction (vertical or horizontal).
For weave pattern recognition there are following two steps,

Image capture and processing
Several techniques to process images for this study, including Gaussian filtering, thresholding,histogram equalization, and autocorrelation.Autocorrelationisto determine structural re-peat units in the fabric weave.The general autocorrelation functions in weft C x,o and warp C o,y directions are shown in Equations: Here, G i.j is the gray level of a pixel (i,j) in an image, M and N are the number of pixels in weft and warp directions, and C x,o and C o,y represent peaks at integer multiples corresponding to the number of pixels comprising the average repeat unit size in each fabric direction.

Yarn Diameter Measurement
The semivariogram is a statistical function whereby the variability of random field properties is evaluated.In this case, the yarn board was converted into grayness degrees and divided into the square fields like a net.The observed property (grayness degrees) can be expressed as: z=z(x,y)=z(x) in the net.The semivariogram expresses spatial dissimilarity between values at point X i and X j .Generally, it is defined as one-half variance of differencesz (xi)-z(xi+lag).The magnitude lag is a directional vector representing separationbetween two spatial locations.For uniformly distributed points, x values of vector lag express the multiples of distance between squares in the direction of columns (0°), rows (90°) and diagonals (45°).Thus, three types of semivariograms are obtained and anUni-directional semivariogram is calculated by the averaging of these three types of semivariograms.
The so-called centered sample semivariogram, which is constructed when a random field is non-stationary (average value in each field is not constant): Where, Z c (X i ) is the centered average grayness degree defined as: N(lag) is the number of pairs of observations separated by distance lag; Z(X i ) is the grayness degree at the location x i .The image is divided into square fields like a net.The centers of the fields are the locations x.The average value of grayness degree in the given square field is assigned to the location X (Z (X i )).If G (lag)=const., the magnitude Z (.) is not correlated in the given direction.

Conclusions
Digital image processing allows the use of much more complex algorithms, and hence, can offer both more sophisticated performance at simple tasks, and the implementation of methods which would be impossible by other means.
Digital image processing in textile field has many advantages over othertechniques.It allows a much wider range of algorithms to be applied to the input data and can extract valuable informations even from poor qulity of images.Since images are defined over two dimensions (perhaps more) digital image processing may be modeled in the form of multidimensional systems.
One of the biggest advantages of digital imaging is the ability of the operator to post-process the image.Post-processing of the image allows the operator to manipulate the pixel shades to correct image density and contrast, as well as perform other processing functions that could result in improved diagnosis and fewer repeated examinations.