CN112435232A - Defect detection method based on haar wavelet combined image variance - Google Patents

Defect detection method based on haar wavelet combined image variance Download PDF

Info

Publication number
CN112435232A
CN112435232A CN202011318668.2A CN202011318668A CN112435232A CN 112435232 A CN112435232 A CN 112435232A CN 202011318668 A CN202011318668 A CN 202011318668A CN 112435232 A CN112435232 A CN 112435232A
Authority
CN
China
Prior art keywords
image
variance
defect detection
block
image block
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011318668.2A
Other languages
Chinese (zh)
Inventor
江结林
邵禹豪
金子龙
陈亚当
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nanjing University of Information Science and Technology
Original Assignee
Nanjing University of Information Science and Technology
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 Nanjing University of Information Science and Technology filed Critical Nanjing University of Information Science and Technology
Priority to CN202011318668.2A priority Critical patent/CN112435232A/en
Publication of CN112435232A publication Critical patent/CN112435232A/en
Pending legal-status Critical Current

Links

Images

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
    • G06T7/0008Industrial image inspection checking presence/absence
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/10Image enhancement or restoration by non-spatial domain filtering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/50Image enhancement or restoration by the use of more than one image, e.g. averaging, subtraction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image
    • 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/20021Dividing image into blocks, subimages or windows
    • 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/20048Transform domain processing
    • G06T2207/20064Wavelet transform [DWT]
    • 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/20212Image combination
    • G06T2207/20224Image subtraction
    • 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

The invention discloses a defect detection method based on haar wavelet combined image variance, which comprises the steps of firstly, utilizing median filtering to inhibit noise, and utilizing HW to enhance an image so as to obtain a preprocessed image; secondly, partitioning the image based on the preprocessed image, counting the variance of each image block, and partitioning the image block into image blocks with defects and image blocks without defects by combining the variance with a threshold; then, setting a threshold value, and carrying out binarization processing on the variance of the image block to obtain an image block after binarization processing; and finally, synthesizing the image blocks subjected to binarization processing to obtain a defect detection image. The invention effectively inhibits noise through median filtering, increases the gray value difference between the defects and the image background through haar wavelet, not only can accurately detect common defects in the cloth, but also is very effective for the defects with small gray value difference with the cloth background, thereby improving the cloth defect detection efficiency and reducing the false detection rate.

Description

