CN110490864B - Self-adaptive defect detection method for image - Google Patents

Self-adaptive defect detection method for image Download PDF

Info

Publication number
CN110490864B
CN110490864B CN201910779680.4A CN201910779680A CN110490864B CN 110490864 B CN110490864 B CN 110490864B CN 201910779680 A CN201910779680 A CN 201910779680A CN 110490864 B CN110490864 B CN 110490864B
Authority
CN
China
Prior art keywords
image
mask
value
detected
pixel
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.)
Active
Application number
CN201910779680.4A
Other languages
Chinese (zh)
Other versions
CN110490864A (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.)
Yi Si Si Hangzhou Technology Co ltd
Original Assignee
Isvision Hangzhou Technology Co Ltd
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 Isvision Hangzhou Technology Co Ltd filed Critical Isvision Hangzhou Technology Co Ltd
Priority to CN201910779680.4A priority Critical patent/CN110490864B/en
Publication of CN110490864A publication Critical patent/CN110490864A/en
Application granted granted Critical
Publication of CN110490864B publication Critical patent/CN110490864B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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
    • 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
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)
  • Preparing Plates And Mask In Photomechanical Process (AREA)
  • Image Analysis (AREA)

Abstract

The invention disclosesAn adaptive defect detection method for images comprises the following steps: 1) generating mask images with the same size for the images to be detected, counting the mean value mu of the images to be detected, wherein the initial mask value is 00And standard deviation σ0Determining a coefficient M; 2) judging whether the gray value of each pixel is larger than mu0+M×σ0Or less than mu0‑M×σ0If yes, setting the mask value to be 1; 3) counting the mean value mu of the part with the mask value of 0 in the image to be measurediAnd standard deviation σiSetting the gray value of the pixel corresponding to the mask value 1 on the image to be measured as the mean value muiObtaining an image I; 4) generating a mask image I by the same method and judging; 5) i +1, repeating the steps 3) and 4) until the mask values are all 0; 6) and merging and displaying all the areas with the mask value of 1 to obtain a final defect mask image. The method avoids false detection or missing detection caused by unreasonable threshold setting, and can effectively realize defect detection and identification of each scale.

Description

