Search

CN-121982010-A - Defect detection method, device, electronic equipment and storage medium

CN121982010ACN 121982010 ACN121982010 ACN 121982010ACN-121982010-A

Abstract

The application provides a defect detection method, a device, electronic equipment and a storage medium, wherein the defect detection method comprises the steps of carrying out defect detection on a color image and/or a gray level image corresponding to a region to be detected, determining a target defect, and determining that the target defect exists in the region to be detected under the condition that the target defect is determined to be a real defect according to a color mask of the target defect and/or the similarity of the target defect and a preset pseudo defect. The defect detection is carried out on the gray level image corresponding to the region to be detected, so that the influence of chromatic aberration factors on the defect detection is reduced, the authenticity of the detected target defect can be judged through the pseudo defect and the color mask, the robustness of the defect detection is improved, the transitional recall is reduced, and the controllability and the effectiveness of the defect detection are improved.

Inventors

  • ZENG WENBIN
  • ZHANG HENG
  • LIANG JIARUI
  • ZHU HENG

Assignees

  • 捷普电子(广州)有限公司

Dates

Publication Date
20260505
Application Date
20260128

Claims (10)

  1. 1. A defect detection method, comprising: Performing defect detection on the color image and/or the gray level image corresponding to the region to be detected, and determining a target defect; and under the condition that the target defect is determined to be a real defect according to the color mask of the target defect and/or the similarity between the target defect and a preset pseudo defect, determining that the target defect exists in the region to be detected.
  2. 2. The method according to claim 1, wherein after performing defect detection on the color image and/or the gray scale image corresponding to the region to be detected, determining the target defect, further comprises: under the condition that the region to be detected corresponds to the color image, determining the similarity between the target defect and the pseudo defect; Under the condition that the similarity is dissimilar, determining the target number of non-zero value pixel points of the target defect according to the color mask of the target defect; determining that the target defect is a real defect under the condition that the target number is larger than a pixel point threshold value and the abnormality score of the target defect is larger than a first score threshold value, wherein the pixel point threshold value is larger than or equal to zero; and determining that the target defect is a real defect under the condition that the target number is equal to zero and the abnormality score of the target defect is greater than a second score threshold.
  3. 3. The method according to claim 1, wherein after performing defect detection on the color image and/or the gray scale image corresponding to the region to be detected, determining the target defect, further comprises: Under the condition that the region to be detected corresponds to the gray level image, determining the similarity between the target defect and the pseudo defect; And determining that the target defect is a real defect under the condition that the similarity is dissimilar.
  4. 4. A method according to claim 2 or 3, wherein said determining the similarity between the target defect and a pseudo defect comprises: And determining that the similarity of the target defect and the pseudo defect is dissimilar under the condition that the categories of the target defect and the pseudo defect are different, the Euclidean distance between the target defect and the pseudo defect is larger than a distance threshold value and the area difference between the target defect and the pseudo defect is larger than an area threshold value.
  5. 5. A defect detection apparatus, comprising: The detection module is used for detecting defects of the color image and/or the gray image corresponding to the region to be detected and determining target defects; The determining module is used for determining that the target defect exists in the to-be-detected area under the condition that the target defect is determined to be a real defect according to the color mask of the target defect and/or the similarity of the target defect and a preset pseudo defect.
  6. 6. The apparatus of claim 5, wherein the means for determining is further configured to: under the condition that the region to be detected corresponds to the color image, determining the similarity between the target defect and the pseudo defect; Under the condition that the similarity is dissimilar, determining the target number of non-zero value pixel points of the target defect according to the color mask of the target defect; determining that the target defect is a real defect under the condition that the target number is larger than a pixel point threshold value and the abnormality score of the target defect is larger than a first score threshold value, wherein the pixel point threshold value is larger than or equal to zero; and determining that the target defect is a real defect under the condition that the target number is equal to zero and the abnormality score of the target defect is greater than a second score threshold.
  7. 7. The apparatus of claim 5, wherein the means for determining is further configured to: Under the condition that the region to be detected corresponds to the gray level image, determining the similarity between the target defect and the pseudo defect; And determining that the target defect is a real defect under the condition that the similarity is dissimilar.
  8. 8. The apparatus according to claim 6 or 7, wherein the determining module is configured to: And determining that the similarity of the target defect and the pseudo defect is dissimilar under the condition that the categories of the target defect and the pseudo defect are different, the Euclidean distance between the target defect and the pseudo defect is larger than a distance threshold value and the area difference between the target defect and the pseudo defect is larger than an area threshold value.
  9. 9. An electronic device comprising a processor, a memory and a program or instruction stored on the memory and executable on the processor, which program or instruction when executed by the processor implements the steps of the defect detection method as claimed in any of claims 1 to 4.
  10. 10. A readable storage medium, wherein a program or instructions is stored on the readable storage medium, which when executed by a processor, implements the steps of the defect detection method according to any of claims 1-4.