Defect detection method based on haar wavelet combined image variance
Technical Field
The invention belongs to the technical field of image detection, and particularly relates to a defect detection method based on haar wavelet combined image variance.
Background
The cloth is an essential material for making clothes and is closely related to the life of people. In the cloth production process, cloth defect detection is an essential step for ensuring the cloth quality. At present, most cloth factories still adopt a traditional manual detection mode, and the defect is that the cloth defects are missed to be detected due to the long-time manual work. In recent years, many large cloth production companies begin to complete defect detection from foreign imported automatic cloth inspection machines in order to save labor cost and improve cloth detection efficiency, and the purpose is to reduce production cost while improving detection rate. The core technology of the automatic cloth inspecting machine is an algorithm, and a more typical algorithm at present is a spectrum method.
The detection of cloth defects by using the spectral characteristics of images is one of the most widely used methods at present. In signal processing, the sensitivity of the spectrum method to noise is weaker than that of a space domain algorithm, so that the spectrum method is widely applied to the field of computers. Spectral methods mainly include fourier transform, wavelet transform, Gabor transform, and filter-based methods. But the defects are mainly as follows: (1) the false detection rate of the general detection method is too high due to the fact that the image acquisition process is difficult to avoid interference of various noises; (2) when the gray value difference between the defects and the cloth is small, the defects are easy to miss detection.
Disclosure of Invention
The purpose of the invention is as follows: the invention provides a defect detection method based on haar wavelet combined image variance, which aims at the problems that the false detection rate of the existing cloth defect detection method is too high, and defects are difficult to detect when the gray value of the defects is smaller than the gray value of the cloth background.
The technical scheme is as follows: the invention discloses a defect detection method based on haar wavelet combined image variance, which comprises the following steps:
(1) carrying out mean value filtering on the collected cloth defect images to obtain a preprocessed image;
(2) performing Haar wavelet transform on the preprocessed image to obtain an image after wavelet enhancement;
(3) partitioning the wavelet-enhanced image, and calculating the variance of each image block;
(4) setting a threshold value, and carrying out binarization processing on the variance of the image block to obtain an image block after binarization processing;
(5) and synthesizing the image blocks after the binarization processing to obtain a defect detection image.
Further, the step (2) comprises the steps of:
(21) for the preprocessed image Y ═ Y (Y)1;Y2;...Yn) Performing discrete wavelet transform to obtain low frequency Yi LAnd high frequency Yi H(ii) a Correspondingly obtaining a low-frequency image yLAnd a high frequency image yH(ii) a Wherein Y isiN denotes a row vector of the preprocessed image y;
(22) for image yLAnd yHPerforming discrete wavelet transform to obtain four images yLL,yLH,yHL,yHH(ii) a Wherein y isLLAnd yHLCorresponds to yLAnd yHLow-frequency part of, yLHAnd yHHIs yLAnd yHThe high-frequency part of (2);
(23) obtaining an enhanced image through discrete wavelet transform:
x=1.2yLL
further, the step (3) is realized as follows:
partitioning the enhanced image x according to a matrix block mining operator to obtain an image block xi
xi=Rix i=1,2,...,n
Wherein R isiMining operators for matrix blocks, wherein n represents the number of image blocks, and the scale of each block is m multiplied by m;
after the image x is partitioned, the variance of each image block is calculated:
Figure BDA0002792118580000021
further, the step (4) is realized as follows:
(41) judging the variance Dx of the image blocki-mean(xi) Whether a threshold condition is met;
(42) if the variance Dx in the image blocki-mean(xi) If the pixel value is larger than the set threshold value, the image block contains defects, and the pixel value of the whole image block is set to be 255; otherwise, the pixel value of the entire image block is set to 0.
Further, the step (5) is realized as follows:
after all the binarized image blocks are obtained, the image
Figure BDA0002792118580000022
Obtained by the following formula:
Figure BDA0002792118580000023
thereby obtaining a defect detection image
Figure BDA0002792118580000024
Has the advantages that: compared with the prior art, the invention has the beneficial effects that: 1. the invention mainly solves the problem of cloth defect detection, and establishes a new HWV defect detection method by combining Haar Wavelet (HW) with an image Variance (Variance) strategy to realize the aim of cloth intelligent detection; 2. in the detection cloth obtained in an actual factory, due to the reasons of image acquisition and the like, the gray level of part of defects is less different from the gray level of the cloth background, so that the defect omission is serious, the defect detection rate is reduced to a great extent, and in order to solve the actual problem, the invention utilizes haar wavelet to enhance the image and increase the difference between the gray values of the defects and the cloth background; through mean filtering and haar wavelet preprocessing, the image is further partitioned, the image variance is calculated and a binarization strategy is combined, and experiments show that the method not only can effectively detect obvious defects, but also can obtain a better detection effect when the difference between the gray values of the defects and the cloth background is smaller; the invention not only utilizes haar wavelet to improve the defect detection efficiency, but also reduces the false detection rate by combining with the mean filtering, thereby meeting the actual detection requirement of factories.
Drawings
FIG. 1 is a flow chart of image defect detection in accordance with the present invention;
FIG. 2 is a comparison of the present invention and other methods of detection.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings.
The invention provides a defect detection method based on haar wavelet combined image variance, which comprises the following steps as shown in figure 1:
step 1: carrying out mean value filtering on the cloth defect images acquired by the industrial camera to obtain a preprocessed image; the specific filter operator is shown in table 1, and the preprocessed image is obtained.
TABLE 1 Filter operators
1/9 1/9 1/9
1/9 1/9 1/9
1/9 1/9 1/9
Step 2: and performing Haar wavelet transform on the preprocessed image to obtain an image after wavelet enhancement.
For the preprocessed image Y ═ Y (Y)1;Y2;...Yn) Performing a discrete wavelet transform, wherein YiN denotes a row vector of the image y. First, for YiN is subjected to discrete wavelet transform to respectively obtain low-frequency Yi LAnd high frequency Yi H. Accordingly, a low-frequency image y can be obtainedLAnd a high frequency image yH
For image yLAnd yHAnd performing discrete wavelet transform to obtain four images yLL,yLH,yHL,yHHWherein y isLLAnd yHLCorresponds to yLAnd yHLow-frequency part of, yLHAnd yHHIs yLAnd yHThe high frequency part of (2). Obtaining an enhanced image through discrete wavelet transform:
x=1.2yLL
and step 3: and partitioning the wavelet-enhanced image, and calculating the variance of each image block.
Partitioning the enhanced image x according to a matrix block mining operator to obtain an image block xiExpressed as:
xi=Rix i=1,2,...,n
wherein R isiMining operators for matrix blocks, wherein n represents the number of image blocks, and the scale of each block is m multiplied by m;
after the image x is partitioned, the variance of each image block is calculated:
Figure BDA0002792118580000041
and 4, step 4: setting a threshold value, and carrying out binarization processing on the variance of the image block to obtain the image block after binarization processing.
Judging the variance Dx of the image block obtained in the step 3i-mean(xi) Whether a threshold condition is met; if the variance Dx in the image blocki-mean(xi) If the image block is larger than the set threshold value, the image block contains defects,the pixel value of the entire image block is set to 255; otherwise, the pixel value of the entire image block is set to 0.
And 5: and synthesizing the image blocks after the binarization processing to obtain a defect detection image.
After all the binarized image blocks are obtained, the image
Figure BDA0002792118580000042
Obtained by the following formula:
Figure BDA0002792118580000043
thereby obtaining a defect detection image
Figure BDA0002792118580000044
The statistical detection method of haar wavelets and image variances is used for defect picture testing, and results show that when the gray value difference between defects and the background of a cloth image is small, the method can still effectively detect the defects, so that defect detection efficiency is improved, and good detection performance is obtained.
A specific set of test examples is given below. As shown in fig. 2, fig. 2(a) shows a defect image, fig. 2(b) shows a wavelet-enhanced image, fig. 2(c) shows a Gabor detection result, fig. 2(d) shows a fourier transform detection result, fig. 2(e) shows a variance-based detection result, and fig. 2(f) shows a defect detection effect based on a haar wavelet-combined image variance. It can be easily found from the detection effect that when the difference between the gray value of the defect and the gray value of the background of the cloth is small, other algorithms are invalid, but the defect detection method based on the haar wavelet combined image variance can still detect the defect, and the wavelet enhancement effect is fully embodied.
The above description is only a preferred embodiment of the present invention, and is not intended to limit the present invention in any way, and all simple modifications and equivalent variations of the above embodiment according to the technical spirit of the present invention are included in the protection scope of the present invention.