Self-adaptive defect detection method for image
Technical Field
The invention relates to the field of image detection, in particular to a self-adaptive defect detection method for an image.
Background
The image detection technology is a visual detection method widely applied at present, and for a picture with a single ground color, a method of setting a threshold value and identifying an abnormal value in the picture is generally adopted to detect the abnormal point on the surface of the picture, and the abnormal point is a defect on a product. However, setting a single threshold often fails to accurately detect all outliers in an image. This is because the small-sized abnormality is missed if the threshold value is set too large, and a large number of invalid regions are erroneously detected if the threshold value is set too small.
Disclosure of Invention
In order to solve the technical problems, the invention provides an image self-adaptive defect detection method, which can effectively solve the problem that a threshold is difficult to determine during defect identification, avoid false detection or missing detection caused by unreasonable threshold setting, and effectively realize defect detection and identification of each scale.
Therefore, the technical scheme of the invention is as follows:
an adaptive defect detection method for an image comprises the following steps:
1) generating mask graphs with the same size for an image to be detected, setting the initial mask value of each pixel in the mask graphs to be 0, and counting the mean value mu of the gray value of each pixel of the image to be detected0And standard deviation σ0Determining a coefficient M;
the image to be detected is an image with single and uniform ground color;
2) judging whether the gray value of each pixel in the image to be detected is large or notAt mu0+M×σ0Or less than mu0-M×σ0If yes, setting the mask value of the corresponding position of the mask map as 1;
3) counting the gray value mean value mu of the corresponding pixel of the part with the mask value of 0 in the mask image in the image to be detectediAnd standard deviation σiSetting the gray value of the pixel of the part with the mask value of 1 in the mask image on the image to be measured as the mean value muiObtaining an image I; i is a positive integer; i ═ I;
4) generating a mask I with the same size as the image I, setting the initial mask value of the mask I to be 0, and judging whether the gray value of each pixel in the image I is larger than mu or noti+M×σiOr less than mui-M×σiIf yes, setting the mask value of the position corresponding to the mask image I as 1;
5) i +1, replacing the mean value mu of the gray values calculated in step 3) with the mask image I and the image I in step 4)iAnd standard deviation σiRepeating the steps 3) and 4) on the used mask image and the image to be detected until all mask values in the mask image are 0;
6) and combining and displaying the areas with the mask value of 1 in multiple cycles to obtain a final defect mask image. The mask image can be used for acquiring the defect area on the image to be detected.
Further, the cycle termination condition of the step 5) is the preset maximum cycle number or the same mask image obtained after two adjacent cycles.
Further, M is 1 to 5.
Further, the image to be detected is a difference or convolution graph of phase, gradient and curvature, and a modulation graph.
According to the image self-adaptive defect detection method, the detection threshold is set repeatedly, the problem that the threshold is difficult to determine during defect identification can be effectively solved, false detection or missing detection caused by unreasonable threshold setting is avoided, and defect detection and identification of all scales can be effectively realized.
Drawings
FIG. 1 is a diagram illustrating the detection effect of a fixed threshold value that is larger according to a conventional method;
FIG. 2 is a diagram illustrating the detection effect when the threshold is fixed by the prior art method;
FIG. 3 is a mask obtained in step 2) of the present embodiment;
FIG. 4 is a mask map obtained after cycle 1 in an embodiment;
FIG. 5 is a mask map obtained after the 2 nd cycle in an embodiment;
FIG. 6 is a mask map obtained after the 3 rd cycle in the preferred embodiment;
FIG. 7 is a final defect mask map that results from the method of the embodiment.
Note: the same sheet of artwork is processed in figures 1, 2 and 3-7.
Detailed Description
The technical solution of the present invention is described in detail below with reference to the accompanying drawings and the detailed description.
An adaptive defect detection method for an image comprises the following steps:
1) generating mask images with the same size for the image to be detected, setting the initial mask value of each pixel in the mask images to be 0, and counting the mean value mu of the gray value of each pixel of the image to be detected0And standard deviation σ0Determining a coefficient M;
the image to be detected is an image with single and uniform ground color; mirror surface/mirror-like surface images such as automobile paint surfaces, mobile phone screens and the like;
the image to be detected is a difference or convolution graph of phase, gradient and curvature and a modulation graph, and an original image used in the attached figures 3-7 is a phase difference graph after defect modulation;
2) judging whether the gray value of each pixel in the image to be detected is greater than mu0+M×σ0Or less than mu0-M×σ0If yes, setting the mask value of the corresponding position of the mask map as 1; preferably, M is 1 to 5, where M is 3, to obtain a first mask map, fig. 3;
3) counting the gray value mean value mu of the corresponding pixel of the part with the mask value of 0 in the mask image in the image to be detectediAnd standard deviation σiThen, the image to be measured is placed onThe gray value of the pixel of the part with the mask value of 1 in the mask image is set as the mean value muiObtaining an image I; i is a positive integer; i ═ I;
4) generating a mask I with the same size as the image I, setting the initial mask value of the mask I to be 0, and judging whether the gray value of each pixel in the image I is larger than mui+M×σiOr less than mui-M×σiIf yes, setting the mask value of the position corresponding to the mask image I as 1;
5) i +1, replacing the mean value mu of the gray values calculated in step 3) with the mask image I and the image I in step 4)iAnd standard deviation σiRepeating the steps 3) and 4) on the used mask image and the image to be detected until all mask values in the mask image are 0; when i is 1, the mask diagram 1 is fig. 4; when i is 2, the mask fig. 1 is fig. 5; when i is 3, the mask fig. 1 is fig. 6;
6) and combining and displaying the areas with the mask value of 1 in multiple cycles to obtain a final defect mask map, as shown in FIG. 7. The mask image can be used for acquiring the defect area on the image to be detected. It can be seen that fig. 7 does not have the clutter in the lower right corner of fig. 2, relative to the existing fixed threshold approach employed in fig. 2.
In order to prevent the loop from being unable to be terminated due to program error, the loop termination condition of step 5) is also the same as the preset maximum loop number or the mask obtained after two adjacent loops.
The foregoing descriptions of specific exemplary embodiments of the present invention have been presented for purposes of illustration and description. The foregoing description is not intended to be exhaustive or to limit the invention to the precise form disclosed, and obviously many modifications and variations are possible in light of the above teaching. The exemplary embodiments were chosen and described in order to explain certain principles of the invention and its practical application to enable others skilled in the art to make and use various exemplary embodiments of the invention and various alternatives and modifications thereof. It is intended that the scope of the invention be defined by the following claims and their equivalents.

