Summary of the invention
In view of this, the invention provides a kind of complete fabric construction and color two-sided digital image analysis method, be used for the types of organization of detection and identification fabric, thread count, yarn color, and the diameter of yarn and its uniformity.In the present invention, we attempt a kind of digital picture measuring technique that is applicable to the single yarn that extracts in fabric, and this technology on the one hand can independently yarn diameter analysis of compatibility, and the opposing party also can be fit to still keep the yarn diameter analysis of critical shape.
For achieving the above object, technical scheme of the present invention is: describedly comprise based on the fabric of duplex scanning and Digital Image Processing and the hardware components of yarn analysis method:
A computer;
A plate color scanner that is used for fabric construction and the digital scanning analysis of color;
One cover is used for sample to be tested is clamped to the scanning platform of described plate color scanner, realizes the flat cloth specimen clamping device of two-sided magnetic to bit scan of sample image;
Software section comprises:
Four algoritic modules that are used for analyzing with institutional framework, thread count, yarn color, yarn diameter and the uniformity of test fabric, each module comprises image scanning, graphical analysis, three steps of data output:
The function of fabric identification module is used for analyzing the institutional framework with test fabric, namely identifies the pilotaxitic texture of filling yarn and the color alignment mode of yarn, comprises two algorithm structures: gridding methods and frequency domain model;
The function of thread count module is to measure the arranging density of yarn on the longitude and latitude both direction, comprise an algorithm structure: the shifted matching frequency model, step comprises: reduce and coupling the location of image, the extraction at yarn edge, the FFT of one-sided image, the identification of the Frequency point of mapping warp thread and weft yarn and extraction, the single-phase of image and half phase place translation, the FFT of image after the translation, the calibration of the Frequency point of mapping warp thread and weft yarn, the density calculation of filling yarn;
The function of the color analysis module of yarn is to measure the colouring information of yarn, comprise two steps: color calibration and color measuring, the method with the colour table of standard be arranged in sample around, can finish above-mentioned two steps by same width of cloth image, guaranteed the uniformity of color measuring;
The function of yarn diameter and uniformity module be the diameter of measuring yarn with and the uniformity, step comprises: the collection of figure warp thread picture, the cutting apart of figure warp thread picture, the determining of yarn central shaft, along yarn central shaft point-to-point measurement, the mean value of yarn diameter and centrifugal pump are calculated;
Described four analyses and testing algorithm module are installed in the computer, the plate color scanner that is used for fabric construction and the digital scanning analysis of color links to each other with this computer, the digital scanning analysis system of common formation fabric construction and color, sample to be tested is clamped on the scanning platform of described plate color scanner by the flat cloth specimen clamping device of magnetic, it is two-sided to bit scan by sample is carried out, scan image is passed to successively calculating and the analysis of carrying out four analytical test modules on the computer, finish at last data output, its main testing process comprises: sample holder, dual-side image scanning, positive inverse video contraposition, graphical analysis and feature extraction, result's output.
The material of the clamping of the flat cloth specimen clamping device of described magnetic dull and stereotyped (1,2) can be selected metal, also can select nonmetal, but for nonmetal or do not have a magnetic metal, clamping is dull and stereotyped up and down must corresponding embedded magnet or armature, to guarantee to have the magnetic force that attracts each other; The acquisition window (4) that the center of the up and down clamping of the flat cloth specimen clamping device of described magnetic dull and stereotyped (1,2) is offered respectively can be square, also can be the window of other shapes, the material such as mounting glass or transparent resin on it, and guarantee that flat board is to the good clamping of sample, avoid sample to have part to cause specimen surface flexural deformation because of unsettled shelving, and the window shape of clamping flat board should keep corresponding consistent with size up and down; Four location reference point (3) in the clamping of the flat cloth specimen clamping device of described magnetic dull and stereotyped (1,2), its shape, color and number can be done corresponding adjustment according to image recognition algorithm, the Main Function of location reference point is can be so that the image of fabric face and its reverse side, under image two-dimensional coordinate separately, find reference coordinate, realize affine mapping conversion, for each pixel in front finds its respective pixel in the reverse side image; The effect of the location reference point (3) in the clamping of the flat cloth specimen clamping device of described magnetic dull and stereotyped (1,2) can also be the real space resolution ratio of coming calculating pixel according to the distance between two location reference point, and the angle of the foursquare adjacent two edges that consists of according to four location reference point calculates the spatial warping degree of scan image; Connected by revolute axes configuration (5) between the upper clamping dull and stereotyped (1) of the flat cloth specimen clamping device of described magnetic and the lower clamping dull and stereotyped (2), this revolute axes configuration (5) comprises the swivelling chute on the lower clamping flat board, the swivelling chute of upper clamping flat board, and the axle core formation that connects both, clamping dull and stereotyped (1,2) can realize around axle core (15) rotation the foldings of 180 degree up and down; The surfaces externally and internally color of the clamping of the flat cloth specimen clamping device of magnetic dull and stereotyped (1,2) generally is set as black, matte management; In the clamping of the flat cloth specimen clamping device of described magnetic dull and stereotyped (1,2), the number and the color that are ordered in acquisition window (4) color module (221) all around design according to the Standard colour board that Color system mechanism provides, and its color number generally is no less than 16 kinds.
In the fabric based on duplex scanning and Digital Image Processing of the present invention and yarn analysis system and method, the function of the fabric identification module that relates in the described method is used for identifying the pilotaxitic texture of filling yarn and the color alignment mode of yarn, comprises two algorithm structures: gridding methods and frequency domain model;
Wherein the step based on gridding methods identification comprises: the contraposition coupling of positive and negative image, and the grid of positive and negative image initializes, the grid Adaptive matching of positive and negative image, the edge extracting of image, weave type identification, interlacing point error correction, color analysis;
Wherein the step based on the frequency domain Model Identification comprises: reduce and coupling the location of image, the FFT of dual-side image, peak dot filtering, the extraction of periodic frequency point, the calculating of fabric structure parameter and identification.
Described method based on the frequency domain Model Identification utilizes fourier transform technique or relevant spectrum analysis technique to analyze the digitized image of fabric, comprising wavelet transformation, and cosine transform etc.
In the fabric based on duplex scanning and Digital Image Processing of the present invention and yarn analysis system and method, the spectral model of the fabric tissue of the described gridding methods of foundation, by the analysis of spectrum to SATIN AND SATEEN CLOTH, can derive the coordinate figure of peak dot main on corresponding spectrogram, in addition, the peak dot that also has equidistant distribution in main peak point and the line direction of initial point, these are harmonic components of main peak point, the coordinate of harmonic wave peak dot is the integral multiple of main peak point coordinates, therefore also can obtain their coordinate figure; The coordinate figure of all peak dots of trying to achieve according to derivation obtains following formula in frequency domain, and (wherein: a is the warp thread spacing, and b is weft spacings, and R is the Weaving Cycle number, SjFor warp-wise flies number, SwFor broadwise flies number): the spacing of the two adjacent Frequency points that abscissa is identical is: dv=N/b; The spacing of the two adjacent Frequency points that ordinate is identical is: du=N/a; The difference of adjacent 2 abscissa of the difference minimum of abscissa is Δ u1=N/Ra; The difference of adjacent 2 ordinate of the difference minimum of ordinate is: Δ v1=N/Rb; On the positive direction of u, the difference of adjacent 2 abscissa of the difference minimum of ordinate is: Δ u2=(R-Sj) Δ u1On the positive direction of v, the difference of adjacent 2 ordinate of the difference minimum of abscissa is: Δ v2=(R-Sw) Δ v1
The spectral model of the fabric tissue of described gridding methods, analytic process for fabric image is to utilize FFT to obtain the process of the power spectrum image of fabric, the power spectrum that obtains resembled carry out visual preliminary treatment, peak dot filtering, extract the characteristic frequency dot information of power spectrum image, thereby obtain the structural information of fabric, measure the weft density of fabric and analyze the structure type of fabric.
Use the algorithm of peak dot filtering, obtain the peak dot corresponding to longitude and latitude knot structure, at first, make the histogram of power spectrum, observe its intensity profile, get the gray scale of its peak as threshold value t, eliminate the flakes background dot, make that g (x, y) is power spectrum, peak dot is the highest pixel of gray value in certain local; Therefore, can determine peak dot with the algorithm of neighborhood maximums, make that max is the maximum of gray scale in 9 * the 9 square or octagon neighborhoods of power spectrum g (x, y).
The spectral model of the fabric tissue of described gridding methods also comprises the feature extraction algorithm of fabric construction, concrete steps: seek the origin ofcoordinates 0, set up the u-v rectangular coordinate system; Take O as the center of circle, seek abscissa near the peak dot A of u axle, ordinate is near the peak dot B of v axle, and obtain respectively the angle α of OA and u axle, the angle β of OB and v axle, α represent the inclination angle of the relatively vertical positive direction of actual warp thread, and β represents the inclination angle of actual weft yarn relative level positive direction; Take O as the center of circle, begin to scan counterclockwise from inside to outside from the u positive direction, occur if any peak dot, record its coordinate figure, and calculate the vertical range of the actual warp thread direction in edge of peak dot and initial point, the horizontal range of the actual warp thread direction in edge of peak dot and initial point; Add up six index parameters, wherein every initial point is to direction and the u of peak dot, and the distance that the v positive direction is consistent is the forward distance, is labeled as positive sign, otherwise is reverse distance, is labeled as negative sign.
Along with the fast development of computer technology, being tending towards of intelligent identification technology and color electronic measurement technique is ripe, for structural parameters and the measurement yarn color of cognitron fabric provide reliable scientific method automatically.The present invention is mainly based on two-sided digital image scanning and analytical technology, use FFT, gridding methods, color calibration and measurement based on Standard colour board, yarn Skeleton central shaft extract and the inscribed circle measuring technique respectively to the state that interweaves of yarn, yarn arrays density, pattern of rows and columns of dyed yarn and color, yarn diameter is analyzed and is measured, set up a digitlization, objectify, standardized measuring and analysis system is for the fast reverse reaction system of realizing fabric analysis has been established technical foundation.
The specific embodiment
The present invention is described in detail below in conjunction with drawings and Examples.
Describedly comprise based on the fabric of duplex scanning and Digital Image Processing and the hardware components of yarn analysis system:
A computer;
A plate color scanner that is used for fabric construction and the digital scanning analysis of color;
One cover is used for sample to be tested is clamped to the scanning platform of described plate color scanner, realizes the flat cloth specimen clamping device of two-sided magnetic to bit scan of sample image;
Software section comprises:
Four algoritic modules that are used for analyzing with institutional framework, thread count, yarn color, yarn diameter and the uniformity of test fabric, each module comprises image scanning, graphical analysis, three steps of data output:
The function of fabric identification module is used for analyzing the institutional framework with test fabric, namely identifies the pilotaxitic texture of filling yarn and the color alignment mode of yarn, comprises two algorithm structures: gridding methods and frequency domain model;
The function of thread count module is to measure the arranging density of yarn on the longitude and latitude both direction, comprise an algorithm structure: the shifted matching frequency model, step comprises: reduce and coupling the location of image, the extraction at yarn edge, the FFT of one-sided image, the identification of the Frequency point of mapping warp thread and weft yarn and extraction, the single-phase of image and half phase place translation, the FFT of image after the translation, the calibration of the Frequency point of mapping warp thread and weft yarn, the density calculation of filling yarn;
The function of the color analysis module of yarn is to measure the colouring information of yarn, comprise two steps: color calibration and color measuring, the method with the colour table of standard be arranged in sample around, can finish above-mentioned two steps by same width of cloth image, guaranteed the uniformity of color measuring;
The function of yarn diameter and uniformity module be the diameter of measuring yarn with and the uniformity, step comprises: the collection of figure warp thread picture, the cutting apart of figure warp thread picture, the determining of yarn central shaft, along yarn central shaft point-to-point measurement, the mean value of yarn diameter and centrifugal pump are calculated;
Described four analyses and testing algorithm module are installed in the computer, the plate color scanner that is used for fabric construction and the digital scanning analysis of color links to each other with this computer, the digital scanning analysis system of common formation fabric construction and color, sample to be tested is clamped on the scanning platform of described plate color scanner by the flat cloth specimen clamping device of magnetic, it is two-sided to bit scan by sample is carried out, scan image is passed to successively calculating and the analysis of carrying out four analytical test modules on the computer, finish at last data output, its main testing process comprises: sample holder, dual-side image scanning, positive inverse video contraposition, graphical analysis and feature extraction, result's output.
This analysis method is mainly based on two-sided digital image scanning and analytical technology, use FFT, gridding methods, color calibration and measurement based on Standard colour board, yarn Skeleton central shaft extract and the inscribed circle measuring technique respectively to the state that interweaves of yarn, yarn arrays density, pattern of rows and columns of dyed yarn and color, yarn diameter is analyzed and is measured, set up a digitlization, objectify, standardized measuring and analysis system is for the fast reverse reaction system of realizing fabric analysis has been established technical foundation.
See also accompanying drawing 2, this system is comprised of hardware and software two parts, and wherein hardware components mainly comprises: the flat cloth specimen clamping device of a kind of magnetic, a plate color scanner; Software section mainly comprises four algoritic modules: (one) fabric identification module, (two) thread count analysis module, (three) yarn color analysis module, (four) yarn diameter and uniformity test module; Main testing process comprises: sample holder, dual-side image scanning, positive inverse video contraposition, graphical analysis and feature extraction, result's output; Wherein FFT has mainly been adopted in graphical analysis, gridding methods, color calibration and measurement based on Standard colour board, yarn Skeleton central shaft extract and the inscribed circle measuring technique respectively to the state that interweaves of yarn, yarn arrays density, pattern of rows and columns of dyed yarn and color, yarn diameter are analyzed and are measured.
The flat cloth specimen clamping device of described magnetic mainly comprises:
A pair of clamping is dull and stereotyped, and this clamping flat board can be square, connects the location by rotating shaft between the clamping flat board, and the clamping flat board can be realized 180 degree foldings around the rotation of axle core up and down;
Described upper clamping flat board is inlayed phase magnet four square vertices positions, relies on the magnetic force of magnet to realize up and down dull and stereotyped clamping to sample;
Described clamping flat board is equipped with a square glass window at centre bit, the image of the fabric portions in the corresponding window of digital scanning system acquisition;
Described up and down clamping flat board respectively has four location reference point, and the arrangement mode of anchor point, number, shape, color can design according to the image recognition algorithm of reality; Wherein go up the dull and stereotyped vertical contraposition of each corresponding reference point with lower clamping flat board of clamping, to guarantee when scanning the double-edged image of fabric, can to realize exactitude position.
Described clamping flat board around acquisition window, the color module of regularly arranged pattern, this color module is embedded in the flat board, the surface of color module is with dull and stereotyped surperficial concordant.The number of this color module and color design according to the Standard colour board that Color system mechanism provides, and its color number generally is no less than 16 kinds.
The flat cloth specimen clamping device of the described magnetic specific embodiment:
As shown in Figure 1, a pair of clamping is dull and stereotyped 1 and 2, and the clamping flat board can be square, and 1 of clamping flat board connects the location by rotating shaft 5 with being connected, and clamping dull and stereotyped 1 and 2 can realize 180 degree foldings around the rotation of axle core up and down;
As shown in Figure 1, 2, clamping dull and stereotyped 1 and 2 is inlayed phase magnet 6 four square vertices positions, relies on the magnetic force of magnet to realize the clamping of dull and stereotyped up and down 1 and 2 pair of sample 8.
Described clamping dull and stereotyped 1 and 2 is equipped with asquare glass window 4 at centre bit, anddigital scanning system 7 gathers the image of the fabric portions 8 in the corresponding window, and with image transmitting to computer 10.
Described up and down clamping dull and stereotyped 1 and 2 respectively has fourlocation reference point 3, the arrangement mode ofanchor point 3, and number, shape, color can design according to the image recognition algorithm of reality; Wherein go up the vertical contraposition of each corresponding reference point of clamping dull and stereotyped 1 and lower clampingflat board 2, to guarantee when scanning the double-edged image of fabric, can to realize exactitude position, shown in Fig. 3 and 4.
Aforesaid clamping dull and stereotyped 1 and 2 is aroundacquisition window 4, and thecolor module 221 of regularly arranged pattern,color module 221 are embedded in dull and stereotyped 1 and 2 outer surface, the surface ofcolor module 221 andflat board 1 with 2 surperficial concordant.The number ofcolor module 221 and color design according to the Standard colour board that Color system mechanism provides, and its color number generally is no less than 16 kinds, as shown in Figure 5.
(1) fabric identification module
This module is based on the fabric tissue recognition methods of Fourier transform, and model framework and algorithm that it is main comprise:
1) the fabric space-filling model of Criterion
The section morphology of yarn selects comparatively general ellipse cross section as the section morphology of yarn in the fabric, the critical shape of the every one thread of fabric tissue in fabric, and the critical shape that can regard as by two positions in longitude and latitude intersection region and non-intersection region is consisted of; Fabric, longitude and latitude intersection region yarn is the near sinusoidal curve-like.According to the buckling model of yarn, draw the topographic map of fabric face along warp-wise (or broadwise), or according to the regularity of longitude and latitude interlacing point in the space, can find out clearly the periodicity of fabric face.By the periodicity analysis to fabric face fluctuating wave molding on all directions, can obtain through the density of weft yarn and the types of organization of fabric, this is the physical background of utilizing fourier-transform research fabric face texture.
The rule of surface of fabric many interlacing points that distributing, interlacing point are at the be linked in sequence line of organizing of formation rule of a direction, organize line and organize line parallel to arrange to form striped, and it is the fluctuating ripple that this paper defines these stripeds.The interlacing point that consists of the fluctuating ripple is divided into two classes: a class is that the interval of interlacing point is less than a Weaving Cycle; Another kind of is that the interval of interlacing point is greater than a Weaving Cycle.Because more obvious than Equations of The Second Kind fluctuating ripple in actual fabric surface first kind fluctuating ripple visual effect, so graphical analysis is mainly for the first kind ripple that rises and falls.The index of describing the fluctuating ripple is wavelength X and angle of orientation θ.
The number of different tissue fluctuating ripples is also different, and the number m that fluctuating ripple number equals the mode position of single interlacing point and adjacent tissue point in a Weaving Cycle adds 2 (horizontal and vertical two ripples).To the institutional framework of determining, the number of the mode position of its interior tissue point is definite unique.
2) the fabric spectral model of Criterion
Frequency spectrum is the important means of analyzing and processing systematicness picture signal.By two-dimentional Fourier transformation technology, can obtain 2-d spectrum figure corresponding to image, thereby extract easily the spatial frequency information of image.Textile image has reflected the configuration of surface of fabric, and it has periodically variable intensity profile on warp-wise and broadwise, comprises the density information of arranging through weft yarn, and this is the physical background of utilizing the Fourier transformation technology.
The corresponding relation of spatial domain and frequency domain can be determined according to the relation in frequency and cycle, and x, y are the coordinate components of spatial domain, and u, v are the frequency component in respective frequencies territory.(u1, v1), (u2, v2) be through spatial frequency point corresponding to weft yarn, d1, d2Be the spacing through weft yarn under the perfect condition, namely through cycle of weft yarn.Can release: d1=N/u1, d2=N/v1, in the formula, N is the sampling number of image.
Fabric forms different fluctuating ripples in different directions, each fluctuating ripple all can have corresponding Frequency point behind Fourier transform, the position of Frequency point in spectrogram is relevant with the cycle of fluctuating ripple, therefore need only the location positioning with corresponding Frequency point, the cycle of fluctuating ripple can obtain.So can set up the spectral model of fabric tissue based on the Frequency point of fluctuating ripple.
Fabric tissue recognition methods based on grid model, main model framework and algorithm comprise: the contraposition coupling of (1) positive and negative image, (2) grid of positive and negative image initializes, (3) the grid Adaptive matching of positive and negative image, the edge extracting of image, (4) weave type identification, (5) interlacing point error correction and color analysis.
The front is talked about, and comprises gridding methods and frequency domain model fabric grid model in two algorithm structures of described fabric identification module.
The space structure of fabric is to be intertwined to form by warp thread and weft yarn, in general, the direction of warp thread and weft yarn is similar to horizontal and vertical directions, and this crossed structure of fabric can be expressed by setting up model of fabric, and this model is exactly the grid model of fabric.
Fabric model should be expressed two category informations, and a class is general information, and a class is individual information.General information is institutional framework and the color structure of fabric, and these information exchanges are used for all similar fabrics.Individual information then is the sample for certain fabric, the geometry of yarn in the record fabric sample, and distortion, degree of being changes etc., and there is very large difference in this class individual information in each sample.
A complete fabric grid model comprises the data of 2 aspects, is respectively color data, structured data.Wherein structured data is divided into again general data and individual data items, corresponds respectively to general information above-mentioned and individual information.
The grid model color data is stored in the data structure that is called palette.The palette record is present in the parameter of all colours in this fabric, comprises color sRGB parameter, CIELA*B*Parameter etc.The storage of palette also can be expanded according to different application, for example can the store sample illumination parameter.Table 1 has provided a palette data that comprises the yarn of 5 kinds of colors.
The main body of fabric grid model is the plane grid of one 2 dimension, and this grid is used for storing the structured data of fabric.Grid is made of row and column, and they respectively should be in weft yarn and the warp thread of fabric, and is corresponding one by one, and namely each yarns in the fabric has corresponding delegation or row corresponding with it in grid model.Weft yarn W as shown in Figure 6jWith warp thread WiCorrespond respectively to the capable Row in the grid modeljWith row ColumniCapable or the row of each bar in the yarn model are made of a series of continuous grid elements respectively, and each grid elements is corresponding to a bit of yarn in the fabric, for example the element E in the modelJiCorresponding to the S in the yarnJiSection.Like this, corresponding by yarn and row/row and yarn line segment and grid elements, fabric sample can be set up corresponding related with a grid model.
| ID | L | A* | B* | R | G | B | ... |
| 1 | 171。8 | 78。7 | 165。5 | 224 | 161 | 84 | ... |
| 2 | 202。4 | 105。1 | 143。9 | 224 | 198 | 161 | ... |
| 3 | 128。 | 112。 | 144。 | 151 | 122 | 100 | ... |
| 4 | 0 | 4 | | | | |
| 4 | 212。2 | 90。8 | 147。1 | 239 | 211 | 146 | ... |
| 5 | 104。0 | 116。5 | 170。5 | 163 | 77 | 83 | ... |
The palette data of the yarn of table 1:5 kind color
Grid elements is the base unit of grid model, and the structural information of all respective fabric all embodies by the data that are stored in the grid elements.In table 2, we have provided a basic grid elements data structure.In this data structure, mainly comprise the information of 4 aspects:
1) type of grid elements (Type) and structural type (PatternType).The type of grid elements is divided into two kinds, is respectively crosspoint and non crossover point.As can be seen from Figure 6, yarn line segment has two types, and a kind of yarn line segment is the crosspoint of warp thread and weft yarn, for example the S among Fig. 6JiA kind of is the independently yarn line segment of non crossover point, and there is not juxtaposition in these yarn line segments with any other yarn, for example the S among Fig. 6J-3, iAccordingly, the element of grid also is divided into two kinds of crosspoint element and non crossover point elements, and its type is by the type decided of the yarn line segment of correspondence.The tectonic information of fabric is mainly expressed in the mutual alignment in crosspoint by yarn.So if the type of certain grid elements is the crosspoint, then corresponding structural type at yarn crossovers point also needs to record.The structural type in crosspoint is divided into two kinds according to yarn in the mutual alignment in crosspoint, a kind of be weft yarn at fabric face, a kind of is that warp thread is at fabric face.
2) geometry information of grid elements.As mentioned above, the individual information of fabric mainly comprises the geological information of yarn, for example distortion, degree of being variation etc.And in grid model, a yarns is represented by the grid elements of some connections again, so by noting down the geometry information of yarn line segment corresponding to grid elements, the individual geometry information that just can store yarn in the fabric.Listed such as table 2, the main level of a yarn line segment and information comprise the position of yarn line segment, provide (the left side: Left by the position of the four edges of a grid elements, the right: Right, top: Top, bottom: Bottom) and shape (height: Height, wide: Width).
| struct Grid_Element{ int Type;//this element is related to a cross point(0)or not |
| (1); int PatternType;//which kind of yarn is on the face side of the corresponding//yarn segment;0:warp,1:weft; int Left;//geometry information of corresponding yarn segment; int Right; int Top; int Bottom; int Height; int Width; struct Color*Face_clor;//the color information of the two faces; struct Color*Back_color; struct Edge*Face_edge;//edge intensity information of the two faces; struct Edge*Back_edge; } |
Table 2: basic grid elements data structure
3) colouring information of grid elements.In the fabric model palette in front, we have provided how to represent to be present in color in the fabric.These colors distribution situation in fabric then is to express by the color of yarn line segment.If a yarn line segment is the crosspoint, then the color of obverse and reverse at it is respectively the color of corresponding warp thread and weft yarn; If a yarn line segment is not the crosspoint, then its positive and negative color all is the color of corresponding yarn.In the data of grid elements, the color of a yarn line segment positive and negative is stored in respectively in surface colour and the back side look.Surface colour and back side look point to respectively certain color data in the palette.
4) marginal information of grid elements.A yarn line segment is an approximate quadrilateral structure, comprises four edges.The information of the four edges of a yarn line segment can be used to do identification and the checking in crosspoint.If a yarn line segment is the crosspoint, then the marginal information of its positive and negative is different.In grid elements, the marginal information of yarn line segment positive and negative is stored in respectively in two data structures: surface colour and back side look.
(1) coupling of fabric two-face sampling and positive inverse video
The sampling of fabric positive and negative image is to utilize the flat cloth specimen clamping device of special magnetic plate to realize.There are 4 reference registration holes that run through structure in the outside at the sampling window of the flat cloth specimen clamping device of magnetic plate, and these four have consisted of foursquare four summits with reference to registration holes.In the single face sampled images, there are 4 reference points corresponding to the reference registration holes.Because with reference to the penetrability structure of registration holes, in the sampled images of any one side, the relative position relation of reference point and sampling window is constant.
The coupling of fabric positive and negative realizes by reference point.At first, location reference point.With respect to the black background of the flat cloth specimen clamping device of magnetic plate, the reference point of white has obvious color characteristic, can very easily be positioned, and take out the center point coordinate of reference point.Then, take four reference points as standard, the positive and negative image is carried out respectively affine transformation.In the rectangular image after the conversion, 4 reference points lay respectively on four jiaos the summit of image.Final step is that the positive and negative image is carried out in proportion conversion, so that the positive and negative image has identical size.After above 3 steps, the reference point of positive and negative image just in time overlaps, and image obtains coupling.
(2) initialization of the location of yarn and grid model
The fabric grid model is to be based upon yarn with fabric to close one to one and fasten, so the key of setting up grid model is quantity and the position of yarn in the correct detection fabric.
Yarn have a clear and definite geometry.Article one, complete yarn presents and is close to uniform elongated bar shape.In edge graph, a yarns is close to parallel edge line parcel by two.Owing to the mutual intersection of yarn, in the image of single-sided fabric, the edge line of yarn becomes discontinuously arranged, from the image of single-sided fabric, and the geological information that obtains the wall scroll yarn that can't be complete.The discontinuously arranged problem of yarn in one-sided image can be solved by the fabric two-face image fusion.In Fig. 7, we have provided a fabric sample positive and negative image fusion effect, and in fusion image, any one thread can be by complete observing.In the corresponding edge graph of this warm image, what represent that two edge lines of any yarns also can be continuous observes.
In order to detect the yarn in the fabric, we have proposed a kind of template matching algorithm based on breathing out society husband (Hausdorff) distance.For the feature of warp thread in the fusion image and weft yarn, we have designed respectively 2 templates.The warp thread template includes two vertical parallel lines, and the weft yarn template includes two horizontal lines.The design of yarn template customizes for the parallel lines edge feature of yarn in the fusion image edge graph.In Fig. 8, we have provided a warp thread based on template matches and have detected schematic diagram.The detection of yarn and location can be summarized as following a few step:
1) obtains fusion image from the positive and negative sample graph of fabric.
2) utilize Bel (Sobel) the horizontal vertical edge detection operator that continues to obtain level and the vertical edge figure of fusion image.
3) adopt floating frame centered by the arbitrfary point, in vertical (level) edge graph, sampling in proportion with warp thread (weft yarn) template, and sampling window is made histogram ratio binaryzation calculate.Window sample result after the binaryzation and warp thread (weft yarn) detect formwork calculation Hausforff distance, and institute's value is the matching value of this sampling window central point.
4) utilize the method forstep 3 to try to achieve matching value with warp thread (weft yarn) template matches to the every bit of vertical (level) edge graph.
Fig. 9 has provided the as a result figure that the yarn (warp thread) based on template matches extracts.Can see in the drawings, the zone with yarn parallel lines edge feature is significantly strengthened, and the yarn zone presents obvious strip and distributes.Consider that warp thread and weft yarn correspond respectively to vertical and horizontal direction because to the extraction of warp thread and weft yarn as a result figure make respectively along the vertical and horizontal directions matching value cumulative histogram.In the matching value cumulative histogram, can clearly observe the one-to-one relationship of wave crest point and yarn.After cumulative histogram being done the crest separation, can determine warp thread and the weft yarn average coordinates value on level or vertical direction.
Average coordinates value take yarn initializes grid model as the basis.Figure 10 has provided a grid initialization result figure.Can notice, in the initialization result of grid, every row or column all represents with straight line, and this is to be the average coordinates of yarn because the grid initialization data adopts.This grid form obviously can not represent the actual form of fabric, and the situation such as the distortion of yarn and degree of being variation can not be observed from this result in the fabric, so, must initialize on the basis at this grid is adjusted.
(3) adjust based on the fabric grid model adaptation of gradient
The purpose of grid model adjustment be so that the row and column of grid model completely the geometry of the yarn in the fabric sample overlap.The mode of grid adjustment is take grid elements as unit, and the four edges of mobile each grid elements makes it to be covered on the edge of corresponding yarn line segment.
If we regard the edge graph of fusion image as an equation I (x, y), wherein the codomain of I is the point set coordinate, and its numerical value is the gray value of respective point, and we just can obtain the gradient information of edge graph so.In the edge graph, the gradient direction of each point always points to the peaked point of contiguous local gray level.In edge graph, the local gray-value maximum point is marginal point always.So the cumulative gradient direction of the sideline loca of grid elements has just been pointed out the moving direction in this sideline, the gradient accumulated value then is the dynamics size that this limit is drawn by gradient.
The adjustment of grid model can be counted as a process of asking physical system energy energy minimization solution.In the grid adjustment process, the sideline of grid will keep suitable distance with adjacent sideline, and keeps continuity with the sideline that joins.If grid model is regarded as a spring system, so these control informations can be represented as in the grid model any tie point between spring force.In original state, the grid spring is in non-deformation state.The gradient force that acts on the grid sideline is the applied external force of this physical model, and the spring force between the consecutive points is internal action power.The adjustment process of grid model is exactly the process that internal agency and external agency acts on the grid and reaches balance, and its result is exactly grid model energy minimization solution.
Figure 11 has provided the grid model of fabric based on the adjustment result of gradient.After adjusting, can observe the sideline of each element of grid and adjust to correct position, correspondingly, the geometry of yarn has also obtained correct expression.
(4) identification in crosspoint
The institutional framework of fabric provides by the yarn crossovers point of general, and the state of yarn crossovers point depends on the mutual alignment relation of yarn on the crosspoint.The point of general that intersects has two kinds, if weft yarn in the front, then this crosspoint is the weft yarn crosspoint, otherwise, then be the warp thread crosspoint.In grid model, a crosspoint is represented by a quadrangle.The intensity of tetragonal four edges line is decided by to intersect point of general, and is same, can derive the intersection point of general by the intensity in crosspoint.
Suppose that the intensity in sideline, crosspoint is divided into two states under a perfect condition: 0 or 1.The point of general that intersects so can be divided into 8 types.Here, weft yarn and warp thread crosspoint are refined as respectively 4 subtypes.Figure 12 has provided the specific standards that the crosspoint is divided according to edge line intensity.
In actual conditions, the intensity at edge, crosspoint is not to be expressed as definitely 0 or 1, but is expressed as relatively by force or relatively.The division in crosspoint just becomes the K-partition problem of classics so.This K-partition problem has 4 input data and 8 output states.This K-partition problem can solve by the back-propagation artificial neural network of simple 4 inputs, 8 outputs.
For the institutional framework of a fabric of expression, 2 class crosspoints are divided enough, and we are the reason that the crosspoint is refined as 8 subtypes to utilize the syntople in crosspoint to come the junction recognition result is carried out error correction.For example, do out crosspoint (type 1:weft left open) for a weft yarn, adjacent crosspoint, the right only has two possibilities with it: crosspoint (type 2:weft right open) and weft yarn Zuo ﹠amp are opened in the weft yarn right side; Crosspoint (type3:weft left ﹠amp is opened on the right side; Right open.Figure 12 provided the crosspoint adjacency the institute possible.Utilize the crosspoint adjacency information to carry out error correction two criterions are arranged: 1. the back side, a weft yarn crosspoint must be a warp thread crosspoint; 2. the relation in a crosspoint and adjacent 4 crosspoints must meet the relation that the crosspoint syntople figure of table 3 then provides.Based on these two criterions, the junction recognition mistake of part can obtain to correct.Figure 13 has provided the crosspoint classification and has utilized the as a result figure of adjacency information error correction.
(5) extraction of color yarn tissue and utilize the colouring information error correction
| Type | Left | Top | Right | Bottom | |
| 0 | 4,5,6,7 | 4,7 | 4,5,6,7 | 5,7 |
| 1 | 2,3 | 0,1,2,3, 4,7 | 4,5,6,7 | 0,1,2,3, 5,7 |
| 2 | 4,5,6,7 | 0,1,2,3, 4,7 | 1,3 | 0,1,2,3, 5,7 |
| 3 | 2,3 | 0,1,2,3, 4,7 | 1,3 | 0,1,2,3, 5,7 |
| 4 | 0,1,4,5, 6,7 | 5,6 | 0,2,4,5, 6,7 | 0,1,2,3 |
| 5 | 0,1,4,5, 6,7 | 0,1,2,3 | 0,2,4,5, 6,7 | 4,6 |
| 6 | 0,1,4,5, 6,7 | 5,6 | 0,2,4,5, 6,7 | 4,6 |
| 7 | 0,1,4,5, 6,7 | 0,1,2,3 | 0,2,4,5, 6,7 | 0,1,2,3 |
Table 3: crosspoint syntople figure then
The tissue of color yarn is the another kind of key message of fabric.Color yarn tissue extraction comprises 3 steps: 1.Obtain color palette information, namely obtain quantity and the parameter of color in the fabric; 2.Determine the color of every yarns; 3.Utilize the colouring information of yarn to correct the mistake of classifying in the crosspoint.
The information of extracting color in the color fabric is a color cluster problem.The method that we propose is based on the adaptive color cluster that histogram moisture in the soil value is divided.The basis of this method is J.The one dimension histogram self adaptation partitioning algorithm that DELON proposes.Utilize this algorithm, we are according to the brightness of color, colourity, three reference axis circulations of saturation degree are carried out spatial division to being present in an all colours point in the fabric, until reach stable state, do not exist continue to divide may till.This algorithm divide and the color class quantity that goes out as the size of palette, the mean parameter of color class is as the parameter of palette of colors.
Determining of yarn color is a color-match problem.The geometry of yarn can obtain from the grid model of fabric.Thereby we can go out from all colours point parametric statistics that every yarns comprises the mean parameter of yarn color.The mean parameter of yarn color and each color in the palette are mated, and then the yarn of color determines to be the palette of colors the most similar to the color parameter of every yarns.
If it is different consisting of the color of two yarns in a crosspoint, the point of general that then should intersect can be judged by the color of yarn.If the color on north is close to the warp thread color simultaneously close to the color of weft yarn for the color in front, a crosspoint, then this crosspoint is a weft yarn crosspoint, otherwise then this crosspoint is a warp thread crosspoint.If the result who obtains in the classification of crosspoint contradicts with the result who classifies according to colouring information, then we are as the criterion with the result who obtains according to color classification.
Figure 14 has provided the end product that fabric tissue and color are extracted, Figure 15 warp-wise and this result of broadwise recursive copying and simulate the textile image that obtains.
(2) thread count module
Its major function is to measure the arranging density of yarn on the longitude and latitude both direction, main step comprises: (1) characteristic angle is approximate to be judged, (2) calibration of the Frequency point of corresponding warp thread and weft yarn, (3) extraction at yarn edge, (4) FFT of one-sided image, the density calculation of (5) filling yarn.
According to the description of preamble about the frequency domain model of fabric, can obtain a general Theorem about Density (FDP theorem): in the Fu Lier of textile image (Fourier) frequency spectrum, the horizontal/vertical coordinate of energy maximum point (density points) equals the quantity of warp thread and weft yarn in the textile image on the horizontal/.
In actual applications, the Density result who is obtained by the FDP theorem tends to be subject to the impact of 3 each factor: the distortion of fabric, the color of fabric and the histological structure of complex textile.Here, we are the measuring method that proposes a kind of Density, the effectively front two kinds of influence factors in place to go.
In the application of FDP theorem, we always suppose that the direction of warp and weft of fabric corresponds respectively to vertical and horizontal direction.Under this ideal state, in the Fourier of fabric frequency spectrum, can detect the feature angle of 2 energy maximums, these two angles are respectively 0 degree and an angle of 90 degrees, then be defined as respectively the density points of warp thread and weft yarn along the energy maximum point on this both direction, the quantity of warp thread and weft yarn can be derived from the horizontal/vertical coordinate of density points and be obtained (Figure 16).
Yet in actual conditions, the direction of warp and weft of fabric does not often just in time overlap with the vertical-horizontal direction, and this just is called the distortion of fabric.In the situation that the fabric distortion exists, the characteristic angle of two energy maximums that detect in the Fourier of fabric frequency spectrum often deviates from 0 degree or 90 and spends (Figure 17) in this case, we are similar to judgement to two characteristic angle that detect, we think,distance 0 is spent nearest characteristic angle corresponding to warp thread direction, and distance 90 is spent nearest characteristic angle corresponding to weft direction.At this moment, the density points of extracting along the characteristic angle direction is only correct in the weft count point.Judge with characteristic angle is approximate.
Another hypothesis of using the FDP theorem is, in the Fourier frequency spectrum, what density points was corresponding is the strongest periodic structure in the fabric of space, and namely warp thread and weft yarn repeat and the periodic structure that causes.If fabric is colored, and organizing of color yarn also present periodic structure, and then the extraction for density points can impact.This is because in the spatial information of fabric, often the intensity of the periodical information of color will be far longer than the yarn cycle information of bottom.Because, the cyclic component of the corresponding often color of energy maximum point that extracts along the characteristic angle direction, rather than yarn (Figure 18 (1)).
We observe, and the stability of the edge graph information of fabric is very strong.Although the intensity at edge also can be subject to the impact of color, be metastable with respect to gray-scale map.Therefore, we come the gray-scale map of alternative fabrics with the edge graph of fabric, and use FDP in the Fourier of edge graph frequency spectrum.We find, utilize the greatly intensity of reinforcement yarn cyclic component of edge graph, suppress simultaneously the intensity (Figure 18 (2)) of the cyclic component of color.But this result does not also promote completely for the degree of accuracy of the extraction of density points.
Said as the front, edge graph also can be subject to the impact of color to a certain extent, thus cause the edge the intensity color cyclically-varying and conversion affects the degree of accuracy of FDP principle.In order to overcome this factor, we have proposed to substitute with the binaryzation result of edge graph the method for edge graph.The window Binarization methods that the histogram ratio that is based on that the binaryzation of edge graph adopts is cut apart.This method can promote the strength information of local edge, suppresses simultaneously cColor-cycling information of overall importance.Use FDP in the Fourier of edge binary image frequency spectrum, can see, the yarn cycle composition has obtained obvious reinforcement, and the cyclic component of color has obtained good inhibition, and the density points of yarn can be extracted accurately.
(3) yarn color analysis module
This module is based on color calibration and the mensuration of Standard colour board, and main model framework and algorithm comprise:
The major function of the color analysis module of yarn is to measure the colouring information of yarn, relate to two main steps: color calibration and color measuring, since this invention with the colour table of standard be arranged in sample around, can finish above-mentioned two steps by same width of cloth image, guarantee the uniformity of color measuring.
The color analysis of yarn is based on that the flat cloth specimen clamping device of magnetic of special embedded Standard Colors plate carries out.Around the flat cloth specimen clamping device of special magnetic, we are embedded 24 Standard colour boards.That Standard colour board adopts is ColorCheckerTMGeneral color slider (Figure 19), this has guaranteed the accuracy of colour table.The color parameter of Standard colour board is known quantity.Utilize the color slider of these standards, we have proposed a kind of color correction algorithm based on reference colour.This algorithm can guarantee the yarn color accuracy of sampling and the uniformity of repeatedly sampling.
Utilize the color of digital sensor collection to be proofreaied and correct by Standard Colors.Digital sample equipment, for example the Mathematical Modeling of the sensor of scanner can be expressed as:
Wherein, matrix S comprises digital sensor for the mystification degree of different-waveband spectrum, rnThe reflectance spectrum of Standard Colors, RGBnThe actual output of scanner.And the computational methods of the actual numerical value of Standard Colors in the CIEXYZ space are:
Wherein 3 * 3 matrix L comprise the match parameter of CIEXYZ color conversion.Then the rectification problem of color depends on and finds a continuous mapping parameters matrix A, this matrix description the conversion parameter from the scanning color to standard C IEXYZ color space.
XYZ '=X 'n, Y 'n, Z 'n}=A{Rn, Gn, Bn}T, wherein
The computational methods of the mapping matrix A that is proposed by Vrhel and Trussel are to seek a conversion AScanWherein
‖. ‖2For the distance in the CIEXYZ space is calculated operator.Experimental results show that, utilizing least square method estimate to obtain mapping matrix A, to carry out the misalignment that color map causes be the error that reflectance spectrum difference of equal value and owing to color causes, this that is to say, the yarn color data that the color correction that utilizes Standard Colors and said method to do obtains are right-on.
(4) yarn diameter and uniformity test module
This module is based on the extraction of yarn Skeleton central shaft and the inscribed circle measuring technique realizes.
The major function of yarn diameter and uniformity module be the diameter of measuring yarn with and the uniformity, key step comprises: the collection of figure warp thread picture, the cutting apart of figure warp thread picture, the determining of yarn central shaft is along yarn central shaft point-to-point measurement, the mean value of yarn diameter.
The method of measuring yarn diameter with image processing techniques is the diameter of measuring yarn in three dimensions to be converted in two dimensional image plane measure the width that the yarn silhouette is penetrated face.
The method that we propose comprises three steps: at first, obtain the yarn silhouette; Then, in image, isolate yarn object, and describe the form of yarn object with geometric ways; At last, utilize the mean breadth of the geometric description calculating yarn of yarn object.
The sampling of yarn silhouette is to utilize the flat cloth specimen clamping device of special magnetic to finish.Because the variation of yarn color, we have adopted two kinds of different background colour tables.The background colour table of the black light yarn that is used for sampling wherein, the background colour table of the white dark yarn that is used for sampling.Utilize the advantage of different background colour table to be effectively to strengthen contrast (Figure 20) between yarn object and the background colour.
Owing to effectively having utilized different background colour tables, the separation problem of yarn object and background colour to be easier to solve.On the gray scale cumulative histogram of sampled images, can recognize clearly the crest corresponding to background colour.Because the quantity of background color dot is occupied absolute advantage in image, thus be the most remarkable in the cumulative histogram kind corresponding to the crest of background colour, and have obvious gap with the height of the crest of other colors.Utilize this phenomenon, we can carry out the crest division to cumulative histogram exactly, always obtain the dynamic threshold of image binaryzation.Take this dynamic threshold as reference, the sampled images of yarn is carried out binaryzation, can effectively cut apart yarn object and background colour (Figure 21: in).
The central shaft conversion is an effective tool that extracts solid body set form in image.The central shaft conversion method is: the geometric shape of an object can be represented as a series of and the two circles of cutting of object boundary and the track (Figure 21: the right side) in the center of circle thereof.For yarn object, what the track in the center of circle represented is the central shaft of yarn, and diameter of a circle then is that yarn is at the width of its circle centre position.
The central shaft conversion can realize by the erosion algorithm of shape filtering.Erosion algorithm is keeping under the continuous prerequisite of central shaft from the outside of yarn, order erode yarn object.In the situation that yarn has no idea to be further corroded, remaining yarn object partly is exactly the yarn central shaft, and the corrosion number of times that experiences when each point touches erosional surface on the central shaft then is its radius.
After obtaining the central shaft method for expressing of yarn object geometric shape, the width of yarn can be by the cumulative and acquisition of averaging to diameter of a circle corresponding to each point on the central shaft.