CN109949287A - A kind of fabric defects detection method based on adaptivenon-uniform sampling and template correction - Google Patents

A kind of fabric defects detection method based on adaptivenon-uniform sampling and template correction Download PDF

Info

Publication number
CN109949287A
CN109949287A CN201910196033.0A CN201910196033A CN109949287A CN 109949287 A CN109949287 A CN 109949287A CN 201910196033 A CN201910196033 A CN 201910196033A CN 109949287 A CN109949287 A CN 109949287A
Authority
CN
China
Prior art keywords
lattice
template
flaw
flawless
adaptivenon
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910196033.0A
Other languages
Chinese (zh)
Inventor
狄岚
杨达
顾雨迪
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jiangnan University
Original Assignee
Jiangnan University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Jiangnan University filed Critical Jiangnan University
Priority to CN201910196033.0A priority Critical patent/CN109949287A/en
Publication of CN109949287A publication Critical patent/CN109949287A/en
Pending legal-status Critical Current

Links

Abstract

The fabric defects detection method based on adaptivenon-uniform sampling and template correction that the invention discloses a kind of, including training stage and test phase;The training stage obtains a threshold value by the processing to indefectible image;The test phase carries out the detection and identification of fabric defects using the training stage by the threshold value that training obtains.Beneficial effects of the present invention: the present invention proposes that fabric defects detection method and wavelet pretreatment gold image subtraction, Boll wave band method, Regular Band method, the Comparison of experiment results based on template correction and chessboard method based on adaptivenon-uniform sampling and template correction are analyzed, and has a distinct increment on recall ratio and precision ratio.

Description