Claims (4)

1. An adaptive defect detection method for an image is characterized by comprising the following steps:
1) generating mask graphs with the same size for an image to be detected, setting the initial mask value of each pixel in the mask graphs to be 0, and counting the mean value mu of the gray value of each pixel of the image to be detected0And standard deviation σ0Determining a coefficient M;
the image to be detected is an image with single and uniform ground color;
2) judging whether the gray value of each pixel in the image to be detected is greater than mu0+M×σ0Or less than mu0-M×σ0If yes, setting the mask value of the corresponding position of the mask map as 1;
3) counting the gray value mean value mu of the corresponding pixel of the part with the mask value of 0 in the mask image in the image to be detectediAnd standard deviation σiSetting the gray value of the pixel of the part with the mask value of 1 in the mask image on the image to be measured as the mean value muiObtaining an image I; i is a positive integer; i ═ I;
4) generating a mask I with the same size as the image I, setting the initial mask value of the mask I to be 0, and judging whether the gray value of each pixel in the image I is larger than mu or noti+M×σiOr less than mui-M×σiIf yes, setting the mask value of the position corresponding to the mask image I as 1;
5) i +1, replacing the mean value mu of the gray values calculated in step 3) with the mask image I and the image I in step 4)iAnd standard deviation σiRepeating the steps 3) and 4) on the used mask image and the image to be detected until all mask values in the mask image are 0;
6) and combining and displaying the areas with the mask value of 1 in multiple cycles to obtain a final defect mask image.
2. The method for adaptive defect detection of an image according to claim 1, wherein: the cycle termination condition of the step 5) is also the preset maximum cycle number or the same mask image obtained after two adjacent cycles.
3. The method for adaptive defect detection of an image according to claim 1, wherein: m is 1-5.
4. The method for adaptive defect detection of an image according to claim 1, wherein: the image to be measured is a difference or convolution graph of phase, gradient and curvature and a modulation graph.
CN201910779680.4A 2019-08-22 2019-08-22 Self-adaptive defect detection method for image Active CN110490864B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910779680.4A CN110490864B (en) 2019-08-22 2019-08-22 Self-adaptive defect detection method for image

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910779680.4A CN110490864B (en) 2019-08-22 2019-08-22 Self-adaptive defect detection method for image

Publications (2)

Publication Number Publication Date
CN110490864A CN110490864A (en) 2019-11-22
CN110490864B true CN110490864B (en) 2021-09-21

Family

ID=68552984

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910779680.4A Active CN110490864B (en) 2019-08-22 2019-08-22 Self-adaptive defect detection method for image

Country Status (1)