Claims (5)

1. A defect detection method based on haar wavelet combined image variance is characterized by comprising the following steps:
(1) carrying out mean value filtering on the collected cloth defect images to obtain a preprocessed image;
(2) performing Haar wavelet transform on the preprocessed image to obtain an image after wavelet enhancement;
(3) partitioning the wavelet-enhanced image, and calculating the variance of each image block;
(4) setting a threshold value, and carrying out binarization processing on the variance of the image block to obtain an image block after binarization processing;
(5) and synthesizing the image blocks after the binarization processing to obtain a defect detection image.
2. A defect detection method based on haar wavelet combined image variance according to claim 1, characterized in that said step (2) comprises the steps of:
(21) for the preprocessed image Y ═ Y (Y)1;Y2;...Yn) Performing discrete wavelet transform to obtain low frequency Yi LAnd high frequency Yi H(ii) a Correspondingly obtaining a low-frequency image yLAnd a high frequency image yH(ii) a Wherein Y isiN denotes a row vector of the preprocessed image y;
(22) for image yLAnd yHPerforming discrete wavelet transform to obtain four images yLL,yLH,yHL,yHH(ii) a Wherein y isLLAnd yHLCorresponds to yLAnd yHLow-frequency part of, yLHAnd yHHIs yLAnd yHThe high-frequency part of (2);
(23) obtaining an enhanced image through discrete wavelet transform:
x=1.2yLL
3. a defect detection method based on haar wavelet combined image variance according to claim 1, characterized in that said step (3) is implemented as follows:
partitioning the enhanced image x according to a matrix block mining operator to obtain an image block xi
xi=Rix i=1,2,...,n
Wherein R isiMining operators for matrix blocks, wherein n represents the number of image blocks, and the scale of each block is m multiplied by m;
after the image x is partitioned, the variance of each image block is calculated:
Figure FDA0002792118570000011
4. a defect detection method based on haar wavelet combined image variance according to claim 1, characterized in that said step (4) is implemented as follows:
(41) judging the variance Dx of the image blocki-mean(xi) Whether a threshold condition is met;
(42) if the variance Dx in the image blocki-mean(xi) If the pixel value is larger than the set threshold value, the image block contains defects, and the pixel value of the whole image block is set to be 255; otherwise, the pixel value of the entire image block is set to 0.
5. A defect detection method based on haar wavelet combined image variance according to claim 1, characterized in that said step (5) is implemented as follows:
after all the binarized image blocks are obtained, the image
Figure FDA0002792118570000021
Obtained by the following formula:
Figure FDA0002792118570000022
obtaining defect detection images
Figure FDA0002792118570000023
CN202011318668.2A 2020-11-23 2020-11-23 Defect detection method based on haar wavelet combined image variance Pending CN112435232A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011318668.2A CN112435232A (en) 2020-11-23 2020-11-23 Defect detection method based on haar wavelet combined image variance

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011318668.2A CN112435232A (en) 2020-11-23 2020-11-23 Defect detection method based on haar wavelet combined image variance