A kind of fabric defects detection method based on adaptivenon-uniform sampling and template correction
Technical field
The present invention relates to computer visual image processing technology field more particularly to image characteristics extractions.
Background technique
Textile Defect Detection is roughly divided into three kinds of methods, counts class method, structure class method, model class method.Conci Et al. use for reference Fractal and carry out textile Defect Detection, this method thinks that there are flaws when fractal structure changes.It asks In solution preocess, using difference box dimension, faster detection efficiency is obtained.Aiger et al. proposes a kind of based on discrete fourier The unsupervised textile inspection method of transformation and mahalanobis distance, this method are regular by having in removal textile images Part is free of the part of rule to protrude, and in this, as the result of Defect Detection.Henbury et al. obtains figure using morphology As direction character, it is aided with systematicness feature, is achieved on TILDA database good as a result, only this method needs manually Parameter is set, manual intervention is relied on.Kumar et al. proposes the flaw detection method for having supervision filtered based on Gabor.This method Using one group of multiple dimensioned multidirectional Gabor filter, feature on different scale and direction, the completion pair of composition characteristic vector are merged The detection of flaw.Goddard et al. is handled textile images using DaubechiesD2 wavelet basis, and with two points of shapes Feature carries out the description of local roughness and global uniformity to filtered image, and this method includes in 3700 images 89% verification and measurement ratio is reached on the data set of 26 kinds of flaws.
During textile production, detecting and controlling for product quality is very important, textile flaw is to determine The main reason for determining cloth quality.For textile industry, flaw will affect the aesthetics and its quality evaluation of textile, this The sales slip and client's public praise that may cause enterprise are deteriorated.The target of Defect Detection i.e. in time discovery flaw, weaving and It is avoided as far as possible by arranging and repairing because flaw bring fabric quality reduces in detection process.
Recent years, production automation had been to be concerned by more and more people with the increase of cost of labor.It is raw in textile Information technology is introduced during producing can not only reduce recruitment cost, can also improve production efficiency.Most of country's weaving at present Enterprise still uses artificial perching, and artificial perching is worker station before machine, under conditions of with certain illumination, carries out to flaw Label.Although human eye to fault have very strong recognition capability, by physiology, psychology, etc. external conditions influenced, worker's Detection has very strong subjectivity, and detection accuracy and detection efficiency are lower.
The purpose of textile Defect Detection is to extract defect areas from image.This work for worker simultaneously It is not difficult, though without trained worker, can also by difference and experience will in textile images it is irregular Extracting section come out.And allowing computer to carry out this work has certain challenge, needs predefined series of rules, Allow computer that can identify normal textile area.The essence of textile Defect Detection based on computer vision, is exactly right The definition of rule.In order to effectively be defined to rule, need to carry out textile flawless region feature extraction, selection can be with Indicate the parameter of flawless provincial characteristics as the foundation classified with defect areas.
Summary of the invention
The purpose of this section is to summarize some aspects of the embodiment of the present invention and briefly introduce some preferable implementations Example.It may do a little simplified or be omitted to avoid our department is made in this section and the description of the application and the title of the invention Point, the purpose of abstract of description and denomination of invention it is fuzzy, and this simplification or omit and cannot be used for limiting the scope of the invention.
In view of above-mentioned existing problem, the present invention is proposed.
Therefore, the fabric defects detection method based on adaptivenon-uniform sampling and template correction that it is an object of the present invention to provide a kind of, Opposite conventional method has outstanding testing result, significantly improves the precision ratio of sample data.
In order to solve the above technical problems, the invention provides the following technical scheme: a kind of be based on adaptivenon-uniform sampling and template school Positive fabric defects detection method, including training stage and test phase;The training stage passes through the place to indefectible image Reason obtains a threshold value;The test phase carries out fabric defects by the threshold value that training obtains using the training stage Detection and identification.
One kind as the fabric defects detection method of the present invention based on adaptivenon-uniform sampling and template correction is preferably Scheme, in which: the training stage is further comprising the steps of, and the indefectible image with periodic structure is utilized adaptive point The method of cutting forms flawless lattice, obtains N number of flawless lattice set Bi(i=1 ..., N);The flawless lattice passes through to be moved using circulation The method of position changes the ranks sequence of the flawless lattice to be corrected;By between the lattice of having no time after all corrections of calculating Structural similarity obtain similarity relation, and the similarity relation is obtained into equivalence relation by way of transitive closure;Institute It states and establishes unified flawless template on the basis of correcting, according to the structural similarity of calculating to the flawless crystalline substance after correction Difference between lattice and the flawless template is quantified, and the threshold value for the positioning of flaw lattice, and the threshold value are obtained For decision boundary t.
One kind as the fabric defects detection method of the present invention based on adaptivenon-uniform sampling and template correction is preferably Scheme, in which: the test phase is further comprising the steps of, is divided automatically to flaw image, and acquisition is N number of flaw lattice collection Close Ai(i=1 ..., N);The ranks sequence for thering is flaw lattice to change grid by the method for the cyclic shift, to described There is flaw lattice to be corrected;According to the structural similarity algorithm set of computations AiStructural VAR between inner element, obtains To N number of Structural VAR matrix Rei;The decision boundary t obtained using the training stage, to Structural VAR square Battle array ReiThreshold segmentation is carried out, the positioning of flaw lattice is completed;The essence of Pixel-level is carried out to flaw lattice according to the Threshold segmentation Really detection.
One kind as the fabric defects detection method of the present invention based on adaptivenon-uniform sampling and template correction is preferably Scheme, in which: pre-processed and with unmatched with or without flaw figure do of the method that template corrects to the lattice after segmentation to every A grid carries out feature extraction using the structural similarity, and the bearing calibration of the cyclic shift is corrected according to the template Template carry out circulative shift operation;Using the bearing calibration of the cyclic shift, following template model is proposed:
Wherein, A is lattice to be corrected, and B is an indefectible lattice, and p* indicates that the number of row transformation, q* indicate that column become The number changed, p* ∈ [0, r-1], q* ∈ [0, c-1].Tv and Th is two matrixes of r × r and c × c size respectively, as follows:
One kind as the fabric defects detection method of the present invention based on adaptivenon-uniform sampling and template correction is preferably Scheme, in which: the template correction is further comprising the steps of, reference template is established, then by each lattice according to the ginseng Template is examined to be corrected;The gray average matrix of all lattices of each indefectible image is calculated as template, then by remaining Lattice is corrected according to the reference template.
One kind as the fabric defects detection method of the present invention based on adaptivenon-uniform sampling and template correction is preferably Scheme, in which: the structural similarity algorithm is to construct all sample images after the correction between one expression lattice The matrix of similarity relation measures the similarity between lattice using the structural similarity, and the structural similarity is defined as follows: A lattice set Z={ Z is obtained after image adaptive is divided1...Zn};If SijIndicate lattice ZiWith lattice ZjStructure phase Like property, obtain as follows:
Wherein x, y respectively represent lattice Zi and Zj, wherein μxIt is the average gray of x, μyIt is the average gray of y,It is The variance of x,It is the variance of y, σxyIt is the covariance of x and y, C1=(k1L) 2, C2=(k2L)2It is for remaining stable normal Number, L is that the dynamic range of pixel value takes 255, k1=0.01, k2=0.03.
One kind as the fabric defects detection method of the present invention based on adaptivenon-uniform sampling and template correction is preferably Scheme, in which: transitive closure matrix is calculated by the similarity relation matrix, after transitive closure matrix Threshold segmentation, energy Enough clusters by realizing between flawless grid, obtain the positioning of flaw lattice.
One kind as the fabric defects detection method of the present invention based on adaptivenon-uniform sampling and template correction is preferably Scheme, in which: described includes following procedure to transitive closure matrix Threshold segmentation, if t is the threshold value, to the transitive closure Matrix carries out Threshold segmentation, works as SijWhen >=t, lattice Ai and lattice AjBetween be equivalence relation;Work as SijWhen≤t, lattice AiWith lattice AjBetween be not present relationship;And the structural similarity between the flawless lattice is greater than the structure phase between flawless lattice and flaw lattice Like degree.
One kind as the fabric defects detection method of the present invention based on adaptivenon-uniform sampling and template correction is preferably Scheme, in which: the threshold value t can obtain the Clustering Effect of dynamic mapping in section [0,1] dynamic mapping;In training process In, it is that d traverses P flawless image in section [0,1] with step-length;Obtain numerical value t when flawless image is classifiedi, i =1,2 ... P;The wherein selection method of threshold value t are as follows:
T=min (ti)
Process are as follows: threshold value t is traversed in section [0,1] with step-length d, is added up toA classifying quality, for Image of any one width through over-segmentation always has a corresponding T, and as λ=T, classification situation takes place in image;Observation is simultaneously The value that classifying quality occurs for these flawless images is recorded, T is denoted asi, wherein i=1,2 ... L, select wherein minimum value TiAs threshold Value.
One kind as the fabric defects detection method of the present invention based on adaptivenon-uniform sampling and template correction is preferably Scheme, in which: the accurately detection of the flaw lattice Pixel-level is further comprising the steps of, to each flaw lattice detected into Row is following to be calculated:
Wherein TM is that the template corrects the template acquired;σ (x, y) indicates grid OiStandard deviation, λ represents constant, LD (x, y) is the pixel value on the x row y column of flaw grid;The λ value is 2;Since lattice is corrected when detecting, so It performs the following operation and is restored before flaw lattice thresholding.
L=(Tv)(r-p)·L*·(Th)(c-q)
Beneficial effects of the present invention: the present invention proposes the fabric defects detection method based on adaptivenon-uniform sampling and template correction With wavelet pretreatment gold image subtraction, Boll wave band method, Regular Band method, the experimental result based on template correction and chessboard method Comparative analysis has a distinct increment on recall ratio and precision ratio.
Detailed description of the invention
In order to illustrate the technical solution of the embodiments of the present invention more clearly, required use in being described below to embodiment Attached drawing be briefly described, it should be apparent that, drawings in the following description are only some embodiments of the invention, for this For the those of ordinary skill of field, without any creative labor, it can also be obtained according to these attached drawings other Attached drawing.Wherein:
Fig. 1 is the fabric defects detection method described in second embodiment of the invention based on adaptivenon-uniform sampling and template correction Method flow diagram;
Fig. 2 is part Defect Detection result figure described in third embodiment of the invention;
Fig. 3 is the testing result of star-plot broken ends of fractured bone flaw image algorithms of different described in third embodiment of the invention;
Fig. 4 is the testing result of star-plot broken hole flaw image algorithms of different described in third embodiment of the invention;
Fig. 5 is the testing result of star-plot cord flaw image algorithms of different described in third embodiment of the invention;
Fig. 6 is the testing result of box diagram broken ends of fractured bone flaw image algorithms of different described in third embodiment of the invention;
Fig. 7 is the testing result of box diagram broken hole flaw image algorithms of different described in third embodiment of the invention;
Fig. 8 is the testing result of box diagram cord flaw image algorithms of different described in third embodiment of the invention
Fig. 9 is the testing result of scattergram knot flaw image algorithms of different described in third embodiment of the invention;
Figure 10 is the testing result of scattergram stria flaw image algorithms of different described in third embodiment of the invention;
Figure 11 is the testing result of scattergram cord flaw image algorithms of different described in third embodiment of the invention.
Specific embodiment
In order to make the foregoing objectives, features and advantages of the present invention clearer and more comprehensible, right with reference to the accompanying drawings of the specification A specific embodiment of the invention is described in detail, it is clear that and described embodiment is a part of the embodiments of the present invention, and It is not all of embodiment.Based on the embodiments of the present invention, ordinary people in the field is without making creative work Every other embodiment obtained, all should belong to the range of protection of the invention.
In the following description, numerous specific details are set forth in order to facilitate a full understanding of the present invention, but the present invention can be with Implemented using other than the one described here other way, those skilled in the art can be without prejudice to intension of the present invention In the case of do similar popularization, therefore the present invention is not limited by the specific embodiments disclosed below.
Secondly, " one embodiment " or " embodiment " referred to herein, which refers to, may be included at least one realization side of the invention A particular feature, structure, or characteristic in formula." in one embodiment " that different places occur in the present specification not refers both to The same embodiment, nor the individual or selective embodiment mutually exclusive with other embodiments.
Combination schematic diagram of the present invention is described in detail, when describing the embodiments of the present invention, for purposes of illustration only, indicating device The sectional view of structure can disobey general proportion and make partial enlargement, and the schematic diagram is example, should not limit this herein Invent the range of protection.In addition, the three-dimensional space of length, width and depth should be included in actual fabrication.
Simultaneously in the description of the present invention, it should be noted that the orientation of the instructions such as " upper and lower, inner and outer " in term Or positional relationship is to be based on the orientation or positional relationship shown in the drawings, and is merely for convenience of description of the present invention and simplification of the description, and It is not that the device of indication or suggestion meaning or element must have a particular orientation, be constructed and operated in a specific orientation, therefore It is not considered as limiting the invention.In addition, term " first, second or third " is used for description purposes only, and cannot understand For indication or suggestion relative importance.
In the present invention unless otherwise clearly defined and limited, term " installation is connected, connection " shall be understood in a broad sense, example Such as: may be a fixed connection, be detachably connected or integral type connection;It equally can be mechanical connection, be electrically connected or be directly connected to, Can also indirectly connected through an intermediary, the connection being also possible to inside two elements.For the ordinary skill people of this field For member, the concrete meaning of above-mentioned term in the present invention can be understood with concrete condition.
Embodiment 1
The present invention according to the periodicity of pattern texture, obtains unit cell pattern template size first, then carries out to image adaptive It should divide, while method of the application based on template reduces the influence of misalignment between lattice.Select indefectible lattice for establishing Average template, i.e. average value are as reference.By calculating the structural similarity between all grid, and similarity relation is passed through into transmitting The mode of closure obtains equivalence relation, then carries out the cluster between lattice.Finally according to the Threshold segmentation criterion of proposition, flaw is completed Partial detection.
Specifically, the present embodiment proposes a kind of fabric defects detection method based on adaptivenon-uniform sampling and template correction, packet Include training stage and test phase;Training stage obtains a threshold value by the processing to indefectible image;Test phase uses Training stage carries out the detection and identification of fabric defects by the threshold value that training obtains, and carries out the cluster between lattice, to flaw crystalline substance Lattice are positioned.Further more specifically,
Training stage is further comprising the steps of,
Indefectible image with periodic structure is formed into flawless lattice using adaptivenon-uniform sampling method, is obtained N number of flawless Lattice set Bi(i=1 ..., N);
Flawless lattice changes the ranks sequence of flawless lattice by the method using cyclic shift to be corrected;This implementation Example is it should also be noted that, to each lattice after image progress adaptivenon-uniform sampling, there are unmatched phenomenons, for this office It is sex-limited, propose the method for template correction.Due between lattice stretching generate deformation the phenomenon that be local, so segmentation after Each grid have complete periodic pattern information.Each lattice is a character matrix, therefore using cyclic shift Bearing calibration avoids because stretching the influence of the deformation generated.
Either the test phase of training stage still hereafter with template correct method to the lattice after segmentation not It is matched to do pretreatment with or without flaw figure and feature extraction, and cyclic shift are carried out using structural similarity to each grid Bearing calibration carries out circulative shift operation according to the template that template corrects;Using the bearing calibration of cyclic shift, propose as follows Template model:
Wherein, A is lattice to be corrected, and B is an indefectible lattice, and p* indicates that the number of row transformation, q* indicate that column become The number changed, p* ∈ [0, r-1], q* ∈ [0, c-1].Tv and Th is two matrixes of r × r and c × c size respectively, as follows:
And template correction is further comprising the steps of, reference template is established, then by each lattice according to reference template It is corrected;The gray average matrix of all lattices of each indefectible image is calculated as template, then by remaining lattice root It is corrected according to reference template.In order to reduce the influence to misplace between uneven illumination and lattice, the template samples of selection are indefectible The gray average matrix of all lattices of image.It is obtained by the structural similarity between lattice of having no time after all corrections of calculating similar Relationship, and similarity relation is obtained into equivalence relation by way of transitive closure;This step relates to the use of structural similarity algorithm Feature extraction is carried out, has flaw to the unmatched of the lattice after segmentation with the method (i.e. the method for cyclic shift) that template corrects Figure does pretreatment and carries out feature extraction using structural similarity algorithm to each grid.Specifically, setting transitive closure matrix t (Re), similar matrix should seek transitive closure matrix by synthesizing operation, and transitive closure matrix t (Re) is a square of equal value Battle array.Synthesis operation is Re2=Re ° of Re=(Pij)N×N,Method is as follows: Re → Re2...→Re2i→...; Occur when first timeWhen, RekIt is required t (Re).Equivalence relation is similarity relation matrix simultaneously Matrix after above-mentioned synthesis operation transform.
Structural similarity algorithm be by correction after all sample images, constructing one indicates similarity relation between lattice Matrix, application structure similitude measure the similarity between lattice, and structural similarity is defined as follows:
A lattice set Z={ Z is obtained after image adaptive is divided1...Zn};If SijIndicate lattice ZiWith lattice Zj Structural similarity, obtain as follows:
Wherein x, y respectively represent lattice Zi and Zj, wherein μxIt is the average gray of x, μyIt is the average gray of y,It is The variance of x,It is the variance of y, σxyIt is the covariance of x and y, C1=(k1L) 2, C2=(k2L)2It is for remaining stable normal Number, L is that the dynamic range of pixel value takes 255, k1=0.01, k2=0.03.It should be noted that the calculating of training part is Bi Structural similarity coefficient, calculating process and AiCalculating process it is identical, similarly, with following middle set of computations AiInner element Between Structural VAR the step of can be cross-referenced.
Unified flawless template is finally established on the basis of correction in training step, according to the structure phase of above-mentioned calculating The flawless lattice after correction and the difference between flawless template are quantified like property, obtain the threshold for the positioning of flaw lattice Value, and threshold value is decision boundary t, the present embodiment is also referred to as threshold value t.Quantization refers to finding the behaviour section of threshold value t.
As threshold value dynamic becomes larger, gives up the similarity relation of other blocks in more and more blocks and its neighborhood, formed Closed area.Since the similarity relation of flaw area and the flawless block of surrounding is smaller, so dividing those first significantly Flaw area.
Threshold value t can obtain the Clustering Effect of dynamic mapping in section [0,1] dynamic mapping;In the training process, with step A length of d traverses P flawless image in section [0,1];Obtain numerical value t when flawless image is classifiedi, i=1, 2 ... P;The wherein selection method of threshold value t are as follows:
T=m in (ti)
Process are as follows: threshold value t is traversed in section [0,1] with step-length d, is added up toA classifying quality, for Image of any one width through over-segmentation always has a corresponding T, and as λ=T, classification situation takes place in image;Observation is simultaneously The value that classifying quality occurs for these flawless images is recorded, T is denoted asi, wherein i=1,2 ... L, select wherein minimum value TiAs threshold Value.
Embodiment 2
It is the test phase of the above-mentioned fabric defects detection method based on adaptivenon-uniform sampling and template correction in the present embodiment, The test phase is further comprising the steps of,
Flaw image is divided automatically, acquisition is N number of flaw lattice set Ai(i=1 ..., N);Either flawless figure Or flaw figure will be divided by image adaptive, and difference is exactly that flawless figure is the data set used the training stage, flaw figure It is the data set that test phase uses.
There is flaw lattice to change the ranks sequence of grid by the method for cyclic shift, to there is flaw lattice to be corrected;Equally , referring to the flawless lattice of above-described embodiment using the correction of the method for cyclic shift, the present embodiment is the correction for having flaw lattice, no Indigestible to be, the method for the template correction also used has the unmatched of flaw lattice to have flaw figure to do pre- place to after segmentation It manages and feature extraction is carried out using structural similarity algorithm to each lattice.
According to structural similarity algorithm set of computations AiIt is similar to obtain N number of structure for Structural VAR between inner element Coefficient matrix Rei;Above-described embodiment B is referred in this stepiStructural similarity algorithmic procedure, herein for AiEqually It is applicable in, therefore is not detailed.
The decision boundary t obtained using the training stage, to Structural VAR matrix ReiThreshold segmentation is carried out, the flaw is completed The positioning of defect lattice;The accurate detection of Pixel-level is carried out to flaw lattice according to Threshold segmentation.
The present embodiment calculates transitive closure matrix by similarity relation matrix, after transitive closure matrix Threshold segmentation, The positioning of flaw lattice can be obtained by realizing the cluster between flawless grid.Including according to above-mentioned calculated transitive closure Matrix t (Re) and threshold value t specifically includes following procedure to transitive closure matrix Threshold segmentation,
If t is threshold value, Threshold segmentation is carried out to transitive closure matrix t (Re), works as SijWhen >=t, lattice AiWith lattice AjBetween For equivalence relation;Work as SijWhen≤t, lattice AiWith lattice AjBetween be not present relationship;And the structural similarity between flawless lattice is greater than Structural similarity between flawless lattice and flaw lattice, i.e., similarity is high between flawless lattice and lattice of having no time, but lattice of having no time Similarity is low between flaw lattice.
The Clustering Effect of dynamic mapping can be obtained in section [0,1] dynamic mapping according to above-mentioned threshold value t;In training process In, it is that d traverses P flawless image in section [0,1] with step-length;Obtain numerical value t when flawless image is classifiedi, i =1,2 ... P;The wherein selection method of threshold value t are as follows:
T=min (ti)
Process are as follows: threshold value t is traversed in section [0,1] with step-length d, is added up toA classifying quality, for Image of any one width through over-segmentation always has a corresponding T, and as λ=T, classification situation takes place in image;Observation is simultaneously The value that classifying quality occurs for these flawless images is recorded, T is denoted asi, wherein i=1,2 ... L, select wherein minimum value TiAs threshold Value.
In order to realize the accurate detection of flaw lattice Pixel-level, a kind of threshold segmentation method is proposed, this method includes pair The flaw lattice each detected is calculated as follows:
Wherein TM is that template corrects the template acquired;σ (x, y) indicates grid OiStandard deviation, λ represents constant, LD (x, y) For the pixel value on the x row y column of flaw grid;λ value in the present embodiment is 2;Since lattice is corrected when detecting, institute It is restored with being performed the following operation before flaw lattice thresholding, because of the data set after corrected and original data set meeting It is varied, is consistent after reduction with original data set in order to preferably be compared to the experimental result picture after detection, if It does not restore and has partial pixel point and change.
L=(Tv)(r-p)·L*·(Th)(c-q)
Since average and standard deviation is to indicate the good measure of one group of data exception, by average and standard deviation group At threshold value the lattice of normal variation is had good robustness.The average and standard deviation is fixed by above structure similitude The feature extraction of average value and variance embodies in the model of justice.
A kind of fabric defects detection method based on adaptivenon-uniform sampling and template correction provided in this embodiment, side of the present invention Method is divided into training and test two parts.
Training part carries out template to each lattice simultaneously to each grid after the segmentation of flawless image pane and corrects to reduce The influence of misalignment between grid, and select indefectible lattice for establishing average template as reference.By calculating all crystalline substances The structural similarity of compartment, and similarity relation is obtained into equivalence relation by way of transitive closure, then carry out poly- between grid Class.According to the Threshold Segmentation Algorithm of proposition, the detection of defect areas is completed.
Signal referring to Fig.1, it illustrates the fabric flaws that one of present invention is corrected based on adaptivenon-uniform sampling and template The method flow diagram of the specific embodiment of defect detection method 100, specifically includes the following steps:
Step 102, indefectible image is inputted, all indefectible images are first subjected to mean filter pretreatment, are referred to flawless Image carries out the sliding average of 3 × 3 window sizes, obtains pre-processed results image, and reducing noise bring influences;
Step 104, indefectible image is pressed into its period automatic split into grid, each lattice includes that identical pattern is special It levies, is marked after piecemeal, which refers to is marked for each lattice after segmentation, records the number information of lattice, i.e., Ai(i=1 ..., N);
Step 106, the ranks sequence for changing lattice according to the method for the cyclic shift of proposition, to every after adaptivenon-uniform sampling A lattice carries out template correction.
Step 108, it calculates the structural similarity feature after all corrections between grid and is marked;
Step 110, quantify the difference between flawless lattice and template, filter out above-mentioned steps mark structure like the minimum of property Value is as threshold value t and retains;
Step 112, input is to be detected flaw image, and all indefectible images are carried out mean filter pretreatments, are reduced Noise bring influences;
Step 114, flaw image is pressed into its period automatic split into grid, each lattice includes identical pattern characteristics, It is marked after piecemeal;
Step 116, the ranks sequence for changing lattice according to the method for the cyclic shift of proposition, to every after adaptivenon-uniform sampling A lattice carries out template correction;
Step 118, it calculates the structural similarity feature after all corrections between grid and is marked;
Step 120, the structural similarity characteristic value after above-mentioned label is compared with threshold value t, if marker characteristic value is small In threshold value t, then by the label lattice be labeled as defect areas, on the contrary it is then be flawless lattice;
Step 120, the positioning of flaw lattice is completed.
The recall ratio of testing result is defined as follows with precision ratio:
Wherein, tp indicates the flaw part identical with the flaw demarcated by hand detected, and fp indicates the flaw demarcated by hand Defect however the part being missed, fn indicate to be demarcated as flaw however by the part of erroneous detection by hand.
Embodiment 3
The fabric defects detection method based on adaptivenon-uniform sampling and template correction proposed by the present embodiment, in star, It is tested in box and dot standard database.By means of the present invention: the fabric based on adaptivenon-uniform sampling and template correction Flaw detection method and wavelet pretreatment gold image subtraction, Regular Band method, are based on template correction and chessboard at Boll wave band method The Comparison of experiment results of method is analyzed, and illustrates that the present invention has a distinct increment on recall ratio and precision ratio.It should be understood that above-mentioned The method of Defect Detection only carries out EXPERIMENTAL EXEMPLIFICATIONThe explanations with above-mentioned a few class images, in practical application, can according to need and will be upper It states approach application and carries out experimental analysis in different places.
In the present embodiment, testing the database used is Hong Kong University's electrics and electronics engineering system's industrial automation laboratory Fabric sample database, the sample database contain the textile image of 162 256 × 256 sizes altogether;Database shares 3 kinds of types of patterns Textile image: star-plot, box diagram and scattergram.Wherein star-plot and box diagram contain 5 kinds of flaw types, scattergrams altogether 6 Kind flaw type is respectively disconnected warp, broken hole, reticulate pattern, cord, stria and knot.By algorithm proposed by the present invention and tradition Algorithm WGIS, BB, RB, ER and TC compare experiment.Wave pretreatment gold image subtraction is WGIS, Boll wave band method is BB, Regular Band method be RB, be corrected to TC based on template and chessboard method is ER.
Definition TPR is recall ratio, which determines what the pixel in flaw reference map where flaw was correctly marked Ratio;FPR is false detection rate, determines that by algorithmic error labeled as ratio shared by flaw, PPV is background pixel in flaw reference map Precision ratio determines flaw proportion of the flaw of algorithm tag in flaw reference map;NPV is negative predictive value, determines and calculates The background of method label ratio shared by background in flaw reference map.The reference that f value is analyzed as detection case is defined, f value Calculation method is as follows:
F value indicates that the Random geometric sery of recall ratio and precision ratio is average, and α is weight.α is set to 1, expression is when manual markings It is flawless when being but that part that flaw is but missed increases by the part of erroneous detection and manual markings, testing result and manual markings As a result when different, f value can be reduced.It indicates that precision ratio is important as α > 1, indicates that recall ratio is important as α < 1.This α is set to 1, f value in embodiment, and closer to 1 to represent detection effect better.This evaluation method considers recall ratio and precision ratio, Algebra and the close influence of the biggish number of numerical value when solving the addition of non-same amount value of series.
Binarization operation is carried out to the flaw result figure that detection is completed, completes the positioning of flaw lattice;To being detected as flaw Lattice be labeled as 1, lattice of having no time is labeled as 0, and final experimental result is as shown in the following table 1, table 2 and table 3.
1 star-plot fabric defects positioning result of table
Table 1defect location results of star-shaped
2 box diagram fabric defects positioning result of table
Table 2defect location results of box-shaped
3 scattergram fabric defects positioning result of table
Table 3defect location results of dot-shaped
In order to determine the size of flaw shape, the textile application of three types is detected based on the method for template, Part of testing result such as Fig. 2.
The present invention and five kinds of algorithms of WGIS, RB, BB, ER and TC carry out the flaw of star-plot, box diagram, scattergram Comparative experiments.The following table 4,5 and 6 are the results of the accurate detection algorithm of flaw.
4 algorithms of different of table is to star-plot fabric defects detection effect
Table4 Different algorithms for the detection of star-shaped
5 algorithms of different of table is to box diagram fabric defects detection effect
Table5 Different algorithms for the detection of box-shaped
6 algorithms of different of table is to scattergram fabric defects detection effect
Table6 Different algorithms for the detection of dot-shaped
By Fig. 3,4,5 it is found that the method for the invention testing result in 3 seed type flaw figures is better than other five kinds of methods. Table 4 lists the testing result of star-plot, and this paper algorithm is better than in broken hole type, the PPV value testing result of cord type flaw Other five kinds of algorithms, f value is optimal value in broken ends of fractured bone type, broken hole type flaw, and testing result FPR value be constantly in it is lower steady Determine state.The signal of Fig. 6~11 is respectively the inspection of box diagram broken ends of fractured bone flaw image algorithms of different described in third embodiment of the invention Survey the inspection of result, the testing result of box diagram broken hole flaw image algorithms of different, box diagram cord flaw image algorithms of different Survey the inspection of result, the testing result of scattergram knot flaw image algorithms of different, scattergram stria flaw image algorithms of different Survey the signal of the testing result of result and scattergram cord flaw image algorithms of different.
It should be noted that the above examples are only used to illustrate the technical scheme of the present invention and are not limiting, although referring to preferable Embodiment describes the invention in detail, those skilled in the art should understand that, it can be to technology of the invention Scheme is modified or replaced equivalently, and without departing from the spirit and scope of the technical solution of the present invention, should all be covered in this hair In bright scope of the claims.

