CN109035195A - A kind of fabric defect detection method - Google Patents

A kind of fabric defect detection method Download PDF

Info

Publication number
CN109035195A
CN109035195A CN201810433675.3A CN201810433675A CN109035195A CN 109035195 A CN109035195 A CN 109035195A CN 201810433675 A CN201810433675 A CN 201810433675A CN 109035195 A CN109035195 A CN 109035195A
Authority
CN
China
Prior art keywords
value
image
formula
filtering
fabric
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
Application number
CN201810433675.3A
Other languages
Chinese (zh)
Other versions
CN109035195B (en
Inventor
胡峰
徐启永
王传桐
吴雨川
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuhan Textile University
Original Assignee
Wuhan Textile University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuhan Textile University filed Critical Wuhan Textile University
Priority to CN201810433675.3A priority Critical patent/CN109035195B/en
Publication of CN109035195A publication Critical patent/CN109035195A/en
Application granted granted Critical
Publication of CN109035195B publication Critical patent/CN109035195B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/84Systems specially adapted for particular applications
    • G01N21/88Investigating the presence of flaws or contamination
    • G01N21/8851Scan or image signal processing specially adapted therefor, e.g. for scan signal adjustment, for detecting different kinds of defects, for compensating for structures, markings, edges
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/136Segmentation; Edge detection involving thresholding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/187Segmentation; Edge detection involving region growing; involving region merging; involving connected component labelling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • G06T7/62Analysis of geometric attributes of area, perimeter, diameter or volume
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20024Filtering details
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30108Industrial image inspection
    • G06T2207/30124Fabrics; Textile; Paper

Abstract

A kind of fabric defect detection method, comprising the following steps: the first step, Pixel Dimensions calibration;Step 2: image filtering;Step 3: calculating variance ratio;Step 4: drawingh‑MBSFCurve;Step 5: obtaining straight line fitting equation;Step 6: calculating optimal filter parameterh;Step 7: significant and normalized;Step 8: calculating segmentation threshold;Step 9: carrying out defect segmentation;Step 10: calculating fault area;Step 11: eliminating pseudo- fault.The design can not only detect low contrast picture, and universality is strong, and can effectively exclude pseudo- fault, further improve the accuracy of defect detection.

Description

A kind of fabric defect detection method
Technical field
The present invention relates to a kind of fabric defect detection methods, and it is particularly applicable to improve the discrimination of fault and improve frequency tune The universality of humorous significant algorithm.
Background technique
The accuracy rate of artificial detection fabric defects is only 60%~70%, it is difficult to meet industrial production demand.It is knitted to improve The precision of object defect detection, scholars propose the method for many defect detections, can be divided mainly into three classes: statistical method, frequency spectrum Method and model method.
Defect detection method based on statistics, is trained study to similar fault-free fabric first, and extraction is knitted without fault The textural characteristics of object realize the detection in fabric defects region to obtain the judgment threshold of defect regions, such method is simply easy Row, but influence of the testing result vulnerable to the factors such as cloth textured structure and fault shape, may generate small defect regions The case where missing inspection.Defect detection method based on frequency spectrum, transforms to frequency domain for textile image first, then quasi- using certain energy Then texture feature extraction realizes the detection in fabric defects region, such method is in the case where selecting suitable filter group, energy It is good to detect defect regions, but need similar fault sample to be learnt when selecting filter parameter, it is unfavorable for industry Detection.Defect detection method based on model, the texture for being first depending on similar fault-free fabric establish model, then pass through statistics Hypothesis testing differentiates whether test image meets the model, realizes the detection in fabric defects region, but such method it is more complicated, Computationally intensive and on-line study is relatively difficult, and detection effect is poor.In recent years, significant method has been applied to the fault of fabric In detection, and achieve certain research achievement.
The significant algorithm of frequency tuning (abbreviation FT method) that Achanta et al. is proposed uses Gassian low-pass filter pair first Image is pre-processed;Then, pretreated image is transformed into Lab color space, from the angle of frequency domain, is calculated The Euclidean distance of single pixel and entire image average value in each Color Channel of image;Finally by the Euclidean distance in 3 channels With the saliency value as the pixel.It can effectively be kept with notable figure that is simple, generating is calculated with original image resolution phase Sihe The advantages of target area integrality, conducive to the raising of succeeding target segmentation precision.But FT method is applied to fabric defects point When cutting, exist for difficult with the lesser defects identification of fabric background area differentiation in brightness, and wherein Gaussian filter is deposited It is weak poor with noise reduction capability in smoothing capability, and the shortcomings that easy fuzzy fault edge.
Improve the significant algorithm of frequency tuning replaces the Gauss in FT method to filter using optimal non-local mean filtering device (NLM) The problem of then wave device is split textile image using Otsu dividing method, can effectively solve FT algorithm, and it is fast The fast defect regions for being accurately partitioned into fabric, but using when averagely maximum between-cluster variance optimizes the filtering parameter h of NLM filter It needs to be learnt using fault sample and required fault and background area to have certain to degree of comparison, is needed when Otsu method is divided Wanting fault target and background area, there are bimodalities on grey level histogram, and the fabric figure of unimodality is showed to grey level histogram As detection difficult, it is unfavorable for industrial detection.
Summary of the invention
The purpose of the present invention is overcoming the problems, such as that defect detection accuracy existing in the prior art is low, the scope of application is small, Provide that a kind of defect detection accuracy is high, fabric defect detection method applied widely.
In order to achieve the above object, the technical solution of the invention is as follows:
A kind of fabric defect detection method, comprising the following steps:
Step 1: image pixel dimensions are demarcated, the size and area of its single pixel on every picture are calculated;
Step 2: image filtering, takes n normal fabric pictures to be detected, above-mentioned picture is RGB color, enables figure As being f={ f (i) | i ∈ I }, i is pixel in formula, and I is search window;
Filtering parameter h is enabled to be respectively equal to 1,2,3 ... ..., 50, using formula (1) and formula (2) respectively to every normal texture figure Piece carries out non-local mean filtering:
In above formula: fNIt (i) is gray value of the pixel i after non-local mean filtering, f (j) is pixel in search window The gray value of point j, pixel i, j corresponding weight when ω (i, j) is weighted average;For pixel i, j Square of the weighted euclidean distance of the similar window N (i) of corresponding rectangle and N (j), α are the standard deviation of gaussian kernel function, and α is equal to 1;
Step 3: calculating variance ratio, gray scale side of the every normal fabric image before filtering is calculated separately according to formula (3) Difference sigmainWith the variance yields σ of normal fabric gray value of image after filteringout
In formula (3): σ indicates the variance of normal fabric gray value of image, xiFor i-th of gray value of normal textile image, μ For the average value of normal fabric picture gray value, n indicates that normal fabric image has n gray value;
The preceding ratio with variance after filtering of filtering is calculated according to formula (4):
Every picture has tri- Color Channels of R, G and B, therefore every picture has the variance ratio of tri- Color Channels of R, G, B Value, respectively BSFR, BSFGAnd BSFB
Step 4: h-MBSF curve is drawn, according to the variance ratio BSF for three Color Channels that third step is calculatedR, BSFGAnd BSFBCount corresponding average variance ratio under different filtering parameter h values:
The curve graph of average variance ratio and filtering parameter h, i.e. h-MBSF curve graph are drawn, n is normal fabric picture Quantity;
Step 5: obtaining straight line fitting equation, straight line descending branch in h-MBSF curve is intended using least square method Conjunction obtains straight line fitting equation, such as following formula:
A × h+B × MBSF+C=0 (6)
In formula, A, B, C are constant;
Step 6: calculating optimal filter parameter h, calculates each o'clock in h-MBSF curve transition and be fitted directly into the 5th step The vertical range d of line, such as following formula:
When the value range of d is 0.2~0.8, select filtering parameter h corresponding to the smallest point of d value as optimal value, The corresponding points meet A × h+B × MBSF+C value greater than zero simultaneously;
Step 7: significant and normalized, is transformed into Lab color space meter for texture image after the filtering in second step Saliency value S is calculated, such as following formula:
S=| | Iu-INLM|| (8)
In formula (8): IuPixel arithmetic mean of instantaneous value for textile image in Lab color space, INLMFor non-local mean filtering Image afterwards;║ ║ is Euclidean distance formula;
Saliency value S is normalized, such as following formula:
Saliency value S is normalized in 0~255 range and its value is rounded, the saliency value G after being normalized;
Step 8: calculating segmentation threshold, saliency value is arranged by ascending order, when the saliency value of fabric notable figure obeys normal state point When cloth, corresponding saliency value is as segmentation threshold T when taking the probability of saliency value not less than 95%i, every fabric picture can obtain To its corresponding segmentation threshold;Finally, taking TiIn segmentation threshold of the intermediate value as such defect image, such as following formula:
Step 9: carrying out defect segmentation, formula (1) is brought into using optimal filter parameter h obtained in the 6th step and formula (2) is right Picture to be detected is filtered, and the picture obtained after filtering carries out to the 7th step is significant and normalized, then uses the 8th It walks obtained threshold value T and carries out defect segmentation according to formula (11);
G (i) in formula (11) indicates that i-th of element in G, G are the saliency value after normalizing obtained in the 7th step;
Step 10: calculating fault area, pixel number P in the eight connected region that pixel value is 1 in bianry image is calculated, is allowed P is multiplied with the point area of single pixel obtained in the first step, then P continuous image vegetarian refreshments can represent defect regions area;
Step 11: eliminating pseudo- fault, pseudo- fault is eliminated using segmentation threshold M and formula (12), obtains final segmentation figure Picture F, such as following formula:
Threshold value M takes 0.5mm × 0.5mm;Gray value is 0 in image after segmentation, then it is assumed that is not deposited in textile image In fault;It is on the contrary, then it is assumed that there are faults in image, can completely obtain defect segmentation result: binary map by handling above The region that middle gray value is 1 is defect regions, and the region that gray value is 0 is fabric normal segments;Defect detection is completed at this time.
Compared with prior art, the invention has the benefit that
1, using the variance ratio of normal fabric filtering front and back in a kind of fabric defect detection method of the present invention, as filtering The Optimality Criteria of parameter h can accurately obtain optimal filter parameter h.The picture low for contrast also can be good at realizing defect Point detection, to improve this detection method accuracy rate.Therefore, the present invention is able to detect low contrast picture, and universality is strong, detection Accuracy rate is high.
2, a kind of fabric defect detection method of the present invention is filtered picture to be optimized, is obtained by optimization filtering parameter h To the preferable textile image of segmentation effect, defect segmentation is carried out to it, effectively increases the accuracy rate of segmentation.Therefore the present invention point Cut accuracy rate height, defect detection high reliablity.
3, in a kind of fabric defect detection method of the present invention, by calculating the eight connected region that pixel value is 1 in bianry image Interior contiguous pixels point quantity indicates defect regions area, to exclude pseudo- fault, further improves the accuracy of defect detection. Therefore, the present invention can effectively exclude pseudo- fault, further improve the accuracy of defect detection.
Detailed description of the invention
Fig. 1 is the relation curve of the variance ratio of tri- Color Channels of R, G, B and filtering parameter h in third step of the present invention Figure.
Fig. 2 is h-MBSF curve graph in the 4th step of the invention.
Fig. 3 is the method for the present invention and the contrast effect figure for improving the significant algorithm progress defect detection of frequency tuning.
Fig. 4 is the style of shooting schematic diagram of fabric picture of the present invention.
Specific embodiment
Below in conjunction with Detailed description of the invention and specific embodiment, the present invention is described in further detail.
Referring to Fig. 1 to Fig. 2, a kind of fabric defect detection method, comprising the following steps:
Step 1: image pixel dimensions are demarcated, the size and area of its single pixel on every picture are calculated;
Step 2: image filtering, takes n normal fabric pictures to be detected, above-mentioned picture is RGB color, enables figure As being f={ f (i) | i ∈ I }, i is pixel in formula, and I is search window;
Filtering parameter h is enabled to be respectively equal to 1,2,3 ... ..., 50, using formula (1) and formula (2) respectively to every normal texture figure Piece carries out non-local mean filtering:
In above formula: fNIt (i) is gray value of the pixel i after non-local mean filtering, f (j) is pixel in search window The gray value of point j, pixel i, j corresponding weight when ω (i, j) is weighted average;For pixel i, j Square of the weighted euclidean distance of the similar window N (i) of corresponding rectangle and N (j), α are the standard deviation of gaussian kernel function, and α is equal to 1;
Step 3: calculating variance ratio, gray scale side of the every normal fabric image before filtering is calculated separately according to formula (3) Difference sigmainWith the variance yields σ of normal fabric gray value of image after filteringout
In formula (3): σ indicates the variance of normal fabric gray value of image, xiFor i-th of gray value of normal textile image, μ For the average value of normal fabric picture gray value, n indicates that normal fabric image has n gray value;
The preceding ratio with variance after filtering of filtering is calculated according to formula (4):
Every picture has tri- Color Channels of R, G and B, therefore every picture has the variance ratio of tri- Color Channels of R, G, B Value, respectively BSFR, BSFGAnd BSFB
Step 4: h-MBSF curve is drawn, according to the variance ratio BSF for three Color Channels that third step is calculatedR, BSFGAnd BSFBCount corresponding average variance ratio under different filtering parameter h values:
The curve graph of average variance ratio and filtering parameter h, i.e. h-MBSF curve graph are drawn, n is normal fabric picture Quantity;
Step 5: obtaining straight line fitting equation, straight line descending branch in h-MBSF curve is intended using least square method Conjunction obtains straight line fitting equation, such as following formula:
A × h+B × MBSF+C=0 (6)
In formula, A, B, C are constant;
Step 6: calculating optimal filter parameter h, calculates each o'clock in h-MBSF curve transition and be fitted directly into the 5th step The vertical range d of line, such as following formula:
When the value range of d is 0.2~0.8, select filtering parameter h corresponding to the smallest point of d value as optimal value, The corresponding points meet A × h+B × MBSF+C value greater than zero simultaneously;
Step 7: significant and normalized, is transformed into Lab color space meter for texture image after the filtering in second step Saliency value S is calculated, such as following formula:
S=| | Iu-INLM|| (8)
In formula (8): IuPixel arithmetic mean of instantaneous value for textile image in Lab color space, INLMFor non-local mean filtering Image afterwards;║ ║ is Euclidean distance formula;
Saliency value S is normalized, such as following formula:
Saliency value S is normalized in 0~255 range and its value is rounded, the saliency value G after being normalized;
Step 8: calculating segmentation threshold, saliency value is arranged by ascending order, when the saliency value of fabric notable figure obeys normal state point When cloth, corresponding saliency value is as segmentation threshold T when taking the probability of saliency value not less than 95%i, every fabric picture can obtain To its corresponding segmentation threshold;Finally, taking TiIn segmentation threshold of the intermediate value as such defect image, such as following formula:
Step 9: carrying out defect segmentation, formula (1) is brought into using optimal filter parameter h obtained in the 6th step and formula (2) is right Picture to be detected is filtered, and the picture obtained after filtering carries out to the 7th step is significant and normalized, then uses the 8th It walks obtained threshold value T and carries out defect segmentation according to formula (11);
G (i) in formula (11) indicates that i-th of element in G, G are the saliency value after normalizing obtained in the 7th step;
Step 10: calculating fault area, pixel number P in the eight connected region that pixel value is 1 in bianry image is calculated, is allowed P is multiplied with the point area of single pixel obtained in the first step, then P continuous image vegetarian refreshments can represent defect regions area;
Step 11: eliminating pseudo- fault, pseudo- fault is eliminated using segmentation threshold M and formula (12), obtains final segmentation figure Picture F, such as following formula:
Threshold value M takes 0.5mm × 0.5mm;Gray value is 0 in image after segmentation, then it is assumed that is not deposited in textile image In fault;It is on the contrary, then it is assumed that there are faults in image, can completely obtain defect segmentation result: binary map by handling above The region that middle gray value is 1 is defect regions, and the region that gray value is 0 is fabric normal segments;Defect detection is completed at this time.This The principle of invention is described as follows:
Referring to fig. 4, the contrast to improve defect regions and background area.In textile image collection process of the invention, Light source and camera are respectively placed in fabric and carry out Image Acquisition.Using the difference of fault and background area light transmittance, Improve defect regions contrast.
Referring to Fig. 1, with the increase of filtering parameter h, variation tendency almost one of the variance ratio BSF in RGB color channel It causes, and curve can be divided into four-stage, is respectively as follows: slow descending branch, straight line descending branch, changeover portion peace and delays transforming section.Explanation Parameter h is more than after a certain critical value, and non-local mean filtering device is more and more limited to the smoothing effect of image, gray value of image Distribution tends towards stability.
Referring to Fig. 3, improve the significant algorithm of frequency tuning can accurately identify thick warp, ring, hang through, tieing, staplings, line Head, greasy dirt and this kind of flaw of broken hole, but not for sideband latitude, sluff-offs, the lower flaw recognition capability of this kind of contrast of dilute latitude Foot forms a large amount of pseudo- defect regions;And textile image variance can preferably reflect the distribution of textile image gray value, variance The grey value difference for being worth pixel in smaller expression textile image is smaller, and the variance ratio of normal fabric filtering of the present invention front and back is made For the Optimality Criteria of filtering parameter h, optimal filter parameter h can be accurately obtained, it is significant effectively to overcome improvement frequency tuning Problem of the algorithm to sideband latitude, sluff-offs and dilute weft fabric segmentation effect difference.
When being filtered to textile image, discovery filtering parameter h controls fabric by the size of weighing factor ω (i, j) The filter strength of image.If value is too small, noise filtering is not thorough, and miss detection easily occurs;If value is too big, can lead Image excess smoothness is caused, is unfavorable for the raising of defect segmentation precision, detection leakage phenomenon easily occurs.
Embodiment 1:
A kind of fabric defect detection method, comprising the following steps:
Step 1: image pixel dimensions are demarcated, the size and area of its single pixel on every picture are calculated;
Step 2: image filtering, takes n normal fabric pictures to be detected, above-mentioned picture is RGB color, enables figure As being f={ f (i) | i ∈ I }, i is pixel in formula, and I is search window;
Filtering parameter h is enabled to be respectively equal to 1,2,3 ... ..., 50, using formula (1) and formula (2) respectively to every normal texture figure Piece carries out non-local mean filtering:
In above formula: fNIt (i) is gray value of the pixel i after non-local mean filtering, f (j) is pixel in search window The gray value of point j, pixel i, j corresponding weight when ω (i, j) is weighted average;For pixel i, j Square of the weighted euclidean distance of the similar window N (i) of corresponding rectangle and N (j), α are the standard deviation of gaussian kernel function, and α is equal to 1;
Step 3: calculating variance ratio, gray scale side of the every normal fabric image before filtering is calculated separately according to formula (3) Difference sigmainWith the variance yields σ of normal fabric gray value of image after filteringout
In formula (3): σ indicates the variance of normal fabric gray value of image, xiFor i-th of gray value of normal textile image, μ For the average value of normal fabric picture gray value, n indicates that normal fabric image has n gray value;
The preceding ratio with variance after filtering of filtering is calculated according to formula (4):
Every picture has tri- Color Channels of R, G and B, therefore every picture has the variance ratio of tri- Color Channels of R, G, B Value, respectively BSFR, BSFGAnd BSFB
Step 4: h-MBSF curve is drawn, according to the variance ratio BSF for three Color Channels that third step is calculatedR, BSFGAnd BSFBCount corresponding average variance ratio under different filtering parameter h values:
The curve graph of average variance ratio and filtering parameter h, i.e. h-MBSF curve graph are drawn, n is normal fabric picture Quantity;
Step 5: obtaining straight line fitting equation, straight line descending branch in h-MBSF curve is intended using least square method Conjunction obtains straight line fitting equation, such as following formula:
A × h+B × MBSF+C=0 (6)
In formula, A, B, C are constant;
Step 6: calculating optimal filter parameter h, calculates each o'clock in h-MBSF curve transition and be fitted directly into the 5th step The vertical range d of line, such as following formula:
When the value range of d is 0.2~0.8, select filtering parameter h corresponding to the smallest point of d value as optimal value, The corresponding points meet A × h+B × MBSF+C value greater than zero simultaneously;
Step 7: significant and normalized, is transformed into Lab color space meter for texture image after the filtering in second step Saliency value S is calculated, such as following formula:
S=| | Iu-INLM|| (8)
In formula (8): IuPixel arithmetic mean of instantaneous value for textile image in Lab color space, INLMFor non-local mean filtering Image afterwards;║ ║ is Euclidean distance formula;
Saliency value S is normalized, such as following formula:
Saliency value S is normalized in 0~255 range and its value is rounded, the saliency value G after being normalized;
Step 8: calculating segmentation threshold, saliency value is arranged by ascending order, when the saliency value of fabric notable figure obeys normal state point When cloth, corresponding saliency value is as segmentation threshold T when taking the probability of saliency value not less than 95%i, every fabric picture can obtain To its corresponding segmentation threshold;Finally, taking TiIn segmentation threshold of the intermediate value as such defect image, such as following formula:
Step 9: carrying out defect segmentation, formula (1) is brought into using optimal filter parameter h obtained in the 6th step and formula (2) is right Picture to be detected is filtered, and the picture obtained after filtering carries out to the 7th step is significant and normalized, then uses the 8th It walks obtained threshold value T and carries out defect segmentation according to formula (11);
G (i) in formula (11) indicates that i-th of element in G, G are the saliency value after normalizing obtained in the 7th step;
Step 10: calculating fault area, pixel number P in the eight connected region that pixel value is 1 in bianry image is calculated, is allowed P is multiplied with the point area of single pixel obtained in the first step, then P continuous image vegetarian refreshments can represent defect regions area;
Step 11: eliminating pseudo- fault, pseudo- fault is eliminated using segmentation threshold M and formula (12), obtains final segmentation figure Picture F, such as following formula:
Threshold value M takes 0.5mm × 0.5mm;Gray value is 0 in image after segmentation, then it is assumed that is not deposited in textile image In fault;It is on the contrary, then it is assumed that there are faults in image, can completely obtain defect segmentation result: binary map by handling above The region that middle gray value is 1 is defect regions, and the region that gray value is 0 is fabric normal segments;Defect detection is completed at this time.

Claims (1)

1. a kind of fabric defect detection method, it is characterised in that: the defect detection method the following steps are included:
Step 1: image pixel dimensions are demarcated, the size and area of single pixel on every picture are calculated;
Step 2: image filtering, takes n normal fabric pictures to be detected, above-mentioned picture is RGB color, and enabling image is f ={ f (i) | i ∈ I }, i is pixel in formula, and I is search window;
Enable filtering parameter h be respectively equal to 1,2,3 ... ..., 50, respectively using formula (1) and formula (2) to every normal texture picture into Row non-local mean filtering:
In above formula: fNIt (i) is gray value of the pixel i after non-local mean filtering, f (j) is pixel j in search window Gray value, pixel i, j corresponding weight when ω (i, j) is weighted average;For pixel i, corresponding to j The similar window N (i) of rectangle and N (j) weighted euclidean distance square, α be gaussian kernel function standard deviation, α be equal to 1;
Step 3: calculating variance ratio, gray variance value of the every normal fabric image before filtering is calculated separately according to formula (3) σinWith the variance yields σ of normal fabric gray value of image after filteringout
In formula (3): σ indicates the variance of normal fabric gray value of image, xiFor i-th of gray value of normal textile image, μ is positive The average value of normal fabric picture gray value, n indicate that normal fabric image has n gray value;
The preceding ratio with variance after filtering of filtering is calculated according to formula (4):
Every picture has tri- Color Channels of R, G and B, therefore every picture has the variance ratio of tri- Color Channels of R, G, B, point It Wei not BSFR, BSFGAnd BSFB
Step 4: h-MBSF curve is drawn, according to the variance ratio BSF for three Color Channels that third step is calculatedR, BSFG And BSFB, corresponding average variance ratio under different filtering parameter h values is counted according to formula (5):
The curve graph of average variance ratio and filtering parameter h, i.e. h-MBSF curve graph are drawn, n is the quantity of normal fabric picture;
Step 5: obtaining straight line fitting equation, straight line descending branch in h-MBSF curve is fitted using least square method Straight line fitting equation out, such as following formula:
A × h+B × MBSF+C=0 (6)
In formula, A, B, C are constant;
Step 6: calculating optimal filter parameter h, each o'clock fitting a straight line into the 5th step in h-MBSF curve transition is calculated Vertical range d, such as following formula:
When the value range of d is 0.2~0.8, select filtering parameter h corresponding to the smallest point of d value as optimal value, simultaneously The corresponding points meet A × h+B × MBSF+C value greater than zero;
Step 7: significant and normalized, it is aobvious to be transformed into the calculating of Lab color space for texture image after the filtering in second step Work value S, such as following formula:
S=| | Iu-INLM|| (8)
In formula (8): IuPixel arithmetic mean of instantaneous value for textile image in Lab color space, INLMAfter non-local mean filtering Image;║ ║ is Euclidean distance formula;
Saliency value S is normalized, such as following formula:
Saliency value S is normalized in 0~255 range and its value is rounded, the saliency value G after being normalized;
Step 8: calculating segmentation threshold, saliency value is arranged by ascending order, when the saliency value Normal Distribution of fabric notable figure When, corresponding saliency value is as segmentation threshold T when taking the probability of saliency value not less than 95%i, every fabric picture is available Its corresponding segmentation threshold;Finally, taking TiIn segmentation threshold of the intermediate value as such defect image, such as following formula:
Step 9: carrying out defect segmentation, formula (1) and formula (2) are brought into to be checked using optimal filter parameter h obtained in the 6th step Mapping piece is filtered, and the picture obtained after filtering carries out to the 7th step is significant and normalized, is then obtained using the 8th step The threshold value T arrived carries out defect segmentation according to formula (11);
G (i) in formula (11) indicates that i-th of element in G, G are the saliency value after normalizing obtained in the 7th step;
Step 10: calculate fault area, calculate bianry image in pixel value be 1 eight connected region in pixel number P, allow P and The point area of single pixel obtained in the first step is multiplied, then P continuous image vegetarian refreshments can represent defect regions area;
Step 11: eliminating pseudo- fault, pseudo- fault is eliminated using segmentation threshold M and formula (12), obtains final segmented image F, Such as following formula:
Threshold value M takes 0.5mm × 0.5mm;Gray value is 0 in image after segmentation, then it is assumed that defect is not present in textile image Point;It is on the contrary, then it is assumed that there are faults in image, can completely obtain defect segmentation result by handling above: grey in binary map The region that angle value is 1 is defect regions, and the region that gray value is 0 is fabric normal segments;Defect detection is completed at this time.
CN201810433675.3A 2018-05-08 2018-05-08 Fabric defect detection method Expired - Fee Related CN109035195B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810433675.3A CN109035195B (en) 2018-05-08 2018-05-08 Fabric defect detection method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810433675.3A CN109035195B (en) 2018-05-08 2018-05-08 Fabric defect detection method

Publications (2)

Publication Number Publication Date
CN109035195A true CN109035195A (en) 2018-12-18
CN109035195B CN109035195B (en) 2021-11-30

Family

ID=64611468

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810433675.3A Expired - Fee Related CN109035195B (en) 2018-05-08 2018-05-08 Fabric defect detection method

Country Status (1)

Country Link
CN (1) CN109035195B (en)

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109961437A (en) * 2019-04-04 2019-07-02 江南大学 A kind of conspicuousness fabric defect detection method under the mode based on machine teaching
CN110021023A (en) * 2019-03-05 2019-07-16 西安工程大学 A kind of electronics cloth defect segmentation method
CN110473190A (en) * 2019-08-09 2019-11-19 江南大学 A kind of adaptive fabric defect detection method based on scale
CN110991082A (en) * 2019-12-19 2020-04-10 信利(仁寿)高端显示科技有限公司 Mura quantification method based on excimer laser annealing
CN111080574A (en) * 2019-11-19 2020-04-28 天津工业大学 Fabric defect detection method based on information entropy and visual attention mechanism
CN111861996A (en) * 2020-06-23 2020-10-30 西安工程大学 Printed fabric defect detection method
CN113724241A (en) * 2021-09-09 2021-11-30 常州市宏发纵横新材料科技股份有限公司 Broken filament detection method and device for carbon fiber warp-knitted fabric and storage medium
CN113838038A (en) * 2021-09-28 2021-12-24 常州市宏发纵横新材料科技股份有限公司 Carbon fiber cloth cover defect detection method and device, electronic equipment and storage medium
CN115082460A (en) * 2022-08-18 2022-09-20 聊城市恒丰电子有限公司 Weaving production line quality monitoring method and system
CN115115615A (en) * 2022-07-26 2022-09-27 南通好心情家用纺织品有限公司 Textile fabric quality evaluation method and system based on image recognition
CN115311294A (en) * 2022-10-12 2022-11-08 启东金耀億华玻纤材料有限公司 Glass bottle body flaw identification and detection method based on image processing

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20010012381A1 (en) * 1997-09-26 2001-08-09 Hamed Sari-Sarraf Vision-based, on-loom fabric inspection system
CN102706881A (en) * 2012-03-19 2012-10-03 天津工业大学 Cloth defect detecting method based on machine vision
CN105261003A (en) * 2015-09-10 2016-01-20 西安工程大学 Defect point detection method on basis of self structure of fabric
CN105678767A (en) * 2016-01-07 2016-06-15 无锡信捷电气股份有限公司 SoC software and hardware collaborative design-based cloth surface blemish detection method
CN106872487A (en) * 2017-04-21 2017-06-20 佛山市南海区广工大数控装备协同创新研究院 The surface flaw detecting method and device of a kind of view-based access control model
CN107870172A (en) * 2017-07-06 2018-04-03 黎明职业大学 A kind of Fabric Defects Inspection detection method based on image procossing

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20010012381A1 (en) * 1997-09-26 2001-08-09 Hamed Sari-Sarraf Vision-based, on-loom fabric inspection system
CN102706881A (en) * 2012-03-19 2012-10-03 天津工业大学 Cloth defect detecting method based on machine vision
CN105261003A (en) * 2015-09-10 2016-01-20 西安工程大学 Defect point detection method on basis of self structure of fabric
CN105678767A (en) * 2016-01-07 2016-06-15 无锡信捷电气股份有限公司 SoC software and hardware collaborative design-based cloth surface blemish detection method
CN106872487A (en) * 2017-04-21 2017-06-20 佛山市南海区广工大数控装备协同创新研究院 The surface flaw detecting method and device of a kind of view-based access control model
CN107870172A (en) * 2017-07-06 2018-04-03 黎明职业大学 A kind of Fabric Defects Inspection detection method based on image procossing

Non-Patent Citations (8)

* Cited by examiner, † Cited by third party
Title
KAZIM YILDIZ等: "Fault detection of fabrics using image processing methods", 《PAMUKKALE UNIVERSITY JOURNAL OF ENGINEERING SCIENCES》 *
RADHAKRISHNA ACHANTA等: "Frequency-turned salient region detection", 《2009 IEEE CONFERENCE ON COMPUTER VISION AND PATTERN RECOGNITION》 *
刘洲峰: "基于改进自适应阈值的织物疵点检测算法研究", 《微型机与应用》 *
姚明海等: "基于全局和局部显著性的织物疵点检测", 《浙江工业大学学报》 *
张权等: "一种基于优化参数的非局部均值滤波算法", 《计算机应用与软件》 *
王传桐等: "改进频率调谐显著算法在疵点辨识中的应用", 《纺织学报》 *
赵波等: "新的基于图像显著性区域特征的织物疵点检测算法", 《计算机应用》 *
马腾等: "基于双边滤波与区域生长的织物疵点检测", 《北京信息科技大学学报》 *

Cited By (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110021023A (en) * 2019-03-05 2019-07-16 西安工程大学 A kind of electronics cloth defect segmentation method
CN109961437A (en) * 2019-04-04 2019-07-02 江南大学 A kind of conspicuousness fabric defect detection method under the mode based on machine teaching
CN110473190A (en) * 2019-08-09 2019-11-19 江南大学 A kind of adaptive fabric defect detection method based on scale
CN110473190B (en) * 2019-08-09 2022-03-04 江南大学 Adaptive fabric defect detection method based on scale
CN111080574A (en) * 2019-11-19 2020-04-28 天津工业大学 Fabric defect detection method based on information entropy and visual attention mechanism
CN110991082A (en) * 2019-12-19 2020-04-10 信利(仁寿)高端显示科技有限公司 Mura quantification method based on excimer laser annealing
CN110991082B (en) * 2019-12-19 2023-11-28 信利(仁寿)高端显示科技有限公司 Mura quantification method based on excimer laser annealing
CN111861996A (en) * 2020-06-23 2020-10-30 西安工程大学 Printed fabric defect detection method
CN111861996B (en) * 2020-06-23 2023-11-03 西安工程大学 Printed fabric defect detection method
CN113724241A (en) * 2021-09-09 2021-11-30 常州市宏发纵横新材料科技股份有限公司 Broken filament detection method and device for carbon fiber warp-knitted fabric and storage medium
CN113724241B (en) * 2021-09-09 2022-08-02 常州市宏发纵横新材料科技股份有限公司 Broken filament detection method and device for carbon fiber warp-knitted fabric and storage medium
CN113838038A (en) * 2021-09-28 2021-12-24 常州市宏发纵横新材料科技股份有限公司 Carbon fiber cloth cover defect detection method and device, electronic equipment and storage medium
CN115115615A (en) * 2022-07-26 2022-09-27 南通好心情家用纺织品有限公司 Textile fabric quality evaluation method and system based on image recognition
CN115115615B (en) * 2022-07-26 2022-12-13 南通好心情家用纺织品有限公司 Textile fabric quality evaluation method and system based on image recognition
CN115082460A (en) * 2022-08-18 2022-09-20 聊城市恒丰电子有限公司 Weaving production line quality monitoring method and system
CN115311294A (en) * 2022-10-12 2022-11-08 启东金耀億华玻纤材料有限公司 Glass bottle body flaw identification and detection method based on image processing

Also Published As

Publication number Publication date
CN109035195B (en) 2021-11-30

Similar Documents

Publication Publication Date Title
CN109035195A (en) A kind of fabric defect detection method
CN107507173B (en) No-reference definition evaluation method and system for full-slice image
Liu et al. A fabric defect detection method based on deep learning
CN105844621A (en) Method for detecting quality of printed matter
CN106529559A (en) Pointer-type circular multi-dashboard real-time reading identification method
GB2569751A (en) Static infrared thermal image processing-based underground pipe leakage detection method
CN109472822A (en) Dimension of object measurement method based on depth image processing
CN104008399B (en) The recognition methodss of the gauge pointer shake based on support vector machine in a kind of instrument detection
CN104574389A (en) Battery piece chromatism selection control method based on color machine vision
CN102974551A (en) Machine vision-based method for detecting and sorting polycrystalline silicon solar energy
CN103971126A (en) Method and device for identifying traffic signs
CN105404874B (en) A kind of vehicle window identifying system based on projection and hough straight-line detections
CN103489187A (en) Quality test based segmenting method of cell nucleuses in cervical LCT image
CN109341524A (en) A kind of optical fiber geometric parameter detection method based on machine vision
CN103226829A (en) Image edge detection method based on edge enhancement operator
CN116310845B (en) Intelligent monitoring system for sewage treatment
CN113313107B (en) Intelligent detection and identification method for multiple types of diseases on cable surface of cable-stayed bridge
CN108765406A (en) A kind of snow mountain detection method based on infrared remote sensing image
CN116612123B (en) Visual detection method for peanut oil processing quality
CN110189375A (en) A kind of images steganalysis method based on monocular vision measurement
CN104182992B (en) Method for detecting small targets on the sea on the basis of panoramic vision
CN109540917A (en) A kind of multi-angle mode yarn under working external appearance characteristic parameter extraction and analysis method
WO2023231262A1 (en) Hoisting wire rope tension measurement method based on visual vibration frequency identification
WO2023159985A1 (en) Video detection technology-based identification method for abnormal behaviors of sorting center
CN105787912A (en) Classification-based step type edge sub pixel localization method

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
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20211130

CF01 Termination of patent right due to non-payment of annual fee