Publications (1)

Publication Number Publication Date
CN112435232A true CN112435232A (en) 2021-03-02

Family

ID=74693512

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011318668.2A Pending CN112435232A (en) 2020-11-23 2020-11-23 Defect detection method based on haar wavelet combined image variance

Country Status (1)

Country Link
CN (1) CN112435232A (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103604809A (en) * 2013-10-22 2014-02-26 江南大学 Pattern cloth flaw online visual inspection method
CN103903268A (en) * 2014-04-09 2014-07-02 南京理工大学 Road surface crack detection method based on multiple lower-layer marked features
CN106093066A (en) * 2016-06-24 2016-11-09 安徽工业大学 A kind of magnetic tile surface defect detection method based on the machine vision attention mechanism improved
CN107705306A (en) * 2017-10-26 2018-02-16 中原工学院 A kind of fabric defect detection method based on multiple features matrix low rank decomposition
CN108776140A (en) * 2018-06-08 2018-11-09 福建新大陆电脑股份有限公司 A kind of printed matter flaw detection method and system based on machine vision
CN109741334A (en) * 2018-11-28 2019-05-10 恒银金融科技股份有限公司 A method of image segmentation is carried out by piecemeal threshold value
US20190362470A1 (en) * 2017-02-15 2019-11-28 Flir Systems, Inc. Systems and methods for efficient enhanced image filtering by collaborative sharpening in similarity domain
CN110570404A (en) * 2019-08-26 2019-12-13 南京信息工程大学 Sobel operator-based cloth defect detection method
CN111179243A (en) * 2019-12-25 2020-05-19 武汉昕竺科技服务有限公司 Small-size chip crack detection method and system based on computer vision

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103604809A (en) * 2013-10-22 2014-02-26 江南大学 Pattern cloth flaw online visual inspection method
CN103903268A (en) * 2014-04-09 2014-07-02 南京理工大学 Road surface crack detection method based on multiple lower-layer marked features
CN106093066A (en) * 2016-06-24 2016-11-09 安徽工业大学 A kind of magnetic tile surface defect detection method based on the machine vision attention mechanism improved
US20190362470A1 (en) * 2017-02-15 2019-11-28 Flir Systems, Inc. Systems and methods for efficient enhanced image filtering by collaborative sharpening in similarity domain
CN107705306A (en) * 2017-10-26 2018-02-16 中原工学院 A kind of fabric defect detection method based on multiple features matrix low rank decomposition
CN108776140A (en) * 2018-06-08 2018-11-09 福建新大陆电脑股份有限公司 A kind of printed matter flaw detection method and system based on machine vision
CN109741334A (en) * 2018-11-28 2019-05-10 恒银金融科技股份有限公司 A method of image segmentation is carried out by piecemeal threshold value
CN110570404A (en) * 2019-08-26 2019-12-13 南京信息工程大学 Sobel operator-based cloth defect detection method
CN111179243A (en) * 2019-12-25 2020-05-19 武汉昕竺科技服务有限公司 Small-size chip crack detection method and system based on computer vision

Non-Patent Citations (5)

* Cited by examiner, † Cited by third party
Title
BOHENG WANG等: "An Enhanced Nonlocal Self-Similarity Technique for Fabric Defect Detection", 《AN ENHANCED NONLOCAL SELF-SIMILARITY TECHNIQUE FOR FABRIC DEFECT DETECTION》, vol. 1, no. 3, pages 135 - 142 *
XUE ZHI YANG等: "Discriminative fabric defect detection using adaptive wavelets", 《OPTICAL ENGINEERING》, vol. 41, no. 12, pages 1 - 11 *
楼少敏;俞晓群;朱彦;: "基于MATLAB的织品缝线疵点检测研究", 计算机测量与控制, no. 03, pages 1 *
王博恒: "基于Haar小波分解及灰度梯度增强的疵点检测算法研究", 《中国优秀硕士学位论文全文数据库 工程科技Ⅰ辑》, pages 024 - 178 *
甄勇;刘伟;赵拥军;陈建宏;: "大场景SAR图像舰船目标快速检测", 信息工程大学学报, no. 05, pages 535 - 540 *

Similar Documents

Publication Publication Date Title
CN107194919B (en) Mobile phone screen defect detection method based on regular texture background reconstruction
WO2021012735A1 (en) Method and system for detecting screen display defects
CN109410230B (en) Improved Canny image edge detection method capable of resisting noise
KR102047855B1 (en) Background suppression method and detection device during display panel auto-optical detection
CN107478657A (en) Stainless steel surfaces defect inspection method based on machine vision
TWI393073B (en) Image denoising method
CN102331425B (en) Textile defect detection method based on defect enhancement
CN109472788B (en) Method for detecting flaw on surface of airplane rivet
Zhou et al. Method of improved fuzzy contrast combined adaptive threshold in NSCT for medical image enhancement
CN106296763B (en) A kind of metal material Industry CT Image Quality method for quickly correcting
CN103729856B (en) A kind of Fabric Defects Inspection detection method utilizing S-transformation signal extraction
WO2020124873A1 (en) Image processing method
CN110570404A (en) Sobel operator-based cloth defect detection method
CN111047556B (en) Strip steel surface defect detection method and device
CN115272303B (en) Textile fabric defect degree evaluation method, device and system based on Gaussian blur
CN105809646A (en) Method and system for calculating pore parameters of frozen earth based on iteration best threshold method
CN112669265B (en) Method for realizing surface defect detection based on Fourier transform and image gradient characteristics
Ma et al. An automatic detection method of Mura defects for liquid crystal display
CN112070717A (en) Power transmission line icing thickness detection method based on image processing
CN114332081A (en) Textile surface abnormity determination method based on image processing
CN112435232A (en) Defect detection method based on haar wavelet combined image variance
CN110400319A (en) A kind of spinning cake greasy dirt partitioning algorithm based on domain division method
CN102509265A (en) Digital image denoising method based on gray value difference and local energy
CN110288536A (en) A kind of borehole image processing method based on improvement bilateral filtering
Li et al. Fabric defect detection using wavelet decomposition

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