Claims (10)

1. a kind of fabric defects detection method based on adaptivenon-uniform sampling and template correction, it is characterised in that: including the training stage And test phase;
The training stage obtains a threshold value by the processing to indefectible image;
The test phase carries out the detection and knowledge of fabric defects using the training stage by the threshold value that training obtains Not.
2. the fabric defects detection method based on adaptivenon-uniform sampling and template correction as described in claim 1, it is characterised in that: The training stage is further comprising the steps of,
Indefectible image with periodic structure is formed into flawless lattice using adaptivenon-uniform sampling method, obtains N number of flawless lattice Set Bi(i=1 ..., N);
The flawless lattice changes the ranks sequence of the flawless lattice by the method using cyclic shift to be corrected;
Similarity relation is obtained by calculating the structural similarity after all corrections between the lattice of having no time, and by the similarity relation Equivalence relation is obtained by way of transitive closure;
Unified flawless template is established on the basis of the correction, according to the structural similarity of calculating to the institute after correction The difference stated between flawless lattice and the flawless template is quantified, and the threshold value for the positioning of flaw lattice is obtained, and The threshold value is decision boundary t.
3. the fabric defects detection method based on adaptivenon-uniform sampling and template correction as claimed in claim 2, it is characterised in that: The test phase is further comprising the steps of,
Flaw image is divided automatically, acquisition is N number of flaw lattice set Ai(i=1 ..., N);
The ranks sequence for having flaw lattice to change grid by the method for the cyclic shift, has flaw lattice to carry out school to described Just;
According to the structural similarity algorithm set of computations AiStructural VAR between inner element obtains the similar system of N number of structure Matrix number Rei
The decision boundary t obtained using the training stage, to Structural VAR matrix ReiThreshold segmentation is carried out, is completed The positioning of flaw lattice;
The accurate detection of Pixel-level is carried out to flaw lattice according to the Threshold segmentation.
4. the fabric defects detection method based on adaptivenon-uniform sampling and template correction, feature exist as claimed in claim 2 or claim 3 In: with template correct method to the lattice after segmentation it is unmatched with or without flaw figure do pre-process and each grid is made Carry out feature extraction with the structural similarity, and the template that is corrected according to the template of the bearing calibration of the cyclic shift into Row circulative shift operation;
Using the bearing calibration of the cyclic shift, following template model is proposed:
Wherein, A is lattice to be corrected, and B is an indefectible lattice, and p* indicates that the number of row transformation, q* indicate rank transformation Number, p* ∈ [0, r-1], q* ∈ [0, c-1].Tv and Th is two matrixes of r × r and c × c size respectively, as follows:
5. the fabric defects detection method based on adaptivenon-uniform sampling and template correction as claimed in claim 4, it is characterised in that: The template correction is further comprising the steps of,
Reference template is established, is then corrected each lattice according to the reference template;
The gray average matrix of all lattices of each indefectible image is calculated as template, then by remaining lattice according to Reference template is corrected.
6. the fabric defects detection method based on adaptivenon-uniform sampling and template correction as claimed in claim 5, it is characterised in that: The structural similarity algorithm is by all sample images after the correction, and constructing one indicates similarity relation between lattice Matrix measures the similarity between lattice using the structural similarity, and the structural similarity is defined as follows:
A lattice set Z={ Z is obtained after image adaptive is divided1...Zn};If SijIndicate lattice ZiWith lattice ZjKnot Structure similitude obtains as follows:
Wherein x, y respectively represent lattice ZiWith Zj, wherein μxIt is the average gray of x, μyIt is the average gray of y,It is x Variance,It is the variance of y, σxyIt is the covariance of x and y, C1=(k1L)2, C2=(k2L)2It is for maintaining stable constant, L It is that the dynamic range of pixel value takes 255, k1=0.01, k2=0.03.
7. such as the fabric defects detection method described in claim 5 or 6 based on adaptivenon-uniform sampling and template correction, feature exists In: transitive closure matrix is calculated by the similarity relation matrix, after transitive closure matrix Threshold segmentation, reality can be passed through Cluster between existing flawless grid, obtains the positioning of flaw lattice.
8. the fabric defects detection method based on adaptivenon-uniform sampling and template correction as claimed in claim 7, it is characterised in that: Described includes following procedure to transitive closure matrix Threshold segmentation,
If t is the threshold value, Threshold segmentation is carried out to the transitive closure matrix, works as SijWhen >=t, lattice AiWith lattice AjBetween be Equivalence relation;Work as SijWhen≤t, lattice AiWith lattice AjBetween be not present relationship;And the structural similarity between the flawless lattice is big Structural similarity between flawless lattice and flaw lattice.
9. the fabric defects detection method based on adaptivenon-uniform sampling and template correction as claimed in claim 8, it is characterised in that: The threshold value t can obtain the Clustering Effect of dynamic mapping in section [0,1] dynamic mapping;It in the training process, is d with step-length P flawless image is traversed in section [0,1];Obtain numerical value t when flawless image is classifiedi, i=1,2 ... P;Its The selection method of middle threshold value t are as follows:
T=min (ti)
Process are as follows: threshold value t is traversed in section [0,1] with step-length d, is added up toA classifying quality, for any Image of one width through over-segmentation always has a corresponding T, and as λ=T, classification situation takes place in image;It observes and records The value of classifying quality occurs for these flawless images, is denoted as Ti, wherein i=1,2 ... L, select wherein minimum value TiAs threshold value.
10. the fabric defects detection method based on adaptivenon-uniform sampling and template correction as claimed in claim 8 or 9, feature Be: the accurately detection of the flaw lattice Pixel-level is further comprising the steps of,
Each flaw lattice detected is calculated as follows:
Wherein TM is that the template corrects the template acquired;σ (x, y) indicates grid OiStandard deviation, λ represents constant, LD (x, y) For the pixel value on the x row y column of flaw grid;The λ value is 2;
Since lattice is corrected when detecting, restored so being performed the following operation before flaw lattice thresholding.
L=(Tv)(r-p)·L*·(Th)(c-q)
CN201910196033.0A 2019-03-15 2019-03-15 A kind of fabric defects detection method based on adaptivenon-uniform sampling and template correction Pending CN109949287A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910196033.0A CN109949287A (en) 2019-03-15 2019-03-15 A kind of fabric defects detection method based on adaptivenon-uniform sampling and template correction

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910196033.0A CN109949287A (en) 2019-03-15 2019-03-15 A kind of fabric defects detection method based on adaptivenon-uniform sampling and template correction

