CN107945164A - Textile flaw detection method based on peak threshold, rotational alignment and composite character - Google Patents
Textile flaw detection method based on peak threshold, rotational alignment and composite character Download PDFInfo
- Publication number
- CN107945164A CN107945164A CN201711188161.8A CN201711188161A CN107945164A CN 107945164 A CN107945164 A CN 107945164A CN 201711188161 A CN201711188161 A CN 201711188161A CN 107945164 A CN107945164 A CN 107945164A
- Authority
- CN
- China
- Prior art keywords
- mrow
- msub
- map grid
- value
- msubsup
- 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.)
- Granted
Links
- 239000004753 textile Substances 0.000 title claims abstract description 69
- 238000001514 detection method Methods 0.000 title claims abstract description 22
- 239000002131 composite material Substances 0.000 title claims abstract description 12
- 238000000034 method Methods 0.000 claims abstract description 86
- 238000012549 training Methods 0.000 claims description 89
- 239000013598 vector Substances 0.000 claims description 81
- 238000004422 calculation algorithm Methods 0.000 claims description 76
- 238000012360 testing method Methods 0.000 claims description 54
- 239000011159 matrix material Substances 0.000 claims description 47
- 238000001228 spectrum Methods 0.000 claims description 35
- 230000011218 segmentation Effects 0.000 claims description 24
- 238000007689 inspection Methods 0.000 claims description 15
- 230000001174 ascending effect Effects 0.000 claims description 13
- 239000000203 mixture Substances 0.000 claims description 10
- 230000009466 transformation Effects 0.000 claims description 6
- 238000004364 calculation method Methods 0.000 claims description 5
- 238000012217 deletion Methods 0.000 claims description 4
- 230000037430 deletion Effects 0.000 claims description 4
- 230000002950 deficient Effects 0.000 claims description 3
- 238000003708 edge detection Methods 0.000 claims description 3
- 238000011156 evaluation Methods 0.000 claims description 3
- 101150097685 metI gene Proteins 0.000 claims description 3
- 238000005286 illumination Methods 0.000 abstract description 3
- 230000007547 defect Effects 0.000 description 18
- 238000010586 diagram Methods 0.000 description 18
- 239000004744 fabric Substances 0.000 description 16
- 230000006870 function Effects 0.000 description 9
- 238000004458 analytical method Methods 0.000 description 7
- 241000894007 species Species 0.000 description 6
- PXFBZOLANLWPMH-UHFFFAOYSA-N 16-Epiaffinine Natural products C1C(C2=CC=CC=C2N2)=C2C(=O)CC2C(=CC)CN(C)C1C2CO PXFBZOLANLWPMH-UHFFFAOYSA-N 0.000 description 4
- 238000000638 solvent extraction Methods 0.000 description 4
- 230000003044 adaptive effect Effects 0.000 description 3
- 238000012937 correction Methods 0.000 description 3
- 241000208340 Araliaceae Species 0.000 description 2
- 241000287196 Asthenes Species 0.000 description 2
- 235000005035 Panax pseudoginseng ssp. pseudoginseng Nutrition 0.000 description 2
- 235000003140 Panax quinquefolius Nutrition 0.000 description 2
- 238000000205 computational method Methods 0.000 description 2
- 125000004122 cyclic group Chemical group 0.000 description 2
- 238000002474 experimental method Methods 0.000 description 2
- 235000008434 ginseng Nutrition 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 238000009394 selective breeding Methods 0.000 description 2
- 230000006641 stabilisation Effects 0.000 description 2
- 238000011105 stabilization Methods 0.000 description 2
- 101100272279 Beauveria bassiana Beas gene Proteins 0.000 description 1
- 230000002159 abnormal effect Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000033228 biological regulation Effects 0.000 description 1
- 210000000988 bone and bone Anatomy 0.000 description 1
- 230000000052 comparative effect Effects 0.000 description 1
- 238000004590 computer program Methods 0.000 description 1
- 239000012141 concentrate Substances 0.000 description 1
- 238000000354 decomposition reaction Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 235000013399 edible fruits Nutrition 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000000605 extraction Methods 0.000 description 1
- 230000001788 irregular Effects 0.000 description 1
- 230000015654 memory Effects 0.000 description 1
- 230000000877 morphologic effect Effects 0.000 description 1
- 238000003909 pattern recognition Methods 0.000 description 1
- 230000007115 recruitment Effects 0.000 description 1
- 238000012552 review Methods 0.000 description 1
- 238000005070 sampling Methods 0.000 description 1
- 238000012216 screening Methods 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 230000031068 symbiosis, encompassing mutualism through parasitism Effects 0.000 description 1
- 230000017105 transposition Effects 0.000 description 1
- 238000012800 visualization Methods 0.000 description 1
- 238000009941 weaving Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/0002—Inspection of images, e.g. flaw detection
- G06T7/0004—Industrial image inspection
- G06T7/001—Industrial image inspection using an image reference approach
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/21—Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
- G06F18/214—Generating training patterns; Bootstrap methods, e.g. bagging or boosting
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/23—Clustering techniques
- G06F18/232—Non-hierarchical techniques
- G06F18/2321—Non-hierarchical techniques using statistics or function optimisation, e.g. modelling of probability density functions
- G06F18/23213—Non-hierarchical techniques using statistics or function optimisation, e.g. modelling of probability density functions with fixed number of clusters, e.g. K-means clustering
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/13—Edge detection
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/136—Segmentation; Edge detection involving thresholding
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20048—Transform domain processing
- G06T2207/20061—Hough transform
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/30—Subject of image; Context of image processing
- G06T2207/30108—Industrial image inspection
- G06T2207/30124—Fabrics; Textile; Paper
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Computer Vision & Pattern Recognition (AREA)
- General Physics & Mathematics (AREA)
- Artificial Intelligence (AREA)
- Life Sciences & Earth Sciences (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Bioinformatics & Computational Biology (AREA)
- Evolutionary Biology (AREA)
- Evolutionary Computation (AREA)
- General Engineering & Computer Science (AREA)
- Quality & Reliability (AREA)
- Probability & Statistics with Applications (AREA)
- Image Analysis (AREA)
- Other Investigation Or Analysis Of Materials By Electrical Means (AREA)
Abstract
The present invention provides a kind of textile flaw detection method based on peak threshold, rotational alignment and composite character, this method analyzes the Pixel of Digital Image half-tone information based on flat textile surface under lighting source, divide the image into the grid for non-overlapping copies, calculate the IRM of each grid, HOG, GLCM and Gabor characteristic value, textile surface flaw is automatically positioned according to feature Distribution value.The present invention is especially suitable for the textile surface flaw being automatically identified in the textile flat surfaces gray-scale image that is gathered under steady illumination light source.
Description
Technical field
The present invention relates to textile Defect Detection technical field, more particularly to one kind based on peak threshold, rotational alignment
With the textile flaw detection method of composite character.
Background technology
Traditional textile flaw manual identified accuracy rate only has 60-75% (referring to document:K.Srinivasan,
P.H.Dastoor,P.Radhakrishnaiah,et al..FDAS:a knowledge-based framework for
analysis of defects in woven textiles tructures,J.Text.Inst.83(1992)431–
448.), the method for machine automatic identification textile flaw has practical application request.The digital picture of flat textile surface is adopted
Sample (hereinafter referred to as textile images) belongs to 2 d texture, and 2 d texture has been demonstrated can be according to 17 kinds of wallpaper group (wallpaper
Group the pattern arrangement method) defined is generated (referring to document:H.Y.T.Ngan,G.K.H.Pang,N.H.C.Yung.Motif-
based defect detection for patterned fabric,Pattern Recognit.(2008)1878–
1894.), for generate the pattern of 2 d texture be known as map grid (lattice) (referring to:https://en.wikipedia.org/
Wiki/Wallpaper_group), pattern is known as motif inside map grid.Most textile flaw automatic detection methods can only be located
The textile images of p1 types in wallpaper group are managed (referring to document:H.Y.T.Ngan,G.K.H.Pang,
N.H.C.Yung.Automated fabric defect detection—A review,Image and Vision
Computing 29 (7) (2011) 442-458.), only a few methods can handle beyond p1 types textile images (referring to
Document:H.Y.T.Ngan,G.K.H.Pang,N.H.C.Yung.Motif-based defect detection for
Patterned fabric, Pattern Recognit. (2008) 1878-1894.), such as the benchmark based on wavelet pretreatment
Image difference method (wavelet-pre-processed golden image subtraction, hereinafter referred to as WGIS) (ginseng
See document:H.Y.T.Ngan,G.K.H.Pang,N.H.C.Yung,et al.,Wavelet based methods on
Patterned fabric defect detection, Pattern Recognit.38 (4) (2005) 559-576.), symbiosis
Matrix method is (referring to document:C.J.Kuo,T.Su,Gray relational analysis for recognizing
Fabric defects, Text.Res.J.73 (5) (2003) 461-465.), cloth forest belt method (Bollinger bands, with
Lower abbreviation BB) (referring to document:H.Y.T.Ngan,G.K.H.Pang,Novel method for patterned fabric
Inspection using bollinger bands, Opt.Eng.45 (8) (2006) 087202-1-087202-15.), rule
Band method (regular bands, hereinafter referred to as RB) is (referring to document:H.Y.T.Ngan,G.K.H.Pang,Regularity
analysis for patterned texture inspection,IEEE Trans.Autom.Sci.Eng.6(1)(2009)
131-144.), Elo appraisal procedures (Elo rating method, hereinafter referred to as ER) are (referring to document:C.S.C.Tsang,
H.Y.T.Ngan,G.K.H.Pang,Fabric inspection based on the Elo rating method,
Pattern Recognit.51 (2016) 378-394.) etc..Although these methods can handle the textile images beyond p1,
But their computational methods are built upon on the pattern (hereinafter referred to as map grid) of the similar lattice based on artificial selection more.Such as
WGIS requires the size and texture of artificial selection map grid, and BB, RB and ER require the size of Manual definition's map grid.These prioris
The degree of automation of machine recognition textile flaw is reduced to a certain extent.
The content of the invention
The technical problems to be solved by the invention are:In order to improve the degree of automation of machine recognition textile flaw, this
Invention provides a kind of textile flaw detection method based on peak threshold, rotational alignment and composite character, main to include design
A kind of automatic segmentation textile images for the method for map grid and based on map grid and hybrid feature extraction method HOG, GLCM and
The flaw recognition methods that Gabor is combined.
To make statement cheer and bright, existing centralized definition partial symbols according to the present invention and concept.
Represent Positive Integer Set.Expression includes zero integer set.Expression includes zero arithmetic number set.Table
Show including zero real number set.Represent that element number isReal vector.Represent plural number set.Represent element
Number isComplex vector.T representing matrixes or vectorial transposition.The real matrix of expression × m sizes, wherein The real matrix of expression × n × m sizes, whereinIfAndThen Ai,:Represent square
The i-th row of battle array A, A:,jThe jth row of representing matrix A.
IfAndThen Al,:,:Represent the l layer matrixes that size is n × m in A, Al,i,:Table
Show the i-th row of the l layer matrixes that size is n × m in A, Al,:,jRepresent the jth row for the l layer matrixes that size is n × m in A.
Represent ratioSmall maximum integer, such as
{aiRepresent by index i determine by element aiThe set or multiset of composition.
| S | represent the element number in set S, if S is vector, | S | represent element number contained by vector, | S | it is known as
Vector length.
Avg (S) or mean (S):The average of set of computations or multiset S, the element of S is real number.
std(S):The standard deviation of set of computations or multiset S, the element of S is real number.med(S):Set of computations is more
Collect the median of S again, the element of S is real number.mod(S):The mode of multiset S is calculated, the element of S is real number.max(S)
Set or the element maximum of multiset S, such as max (I are found out in expressionc) represent IcThe maximum gradation value of middle pixel.Max (s " bars
Part) represent find out it is qualifiedMaximum.Min (s) represents to find out set or the element minimum value of multiset s, example
Such as min (Ic) represent IcThe minimum gradation value of middle pixel.
arg maxsF (s) is represented in the value range of the domain internal variable s of function f so that function f (s) takes maximum
The s of value.
arg minsF (s) is represented in the value range of the domain internal variable s of function f so that function f (s) takes minimum
The s of value.
arg maxsf1(s),2(s) represent in function f1And f2Domain intersection internal variable s value range in so that
Function f1(s) and f2(s) s being maximized.
Represent the domain internal variable s in function f (s)1And s2Value range in so that function f
(s) s being maximized1And s2。
arg modi({ai) represent corresponding multiset { aiMode mod ({ ai) index.
dimx(I) total line number of two-dimensional image I, dim are representedy(I) total columns of I is represented.
Image origin:The position that pixel column column index starts in image, the hypothesis on location are in the image upper left corner and value
(1,1)。
I (x, y) represents the pixel value in two-dimensional image I with ranks index (x, y).Line indexIt is former by image
Point starts for step-length to be incremented by downwards with 1,1≤x≤dimx(I);Column indexBy image origin with 1 for step-length to the right
It is incremented by, 1≤y≤dimy(I)。
Image boundary:With line index dimx(I) row and column index dimy(I) row.
Textile images cartoon component Ic:To the textile images of a width gray processing, using based on Qu Bo (curvelet)
With the anatomic element analysis method of discrete cosine transform (local discrete cosine transform, hereinafter referred to as DCT)
The image with smooth edge pattern that (morphological component analysis, hereinafter referred to as MCA) is calculated
Referred to as cartoon component Ic, IcIt is a width gray level image.
DCT sizes:MCA is divided an image into not overlapping and with fixed size in image local application DCT first
Rectangular area, then applies each region DCT, and the size of rectangular area is known as DCT sizes, and unit is pixel, one in region
Capable pixel number is known as the width of DCT sizes, and the pixel number of a row is known as the height of DCT sizes.
Threshold coefficient fc:For binaryzation IcParameter, which is calculated by step 2.
Binaryzation cartoon component Itc:Use fc·max(Ic) it is used as threshold binarization IcObtained bianry image, wherein 1
Represent foreground pixel, i.e. IcMiddle gray value is not less than the pixel of threshold value, and 0 represents background pixel.ItcWith IcLine number and columns phase
Together.
Transverse projection It isMultiset, wherein1≤k
≤dimy(I), i.e.,Represent the background pixel number that line index is x.
Longitudinal projection It isMultiset, wherein1≤l
≤dimx(I), i.e.,Represent the background pixel number that column index is y.
RepresentPeak value multiset,In element be known as peak value, peak value refers toMiddle satisfaction
WithElementWherein x represents line index.
RepresentPeak value multiset,In element be known as peak value, peak value refers toMiddle satisfaction
WithElementWherein y represents column index.
Two value object barycenter:ItcIn two value objects include foreground pixel image line index average value and column index it is flat
Average.
Represent to be linked in sequence by operand and produce vector, such as scalar v1=1 and vector v2=[2 3]T,For scalar s1=8, s2=1, s3=5,For vector
v1=[2 3]T, v2=[5 0 4]T,
Represent by element vector multiplication, such as vector v1=[5 0.9 4]T, v2=[1 0 1]T, then
Wherein a,
Map grid indexes (ir,ic):After image is divided into nonoverlapping map grid, according to the arrangement position of map grid in the picture,
Each map grid has unique map grid line index irWith unique map grid column index ic, in image upper left corner map grid index for (1,
1) it is, (1,2) close to the right side map grid index of the map grid, is (2,1) close to the downside map grid index that index is (1,1) map grid,
The rest may be inferred.Represent that map grid index is (ir,ic) map grid, wherein L1,1Referred to as first map grid.
Map grid pixel index:Map grid is made of pixel, therefore map grid is a sub-picture, image origin and pixel column column index
Definition be also applied for map grid pixel index.
Map grid size:Number of lines of pixels contained by map grid and columns.
Map grid texture species:The species of map grid texture is produced based on map grid segmentation and textile gray level image, such as Fig. 9 institutes
Show, image placed in the middle generates 5 × 7 map grids according to map grid segmentation, and according to the texture of map grid, 35 map grids can be divided into 3 classes.
Map grid matrix:Each element is a map grid in matrix in units of map grid, i.e. matrix.As shown in Figure 10,
Each image includes 2 × 2 map grid, and map grid matrix one 2 × 2 corresponding, i.e., element index is identical with map grid index in matrix.
Eigenmatrix:Using feature extracting method calculate map grid matrix in each element feature vector, with feature to
Measure and form matrix for unit, i.e., each element is the feature vector of a map grid in matrix, and element index is right with it in matrix
Index of the map grid answered in map grid matrix is identical.
Training sample set:N sub-pictures I1,I2…INResolution ratio it is identical, all images according to map grid segmentation produce map grid
Texture species and its quantity is all identical and arrangement angle is 0 °, if map grid texture species number isIt is and abnormal without considering shape
Change and illumination variation etc. are influenced under the factor of image sampling, the i-th sub-picture IiIn map gridWithWithTexture is identical and L1,1, L2,1…Lt,1Texture differ, whereinSuch as the fourth officer shown in attached drawing 10
Image I1, I2, I3And I4Split according to map grid, each image produces 4 map grids, and the map grid of four sub-pictures only has 2 kinds of texture classes
Type, and arrangement mode is satisfied by above-mentioned condition.IiReferred to as training sample.
Test sample collection:Similar with training sample set, all image resolution ratios are identical, and the figure produced according to map grid segmentation
Check manages species and its quantity is all identical, arrangement mode and the training sample set of each image map grid define described in it is consistent,
Unlike training sample set, the image that test sample is concentrated contains position at random and texture is not belonging to map grid texture species
Irregular area, the region are defined as flaw.The image that test sample is concentrated is known as test sample.
Feature extracting method title ordered set T:Represent feature extracting method f1, f2…f|T|Name set, such as T=
{ HOG, LBP }, then | T |=2 and f1Represent HOG methods, f2Represent LBP methods.
maxx(a) represent in the set a comprising ranks index (x, y), the maximum of line index x.minx(a) represent to include
In the set a of ranks index (x, y), the minimum value of line index x.maxy(a) represent in the set a comprising ranks index (x, y),
The maximum of column index y.miny(a) represent in the set a comprising ranks index (x, y), the minimum value of column index y.
Represent according to transverse projectionComprising background pixel number calculate entropy.Represent according to transverse projectionComprising
Background pixel number calculate entropy.Entropy threshold exRepresent according to the textile gray level image of having no time that a group picture lattice arrangement angle is 0 °
CalculateThe integer part of average.Entropy threshold eyRepresent according to the textile gray-scale map of having no time that a group picture lattice arrangement angle is 0 °
As calculatingThe integer part of average.
On the basis of being as defined above, the technical solution adopted by the present invention to solve the technical problems is:One kind is based on peak
It is worth the textile flaw detection method of threshold value, rotational alignment and composite character, including two stages:Training stage and test rank
Section.Training stage is according to a series of indefectible textile images (image of hereinafter referred to as having no time) segmentation map grids and calculates flaw identification
Required parameter;Test phase carries out map grid segmentation to a secondary textile images according to the parameter that the training stage obtains and judges map grid
Whether flaw is included, finally mark contains map grid defective.Inventive method assumes that textile images have following features:Relatively
In the row and column of textile images, map grid is transversely arranged according to the direction of image line, and by the direction longitudinal arrangement of row;MCA's
Cartoon component IcIn, map grid has geometry and there were significant differences in gray scale with background pixel.
Training stage includes three steps:Step 1 training sample map grid is split, and step 2 calculates threshold coefficient and entropy threshold,
Step 3 calculates test phase parameter.Test phase includes three steps:Step 4 image calibration, step 5 test sample map grid point
Cut and identified with step 6 flaw.
Step 1 training sample map grid is split.For a training sample, using morphology component analyzing method, (MCA, goes out
From document Jia L., Liang J., Fabric defect inspection based on isotropic lattice
Segmentation, Journal of the Franklin Institute 354 (13) (2017) 5694-5738) calculate instruction
Practice sample cartoon component Ic, use threshold value fc·max(Ic) binaryzation IcObtain bianry image Itc, by Moore-Neighbor with
(Moore-Neighbor tracing algorithm, come from document Jia L., Liang J., Fabric defect to track algorithm
inspection based on isotropic lattice segmentation,Journal of the Franklin
Institute 354 (13) (2017) 5694-5738) obtain ItcThe closure edge of middle object.There is closure edge for each
Object, find out the object ranks index extreme value, if the absolute value of the difference of the object line index extreme value is more than 0.75
dimx(Itc), or the difference of column index extreme value absolute value more than 0.75dimy(Itc), then from ItcMiddle deletion object.Statistics
ItcThe often background pixel number of row and each column, index in rows and columns arrange the horizontal stroke that background pixel number forms background pixel respectively
To projectionAnd longitudinal projectionWithPeak value be denoted as multiset respectivelyWithIt is rightWithRespectively using adaptive
K-mean algorithms (Adaptive K-means) algorithm (Jia L., Liang J., Fabric defect inspection
based on isotropic lattice segmentation,Journal of the Franklin Institute 354
(13) (2017) 5694-5738, hereinafter referred to as self-adaption cluster algorithm) clustered, cluster centre saves as multiset respectivelyWith WithIt is possible to comprising multiple similar cluster centres, the minimum value in these close cluster centres is selected respectively
For threshold valueWith In be not less thanPeak value press corresponding line index, be denoted as S 'h;In be not less than
Peak value press corresponding column index, be denoted as S 'v.For S 'h, by S 'hMiddle element does ascending order arrangement, line index spacing it is multiple
Collection is defined as Continuously stablize the multiset of line space with line indexIt is defined as follows.
Wherein xi∈S′h, i is the continuous positive integer of numerical value.As map grid boundary set ShInitial value, it is defined as follows.
Similarly, can calculateAnd SvIt is initial
Value, is defined as follows.
According to preferable line numberWith preferable columnsWhereinWithRespectively
Represent with most elementsWithTo ShAnd SvIt is extended, i.e.,:From min (Sh) start, with step-lengthTo ItcLine index
Minimum value 1 moves, that is, calculatesCheck forMeetIf there is x ', then x ' is added to Sh, x is otherwise added to ShAnd keep ShMiddle element ascending order arrangement, again
CalculateAnd repeat the above steps;Similarly, from max (Sh) start, with step-lengthTo ItcLine index maximum
dimx(Ic) mobile, that is, calculateCheck forMeetIf there is x ', then x ' is added to Sh, x is otherwise added to Sh, calculate againLay equal stress on
Multiple above-mentioned steps.To SvWith step-lengthDo similar extension.According to ShWith SvThe row and column index included respectively, can be by IcBy this
Row and column where a little indexes is split, and the region for splitting gained is defined as map grid, it is defined as follows.
Wherein1≤ir≤|Sh| -1 and 1≤ic≤|Sv| -1, therefore IcBe partitioned into (| Sh|-1)·(|Sv
| -1) it is aAnd irAnd icIt is respectivelyRow and column index in units of map grid.
Step 2 calculates threshold coefficient and entropy threshold.For training sample set I1,I2…INWith a f of N 'cSelectable value c1,
c2…cm, according to wherein any training sample Ii(i=1,2 ... N), a preferable line numbers of N ' can be calculated by step 1With
A preferable columns of N 'Wherein l=1,2 ... N '.In IiMultisetAnd multisetMiddle appearance
F corresponding to the most elements of numbercValue be denoted as c respectivelyh(i, l) and cv(i, l), is defined as follows.
For IiIf ch(i, l) and cv(i, l) is identical, then respective index (i, l) is stored in setIn,Definition
It is as follows.
For eachI.e. for IiIf at least there are a l ' so that ch(i,l′)≡cv(i, l ') set up, then with
med({cl) closest ch(i, l ') participates in fcCalculating, fcIt is defined as follows.
Wherein chThe index of (i, l)Expression, which takes, to be metI values in definition.For training sample set I1,
I2…INIn the i-th width image Ii, it is f according to parametercStep 1 calculate IiTransverse projectionAnd longitudinal projectionCalculate respectivelyEntropyWithEntropyFor all training samplesWithThe integer part of the average of these entropys is taken to obtain threshold respectively
Value exAnd ey。
Step 3 calculates test phase parameter.The step specifically includes following three steps:Step 3.1 calculates the map grid cycle;
Step 3.2 calculates the preferable statistical value of each feature of map grid;Step 3.3 calculates the preferable statistical value threshold value of each feature.
Step 3.1 calculates the map grid cycle.For training sample set I1,I2…INIn i-th (1≤i≤N) a training
Sample Ii, the threshold coefficient calculated according to step 2 is to IiRepeat step 1 can obtain ShAnd Sv, according to ShAnd SvBy IiBe divided into m ×
N map grid (m=| Sh| -1, n=| Sv|-1).I is calculated using HOG feature extracting methodsiMap gridFeature vector and make spy
It is identical to levy the corresponding map grid index of vector index.CalculateWith i-thrThe Euclidean distance of all map grids in row, by calculating institute
It is related to the column index ascending order arrangement of map grid, then may make up distance vector.ForWillCorresponding distance vector presses icAscending order
Arrangement obtains i-thrCapable n × n distance matrixs.ForBy i-thrCorresponding n × n the distance matrixs of row press irAscending order arranges to obtain
IiRow distance matrixSimilarly, I can be calculatediColumn distance matrixTo vector
(1≤l1≤ m, 1≤l3≤ n) Fourier transform is carried out, obtainCycle and frequency spectrum.According to(With) cycle and frequency spectrum, calculating cycle median and frequency spectrum median, i.e. image line cycle and image line frequency spectrum.Similarly,
I can be builtiColumn distance matrixAnd calculate image column cycle and image column frequency spectrum.According to I1,I2…IN, can
N number of image line cycle and corresponding N number of image line frequency spectrum are calculated, calculates image line frequency spectrum medianFind out and be higher thanImage
In the line frequency spectrum corresponding image line cycle, calculate the median in these image lines cycleTo image column cycle and image column frequency spectrum
Repeat same steps and obtain image column frequency spectrum medianWith image column cycle medianIfOrOrThen t values are 1, otherwise pass through and compareWithCorresponding frequency spectrum size determines the value of t, i.e.,:IfThen
T takesOtherwise t takes
Step 3.2 calculates the preferable statistical value of each feature of map grid.The step includes four sub-steps:Step 3.2.1 is calculated
Characteristic statistics value, step 3.2.2 calculate the sequence of characteristic statistics value, and step 3.2.3 calculates invariant feature element, step 3.2.4 meters
Calculate preferable statistical value.
Step 3.2.1 calculates characteristic statistics value, and training sample set I is calculated according to step 3.11,I2…INMap grid cycle t.
For i-th of training sample Ii, I is split according to step 2iObtain map gridPass through | T | it is a that (T is characterized extracting method title
Ordered set) input is 2-D gray image matrix and output is one-dimensional real vectorial feature extracting method f1, f2…f|T|Calculate
IiMap gridFeature vectorBased on fjFeature vector length be defined as fjSpy
The first prime number F of signj.According to assumed condition and map grid cycle t, IiIn map gridWith WithLine
Manage identical and L1,1, L2,1…Lt,1Texture differ, wherein l1,Therefore there are the different map grid of t class textures and
Kth (1≤k≤t) class map grid is i-thrRow and (ir+l1T) column index of row is identical, therefore the kth that column index is identical
Class map grid can be indexed ascending order composition map grid matrix by ranks.For kth class map grid, at most there are t map grid Matrix C1,C2…Ct,
According to the map grid of composition map grid matrix, kth class map grid is calculated by following formula and is based on fjIiCharacteristic statistics valueWith
Wherein Represent that map grid L is i-thtA map grid matrixArbitrary element,Represent base
In fjMap grid matrixI-th in the feature vector of middle all elements (map grid)FThe multiset of a element (real number), whereinAnd 1F≤Fj, when opt is replaced with mean, std, max or min, thenDefinition is correspondingWith
Step 3.2.2 calculates the sequence of characteristic statistics value.Calculate training sample I1,I2…INBetween be based on fj'sEurope
Formula distance average d (j), it is defined as follows.
For f1, f2…f|T|, it can obtain corresponding d (1), d (2) ... d (| T |).It is special for kth class map grid texture and j-th
Levy extracting method fj(i.e. fixed indices k and j), according to I1,I2…IN, step 3.2.1 can produce N number ofUsing clustering algorithm
To N number ofClustered, clustering algorithm classification parameter is set to t, obtains t class centerForCalculate according to the following formula fromClass label u corresponding to nearest class center*。
IfWhereinRepresent have in the classification that t clustering algorithm produces in the classification of most element numbers
The heart, then exchange characteristic statistics value determined by index (i, j, k) and index (i, j, k*) determined by characteristic statistics value, wherein k*
It is defined as follows.
All fixed Combinations for indexing k and j, for eachRepeat above-mentionedu*WithCalculating and judgementWhether set up, k is repeated if setting up*Calculating and exchange determined by index (i, j, k)
Characteristic statistics value and index (i, j, k*) determined by characteristic statistics value.According to the definition of d (j), training sample I is calculated again1,
I2…I2Between be based on fj'sEuclidean distance average value, obtain corresponding f1, f2…f|T|D ' (1), d ' (2) ... d ' (| T
|).If d (j) >=d ' (j) forAll set up, then retain features described above statistical value and exchange as a result, otherwise arranging characteristic statistics value
Sequence returns to the state at the end of step 3.2.1.
Step 3.2.3 calculates invariant feature element.For kth class map grid texture and j-th of feature extracting method fjIt is (i.e. solid
Standing wire draws k and j), according to above-mentioned steps and I1,I2…INWhat is calculated is N number ofI-thF(1≤iF≤Fj) a elementWithI-thFA elementKth class map grid texture can be calculated and be based on fjFeature vector i-thFA member
The stationary value s of element(j,k)(iF), it is defined as follows
By s(j,k)(iF) by index iFAscending order arrangement then obtains kth class map grid texture and is based on fjStationary value vector s(j,k)。
If parameter nfRepresent predefined minimal characteristic vector length, then work as nf< FjDuring establishment, using self-adaption cluster algorithm pair
s(j,k)(1), s(j,k)(2)…s(j,k)(Fj) clustered, if by the classification that self-adaption cluster algorithm produces by since 1 just
Integer number consecutively, i-thFA stationary value s(j,k)(iF) generic numbering be denoted as Ls(iF), then these number definition set Ls。
If define parameter preset minimal characteristic numberThen kth class map grid texture is based on fjFeature vector i-thFThe stabilization of a element
PropertyIt is defined as follows.
Represent the preceding n for arranging the classification that self-adaption cluster algorithm produces by its number of elements descendingfA classification
Numbering set.WillBy index iFAscending order arrangement then obtains kth class map grid texture and is based on fjStability vectorIt is right
In all fixed Combinations of index k and j, repeat above-mentionedCalculating.
Step 3.2.4 calculates preferable statistical value.For kth class map grid texture and j-th of feature extracting method fjIt is (i.e. fixed
K and j) is indexed, according to above-mentioned steps and I1,I2…INIt can calculateWithBy adaptively gathering
Class algorithm, can be to vector Clustered, if self-adaption cluster is calculated
The classification that method produces is by the positive integer number consecutively since 1 and i-th of vectorGeneric numbering is denoted asThen these number definition setFor i-thu A classification, kth class
Map grid texture is based on fjPreferable statistical valueIt is defined as follows.
Expression belongs to kth class map grid texture and is based on fjI-thuAverage in the characteristic statistics value of a subclass map grid texture
Average value.All fixed Combinations for indexing k and j, repeat above-mentionedCalculating.
Step 3.3 calculates the preferable statistical value threshold value of each feature.According to training sample set and above-mentioned steps, it can calculate and be based on
J-th of feature extracting method fjKth class map grid texture i-thuThe preferable statistical value of a subclass map grid textureIt is (i.e. fixed
Index j, k and iu).Any map grid L produced for any training sample by step 2, according to its feature vector fj(L) as the following formula
Calculate preferable statistical value index k*With
ForThere may be multiple L, its preferable statistical value index meets k*=k andThese map grids composition collection
CloseWhenDuring establishment, the kth class map grid texture based on j-th of feature extracting method can be calculated as follows
I-thuThe ultimate range of a subclass map grid textureI.e. preferable statistical value threshold value.
For indexing j, k and iuAll fixed Combinations, repeat it is above-mentionedCalculating.
Step 4 gamma correction.For the test sample I that map grid arrangement angle is unknown, Canny edge detection method meters are used
Calculate I edge, using Hough transform by edge projection into parameter space, take preceding n in parameter spaceθCorresponding to a peak value
The angle, θ of straight slope, rotates I according to taken θ, obtains nθA rotation image, according to each rotation imageWithCalculate
WithTakeWithThe corresponding angle of middle maximumI is rotatedObtain final calibration result.
Step 5 test sample map grid is split.The calibration result produced to step 4, the threshold coefficient weight obtained according to step 2
Multiple step 1 obtains the row split position of test sample calibration resultWith column split positionAnd according toWithBy test sample
It is divided into map grid.
Step 6 flaw identifies.To any map grid of test sampleAccording to feature extracting method f1, f2…f|T|Calculate special
Sign vector For fjThe feature vector of calculatingAccording to step 3.2 and step
3.3 calculate preferable statistical value index k*WithWithIfThen
Labeled as there is flaw, otherwise labeled as indefectible.When all map grids are based on fjMark terminate, inspection each have flaw map grid Ll
8 face domainThe mark of interior map grid, if in the presence of map grid of having no timeThen judgeWhether into
It is vertical, marked if setting upTo have flaw and makingAnd d is calculated as followsl+1, continue checking forInterior map grid
Mark and repeat the above steps until dl+1For
Wherein threshold coefficient0 < γ≤1,L1Expression is based on fjMark terminate obtain have the free time
Map grid.When dynamic threshold isWhen, it is testing result all to have the ranks index that free time map grid includes pixel.
The beneficial effects of the invention are as follows:It is provided by the invention a kind of based on peak threshold, rotational alignment and composite character
Textile flaw detection method, Pixel of Digital Image gray scale letter of this method analysis based on flat textile surface under lighting source
Breath, divides the image into the grid for non-overlapping copies, the IRM of each grid, HOG, GLCM and Gabor characteristic value is calculated, according to spy
Value indicative distribution automatic positioning textile surface flaw.The present invention is especially suitable for be automatically identified in what is gathered under steady illumination light source
Textile surface flaw in textile flat surfaces gray-scale image.
Brief description of the drawings
The invention will be further described with reference to the accompanying drawings and examples.
Fig. 1 is the main-process stream schematic diagram of the present invention;Fig. 2 is the assumed condition schematic diagram of the present invention;Fig. 3 is the step of the present invention
The flow diagram of rapid 1 training sample map grid segmentation;Fig. 4 is to calculate S in the step 1 of the present inventionhThe basic principle of initial value is shown
It is intended to;Fig. 5 is the textile images background pixel distribution schematic diagram that texture is identical but direction is different in step 2 of the invention;Fig. 6
It is image calibration schematic diagram in step 4 of the invention;Fig. 7 is image rotation schematic diagram in step 4 of the invention;Fig. 8 is this hair
Bright step 3.1 is fallen into a trap nomogram lattice cyclic flow schematic diagram;Fig. 9 is to calculate each to have no time to weave in the step 3.2.1 of the present invention
The characteristic statistics value flow diagram of product gray level image;Figure 10 is training sample set schematic diagram in step 3.2.2 of the invention;Figure
11 be the flow diagram that sorts in the step 3.2.2 of the present invention;Figure 12 is the ideal that each feature is calculated in the step 3.3 of the present invention
Statistical value threshold value flow diagram;Figure 13 is flaw identification process schematic diagram in step 6 of the invention;Figure 14 is step 1 map grid
Partitioning algorithm flow chart;Figure 15 is that step 2 calculates threshold coefficient and entropy threshold algorithm flow chart;Figure 16 is step 3.1 calculating figure
Lattice periodical algorithms flow chart;Figure 17 is that A.1 algorithm calculates eigenmatrix algorithm flow chart;Figure 18 is that A.2 algorithm calculates distance calculation
Method flow chart;Figure 19 is that A.3 algorithm calculates signal period algorithm flow chart;Figure 20 is that step 3.2.1 calculates the calculation of characteristic statistics value
Method flow chart;Figure 21 is that step 3.2.2 calculates characteristic statistics value sort algorithm flow chart;Figure 22 is that step 3.2.3 calculates stabilization
Characteristic element algorithm flow chart;Figure 23 is that step 3.2.4 calculates preferable statistical value algorithm flow chart;Figure 24 is that step 3.3 calculates
The preferable statistical value thresholding algorithm flow chart of each feature;Figure 25 is step 4 image calibration algorithm flow chart;Figure 26 be algorithm A.4
Image rotation algorithm flow chart;Figure 27 is step 6 flaw recognizer flow chart.
Embodiment
Presently in connection with attached drawing, the present invention is described in detail.This figure is simplified schematic diagram, is only illustrated in a schematic way
The basic structure of the present invention, therefore it only shows composition related to the present invention.
The embodiment of computational methods of the present invention is completed by writing computer program, and specific implementation process is related to self-defined
Algorithm is described by pseudocode.Program input is the textile images of gray processing, and program output is the map grid set containing flaw.This hair
Bright embodiment includes six steps, first three step is the training stage, and rear three steps are test phase.
The training stage comprises the following steps:Step 1:Training sample cartoon is calculated using morphology component analyzing method
Component Ic, by IcSplit by the row and column where index, obtain training sample map grid;Step 2:According to what is obtained in step 1
Training sample map grid, calculates the preferable line number of any training sample and preferable columns, to obtain threshold coefficient, then according to training
The transverse projection of sample and longitudinal projection calculate entropy threshold, repeat the above steps so that the threshold value system of all training samples is calculated
Number and entropy threshold;Step 3:Any training sample is concentrated for training sample, according to the threshold coefficient and entropy calculated in step 2
Threshold value, the feature vector of map grid is calculated using HOG feature extracting methods, distance matrix is calculated by feature vector, by distance matrix
Obtain calculating the map grid cycle by Fourier transformation;According to the preferable statistical value of each feature of map grid computation of Period map grid;
The test phase comprises the following steps:Step 4:Image calibration, for the test specimens that map grid arrangement angle is unknown
This, the edge of test sample is calculated using Canny edge detection methods, using Hough transform by edge projection to parameter space
In, take preceding n in parameter spaceθThe angle, θ of straight slope corresponding to a peak value, according to taken θ rotary tests sample, obtains nθ
A rotation image, transverse projection entropy and longitudinal projection's entropy are calculated most according to the transverse projection of each rotation image and longitudinal projection
It is worth corresponding angle greatlyTest sample is rotatedObtain final calibration result;Step 5:Test sample map grid is split, right
The calibration result that step 4 produces, the threshold coefficient repeat step 1 obtained according to step 2 obtain the row of test sample calibration result
Split positionWith column split positionAnd according toWithTest sample is divided into map grid;Step 6:Flaw identifies, according to step
Rapid 3 method calculates feature vector, map grid cycle, the preferable statistical value of each feature of map grid and the preferable statistical value of test sample
Threshold value, and by result of calculation compared with preferable statistical value threshold value, to identify map grid defective.The order of this method and patrol
The relation of collecting refers to Fig. 1.
As shown in Fig. 2, inventive method assumes that textile images have following features:Relative to textile images row and
Row, map grid is transversely arranged according to the direction of image line, and by the direction longitudinal arrangement of row;In the cartoon component I of MCAcIn, map grid tool
There is geometry and there were significant differences in gray scale with background pixel.Three kinds of situations are shown in Fig. 2, a kind of feelings are shown per a line
Condition, often row first row is textile images, and secondary series is Ic, the 3rd row are IcThree-dimensional Mesh figure, the 4th row be binaryzation cartoon
Component often row background pixel number distribution, the abscissa of the 4th row figure is line index, and ordinate is background pixel number.Fig. 2
The map grid of middle the first row textile images does not have geometry, and which results in background pixel distribution to lack obvious periodicity;The
Although the map grid of two row textile images has geometry, but the shape in map grid and background are in IcIn difference it is small, i.e., it is corresponding
The most of region of Mesh figures be almost flat, this causes background pixel quantity excessive, and background pixel distribution lacks obvious
Periodically;The third line textile images map grid has geometry and in IcIn it is big with the difference of background, its background pixel distribution
With periodically.
Individually below to this six step expansion explanations.
1st, the training stage
A series of as shown in Figure 1, training stage ginseng first according to needed for textile gray level images of having no time calculate map grid segmentation
Number, then carries out map grid segmentation to image of having no time and calculates parameter needed for test phase.Training stage includes three steps:Step
1 training sample map grid is split, and step 2 calculates threshold coefficient and entropy threshold, and step 3 calculates test phase parameter.The present invention proposes
The parameter that is obtained according to step 2 of map grid dividing method, pass through step 1 and split map grid.
Step 1 training sample map grid is split.As shown in figure 3, the textile images given for a width, according to such as Figure 14 institutes
The map grid partitioning algorithm shown, I is calculated using MCAcWith texture component, according to calculating threshold coefficient as shown in figure 15 and entropy threshold
Algorithm, the threshold coefficient f being calculatedc, use threshold value fc·max(Ic) binaryzation IcObtain Itc.I is shown in Fig. 3c's
Mesh schemes, IcIn two-dimensional pattern three-dimensional " mountain peak ", binaryzation I are shown as in Mesh figurescCut equivalent to a gray plane
Disconnected mountain peak, the pixel corresponding to part above the plane of mountain peak save as 1, and the pixel corresponding to part below the plane of mountain peak is protected
0 is saved as, this binaryzation result is Itc, i.e. Fig. 3 lower rights arrow " uses threshold binarization IcObtain Itc" signified pattern.
Assuming that textile images are at least made of 4 map grids, then ItcThe object size of middle corresponding map grid should be less than image
The half of size, so if there is oversized situation, then this object is not then map grid, should be from ItcMiddle deletion ruler
Very little excessive object, i.e.,:By Moore-Neighbor track algorithms, (Moore-Neighbor tracing algorithm, go out
From document Jia L., Liang J., Fabric defect inspection based on isotropic lattice
Segmentation, Journal of the Franklin Institute 354 (13) (2017) 5694-5738) obtain Itc
The closure edge of middle object.For each object with closure edge, the extreme value that the object ranks index is found out, if this is right
As line index extreme value difference absolute value more than 0.75dimx(Itc), or the difference of column index extreme value absolute value more than 0.75
dimy(Itc), then from ItcMiddle deletion object, i.e., be set to 0 by the pixel of oversized object.
The geometry of textile images map grid is by ItcIn two value objects described by, the rich and varied of map grid result in two
The diversity of value object geometry, but between two value objects the distribution of background pixel influenced by its shape it is small, i.e.,:Different shape
Two value objects, if its distribution in same direction is identical, then the distribution of background pixel in this direction is similar.Such as Fig. 3
Shown, often the background pixel number of row and each column, order in rows and columns arrange background picture to statistics binaryzation cartoon component respectively
Plain number is to constitute the transverse projection of background pixelAnd longitudinal projectionWithPeak value be denoted as multiset respectivelyWithThat is close to label " transverse projection during transverse projection and longitudinal projection illustrate in Fig. 3" and " longitudinal projection" it is dark small
Point, these peak values reflect ItcThe boundary of middle map grid.
Other peak values are filtered to obtain these peak values, it is rightWithAdaptive K-mean algorithms are applied respectively
(Adaptive K-means) algorithm (Jia L., Liang J., Fabric defect inspection based on
isotropic lattice segmentation,Journal of the Franklin Institute 354(13)
(2017) 5694-5738, hereinafter referred to as self-adaption cluster algorithm) clustered, cluster centre saves as multiset respectivelyWith
Due to the randomness of data,WithIt is possible to comprising multiple similar cluster centres, these close cluster centres
In minimum value elected as threshold value respectivelyWithI.e.:WillDescending arranges, fromStart, two-spot before and after calculating
The absolute value of the difference of element, it is high that difference is more than DCT sizesFirst element beSimilarly, willDescending arranges, fromStart, the absolute value of the difference of two elements before and after calculating, it is wide that difference is more than DCT sizesFirst element beIn be not less thanPeak value press corresponding line index, be denoted as S 'h;In be not less thanPeak value by institute it is right
The column index answered, is denoted as S 'v。
Due to the interference of the factors such as flaw, S 'hWith S 'vIn ranks index not necessarily accurately reflect the boundary of map grid.Cause
This is, it is necessary to assess S 'hIn whether there is with stablizing the line index of line space, and S 'vIn whether there is have stablize column pitch
Column index, these ranks index is as the boundary of map grid to split map grid.For S 'h, by S 'hMiddle element does ascending order arrangement, OK
The multiset of index spacing is defined as Continuously stablize with line index
The multiset of line spaceIt is defined as follows.
Wherein xi ∈ S 'h, i is the continuous positive integer of numerical value, such as i can take 2,3,4, but cannot only take 2 and 4.Due to
Meet there may be multipleThe continuous spacing of definition, it is possible that there are multipleWherein with most element numbers(it is denoted as) corresponding to line index as map grid boundary set ShInitial value, it is defined as follows.
As shown in Figure 4, it is shown that with a secondary textile images transverse projectionBased on calculate ShThe process of initial value, it is left
Side is shownPeak valueRepresented with dark dot, it is rightClustered, obtainedPass through cluster in Fig. 47 are obtained
The cluster centre of class, according toCluster centre threshold value is calculatedIndicated in figureStraight line on fork.According toScreeningElement, delete compared with small leak, i.e., the diagram among Fig. 4, according to the line index meter of the continuous peak value of line index
Its line space is calculated, then obtains that there is different length (element number)Wherein with most elements(i.e. indicated in Fig. 4
It is " maximum") beShInitial value beAs shown in Fig. 4 rightmost sides.
Similarly, can calculateAnd SvIt is initial
Value, is defined as follows.
Because ShWith SvCorresponding to initial valueWithRespectively comprising stablizing line space and stablizing column pitch, thereforeWithMedian is defined as preferable line numberWith preferable columnsShWith Sv's
Initial value example is shown in attached drawing 3, as shown in figure 3, textile images only subregion is by ShAnd SvInitial value cover at the same time, i.e. Fig. 3
Indicate " ShAnd SvInitial value " diagram in grid, the region of only vertical straight line only has SvCovering.ShAnd SvExtension be based onWithCarry out.Due to ShIn line index by ascending order arrange, from min (Sh) start, with step-lengthTo ItcLine index minimum value 1
It is mobile, that is, calculateCheck for MeetIf
There are x ', then x ' is added to Sh, x is otherwise added to ShAnd keep ShMiddle element ascending order arrangement, calculates again
And repeat the above steps;Similarly, from max (Sh) start, with step-lengthTo ItcLine index maximum dimx(Ic) mobile, that is, count
CalculateCheck forMeetIf there is x ',
X ' is then added to Sh, x is otherwise added to Sh, calculate againAnd repeat the above steps.To SvWith step-lengthSimilar extension is done, in detail map grid partitioning algorithm flow as shown in Figure 14.Extend obtained ShWith SvIt substantially covers textile figure
The most of region of picture, as shown in Figure 3.According to ShWith SvThe row and column index included respectively, can be by IcBy these index places
Row and column is split, and the region for splitting gained is defined as map grid, it is defined as follows.
Wherein1≤ir≤|Sh| -1 and 1≤ic≤|Sv| -1, therefore IcBe partitioned into (| Sh|-1)·(|
Sv| -1) it is aAnd irAnd icIt is respectivelyRow and column index in units of map grid.
Step 2 calculates threshold coefficient and entropy threshold.One important parameter of map grid segmentation is threshold coefficient fc, such as Fig. 3 institutes
Show, IcBinaryzation be to be based on threshold value fc·max(Ic) complete, and the threshold value depends on fc.For training sample set I1,I2…IN
IiUsing based on different fcThe map grid partitioning algorithm (its flow is as shown in figure 14) of value can obtain multipleWithCalculate institute
WithHistogram, wherein occurrence number is mostWithAnd its corresponding fcValue is to determining fcFinal value
With reference significance.For training sample set I1,I2…INWith a f of N 'cSelectable value c1,c2…cm, orderWith
Represent that input is I respectivelyi, i=1,2 ... N and fc=cl, what the step 1 of l=1,2 ... N ' was calculatedWithFor each
IiIt is all a there are N 'It is a with N 'On IiMultisetAnd multisetIn go out
F corresponding to the most elements of occurrence numbercValue is denoted as c respectivelyh(i, l) and cv(i, l), is defined as follows.
For IiIf ch(i, l) and cv(i, l) is identical, then respective index (i, l) is stored in setIn,Definition such as
Under.
For eachI.e. for IiIf at least there are a l ' so that ch(i,l′)≡cv(i, l ') set up, then with
med({cl) closest ch(i, l ') participates in fcCalculating, fcIt is defined as follows.
Wherein chThe index of (i, l) Expression, which takes, to be metI values in definition.Image calibration is established to two
In the analysis that background pixel is distributed in value textile images cartoon component, as shown in Figure 5.In Figure 5, positioned at the weaving at center
Product image every 15 ° of rotations once, have rotated altogether 7 times (i.e. 0 °, 15 °, 30 ° ...), rotating image is by suitable since 0 °
Clockwise is arranged around original image, and each image is f according to parametercThe transverse projection that is calculated of step 1And longitudinal projectionShow to graphically, basis respectively is labeled with below figureWithThe entropy of calculatingWithObserve shown in attached drawing 5WithIt can be found that the entropy of 0 ° and 90 ° image exceedes the entropy of other rotation images.For training sample set I1,I2…IN, calculate every width
ImageWithThe integer part of the average of these entropys is taken to obtain two threshold value exAnd ey, can be used for the arrangement for judging map grid
Whether angle is close to 0 ° or 90 ° of multiple.exAnd eyCalculating process pseudocode description calculating threshold coefficient as shown in Figure 15
With the algorithm flow of entropy threshold.
Step 3 calculates test phase parameter.The step specifically includes following three steps:Step 3.1 calculates the map grid cycle;
Step 3.2 calculates the preferable statistical value of each feature of map grid;Step 3.3 calculates the preferable statistical value threshold value of each feature.
Step 3.1 calculates map grid cyclic flow and refers to Fig. 8.According to training sample set I1,2…INFigure can be calculated with step 1.3
Ideal of a lattice size line numberAnd columnsSplit i-th by step 2 again (1≤N) a training sample IiObtain IiM × n
Map grid.Assuming that in IiOften row and each column map grid in, be often separated by t ' -1The texture phase of two map grids of a map grid
Together, the minimum value in t ' values is known as map grid cycle t.Such as during t=1, IiAll map grids texture it is identical;During t=2, Ii's
Map grid texture is then identical every a map grid.By the Texture classification of map grid, then IiThere is the map grid texture of t type.Use HOG
(Dalal,N.,Triggs B.,Histograms of Oriented Gradients for Human Detection,IEEE
Comput.Soc.Conf.on Comput.Vision and Pattern Recognition 1 (2005) 886-893) feature
Extracting method (hereinafter referred to as HOG methods) calculates IiThe feature vector of map grid simultaneously makes feature vector index corresponding map grid rope
Draw identical, i.e., the feature vector as corresponding to the arrangement mode arrangement map grid of map grid.For IiMap grid(1≤ir≤ m, 1
≤ic≤ n), calculateWith i-thrThe Euclidean distance of all map grids in row, the column index ascending order row of map grid as involved by calculating
Row, then may make up distance vector.Therefore i-th is fixedrEach map grid in row, according to i-thrCapable all map grids can all calculate one
Distance vector, these distance vectors are arranged by involved fixation map grid column index ascending order is calculated, then obtain being based on i-thrOK
N × n distance matrixs, distance matrix is pressed into irAscending order arranges, and obtains IiRow distance matrixSimilarly, may be used
To calculate IiColumn distance matrixBy vectorQuick Fourier is carried out as one-dimensional signal
Leaf transformation (fast Fourier transform, hereinafter referred to as FFT), then can obtainCycle and frequency spectrum, this cycle
It is defined as with frequency spectrum as IiThe row cycle and line frequency spectrum, calculate all 1≤l1≤ m and 1≤l3Corresponding to≤nRow week
Phase and line frequency are composed and calculate row cycle median and line frequency spectrum median, and gained median is respectively defined as image line cycle and figure
As line frequency is composed.Similarly, according to column distance matrix D(c), I can be calculatediThe row cycle and row frequency spectrum, and calculate corresponding image
Arrange cycle and image column frequency spectrum.Attached drawing 8 illustrates I1,I2…INThe row cycle and line frequency spectrum conceptual two-dimentional scatter diagram, row week
Phase and the conceptual two-dimentional scatter diagram of row frequency spectrum.According to I1,I2…IN, N number of image line cycle and corresponding N number of image can be calculated
Line frequency is composed, and calculates image line frequency spectrum medianFind out and be higher thanImage line frequency spectrum corresponding to the image line cycle, calculate this
The median in a little image line cyclesSame steps are repeated to image column cycle and image column frequency spectrum and obtain image column frequency spectrum middle position
ValueWith image column cycle medianIfOrOrThen t values are 1, otherwise pass through and compareWithCorresponding frequency spectrum determines the value of t, i.e.,:IfThen t takesOtherwise t takesStep 3.1 algorithm flow refers to Figure 16 institutes
The calculating map grid periodical algorithms flow chart shown, A.1 the algorithm shown in Figure 17 calculates eigenmatrix algorithm flow chart, shown in Figure 18
A.2, A.3 algorithm calculates signal period algorithm flow chart apart from the algorithm shown in computational algorithm flow chart and Figure 19.
Step 3.2 includes four sub-steps:Step 3.2.1 calculates characteristic statistics value, and step 3.2.2 calculates characteristic statistics value
Sequence, step 3.2.3 calculate invariant feature element, and step 3.2.4 calculates preferable statistical value.
Step 3.2.1 calculates the characteristic statistics value of each textile gray level image of having no time.Calculated and trained according to above-mentioned steps
Sample set I1,I2…INMap grid cycle t, the i.e. identical map grid of texture arrangement regulation.For i-thSecondary nothing
Free time image Ii, it can be divided into the different map grid of t class textures, i-thrRow kthClass map grid and (ir+ t) OK
The map grid column index value of such map grid is identical, thus can be in IiIn only access the map grid for belonging to one kind together, for kth class map grid,
I-thrOK, (ir+ t) OK, (ir+ 2t) OK ..., such map grid can form matrix, which is known as map grid matrix, for
K class map grids, map grid matrix at most may be present t, i.e. C1,C2…Ct.As shown in figure 9, as t=3, the 3rd class map grid has 3 squares
Battle array:C1It is made of the 3rd class map grid of the 1st row and the 4th row (i.e. 1+t rows), C2It is made of the 3rd class map grid of the 5th row of the 2nd row, C3By
The 3rd class map grid composition of 3rd row.Assuming that in the presence of | T | a input is 2-D gray image matrix and output is one-dimensional real vector
Feature extracting method f1, f2…f|T|, these feature extracting methods are for the identical input picture generation length phase of line number and columns
Same feature vector, then IiIn map gridCan be according to f1, f2…f|T|Calculate | T | a feature vectorIf IiThe size of all map grids is according to I1,I2…INPixel minimum line number contained by middle map grid
nrWith minimum columns ncIt is adjusted, i.e., only retains in map grid the 1st row to n-thrGo and the 1st row to n-thcThe pixel of row, then IiIn
Any two map gridWithBased on fj Feature vector length it is identical, i.e.,This is based on fjFeature vector length be defined as fjCharacteristic element prime number Fj.For IiMiddle kth class
Map grid, can be according to the map grid Matrix C of such map grid1,C2…CtCalculating is based on fjFeature vector in each element averageStandard deviationMaximumAnd minimum valueThis 4 values are defined as IiCharacteristic statistics value, i.e., by following formula
Definition.
WhereinRepresent that map grid L is i-thtA map grid matrixArbitrary element,WhereinExpression is based on fjMap grid matrixI-th in the feature vector of middle all elements (map grid)FA element is (real
Number) multiset, when opt is replaced with mean, std, max or min, thenDefinition is corresponding
WithThe calculating characteristic statistics value-based algorithm flow chart of step 3.2.1 flows in detail as shown in Figure 20.
Step 3.2.2 calculates the sequence of characteristic statistics value.Although I1,I2…INFor the sample of having no time of same training sample set, but
The definition of training sample set does not guarantee that first map grid L in each sample1,1Texture it is identical.Training sample as shown in Figure 10
This collection, the training sample set are had no time image I comprising 4 pairs1, I2, I3And I4, wherein I3Middle L1,1Texture and other samples in
One map grid texture is different.If the texture of first map grid of all training samples is different, then step 3.2.1 calculates feature
Statistical value just needs to resequence.As shown in figure 11, training sample set includes training sample I1, I2, I3, I4, I5And I6, wherein I4
L1,1It is different from first map grid texture of other samples, cause characteristic statistics value also different from the sequence of other samples.If
First map grid texture of all training samples is all identical, then sequence is then nonsensical.It is whether necessary in order to detect sequence, count
Calculate training sample I1,I2…INBetween be based on fj'sThe Euclidean distance average value d (j) of (1≤i≤N, 1≤k≤t), it is fixed
Justice is as follows.
For f1, f2…f|T|, corresponding d (1) can be obtained, d (2) ... d (| T |) correspondingly, can root again after completing to sort
Calculate d ' (1), d ' (2) ... d ' (| T |) according to above formula, relatively before and after two groups of distance averages, if d (j) >=d ' (j) for 1≤j≤
| T | all set up, then retain ranking results, otherwise recover the state before sequence.The flow that sorts is as shown in figure 11.For kth class figure
Check is managed N number of(1≤i≤N), clusters it using clustering algorithm, clustering algorithm classification parameter is set to t, then obtains t
A class centerForCalculate according to the following formula fromClass corresponding to nearest class center
Label u*。
IfWhereinRepresent that there is the center of the class of most element numbers in t classification, then exchange index
Characteristic statistics value determined by (i, j, k) and index (i, j, k*) determined by characteristic statistics value, wherein k*It is defined as follows.
All fixed Combinations for indexing k and j, for eachRepeat above-mentionedu*WithCalculating and judgementWhether set up, k is repeated if setting up*Calculating and exchange determined by index (i, j, k)
Characteristic statistics value and index (i, j, k*) determined by characteristic statistics value.The calculating of step 3.2.2 flows in detail as shown in Figure 21 is special
Levy statistical value sort algorithm flow chart.
Step 3.2.3 calculates invariant feature element.I is concentrated according to training sample1,I2…INT kind map grid textures can calculate
Based on fjN × t group characteristic statistics values, for kth (1≤k≤t) class map grid texture, according to it(1
≤ i≤N) i-thF(1≤iF≤Fj) a elementWithI-thFA elementWherein FjFor
fj(1≤j≤| T |) characteristic element prime number, kth class map grid texture can be calculated and be based on fjFeature vector i-thFA element
Stationary value s(j,k)(iF), it is defined as follows.
By s(j,k)(iF) by index iFAscending order arrangement then obtains kth class map grid texture and is based on fjStationary value vector s(j,k)。
If parameter nfRepresent predefined minimal characteristic vector length, this method nfValue is nf=8, then work as nf< Fj, should during establishment
F is based on to kth class map grid texture with self-adaption cluster algorithmjFjA stationary value is clustered, if self-adaption cluster algorithm is produced
Raw classification is by the positive integer number consecutively and i-th since 1FA stationary value s(j,k)(iF) numbering of generic is denoted as Ls
(iF), then these number definition set Ls.If define parameter preset minimal characteristic numberThen kth class map grid texture is based on fj
Feature vector i-thFThe stability of a elementIt is defined as follows.
Wherein δ is Dirac delta function,Represent the classification category that self-adaption cluster algorithm produces including first prime number
The preceding n that descending arrangesfThe numbering set of a classification.WillBy index iFAscending order arrangement then obtains kth class map grid line
Reason is based on fjStability vectorAll fixed Combinations for indexing k and j, repeat above-mentionedCalculating.Step
3.2.3 the algorithm flow chart of flow in detail as shown in Figure 22.
Step 3.2.4 calculates preferable statistical value.I is concentrated for training sample1,I2…INKth (1≤k≤t)
Class map grid texture, can calculate kth class map grid texture according to step 3.2.3 and be based on fj(1≤j≤| T |) stability vector, can be to vector by self-adaption cluster algorithmClustered,
If by the classification that self-adaption cluster algorithm produces by the positive integer number consecutively since 1 and i-th (1≤i≤N) it is a to
AmountThe numbering of generic is denoted asThen these number definition setIn a practical situation, may
It can occurClose situation, therefore defined parametersIf U(j,k)> nK, then cluster is re-started, we
Method nKValue is nK=5.For i-thu(1≤iu≤U(j,k)) a classification, kth class map grid texture is based on fjPreferable system
EvaluationIt is defined as follows.
Expression belongs to kth class map grid texture and is based on fjI-thuAverage in the characteristic statistics value of a subclass map grid texture
Average value.All fixed Combinations for indexing k and j, repeat above-mentionedCalculating.Step 3.2.4 flows refer to Figure 23
Shown calculating ideal statistical value algorithm pattern.
Step 3.3 calculates the preferable statistical value threshold value of each feature.I is concentrated for training sample1,I2…IN, according to step
3.2.4 can obtain kth (1≤t) class map grid texture is based on fj(1≤j≤| T |) i-thu(1≤iu≤U(j,k))
The preferable statistical value of a subclass map grid textureAny map grid L produced for any training sample according to map grid segmentation,
It can calculate based on fjFeature vector fj(L) and its Euclidean distance between all preferable statistical values wherein most narrow spacing can, be found out
K is indexed from corresponding preferable statistical value*WithIt is defined as follows.
Therefore, it is based on f for kth class map grid texturejI-thuThe preferable statistical value of a subclass map grid textureMay
There are multiple map grids and the relevant k of map grid*WithWithIndex k and iuIt is identical, these map grids composition setWhenDuring establishment, it can calculateThe feature vector of middle map grid withUltimate rangeIt is defined as follows.
For indexing j, k and iuAll fixed Combinations, repeat it is above-mentionedCalculating.As preferable statistical value
Threshold value, its calculating process is as shown in Figure 12.In attached drawing 12, left side is the textile gray level image for having completed map grid segmentation, should
Image includes 2 class map grid textures, for any map grid in imageAccording to f1, f2…f|T|Calculate the map grid | T | a spy
Sign vectorFor j-th of feature vectorCalculate k*WithAs a result with comprising
Corresponding diagram case puts the graphical representation of gray scale color lump, wherein dark gray scale color lump represents small distance, the numeral on each color lump from
It is left-to-right to be followed successively by k*WithForCorresponding index k and iu, delete correspondingStep 3.3 flow is detailed
The preferable statistical value thresholding algorithm flow chart of each feature of calculating as shown in Figure 24.
2nd, test phase
On the parameter basis obtained in the training stage, the sub-picture that test phase concentrates test sample carries out flaw inspection
Survey and position.Test phase includes three steps:Step 4 gamma correction, the segmentation of step 5 test sample map grid and step 6 flaw
Identification.
Step 4 gamma correction.For the test sample I that map grid arrangement angle is unknown, I is rotated into θ=1 ° successively, 2 °,
3 ° ... 360 ° and calculate correspondingWithCorresponded to if existed in angle, θWithMaximumSoIt is referred to as preferable
Collimation angle,Corresponding rotation image is then used as calibration result.It is defined as follows.
Above-mentioned calculatingProcess due to the value of θ it is excessive, computational efficiency is not high, and this law uses flow meter as shown in Figure 6
CalculateApproximation.As shown in fig. 6, for the unknown textile images I of map grid arrangement angle, the present invention is examined using Canny edges
Survey method calculate I edge, using Hough transform by edge projection into parameter space, take preceding n in parameter spaceθA peak value
The angle, θ of corresponding straight slope, rotates I according to taken θ, obtains nθA rotation image, according to each rotation imageWithCalculateWithTakeWithThe corresponding angle of middle maximum, it is approximate with the angle Corresponding rotation image
Then as final calibration result.The pseudocode for calibrating flow describes image calibration algorithm flow chart as shown in Figure 25.
It is sky by the corner parts of the image of affine transformation, such as although image rotation can be completed by affine transformation
Shown in Fig. 7.Number has been arranged in order 5 width images from left to right in Fig. 7, and the first width shows textile figure of the map grid by 37 ° of arrangements
As I, the second pair is shown rotates minus 37 ° of obtained image (original Is using affine transformationr), occur in the image leaving blank (as
Element value is 4 delta-shaped regions 0)If these regions of leaving blank are not handled, then these regions can not only influenceWith
Calculating, it is also possible to flaw is identified as by subsequent step.For fillingThis invention takes found outBevel edgeEndpoint and
Parallel toLonger right-angle side straight line, the original rotation image I for being obtained affine transformation as symmetry axis using the straight liner's
Pixel is copied to3rd width of number and the fourth officer image vision process from left to right in attached drawing 7, the description of its pseudocode
Image rotation algorithm flow chart as shown in Figure 26.Fig. 7 rightmosts indicate " final Ir" image be image rotation algorithm rotation
As a result, although region of leaving blank is filled, some artifacts (artifacts) are appeared in rotation results, such as the lower left corner
There is dislocation in map grid arrangement.
Step 5 test sample map grid is split.The calibration result produced to step 4, the threshold coefficient weight obtained according to step 2
Multiple step 1 obtains the row split position of test sample calibration resultWith column split positionAnd according toWithBy test sample
It is divided into map grid.
Step 6 flaw identifies that flow is as shown in Figure 13.For a secondary given textile gray level image I, produced by step 5
The map grid of raw I, to any map grid in IAccording to feature extracting method f1, f2…f|T|Calculate| T | a feature vectorFor based on fj Feature vectorCalculation procedure
The preferable statistical value index k of 3.3 definition*WithAnd comparative feature value distanceWithSize, ifThenLabeled as there is flaw, otherwise labeled as indefectible.
When all map grids are based on fjMark terminate, inspection each have flaw map grid Ll8 face domainThe mark of interior map grid
Note, if in the presence of map grid of having no timeThen compareWith dynamic threshold dlSize, ifThenMark
To have flaw and makingAnd d is calculated as followsl+1, continue checking forThe mark of interior map grid, and repeat above-mentioned step
Suddenly until the dynamic threshold newly calculated is
Wherein0 < γ≤1, this method value are γ=0.93,L1Expression is based on fjMark knot
What beam obtained has free time map grid.When dynamic threshold isWhen, it is detection knot all to have the ranks index that free time map grid includes pixel
Fruit.
Step 6 flow flaw recognizer flow chart as shown in Figure 27 in detail.
The high efficiency experiment of the present invention proves:
Use Hong Kong University's Electrical and Electronic engineering department industry automatic in the Defect Detection recruitment evaluation of the method for the present invention
Change 24 color textile product images that the 56 width pixel sizes that laboratory provides are 256 × 256, these images are turned in an experiment
It is changed to the gray level image of 8.56 width images include a kind of pattern:Box-shaped image.Box-shaped image includes 26 indefectible and 30 width
There is flaw image.There are free time textile images A.4 to generate 10 width rotation image with random angles using algorithm to each, then delete
There are the image of serious artifact, and finally obtain 251 map grids has free time textile images as test specimens by what random direction arranged
This collection and without rotating 26 textile images of having no time as training sample set.Training sample set includes 5 kinds of flaw types:It is disconnected
Hold (broken end), hole (hole), reticulate pattern (netting multiple), cord (thick bar) and stria
(thin bar), the particular number of every kind of flaw type refer to the first row of table 1.All flaw images have the flaw of formed objects
Defect reference map (ground-truth image), flaw reference map is 2 value images, wherein 1 represents flaw, 0 represents background.For
The algorithm compared includes WGIS, BB, RB and ER, parameter setting and document (Jia L., the Liang J., Fabric of these algorithms
defect inspection based on isotropic lattice segmentation,Journal of the
Franklin Institute 354 (13) (2017) 5694-5738) it is identical.Parameter choosing of the method for the present invention based on the data set
It is selected as:Minimal characteristic number nf=8, classification number limit nK=5, threshold coefficient γ=0.93, T=" HOG ", " GLCM ",
“Gabor”}。
Index for assessment includes true positives (true positive, hereinafter referred to as TP), false positive
(positiverate, hereinafter referred to as FPR), True Positive Rate (truepositiverate, hereinafter referred to as TPR), false positive rate
(positiverate, hereinafter referred to as FPR), positive predictive value (positivepredictivevalue, hereinafter referred to as PPV) and
Negative predictive value negativepredictivevalue, hereinafter referred to as NPV).TPR, which is weighed, represents flaw in flaw reference map
Pixel is correctly demarcated as the ratio of flaw by algorithm, and FPR, which is weighed, represents the pixel of background by algorithmic error mark in flaw reference map
It is set to the ratio of flaw, the flaw proportion in the flaw of PPV measure algorithms output in flaw reference map, NPV measure algorithms
Background proportion in the background of output in flaw reference map.For TPR, PPV and NPV, desired value is the bigger the better, for
FPR is then the smaller the better.Related mathematical definition can document (M.K.Ng, H.Y.T.Ngan, X.Yuan, et al.,
Patterned fabric inspection and visualization by the method of image
Decomposition, IEEETrans.Autom.Sci.Eng.11 (3) (2014) 943-947) in find.The method of the present invention,
The index calculating method of WGIS, BB, RB and ER and document (Jia L., Liang J., Fabric defect inspection
based on isotropic lattice segmentation,Journal of the Franklin Institute 354
(13) (2017) 5694-5738) it is identical.Experimental Hardware platform for the CoreTMi7-3610QM230-GHz of Intel containing processor and
The laptop of 8.00GB memories, software are Windows 10 and Maltab8.4.
Table 1 enumerates box-shaped image Defect Detection as a result, the every row index value for wherein marking flaw type is corresponding method
To the index average value of all test sample operation results of the flaw type.According to 1 overview of table, one column, the method for the present invention has most
Global TPR (0.558) excellent global TPR (0.724) and overall situation NPV (0.994), its overall situation TPR higher than WGIS times is much higher,
But the global FPR of WGIS is relatively low.For hole, the flaw of reticulate pattern and stria type, the TPR of the method for the present invention is optimal,
FPR is bigger than normal at the same time.The broken ends of fractured bone and cord TPR (0.68;0.85) than WGIS (0.98;1.00) it is low, but FPR (0.2,0.3) compares
WGIS (0.12,0.16) is high.To sum up, the method for the present invention has reached global optimum TPR and NPV, its overall situation FPR is larger, while this
The flaw of hole of the inventive method especially suitable for detecting box-shaped image, reticulate pattern and stria type.
1 box-shaped image Defect Detection result of table
Using the above-mentioned desirable embodiment according to the present invention as enlightenment, by above-mentioned description, relevant staff
Various changes and amendments can be carried out in without departing from the scope of the present invention completely.The technical scope of this invention is not
The content being confined on specification, it is necessary to which its technical scope is determined according to right.
Claims (5)
- A kind of 1. textile flaw detection method based on peak threshold, rotational alignment and composite character, it is characterised in that:Including Two stages of training stage and test phase;Training stage, according to a series of indefectible textile gray level images (hereinafter referred to as without Free time image or training sample) parameter needed for map grid segmentation is calculated, map grid segmentation then is carried out to image of having no time and calculates test rank Parameter needed for section flaw identification;One secondary textile images are carried out map grid point by test phase according to the parameter that the training stage obtains Cut and judge whether map grid includes flaw, finally mark contains map grid defective;The training stage comprises the following steps:Step 1:Training sample cartoon component I is calculated using morphology component analyzing methodc, by IcBy the row and column where index Split, obtain training sample map grid;Step 2:According to the training sample map grid obtained in step 1, the preferable line number of any training sample and preferable columns are calculated, To obtain threshold coefficient, entropy threshold is then calculated according to the transverse projection of training sample and longitudinal projection, repeat the above steps with The threshold coefficient and entropy threshold of all training samples is calculated;Step 3:Any training sample is concentrated for training sample, according to the threshold coefficient and entropy threshold calculated in step 2, is adopted The feature vector of map grid is calculated with HOG feature extracting methods, distance matrix is calculated by feature vector, distance matrix is passed through in Fu Leaf transformation obtains calculating the map grid cycle;According to the preferable statistical value of each feature of map grid computation of Period map grid;The test phase comprises the following steps:Step 4:Image calibration, for the test sample that map grid arrangement angle is unknown, is calculated using Canny edge detection methods and surveyed The edge of sample sheet, using Hough transform by edge projection into parameter space, take preceding n in parameter spaceθCorresponding to a peak value Straight slope angle, θ, according to taken θ rotary tests sample, obtain nθA rotation image, according to the horizontal stroke of each rotation image To projection angle corresponding with the maximum that longitudinal projection calculates transverse projection entropy and longitudinal projection's entropyTest sample is rotatedObtain final calibration result;Step 5:Test sample map grid is split, the calibration result produced to step 4, and the threshold coefficient obtained according to step 2 repeats Step 1 obtains the row split position of test sample calibration resultWith column split positionAnd according toWithBy test specimens one's duty It is segmented into map grid;Step 6:Flaw identifies, feature vector, map grid cycle, each feature of map grid of test sample are calculated according to the method for step 3 Preferable statistical value and preferable statistical value threshold value, and result of calculation is had compared with preferable statistical value threshold value to identify The map grid of flaw.
- 2. the textile flaw detection method based on peak threshold, rotational alignment and composite character as claimed in claim 1, its It is characterized in that:The segmentation of step 1 training sample map grid specifically includes following steps:For a training sample, training sample cartoon component I is calculated using morphology component analyzing methodc, use threshold value fc· max(Ic) binaryzation IcObtain bianry image Itc, I is obtained by Moore-Neighbor track algorithmstcThe closure edge of middle object; For each object with closure edge, the extreme value that the object ranks index is found out, if the difference of the object line index extreme value Absolute value more than 0.75dimx(Itc), or the difference of column index extreme value absolute value more than 0.75dimy(Itc), then from Itc Middle deletion object;Count ItcThe often background pixel number of row and each column, index in rows and columns arrange background pixel respectively Number forms the transverse projection of background pixelAnd longitudinal projection WithPeak value be denoted as multiset respectivelyWithIt is rightWithClustered respectively using self-adaption cluster algorithm, cluster centre saves as multiset respectivelyWith WithIt is possible to Comprising multiple similar cluster centres, the minimum value in these close cluster centres is elected as threshold value respectivelyWith In be not less thanPeak value press corresponding line index, be denoted as S 'h;In be not less thanPeak value press corresponding row Index, is denoted as S 'v;For S 'h, by S 'hMiddle element does ascending order arrangement, and the multiset of line index spacing is defined asContinuously stablize the multiset of line space with line indexDefinition It is as follows:Wherein xi∈S′h, i is the continuous positive integer of numerical value, as map grid boundary set ShInitial value, it is defined as follows:Similarly, can calculate And SvInitial value, it is fixed Justice is as follows:According to preferable line numberWith preferable columnsWhereinWithRepresent respectively With most elementsWithTo ShAnd SvIt is extended, i.e.,:From min (Sh) start, with step-lengthTo ItcLine index is minimum Value 1 moves, that is, calculatesCheck forMeet If there is x ', then x ' is added to Sh, x is otherwise added to ShAnd keep ShMiddle element ascending order arrangement, calculates againAnd repeat the above steps;Similarly, from max (Sh) start, with step-lengthTo ItcLine index maximum dimx (Ic) mobile, that is, calculateCheck forMeetIf there is x ', then x ' is added to Sh, x is otherwise added to Sh, calculate againLay equal stress on Multiple above-mentioned steps;To SvWith step-lengthDo similar extension.According to ShWith SvThe row and column index included respectively, can be by IcBy this Row and column where a little indexes is split, and the region for splitting gained is defined as map grid, it is defined as follows:<mrow> <msub> <mi>L</mi> <mrow> <msub> <mi>i</mi> <mi>r</mi> </msub> <mo>,</mo> <msub> <mi>i</mi> <mi>c</mi> </msub> </mrow> </msub> <mo>=</mo> <mo>{</mo> <mi>I</mi> <mrow> <mo>(</mo> <mi>x</mi> <mo>,</mo> <mi>y</mi> <mo>)</mo> </mrow> <mo>|</mo> <msub> <mi>x</mi> <msub> <mi>k</mi> <mn>1</mn> </msub> </msub> <mo><</mo> <mi>x</mi> <mo><</mo> <msub> <mi>x</mi> <mrow> <msub> <mi>k</mi> <mn>1</mn> </msub> <mo>+</mo> <mn>1</mn> </mrow> </msub> <mo>,</mo> <msub> <mi>y</mi> <msub> <mi>k</mi> <mn>2</mn> </msub> </msub> <mo><</mo> <mi>y</mi> <mo><</mo> <msub> <mi>y</mi> <mrow> <msub> <mi>k</mi> <mn>2</mn> </msub> <mo>+</mo> <mn>1</mn> </mrow> </msub> <mo>,</mo> <msub> <mi>x</mi> <msub> <mi>k</mi> <mn>1</mn> </msub> </msub> <msub> <mi>x</mi> <mrow> <msub> <mi>k</mi> <mn>1</mn> </msub> <mo>+</mo> <mn>1</mn> </mrow> </msub> <mo>&Element;</mo> <msub> <mi>S</mi> <mi>h</mi> </msub> <mo>,</mo> <msub> <mi>y</mi> <msub> <mi>k</mi> <mn>2</mn> </msub> </msub> <mo>,</mo> <msub> <mi>y</mi> <mrow> <msub> <mi>k</mi> <mn>2</mn> </msub> <mo>+</mo> <mn>1</mn> </mrow> </msub> <mo>&Element;</mo> <msub> <mi>S</mi> <mi>v</mi> </msub> <mo>}</mo> </mrow>Wherein1≤ir≤|Sh| -1 and 1≤ic≤|Sv| -1, therefore IcBe partitioned into (| Sh|-1)·(|Sv|-1) It is aAnd irAnd icIt is respectivelyRow and column index in units of map grid.
- 3. the textile flaw detection method based on peak threshold, rotational alignment and composite character as claimed in claim 2, its It is characterized in that:Step 2 calculates threshold coefficient and entropy threshold specifically includes following steps:For training sample set I1, I2...INWith a f of N 'cSelectable value c1, c2...cm, according to wherein any training sample Ii(i =1,2...N), a preferable line numbers of N ' can be calculated by step 1With a preferable columns of N 'Wherein l=1, 2...N′.In IiMultisetAnd multisetThreshold coefficient f corresponding to the middle most elements of occurrence numberc Value be denoted as c respectivelyh(i, l) and cv(i, l), is defined as follows:For IiIf ch(i, l) and cv(i, l) is identical, then respective index (i, l) is stored in setIn,It is defined as follows:For eachI.e. for IiIf at least there are a l ' so that ch(i, l ') ≡ cv(i, l ') set up, then with med ({cl) closest ch(i, l ') participates in fcCalculating, fcIt is defined as follows:Wherein chThe index of (i, l)Expression, which takes, to be metI values in definition;For training sample set I1, I2...INIn the i-th width image Ii, it is f according to parametercStep 1 calculate IiTransverse projectionAnd longitudinal projectionCount respectively CalculateEntropyWithEntropyFor all training samplesWithThe integer part of the average of these entropys is taken to obtain respectively Threshold value exAnd ey。
- 4. the textile flaw detection method based on peak threshold, rotational alignment and composite character as claimed in claim 3, its It is characterized in that:Step 3 calculates test phase parameter and specifically includes following steps:Step 3.1 calculates the map grid cycle, for training sample set I1, I2...INInA trained sample This Ii, the threshold coefficient calculated according to step 2 is to IiRepeat step 1 can obtain ShAnd Sv, according to ShAnd SvBy IiIt is divided into m × n A map grid (m=| Sh| -1, n=| Sv|-1);I is calculated using HOG feature extracting methodsiMap gridFeature vector and make feature The corresponding map grid index of vector index is identical;CalculateWith i-thrThe Euclidean distance of all map grids in row, as involved by calculating And the column index ascending order arrangement of map grid, then it may make up distance vector;ForWillCorresponding distance vector presses icAscending order is arranged Row obtain i-thrCapable n × n distance matrixs;ForBy i-thrCorresponding n × n the distance matrixs of row press irAscending order arranges to obtain Ii Row distance matrixSimilarly, I can be calculatediColumn distance matrixTo vectorFourier transform is carried out, is obtainedCycle and frequency spectrum;According to(With) cycle and frequency spectrum, calculating cycle median and frequency spectrum median, i.e. image line cycle and video line rate Spectrum;Similarly, I can be builtiColumn distance matrixAnd calculate image column cycle and image column frequency spectrum;According to I1, I2...IN, N number of image line cycle and corresponding N number of image line frequency spectrum can be calculated, calculates image line frequency spectrum medianLook for Go out to be higher thanImage line frequency spectrum corresponding to the image line cycle, calculate the median in these image lines cycleTo image column week Phase and image column frequency spectrum repeat same steps and obtain image column frequency spectrum medianWith image column cycle medianIf OrOrThen t values are 1, otherwise pass through and compareWithCorresponding frequency spectrum size determines the value of t, i.e.,: IfThen t takesOtherwise t takesStep 3.2 calculates the preferable statistical value of each feature of map grid, which includes four sub-steps:Step 3.2.1 calculates feature Statistical value, step 3.2.2 calculate the sequence of characteristic statistics value, and step 3.2.3 calculates invariant feature element, and step 3.2.4 calculates reason Think statistical value;Step 3.2.1 calculates characteristic statistics value, and training sample set I is calculated according to step 3.11, I2...INMap grid cycle t, it is right In i-th of training sample Ii, I is split according to step 2iObtain map gridPass through | T | it is a that (T, which is characterized extracting method title, to be had Ordered sets) input is 2-D gray image matrix and output is one-dimensional real vectorial feature extracting method f1, f2...f|T|Calculate Ii Map gridFeature vectorBased on fjFeature vector length be defined as fjFeature First prime number Fj;According to the map grid in assumed condition and map grid cycle t, IiWith WithTexture Identical and L1,1, L2,1...LT, 1Texture differ, whereinTherefore there are the different map grid of t class textures and theClass map grid is i-thrRow and (ir+l1T) column index of row is identical, therefore the kth that column index is identical Class map grid can be indexed ascending order composition map grid matrix by ranks.For kth class map grid, at most there are t map grid Matrix C1, C2...Ct, according to the map grid of composition map grid matrix, kth class map grid is calculated by following formula and is based on fjIiCharacteristic statistics valueWith<mrow> <msubsup> <mi>r</mi> <mrow> <mi>o</mi> <mi>p</mi> <mi>t</mi> </mrow> <mrow> <mo>(</mo> <mi>i</mi> <mo>,</mo> <mi>j</mi> <mo>,</mo> <mi>k</mi> <mo>)</mo> </mrow> </msubsup> <mo>=</mo> <mfrac> <mn>1</mn> <mi>t</mi> </mfrac> <munder> <mo>&Sigma;</mo> <mrow> <mn>1</mn> <mo>&le;</mo> <msub> <mi>i</mi> <mi>t</mi> </msub> <mo>&le;</mo> <mi>t</mi> </mrow> </munder> <mfenced open = "[" close = "]"> <mtable> <mtr> <mtd> <mrow> <mi>o</mi> <mi>p</mi> <mi>t</mi> <mrow> <mo>(</mo> <msub> <mrow> <mo>{</mo> <msub> <mi>f</mi> <mrow> <mi>j</mi> <mo>,</mo> <mn>1</mn> </mrow> </msub> <mrow> <mo>(</mo> <mi>L</mi> <mo>)</mo> </mrow> <mo>}</mo> </mrow> <mrow> <mi>L</mi> <mo>&Element;</mo> <msub> <mi>C</mi> <msub> <mi>i</mi> <mi>t</mi> </msub> </msub> </mrow> </msub> <mo>)</mo> </mrow> </mrow> </mtd> </mtr> <mtr> <mtd> <mrow> <mi>o</mi> <mi>p</mi> <mi>t</mi> <mrow> <mo>(</mo> <msub> <mrow> <mo>{</mo> <msub> <mi>f</mi> <mrow> <mi>j</mi> <mo>,</mo> <mn>2</mn> </mrow> </msub> <mrow> <mo>(</mo> <mi>L</mi> <mo>)</mo> </mrow> <mo>}</mo> </mrow> <mrow> <mi>L</mi> <mo>&Element;</mo> <msub> <mi>C</mi> <msub> <mi>i</mi> <mi>t</mi> </msub> </msub> </mrow> </msub> <mo>)</mo> </mrow> </mrow> </mtd> </mtr> <mtr> <mtd> <mo>.</mo> </mtd> </mtr> <mtr> <mtd> <mo>.</mo> </mtd> </mtr> <mtr> <mtd> <mo>.</mo> </mtd> </mtr> <mtr> <mtd> <mrow> <mi>o</mi> <mi>p</mi> <mi>t</mi> <mrow> <mo>(</mo> <msub> <mrow> <mo>{</mo> <msub> <mi>f</mi> <mrow> <mi>j</mi> <mo>,</mo> <msub> <mi>F</mi> <mi>j</mi> </msub> </mrow> </msub> <mrow> <mo>(</mo> <mi>L</mi> <mo>)</mo> </mrow> <mo>}</mo> </mrow> <mrow> <mi>L</mi> <mo>&Element;</mo> <msub> <mi>C</mi> <msub> <mi>i</mi> <mi>t</mi> </msub> </msub> </mrow> </msub> <mo>)</mo> </mrow> </mrow> </mtd> </mtr> </mtable> </mfenced> </mrow>WhereinRepresent that map grid L is i-thtA map grid matrixArbitrary element,Expression is based on fj Map grid matrixI-th in the feature vector of middle all elements (map grid)FThe multiset of a element (real number), whereinAnd 1 ≤iF≤Fj, when opt is replaced with mean, std, max or min, thenDefinition is correspondingWithStep 3.2.2 calculates the sequence of characteristic statistics value, calculates training sample I1, I2...INBetween be based on fj'sIt is European away from From average value d (j), it is defined as follows:<mrow> <mi>d</mi> <mrow> <mo>(</mo> <mi>j</mi> <mo>)</mo> </mrow> <mo>=</mo> <msubsup> <mi>&Sigma;</mi> <mrow> <msup> <mi>i</mi> <mo>&prime;</mo> </msup> <mo>=</mo> <mn>1</mn> </mrow> <mrow> <mi>N</mi> <mo>-</mo> <mn>1</mn> </mrow> </msubsup> <mfrac> <mrow> <mo>|</mo> <mo>|</mo> <msubsup> <mi>r</mi> <mrow> <mi>m</mi> <mi>e</mi> <mi>a</mi> <mi>n</mi> </mrow> <mrow> <mo>(</mo> <msup> <mi>i</mi> <mo>&prime;</mo> </msup> <mo>,</mo> <mi>j</mi> <mo>,</mo> <mn>1</mn> <mo>)</mo> </mrow> </msubsup> <mo>-</mo> <msubsup> <mi>r</mi> <mrow> <mi>m</mi> <mi>e</mi> <mi>a</mi> <mi>n</mi> </mrow> <mrow> <mo>(</mo> <msup> <mi>i</mi> <mo>&prime;</mo> </msup> <mo>+</mo> <mn>1</mn> <mo>,</mo> <mi>j</mi> <mo>,</mo> <mn>1</mn> <mo>)</mo> </mrow> </msubsup> <mo>|</mo> <msub> <mo>|</mo> <mn>2</mn> </msub> </mrow> <mrow> <mi>N</mi> <mo>-</mo> <mn>1</mn> </mrow> </mfrac> </mrow>For f1, f2...f|T|, it can obtain corresponding d (1), d (2) ... d (| T |);For kth class map grid texture and j-th of feature Extracting method fj(i.e. fixed indices k and j), according to I1, I2...IN, step 3.2.1 can produce N number ofUsing clustering algorithm To N number ofClustered, clustering algorithm classification parameter is set to t, obtains t class centerForCalculate according to the following formula fromClass label u corresponding to nearest class center*;<mrow> <msup> <mi>u</mi> <mo>*</mo> </msup> <mo>=</mo> <mi>arg</mi> <mi> </mi> <msub> <mi>min</mi> <mrow> <mn>1</mn> <mo>&le;</mo> <mi>u</mi> <mo>&le;</mo> <mi>t</mi> </mrow> </msub> <msqrt> <mrow> <mo>|</mo> <mo>|</mo> <msubsup> <mi>r</mi> <mrow> <mi>m</mi> <mi>e</mi> <mi>a</mi> <mi>n</mi> </mrow> <mrow> <mo>(</mo> <mi>i</mi> <mo>,</mo> <mi>j</mi> <mo>,</mo> <mi>k</mi> <mo>)</mo> </mrow> </msubsup> <mo>-</mo> <msubsup> <mi>S</mi> <mrow> <mi>j</mi> <mo>,</mo> <mi>k</mi> </mrow> <mrow> <mo>(</mo> <mi>u</mi> <mo>)</mo> </mrow> </msubsup> <mo>|</mo> <msub> <mo>|</mo> <mn>2</mn> </msub> </mrow> </msqrt> </mrow>IfWhereinRepresent that there is the class center of most element numbers in the classification that t clustering algorithm produces, then Exchange characteristic statistics value determined by index (i, j, k) and index (i, j, k*) determined by characteristic statistics value, wherein k*Definition is such as Under:<mrow> <msup> <mi>k</mi> <mo>*</mo> </msup> <mo>=</mo> <mi>arg</mi> <mi> </mi> <msub> <mi>min</mi> <mrow> <mn>1</mn> <mo>&le;</mo> <mi>k</mi> <mo>&le;</mo> <mi>t</mi> </mrow> </msub> <msqrt> <mrow> <mo>|</mo> <mo>|</mo> <msubsup> <mi>r</mi> <mrow> <mi>m</mi> <mi>e</mi> <mi>a</mi> <mi>n</mi> </mrow> <mrow> <mo>(</mo> <mi>i</mi> <mo>,</mo> <mi>j</mi> <mo>,</mo> <mi>k</mi> <mo>)</mo> </mrow> </msubsup> <mo>-</mo> <msubsup> <mi>S</mi> <mrow> <mi>j</mi> <mo>,</mo> <mi>k</mi> </mrow> <mrow> <mo>(</mo> <msubsup> <mi>u</mi> <mrow> <mi>m</mi> <mi>a</mi> <mi>x</mi> </mrow> <mrow> <mo>(</mo> <mi>k</mi> <mo>)</mo> </mrow> </msubsup> <mo>)</mo> </mrow> </msubsup> <mo>|</mo> <msub> <mo>|</mo> <mn>2</mn> </msub> </mrow> </msqrt> </mrow>All fixed Combinations for indexing k and j, for eachRepeat above-mentionedu*With's Calculate and judgeWhether set up, k is repeated if setting up*Calculating and exchange determined by index (i, j, k) feature and unite Evaluation and index (i, j, k*) determined by characteristic statistics value;According to the definition of d (j), training sample I is calculated again1, I2...IN Between be based on fj'sEuclidean distance average value, obtain corresponding f1, f2...f|T|D ' (1), d ' (2) ... d ' (| T |). If d (j) >=d ' (j) forAll set up, then retain features described above statistical value and exchange as a result, otherwise characteristic statistics value sorts extensive The state at the end of step 3.2.1 is arrived again;Step 3.2.3 calculates invariant feature element, for kth class map grid texture and j-th of feature extracting method fj(i.e. fixed rope Draw k and j), according to above-mentioned steps and I1, I2...INWhat is calculated is N number of A elementWithI-thFA elementKth class map grid texture can be calculated and be based on fjFeature vector i-thFA member The stationary value s of element(j, k)(iF), it is defined as follows:<mrow> <msub> <mi>s</mi> <mrow> <mo>(</mo> <mi>j</mi> <mo>,</mo> <mi>k</mi> <mo>)</mo> </mrow> </msub> <mrow> <mo>(</mo> <msub> <mi>i</mi> <mi>F</mi> </msub> <mo>)</mo> </mrow> <mo>=</mo> <mfrac> <mrow> <msubsup> <mi>&Sigma;</mi> <mrow> <mi>i</mi> <mo>=</mo> <mn>1</mn> </mrow> <mi>N</mi> </msubsup> <msubsup> <mi>r</mi> <mrow> <mi>s</mi> <mi>t</mi> <mi>d</mi> </mrow> <mrow> <mo>(</mo> <mi>i</mi> <mo>,</mo> <mi>j</mi> <mo>,</mo> <mi>k</mi> <mo>)</mo> </mrow> </msubsup> <mrow> <mo>(</mo> <msub> <mi>i</mi> <mi>F</mi> </msub> <mo>)</mo> </mrow> </mrow> <mrow> <msubsup> <mi>&Sigma;</mi> <mrow> <mi>i</mi> <mo>=</mo> <mn>1</mn> </mrow> <mi>N</mi> </msubsup> <msubsup> <mi>r</mi> <mrow> <mi>m</mi> <mi>e</mi> <mi>a</mi> <mi>n</mi> </mrow> <mrow> <mo>(</mo> <mi>i</mi> <mo>,</mo> <mi>j</mi> <mo>,</mo> <mi>k</mi> <mo>)</mo> </mrow> </msubsup> <mrow> <mo>(</mo> <msub> <mi>i</mi> <mi>F</mi> </msub> <mo>)</mo> </mrow> </mrow> </mfrac> </mrow>By s(j, k)(iF) by index iFAscending order arrangement then obtains kth class map grid texture and is based on fjStationary value vector s(j, k);If parameter nfRepresent predefined minimal characteristic vector length, then work as nf< FjDuring establishment, using self-adaption cluster algorithm to s(j, k)(1), s(j, k)(2)...s(j, k)(Fj) clustered, if by the classification that self-adaption cluster algorithm produces by the positive integer since 1 successively Numbering, i-thFA stationary value s(j, k)(iF) generic numbering be denoted as Ls(iF), then these number definition set Ls;If definition is pre- Setting parameter minimal characteristic numberThen kth class map grid texture is based on fjFeature vector i-thFThe stability of a element It is defined as follows:<mrow> <msubsup> <mi>s</mi> <mrow> <mo>(</mo> <mi>j</mi> <mo>,</mo> <mi>k</mi> <mo>)</mo> </mrow> <mo>*</mo> </msubsup> <mrow> <mo>(</mo> <msub> <mi>i</mi> <mi>F</mi> </msub> <mo>)</mo> </mrow> <mo>=</mo> <mfenced open = "{" close = ""> <mtable> <mtr> <mtd> <mrow> <munder> <mo>&Sigma;</mo> <mrow> <msub> <mi>i</mi> <mi>s</mi> </msub> <mo>&Element;</mo> <msubsup> <mi>L</mi> <mi>s</mi> <mo>*</mo> </msubsup> </mrow> </munder> <mi>&delta;</mi> <mrow> <mo>(</mo> <msub> <mi>L</mi> <mi>s</mi> </msub> <mo>(</mo> <msub> <mi>i</mi> <mi>F</mi> </msub> <mo>)</mo> <mo>-</mo> <msub> <mi>i</mi> <mi>s</mi> </msub> <mo>)</mo> </mrow> <mo>,</mo> </mrow> </mtd> <mtd> <mrow> <msub> <mi>n</mi> <mi>f</mi> </msub> <mo><</mo> <mo>|</mo> <msub> <mi>L</mi> <mi>s</mi> </msub> <mo>|</mo> </mrow> </mtd> </mtr> <mtr> <mtd> <mrow> <mn>1</mn> <mo>,</mo> </mrow> </mtd> <mtd> <mrow> <msub> <mi>n</mi> <mi>f</mi> </msub> <mo>&GreaterEqual;</mo> <mo>|</mo> <msub> <mi>L</mi> <mi>s</mi> </msub> <mo>|</mo> </mrow> </mtd> </mtr> </mtable> </mfenced> </mrow>Represent the preceding n for arranging the classification that self-adaption cluster algorithm produces by its number of elements descendingfThe numbering of a classification Set;WillBy index iFAscending order arrangement then obtains kth class map grid texture and is based on fjStability vectorFor rope Draw all fixed Combinations of k and j, repeat above-mentionedCalculating;Step 3.2.4 calculates preferable statistical value, for kth class map grid texture and j-th of feature extracting method fj(i.e. fixed indices k And j), according to above-mentioned steps and I1, I2...INIt can calculateWithCalculated by self-adaption cluster Method, can be to vector Clustered, if self-adaption cluster algorithm is produced Raw classification is by the positive integer number consecutively since 1 and i-th of vectorGeneric numbering is denoted as Then these number definition setFor A classification, kth class map grid texture Based on fjPreferable statistical valueIt is defined as follows:<mrow> <msubsup> <mi>r</mi> <mrow> <msup> <mi>mean</mi> <mo>*</mo> </msup> </mrow> <mrow> <mo>(</mo> <mi>j</mi> <mo>,</mo> <mi>k</mi> <mo>,</mo> <msub> <mi>i</mi> <mi>u</mi> </msub> <mo>)</mo> </mrow> </msubsup> <mo>=</mo> <munder> <mo>&Sigma;</mo> <mrow> <mn>1</mn> <mo>&le;</mo> <msup> <mi>i</mi> <mo>*</mo> </msup> <mo>&le;</mo> <mi>N</mi> </mrow> </munder> <mfrac> <mrow> <msubsup> <mi>r</mi> <mrow> <mi>m</mi> <mi>e</mi> <mi>a</mi> <mi>n</mi> </mrow> <mrow> <mo>(</mo> <msup> <mi>i</mi> <mo>*</mo> </msup> <mo>,</mo> <mi>j</mi> <mo>,</mo> <mi>k</mi> <mo>)</mo> </mrow> </msubsup> <mo>&CenterDot;</mo> <mi>&delta;</mi> <mrow> <mo>(</mo> <msub> <mi>L</mi> <mrow> <mi>s</mi> <mi>r</mi> </mrow> </msub> <mo>(</mo> <msup> <mi>i</mi> <mo>*</mo> </msup> <mo>)</mo> <mo>-</mo> <msubsup> <mi>u</mi> <mrow> <mi>s</mi> <mi>r</mi> </mrow> <mrow> <mo>(</mo> <mi>j</mi> <mo>,</mo> <mi>k</mi> <mo>)</mo> </mrow> </msubsup> <mo>(</mo> <msub> <mi>i</mi> <mi>u</mi> </msub> <mo>)</mo> <mo>)</mo> </mrow> </mrow> <mrow> <msub> <mi>&Sigma;</mi> <mrow> <mn>1</mn> <mo>&le;</mo> <mi>i</mi> <mo>&le;</mo> <mi>N</mi> </mrow> </msub> <mi>&delta;</mi> <mrow> <mo>(</mo> <msub> <mi>L</mi> <mrow> <mi>s</mi> <mi>r</mi> </mrow> </msub> <mo>(</mo> <mi>i</mi> <mo>)</mo> <mo>-</mo> <msubsup> <mi>u</mi> <mrow> <mi>s</mi> <mi>r</mi> </mrow> <mrow> <mo>(</mo> <mi>j</mi> <mo>,</mo> <mi>k</mi> <mo>)</mo> </mrow> </msubsup> <mo>(</mo> <msub> <mi>i</mi> <mi>u</mi> </msub> <mo>)</mo> <mo>)</mo> </mrow> </mrow> </mfrac> </mrow>Expression belongs to kth class map grid texture and is based on fjI-thuAverage is flat in the characteristic statistics value of a subclass map grid texture Average.All fixed Combinations for indexing k and j, repeat above-mentionedCalculating;Step 3.3 calculates the preferable statistical value threshold value of each feature, according to training sample set and above-mentioned steps, can calculate based on jth A feature extracting method fjKth class map grid texture i-thuThe preferable statistical value of a subclass map grid texture(i.e. fixed rope Draw j, k and iu);Any map grid L produced for any training sample by step 2, according to its feature vector fj(L) count as the following formula Calculate preferable statistical value index k*With<mrow> <msup> <mi>k</mi> <mo>*</mo> </msup> <mo>,</mo> <msubsup> <mi>i</mi> <mi>u</mi> <mo>*</mo> </msubsup> <mo>=</mo> <munder> <munder> <mrow> <mi>arg</mi> <mi> </mi> <mi>m</mi> <mi>i</mi> <mi>n</mi> </mrow> <mrow> <mn>1</mn> <mo>&le;</mo> <mi>k</mi> <mo>&le;</mo> <mi>t</mi> </mrow> </munder> <mrow> <mn>1</mn> <mo>&le;</mo> <msub> <mi>i</mi> <mi>u</mi> </msub> <mo>&le;</mo> <msub> <mi>U</mi> <mrow> <mo>(</mo> <mi>j</mi> <mo>,</mo> <mi>k</mi> <mo>)</mo> </mrow> </msub> </mrow> </munder> <mo>|</mo> <mo>|</mo> <msub> <mi>f</mi> <mi>j</mi> </msub> <mrow> <mo>(</mo> <mi>L</mi> <mo>)</mo> </mrow> <mo>-</mo> <msubsup> <mi>r</mi> <mrow> <msup> <mi>mean</mi> <mo>*</mo> </msup> </mrow> <mrow> <mo>(</mo> <mi>j</mi> <mo>,</mo> <mi>k</mi> <mo>,</mo> <msub> <mi>i</mi> <mi>u</mi> </msub> <mo>)</mo> </mrow> </msubsup> <mo>|</mo> <msub> <mo>|</mo> <mn>2</mn> </msub> </mrow>ForThere may be multiple L, its preferable statistical value index meets k*=k andThese map grids composition setWhenDuring establishment, of the kth class map grid texture based on j-th of feature extracting method can be calculated as follows iuThe ultimate range of a subclass map grid textureI.e. preferable statistical value threshold value:For indexing j, k and iuAll fixed Combinations, repeat it is above-mentionedCalculating.
- 5. the textile flaw detection method based on peak threshold, rotational alignment and composite character as claimed in claim 4, its It is characterized in that:The identification of step 6 flaw specifically includes:To any map grid of test sampleAccording to feature extracting method f1, f2...f|T|Calculate feature vectorFor fjThe feature vector of calculatingAccording to step Rapid 3.2 and step 3.3 calculate preferable statistical value index k*With WithIf ThenLabeled as there is flaw, otherwise labeled as indefectible;When all map grids are based on fjMark terminate, inspection each have flaw Map grid Ll8 face domainThe mark of interior map grid, if in the presence of map grid of having no timeThen judge Whether set up, marked if setting upTo have flaw and makingAnd d is calculated as followsl+1, continue checking for The mark of interior map grid simultaneously repeats the above steps until dl+1ForWherein,Wherein threshold coefficient0 < γ≤1,L1Expression is based on fjMark terminate obtain have free time map grid; When dynamic threshold isWhen, it is testing result all to have the ranks index that free time map grid includes pixel.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711188161.8A CN107945164B (en) | 2017-11-24 | 2017-11-24 | Textile flaw detection method based on peak threshold, rotational alignment and composite character |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711188161.8A CN107945164B (en) | 2017-11-24 | 2017-11-24 | Textile flaw detection method based on peak threshold, rotational alignment and composite character |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107945164A true CN107945164A (en) | 2018-04-20 |
CN107945164B CN107945164B (en) | 2019-07-26 |
Family
ID=61948619
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201711188161.8A Active CN107945164B (en) | 2017-11-24 | 2017-11-24 | Textile flaw detection method based on peak threshold, rotational alignment and composite character |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107945164B (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108717069A (en) * | 2018-05-29 | 2018-10-30 | 电子科技大学 | A kind of high-pressure bottle thermal imaging imperfection detection method based on the segmentation of row variable step |
CN108765401A (en) * | 2018-05-29 | 2018-11-06 | 电子科技大学 | A kind of thermal imaging testing method based on ranks variable step segmentation and region-growing method |
CN109886952A (en) * | 2019-02-25 | 2019-06-14 | 京东方科技集团股份有限公司 | A kind of screen defect point detecting method and its device, computer-readable medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101976440A (en) * | 2010-11-09 | 2011-02-16 | 东华大学 | Sobel operator-based extraction method of profile and detail composite characteristic vector used for representing fabric texture |
CN106770323A (en) * | 2016-12-15 | 2017-05-31 | 常州大学 | Based on the textile flaw detection method that hierarchical clustering and Gabor are filtered |
CN107248152A (en) * | 2017-05-18 | 2017-10-13 | 常州大学 | Textile flaw detection method based on class grid pattern and its area features |
CN107274385A (en) * | 2017-05-18 | 2017-10-20 | 常州大学 | Textile flaw detection method based on class grid pattern and its Gabor characteristic |
-
2017
- 2017-11-24 CN CN201711188161.8A patent/CN107945164B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101976440A (en) * | 2010-11-09 | 2011-02-16 | 东华大学 | Sobel operator-based extraction method of profile and detail composite characteristic vector used for representing fabric texture |
CN106770323A (en) * | 2016-12-15 | 2017-05-31 | 常州大学 | Based on the textile flaw detection method that hierarchical clustering and Gabor are filtered |
CN107248152A (en) * | 2017-05-18 | 2017-10-13 | 常州大学 | Textile flaw detection method based on class grid pattern and its area features |
CN107274385A (en) * | 2017-05-18 | 2017-10-20 | 常州大学 | Textile flaw detection method based on class grid pattern and its Gabor characteristic |
Non-Patent Citations (2)
Title |
---|
李冠志: "基于机器视觉的织物瑕疵实时自动检测平台研究", 《中国优秀硕士学位论文全文数据库 工程科技Ⅰ辑》 * |
粱久祯等: "基于相似关系的纺织品瑕疵检测方法", 《模式识别与人工智能》 * |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108717069A (en) * | 2018-05-29 | 2018-10-30 | 电子科技大学 | A kind of high-pressure bottle thermal imaging imperfection detection method based on the segmentation of row variable step |
CN108765401A (en) * | 2018-05-29 | 2018-11-06 | 电子科技大学 | A kind of thermal imaging testing method based on ranks variable step segmentation and region-growing method |
CN108717069B (en) * | 2018-05-29 | 2020-08-11 | 电子科技大学 | High-pressure container thermal imaging defect detection method based on line variable step length segmentation |
CN109886952A (en) * | 2019-02-25 | 2019-06-14 | 京东方科技集团股份有限公司 | A kind of screen defect point detecting method and its device, computer-readable medium |
Also Published As
Publication number | Publication date |
---|---|
CN107945164B (en) | 2019-07-26 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107274385A (en) | Textile flaw detection method based on class grid pattern and its Gabor characteristic | |
CN107705306B (en) | Fabric defect detection method based on multi-feature matrix low-rank decomposition | |
CN107248152A (en) | Textile flaw detection method based on class grid pattern and its area features | |
CN106770323B (en) | The textile flaw detection method filtered based on hierarchical clustering and Gabor | |
CN105678788B (en) | A kind of fabric defect detection method based on HOG and low-rank decomposition | |
CN106780485A (en) | SAR image change detection based on super-pixel segmentation and feature learning | |
CN103955940B (en) | A kind of detection method of the human body cache based on X ray backscatter images | |
CN104282008B (en) | The method and apparatus that Texture Segmentation is carried out to image | |
CN105654121A (en) | Complex jacquard fabric defect detection method based on deep learning | |
CN107945164A (en) | Textile flaw detection method based on peak threshold, rotational alignment and composite character | |
CN106023098B (en) | Image mending method based on the more dictionary learnings of tensor structure and sparse coding | |
CN109949287A (en) | A kind of fabric defects detection method based on adaptivenon-uniform sampling and template correction | |
WO2009120263A2 (en) | System and method for illumination invariant image segmentation | |
CN103218832A (en) | Visual saliency algorithm based on overall color contrast ratio and space distribution in image | |
CN111862027B (en) | Textile flaw detection method based on low-rank sparse matrix decomposition | |
CN109886937A (en) | Defects of insulator detection method based on super-pixel segmentation image recognition | |
CN111091134A (en) | Method for identifying tissue structure of colored woven fabric based on multi-feature fusion | |
CN107895371A (en) | Textile flaw detection method based on peak value coverage values and Gabor characteristic | |
CN116109849A (en) | SURF feature matching-based high-voltage isolating switch positioning and state identification method | |
CN113689431B (en) | Industrial product appearance defect detection method and device | |
Krishnan et al. | Performance analysis of texture classification techniques using shearlet transform | |
CN104239411B (en) | A kind of detection method of the lattice-shaped radar based on color, position cluster and Corner Detection | |
CN107977961A (en) | Textile flaw detection method based on peak value coverage values and composite character | |
Bao et al. | Low-rank decomposition fabric defect detection based on prior and total variation regularization | |
CN101976441A (en) | Method for extracting Sobel operator filtering profile for representing fabric texture and fractal detail mixed characteristic vector |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
EE01 | Entry into force of recordation of patent licensing contract |
Application publication date: 20180420 Assignee: Shandong Hongde Yuheng Information Technology Co.,Ltd. Assignor: CHANGZHOU University Contract record no.: X2023980051060 Denomination of invention: Textile defect detection method based on peak threshold, rotation calibration, and mixed features Granted publication date: 20190726 License type: Common License Record date: 20231209 |
|
EE01 | Entry into force of recordation of patent licensing contract |