Description

Defect detection method, device, electronic equipment and storage medium Technical Field The application belongs to the technical field of product defect detection, and particularly relates to a defect detection method, a defect detection device, electronic equipment and a storage medium. Background The traditional defect detection technology is easy to be interfered in the detection of the surface defects of the industrial product surface, the industrial picture is easy to be influenced by factors such as illumination change, product color difference change, product background, slight differences of components on the product surface and the like although the background is fixed, and further the situation of excessive recall of the defect detection (namely, the normal defect-free area is also judged to be the defect) is caused, so that the error rate of the defect detection of the product is too high, and the defect detection result is unreliable. Disclosure of Invention The embodiment of the application provides a defect detection method, a defect detection device and an electronic equipment storage medium, which can solve the problems of high error rate of product defect detection and unreliable defect detection result. In a first aspect, an embodiment of the present application provides a defect detection method, where the method includes performing defect detection on a color image and/or a gray scale image corresponding to a region to be detected, determining that a target defect exists in the region to be detected, where the target defect is determined to be a real defect according to a color mask of the target defect and/or a similarity between the target defect and a preset pseudo defect. In a second aspect, an embodiment of the present application provides a defect detection device, where the defect detection device includes a detection module configured to detect a defect in a color image and/or a gray scale image corresponding to a region to be detected, and determine a target defect, and a determination module configured to determine that the region to be detected has the target defect when the target defect is determined to be a real defect according to a color mask of the target defect and/or a similarity between the target defect and a preset pseudo defect. In a third aspect, an embodiment of the present application provides an electronic device, including a processor, a memory, and a program or instruction stored on the memory and executable on the processor, the program or instruction implementing the steps of the method according to the first aspect when executed by the processor. In a fourth aspect, embodiments of the present application provide a readable storage medium having stored thereon a program or instructions which when executed by a processor perform the steps of the method according to the first aspect. In the embodiment of the application, the target defect is determined by carrying out defect detection on the color image and/or the gray level image corresponding to the region to be detected, and under the condition that the target defect is determined to be a real defect according to the color mask of the target defect and/or the similarity of the target defect and a preset pseudo defect, the target defect is determined to exist in the region to be detected, and the authenticity and the effectiveness of the target defect can be determined through the color mask of the target defect and/or the similarity of the target defect and the preset pseudo defect, so that the robustness of defect detection is improved, and excessive recall is avoided. Drawings In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments described in the embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort to a person skilled in the art. FIG. 1 is a schematic flow chart of a defect detection method according to an embodiment of the present application; FIG. 2 is a schematic diagram of a defect detection method according to an embodiment of the present application; FIG. 3 is a schematic diagram of a defect detecting device according to an embodiment of the present application; Fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present application. Detailed Description The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the application. All other embodiments, which can be made by those skilled in the art based on the embodiments of th