Publications (1)

Publication Number Publication Date
CN109949287A true CN109949287A (en) 2019-06-28

Family

ID=67008799

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910196033.0A Pending CN109949287A (en) 2019-03-15 2019-03-15 A kind of fabric defects detection method based on adaptivenon-uniform sampling and template correction

Country Status (1)

Country Link
CN (1) CN109949287A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110487801A (en) * 2019-07-30 2019-11-22 厦门三安光电有限公司 Identify method, apparatus, equipment and the storage medium of graphite plate high-temperature baking result
CN112802074A (en) * 2021-01-06 2021-05-14 江南大学 Textile flaw detection method based on illumination correction and visual saliency characteristics
CN112862907A (en) * 2021-01-19 2021-05-28 华中科技大学 Microscopic image correction method, device, equipment, storage medium and product
CN116152189A (en) * 2023-01-31 2023-05-23 华纺股份有限公司 Pattern fabric flaw detection method, system and detection terminal
TWI812558B (en) * 2022-11-23 2023-08-11 大陸商環維電子(上海)有限公司 Image detecting method for micro defect and wrong component and system thereof
TWI816549B (en) * 2022-09-14 2023-09-21 朝陽科技大學 Automated defect detection methods

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0742431A1 (en) * 1995-05-10 1996-11-13 Mahlo GmbH &amp; Co. KG Method and apparatus for detecting flaws in moving fabrics or the like
CN102509114A (en) * 2011-11-22 2012-06-20 李京娜 Image registration method based on improved structural similarity
CN107895363A (en) * 2017-10-31 2018-04-10 常州大学 Textile flaw detection method based on template characteristic

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0742431A1 (en) * 1995-05-10 1996-11-13 Mahlo GmbH &amp; Co. KG Method and apparatus for detecting flaws in moving fabrics or the like
CN102509114A (en) * 2011-11-22 2012-06-20 李京娜 Image registration method based on improved structural similarity
CN107895363A (en) * 2017-10-31 2018-04-10 常州大学 Textile flaw detection method based on template characteristic

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
梁久祯等: "基于相似关系的纺织品瑕疵检测方法", 《模式识别与人工智能》 *
赵树志等: "基于改进判别性完整局部二值模式与格分割的织物瑕疵检测方法", 《纺织学报》 *

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110487801A (en) * 2019-07-30 2019-11-22 厦门三安光电有限公司 Identify method, apparatus, equipment and the storage medium of graphite plate high-temperature baking result
CN112802074A (en) * 2021-01-06 2021-05-14 江南大学 Textile flaw detection method based on illumination correction and visual saliency characteristics
CN112862907A (en) * 2021-01-19 2021-05-28 华中科技大学 Microscopic image correction method, device, equipment, storage medium and product
CN112862907B (en) * 2021-01-19 2024-03-19 华中科技大学 Microscopic image correction method, device, equipment, storage medium and product
TWI816549B (en) * 2022-09-14 2023-09-21 朝陽科技大學 Automated defect detection methods
TWI812558B (en) * 2022-11-23 2023-08-11 大陸商環維電子(上海)有限公司 Image detecting method for micro defect and wrong component and system thereof
CN116152189A (en) * 2023-01-31 2023-05-23 华纺股份有限公司 Pattern fabric flaw detection method, system and detection terminal
CN116152189B (en) * 2023-01-31 2023-12-19 华纺股份有限公司 Pattern fabric flaw detection method, system and detection terminal