Country Link
CN (1) CN110490864B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111127415B (en) * 2019-12-19 2023-07-25 信利(仁寿)高端显示科技有限公司 Mura quantification method based on excimer laser annealing
CN112598647A (en) * 2020-12-24 2021-04-02 凌云光技术股份有限公司 Method for detecting weak line defect under arc-shaped surface gradual change background
CN113284148B (en) * 2021-07-23 2021-10-15 苏州高视半导体技术有限公司 Screen dust filtering method
CN113888537B (en) * 2021-12-03 2022-04-12 深圳市网旭科技有限公司 Mask extraction method, device, equipment and storage medium
CN116452582A (en) * 2023-06-13 2023-07-18 季华实验室 Mirror-like surface data detection method and device, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6381374B1 (en) * 1998-10-30 2002-04-30 General Electric Company Histogram analysis method for defective pixel identification
CN107703715A (en) * 2016-08-08 2018-02-16 中芯国际集成电路制造(上海)有限公司 A kind of restorative procedure of mask pattern defect
CN108460757A (en) * 2018-02-11 2018-08-28 深圳市鑫信腾科技有限公司 A kind of mobile phone TFT-LCD screens Mura defects online automatic detection method
CN109916922A (en) * 2019-04-02 2019-06-21 易思维(杭州)科技有限公司 Mirror surface/class mirror article defect inspection method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190238796A1 (en) * 2017-05-11 2019-08-01 Jacob Nathaniel Allen Object Inspection System And Method For Inspecting An Object

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6381374B1 (en) * 1998-10-30 2002-04-30 General Electric Company Histogram analysis method for defective pixel identification
CN107703715A (en) * 2016-08-08 2018-02-16 中芯国际集成电路制造(上海)有限公司 A kind of restorative procedure of mask pattern defect
CN108460757A (en) * 2018-02-11 2018-08-28 深圳市鑫信腾科技有限公司 A kind of mobile phone TFT-LCD screens Mura defects online automatic detection method
CN109916922A (en) * 2019-04-02 2019-06-21 易思维(杭州)科技有限公司 Mirror surface/class mirror article defect inspection method

Also Published As

Publication number Publication date
CN110490864A (en) 2019-11-22

Similar Documents

Publication Publication Date Title
CN110490864B (en) Self-adaptive defect detection method for image
CN111758024B (en) Defect detection method and device
CN108896278B (en) Optical filter silk-screen defect detection method and device and terminal equipment
CN108152278B (en) Urine detection method and device
JP6325520B2 (en) Unevenness inspection system, unevenness inspection method, and unevenness inspection program
US20170154234A1 (en) Information processing device, information processing method, computer-readable recording medium, and inspection system
JP6664557B2 (en) Deformation detection device
CN111047615B (en) Image-based straight line detection method and device and electronic equipment
CN110736610B (en) Method and device for measuring optical center deviation, storage medium and depth camera
CN111598801B (en) Identification method for weak Mura defect
CN117058154B (en) Defect identification method, system and medium for 3DP metal printing powder spreading process
CN116109635B (en) Method, device, equipment and medium for detecting surface quality of composite suspension insulator
CN116152261B (en) Visual inspection system for quality of printed product
EP2226763A2 (en) Image processing method and apparatus for detecting an edge of an object within an image
CN107230212B (en) Vision-based mobile phone size measuring method and system
CN116883336A (en) Image processing method, device, computer equipment and medium
KR101842535B1 (en) Method for the optical detection of symbols
CN117557565B (en) Detection method and device for lithium battery pole piece
CN108399617B (en) Method and device for detecting animal health condition
CN113570578B (en) Method and device for detecting lens ghost phenomenon
KR20160001868A (en) Method for calibrating distortion of image in camera
CN109313811B (en) Automatic correction method, device and system based on vibration displacement of vision system
CN115760653A (en) Image correction method, device, equipment and readable storage medium
CN111369513A (en) Abnormity detection method, abnormity detection device, terminal equipment and storage medium
US20200304739A1 (en) Image processing device, image processing method and storage medium

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
CP01 Change in the name or title of a patent holder
CP01 Change in the name or title of a patent holder

Address after: Room 495, building 3, 1197 Bin'an Road, Binjiang District, Hangzhou City, Zhejiang Province 310051

Patentee after: Yi Si Si (Hangzhou) Technology Co.,Ltd.

Address before: Room 495, building 3, 1197 Bin'an Road, Binjiang District, Hangzhou City, Zhejiang Province 310051

Patentee before: ISVISION (HANGZHOU) TECHNOLOGY Co.,Ltd.