Similar Documents

Publication Publication Date Title
CN109949287A (en) A kind of fabric defects detection method based on adaptivenon-uniform sampling and template correction
CN114549522B (en) Textile quality detection method based on target detection
CN109410192B (en) Fabric defect detection method and device based on multi-texture grading fusion
CN106204543B (en) Fabric defect detection method based on single category support vector machines
CN106373124B (en) Industrial products surface defect visible detection method based on gray level co-occurrence matrixes and RANSAC
CN103544499B (en) The textural characteristics dimension reduction method that a kind of surface blemish based on machine vision is detected
CN101216436A (en) Fabric flaw automatic detection method based on Support Vector data description theory
CN116188475B (en) Intelligent control method, system and medium for automatic optical detection of appearance defects
CN110889838A (en) Fabric defect detection method and device
CN101738998B (en) System and method for monitoring industrial process based on local discriminatory analysis
CN114878574A (en) Cloth defect detection method, device and system based on machine vision
CN109615604A (en) Accessory appearance flaw detection method based on image reconstruction convolutional neural networks
CN106296689B (en) Flaw detection method, system and device
CN109410241A (en) The metamorphic testing method of image-region growth algorithm
CN106203476A (en) A kind of pig&#39;s head tail wheel exterior feature recognition methods based on arest neighbors classification with fuzzy algorithmic approach
Jing et al. Automatic recognition of weave pattern and repeat for yarn-dyed fabric based on KFCM and IDMF
CN107945164B (en) Textile flaw detection method based on peak threshold, rotational alignment and composite character
CN109447968A (en) The metamorphic testing system of image-region growth algorithm
JP6596260B2 (en) Teaching support method and image classification method
CN112766301A (en) Similarity judgment method for indicator diagram of oil extraction machine
Yang et al. Software defect prediction based on fourier learning
CN110427019A (en) A kind of NPDA Fault Classification and control device based on Multivariate Discriminant Analysis
CN113239800B (en) Target detection method and target detection device
CN115761467A (en) Underwater target detection method based on high-low frequency characteristic difference pyramid neural network
Harreni et al. Novel Multipath Convolutional Neural Network Based Fabric Defect Detection System

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20190628

RJ01 Rejection of invention patent application after publication