CN112147147B - Edge defect detection method, edge defect detection device and quality detection equipment - Google Patents

Edge defect detection method, edge defect detection device and quality detection equipment Download PDF

Info

Publication number
CN112147147B
CN112147147B CN201910559978.4A CN201910559978A CN112147147B CN 112147147 B CN112147147 B CN 112147147B CN 201910559978 A CN201910559978 A CN 201910559978A CN 112147147 B CN112147147 B CN 112147147B
Authority
CN
China
Prior art keywords
detection
edge
defect
fine
discrete
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
CN201910559978.4A
Other languages
Chinese (zh)
Other versions
CN112147147A (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.)
Hangzhou Hikrobot Co Ltd
Original Assignee
Hangzhou Hikrobot 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 Hangzhou Hikrobot Co Ltd filed Critical Hangzhou Hikrobot Co Ltd
Priority to CN201910559978.4A priority Critical patent/CN112147147B/en
Publication of CN112147147A publication Critical patent/CN112147147A/en
Application granted granted Critical
Publication of CN112147147B publication Critical patent/CN112147147B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • 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
    • 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
    • G01N2021/8854Grading and classifying of flaws
    • G01N2021/8861Determining coordinates of flaws
    • 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
    • G01N2021/8854Grading and classifying of flaws
    • G01N2021/8874Taking dimensions of defect into account
    • 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
    • G01N2021/8854Grading and classifying of flaws
    • G01N2021/8877Proximity analysis, local statistics
    • 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
    • G01N2021/8887Scan 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 based on image processing techniques

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Chemical & Material Sciences (AREA)
  • Analytical Chemistry (AREA)
  • Biochemistry (AREA)
  • General Health & Medical Sciences (AREA)
  • General Physics & Mathematics (AREA)
  • Immunology (AREA)
  • Pathology (AREA)
  • Image Processing (AREA)
  • Image Analysis (AREA)

Abstract

The invention provides an edge defect detection method, an edge defect detection device and quality detection equipment. Based on the invention, the preset ideal edge curve can be used as a detection reference for the target image, so that the interference of image noise on the accuracy of the edge curve can be reduced; further, the localized defect can be defined based on the distribution of the fine candidate defect points obtained by the fine detection, so that the probability of missing the defect can be reduced, and the accuracy of defect detection can be improved. In addition, the invention can support the manual setting or automatic detection of the ideal edge curve based on the sample image, and is beneficial to the precision control of the ideal edge curve; the invention can support manual setting or automatic generation of the detection area, and is beneficial to improving the accuracy of targeting positioning of defect detection; the invention can shield the predictable strong interference area by introducing a mask; the types of defects identifiable by the present invention may include asperity defects and fracture defects.

Description

Edge defect detection method, edge defect detection device and quality detection equipment
Technical Field
The present invention relates to the field of machine vision, and in particular, to an edge defect detection method, an edge defect detection apparatus, and a quality detection device.
Background
The edge defect detection of the product is an important quality detection index. How to improve the accuracy of edge defect detection is a technical problem to be solved in the prior art.
Disclosure of Invention
In view of the above, the embodiments of the present invention respectively provide an edge defect detecting method, an edge defect detecting device, and a quality detecting apparatus.
In one embodiment, there is provided an edge defect detection method including:
loading a preset ideal edge curve in a detection area of the target image, wherein the detection area covers edge features presented in the target image;
performing discrete detection in a detection area of the target image along the ideal edge curve;
when the discrete candidate defect points are detected, carrying out fine detection on the discrete candidate defect points along an ideal edge curve, wherein the detection granularity of the fine detection is smaller than that of the discrete detection, and the detection density of the fine detection is greater than that of the discrete detection;
And determining regional defects according to the distribution condition of the fine candidate defect points obtained by fine detection.
Optionally, before loading a preset ideal edge curve in a detection area of the captured target image, the method further includes: visually presenting the acquired sample image on a human-computer interaction interface, and storing an input curve detected in the human-computer interaction interface as an ideal edge curve; or detecting sample edge points in the acquired sample image, and fitting the detected sample edge points to form an ideal edge curve; wherein the sample image contains the desired edge of the target image.
Optionally, before performing discrete detection in the detection area of the target image along the ideal edge curve, further comprising: and carrying out pose matching correction on the loaded ideal edge curve and the target image.
Optionally, before performing discrete detection in the detection area of the target image along the ideal edge curve, further comprising: determining a detection area of the target image according to the man-machine interaction input information, and correcting the loaded ideal edge curve to take the boundary of the detection area as a cut-off endpoint; alternatively, a detection region is created from the extent of the ideal edge curve that locates the boundary at the end point of the ideal edge curve.
Optionally, before performing discrete detection in the detection area of the target image along the ideal edge curve and/or performing fine detection on the discrete candidate defect points obtained by the discrete detection along the ideal edge curve, the method further includes: a mask is loaded in the detection area of the target image.
Optionally, performing discrete detection in the detection region of the target image along the ideal edge curve includes: creating a plurality of discrete detection sub-regions arranged at predetermined intervals along an ideal edge curve in the detection region; detecting discrete edge points in each discrete detection sub-area respectively; measuring the deviation distance of each detected discrete edge point relative to an ideal edge curve; and determining the discrete edge points with the deviation distance exceeding a preset first deviation threshold value as discrete candidate defect points.
Optionally, fine detection of discrete candidate defect points along the ideal edge curve includes: selecting a sub-region set of a plurality of discrete detection sub-regions centering on the discrete detection sub-region where each discrete candidate defect point is located; creating a plurality of fine detection subareas along the ideal edge curve by taking the outermost boundary section of the selected subarea set as a cutoff point, wherein the number of the plurality of fine detection subareas is greater than the number of the plurality of discrete detection subareas included in the subarea set, and the span size of a single fine detection subarea along the ideal edge curve is smaller than the span size of a single discrete detection subarea along the ideal edge curve; detecting fine edge points in each fine detection subarea respectively; measuring the deviation distance of each detected fine edge point relative to an ideal edge curve; the fine edge points with the deviation distance exceeding a preset second deviation threshold value are defined as at least one fine candidate defect point set according to the position distribution; measuring the size of a distribution area of each fine candidate defect point set; a fine candidate defect point set whose distribution area size exceeds a predetermined size threshold is determined as a defect edge point set.
Optionally, creating a plurality of fine detection sub-regions along the ideal edge curve with the outermost boundary cut of the selected set of sub-regions as a cut-off point comprises: and creating a plurality of fine detection subareas which are sequentially adjacent along the ideal edge curve by taking the outermost boundary section of the selected subarea set as a cutoff point, wherein the span size of the single fine detection subarea along the ideal edge curve is not more than half of the span size of the single discrete detection subarea along the ideal edge curve.
Optionally, the fine detection of discrete candidate defect points along the ideal edge curve further comprises: and additionally delineating fine edge points, which are adjacent to the fine candidate defect point set on both sides and have deviation distances not exceeding a predetermined second deviation threshold, as the fine candidate defect point set.
Optionally, determining the localized defect according to the distribution of fine candidate defect points obtained by fine detection includes: the defect edge point set is determined as a concave-convex defect region, and/or a region in which fine edge point detection fails is determined as a fracture defect region.
Optionally, determining the fine defect edge point set as the concave-convex defect region, and/or determining the region in which the fine edge point detection fails as the fracture defect region includes: creating bounding boxes for each defective edge point set and areas with failure in fine edge point detection; determining defect attributes of each bounding box, wherein the defect attributes comprise concave-convex defects and fracture defects;
Bounding boxes having the same defect attributes and intersecting are merged.
In another embodiment, there is provided an edge defect detecting apparatus including:
the edge curve loading module is used for loading a preset ideal edge curve in a detection area of the shot target image;
a defect discrete detection module, which is used for detecting the defects, for discrete detection in a detection region of the target image along an ideal edge curve;
the defect fine detection module is used for carrying out fine detection on the discrete candidate defect points along an ideal edge curve when the discrete candidate defect points are detected, wherein the detection granularity of the fine detection is smaller than that of the discrete detection, and the detection density of the fine detection is larger than that of the discrete detection;
and the regional defect identification module is used for determining regional defects according to the distribution condition of the fine candidate defect points obtained by fine detection.
Optionally, the method further comprises: the ideal edge creating module is used for visually presenting the acquired sample image on a human-computer interaction interface and storing an input curve detected in the human-computer interaction interface as an ideal edge curve before a preset ideal edge curve is loaded in a detection area of the shot target image, or detecting sample edge points in the acquired sample image and fitting the detected sample edge points to form the ideal edge curve; wherein the sample image contains the desired edge of the target image.
Alternatively, the process may be carried out in a single-stage, further comprises: and the detection area setting module is used for determining the detection area of the target image according to the man-machine interaction input information before performing discrete detection in the detection area of the target image along the ideal edge curve, correcting the loaded ideal edge curve to take the boundary of the detection area as a cut-off endpoint, or creating the detection area with the boundary positioned by the endpoint of the ideal edge curve according to the extension range of the ideal edge curve.
Optionally, the method further comprises: and the regional local shielding module is used for loading a mask in the detection region of the target image before performing discrete detection in the detection region of the target image along the ideal edge curve and/or performing fine detection on discrete candidate defect points obtained by the discrete detection along the ideal edge curve.
Optionally, the area defect identifying module is further configured to determine a set of defect edge points determined by the fine detection as a concave-convex defect area, and determine a fine detection sub-area failing the fine edge point detection as a broken defect area.
In another embodiment, a quality inspection apparatus is provided that includes a processor for performing the steps in the edge defect detection method described above.
In another embodiment, a non-transitory computer readable storage medium is provided that stores instructions that, when executed by a processor, cause the processor to perform the steps in the edge defect detection method as described above.
Based on the above embodiment, a preset ideal edge curve can be used as a detection reference for the target image, so that compared with an edge curve obtained by detection fitting from the target image, the interference of image noise on the accuracy of the edge curve can be reduced; in addition, when discrete candidate defect points are detected along the ideal edge curve, each discrete candidate defect point can be finely detected, and regional defects can be defined according to the distribution of the fine candidate defect points obtained through fine detection, so that compared with a detection mode of representing the defects through isolated points obtained through discrete detection, the probability of missing detection of the defects can be reduced, and the accuracy of defect detection can be improved.
As an optional further optimization, the above embodiment can support manual setting or automatic detection of an ideal edge curve based on a sample image, which is helpful for precision control of the ideal edge curve; the embodiment can also support manual setting or automatic generation of the detection area, and is beneficial to improving the accuracy of targeting positioning of defect detection; the embodiment can also introduce a mask in the edge defect detection, which is helpful for shielding the influence of a predictable strong interference area on the detection accuracy; and, the above-described embodiments can recognize the concave-convex defect by the edge defect detection and can also extend to the fracture defect.
Drawings
The following drawings are only illustrative of the invention and do not limit the scope of the invention:
FIG. 1 is an exemplary flow chart of a method of edge defect detection in one embodiment;
FIG. 2 is a flow chart of an ideal edge curve creation process suitable for the edge defect detection method shown in FIG. 1;
FIG. 3 is a schematic diagram of an example of automatic detection based on the ideal edge curve creation process shown in FIG. 2;
FIG. 4 is a schematic diagram of an expanded flow of the edge defect detection method shown in FIG. 1 based on ideal edge curve adaptation;
FIGS. 5a to 5c are schematic views showing examples of manual setting of detection areas based on the expansion flow shown in FIG. 4;
FIG. 6 is a schematic diagram of another extended flow chart of the edge defect detection method shown in FIG. 1 based on ideal edge curve adaptation;
FIG. 7 is a flow chart illustrating an example of the edge defect detection method shown in FIG. 1;
FIG. 8 is a schematic diagram of an example of discrete detection based on the example flow shown in FIG. 7;
FIG. 9 is a flow chart based on the example shown in FIG. 7 schematic of a fine detection example of (a);
FIG. 10 is a schematic diagram illustrating an exemplary configuration of an edge defect inspection apparatus according to another embodiment;
FIG. 11 is a schematic diagram showing an expanded structure of the edge defect detecting device shown in FIG. 10;
FIG. 12 is a schematic view of another expanded structure of the edge defect detecting device shown in FIG. 10;
FIG. 13 is a schematic view of a further development of the edge defect inspection apparatus shown in FIG. 10;
fig. 14 is a schematic structural view of a quality inspection apparatus in another embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be further described in detail below by referring to the accompanying drawings and examples.
FIG. 1 is an exemplary flow chart of a method for edge defect detection in one embodiment. Referring to fig. 1, in one embodiment, the edge defect detection method may include:
s110: and loading a preset ideal edge curve in a detection area of the target image. Wherein the target image may be obtained in advance or in real time prior to this step, and the detection area may cover edge features present in the target image.
The ideal edge curve loaded in this step may be a straight line or a curve, and the setting of the ideal edge curve may refer to the desired edge of the target detection object corresponding to the target image. That is, the ideal edge curve may be arbitrarily adjusted according to the difference of the target detection object corresponding to the target image or the difference of the desired edge of the target detection object.
In addition, in the step, the loaded ideal edge curve and the target image can be further subjected to pose matching correction.
S120: discrete detection is performed in a detection area of the target image along the ideal edge curve.
Discrete detection at this step may be considered as discrete sampling of the target image along the ideal edge curve, and not every discrete sampled region is necessarily capable of detecting discrete candidate defect points. If any discrete candidate defect point is not obtained through discrete detection, the target image can be considered to have no edge defect, and the process can be directly ended at the moment.
And, as an optional optimization processing manner, the step may be preceded by further loading a mask in the detection area of the target image, to shield the interference or redundant areas that may be expected.
S130: when the discrete candidate defect points are detected, fine detection is performed on the discrete candidate defect points along the ideal edge curve, wherein the detection granularity of the fine detection is smaller than that of the discrete detection, and the detection density of the fine detection is greater than that of the discrete detection.
The fine detection in this step may be a more densely distributed discrete sampling of the sample area of the target image along the ideal edge curve, or even a continuous sampling of sample areas adjacent to each other, with the objective of finding the actual edge features around the discrete candidate defect points.
And, as an optional optimization processing manner, a mask may be further loaded in the detection area of the target image before this step to shield the interference or redundant area that can be expected.
S140: and determining regional defects according to the distribution condition of the fine candidate defect points obtained by fine detection.
The localized defect in this step refers to a region edge feature surrounding discrete candidate defect points, i.e., a linear defect that will expand from a point-like defect to have a certain edge length. The distribution of the fine candidate defect points may include a distribution shape (which may represent irregularities) of the lattice set, a distribution continuity (which may represent breaks) of the lattice set, and the like.
Of course, it is also possible that the detected fine candidate defect points include only the discrete candidate defect points detected in S120 and not include other defect edge points in addition thereto, and the localized defect at this time may be determined as a defect-free conclusion indicating that the discrete candidate defect points are suspected noise points, or may be determined as a burr defect indicating that the edge is severely worn, and may be specifically set according to the product attribute and the detection experience value of the actual detected object.
Based on the above flow, the preset ideal edge curve can be used as a detection reference for the target image, so that compared with the edge curve obtained by detection fitting from the target image, the interference of image noise on the accuracy of the edge curve can be reduced; in addition, when discrete candidate defect points are detected along the ideal edge curve, each discrete candidate defect point can be finely detected, and regional defects can be defined according to the distribution of the fine candidate defect points obtained through fine detection, so that compared with a detection mode of representing the defects through isolated points obtained through discrete detection, the probability of missing detection of the defects can be reduced, and the accuracy of defect detection can be improved. In addition, if the above procedure introduces a mask in discrete detection and/or fine detection, it may also help to shield the influence of the predictable strong interference area on the detection accuracy.
In practical application, the ideal edge curve can support manual setting, automatic detection setting and both manual setting and automatic detection setting, and can be preferentially selected from the ideal edge curves set in the two modes.
FIG. 2 is a flow chart of an ideal edge curve creation process suitable for the edge defect detection method shown in FIG. 1. Referring to fig. 2, before the process shown in fig. 1 is performed (i.e., before S110 shown in fig. 1), the edge defect detection method in this embodiment may further include the following steps:
s210: and starting a human-computer interaction interface for setting an ideal edge curve.
S220: and responding to the sample loading instruction detected at the human-computer interaction interface, and acquiring a sample image from a path appointed by the sample loading instruction. Wherein the sample image contains the desired edge of the target image.
S230: in response to the setting mode selection instruction detected at the man-machine interaction interface, determining a setting mode of the ideal edge curve, if the setting mode is the manual setting mode, jumping to S241, and if the setting mode is the detection setting mode, jumping to S251.
S241: and visually presenting the acquired sample image on a human-computer interaction interface, and then jumping to S242.
S242: the input curve detected in the man-machine interface is saved as an ideal edge curve, and then the process goes to S260.
For example, the input curve detected in the man-machine interaction interface may be a regular geometrical edge such as a straight line, an arc, etc., and the input curve may be formed by dragging with an interface tool and subjected to operations such as pose fine adjustment. It will be appreciated that the pose described herein may include information of the position, angle, etc. of the geometric edges to be as close as possible to the desired edges in the sample image.
S251: sample edge points are detected in the acquired sample image.
S252: the detected sample edge points are fitted to form an ideal edge curve, and then step S260 is performed.
S260: the ideal edge curve is saved.
As can be seen from the above flow, this embodiment supports precision control of the ideal edge curve by manual setting or automatic detection of the sample image.
Fig. 3 is a schematic diagram of an example of automatic detection based on the ideal edge curve creation process shown in fig. 2. Referring to fig. 3, in implementing S251 in the above-mentioned flow shown in fig. 2:
first, the detection area 300 may be determined according to an area definition frame detected in the human-computer interaction interface (in fig. 3, the detection area 300 is taken as a rectangular area as an example);
Then, the detection area 300 is divided into a plurality of sub-areas 310 (the sub-areas 310 are taken as rectangular areas in fig. 3 as an example), wherein the dividing direction of the sub-areas 310, the width W of the single sub-area 310, and the spacing S between the adjacent sub-areas 310 can be determined according to the configuration instructions detected in the human-computer interaction interface;
thereafter, edge points 320 are searched for each sub-region 310 using any one of edge point search algorithms, such as a Canny algorithm, a Sobel (Sobel) algorithm, a Prewitt algorithm, a Roberts (Roberts) algorithm, etc., and a previously created mask may be loaded at the time of edge point search to mask the edge points which are not desired to be detected;
if a plurality of edge points 320 are found in the same sub-area 310, one of the strongest edge points may be selected by using a preset screening condition, and the pixel difference may be used as an available screening condition of the strongest edge point, that is, the strongest edge point may have the largest gray difference compared with the adjacent pixel points, and of course, the screening condition is not limited thereto;
finally, the edge points 320 in each sub-region 310 are subjected to a straight line fitting or an arc fitting (in fig. 3, straight line fitting is taken as an example), and the fitting algorithm may use, for example, a least square method, a robust least square method, or the like.
It will be appreciated that although the above examples are given by way of example of ideal edge curves in the form of rectangular detection areas, rectangular sub-areas and straight line segments, the detection principle on which the above examples are based is equally applicable to the case of ideal edge curves in the form of circular arc segments in combination with circular, circular annular, and sector detection areas and sub-areas.
When the edge defect detection method of the embodiment is implemented, in order to enable the detection target to be more accurately positioned in the area where the edge feature is located, the detection area can support a manual setting mode, and if the extension range of the ideal edge curve is not matched with the size of the detection area, the embodiment can implement automatic adaptation of the ideal edge curve and the manually set detection area. Of course, the detection area may also be automatically created with reference to the ideal edge curve.
FIG. 4 is a schematic diagram of an extended flow chart of the edge defect detection method shown in FIG. 1 based on ideal edge curve adaptation. Referring to fig. 4, in order to support the adaptation of the ideal edge curve in the case of manually setting the detection area, the process shown in fig. 1 may be further extended to include the following steps:
s410: and loading a preset ideal edge curve in a detection area of the target image. Wherein the target image may be obtained in advance or in real time prior to this step and the detection area may cover edge features present in the target image.
This step can be considered to be basically the same as the S110 principle in fig. 1, and in this step, the loaded ideal edge curve can be further subjected to pose matching correction with the target image.
S420: and determining a detection area of the target image according to the man-machine interaction input information.
S430: the loaded ideal edge curve is modified to take the boundary of the detection area as the cut-off endpoint.
S440: discrete detection is performed in a detection area of the target image along the ideal edge curve.
This step can be considered to be substantially the same as the S120 principle in fig. 1, and as an alternative optimization procedure, a mask can be further loaded in the detection area of the target image before this step to shield the interference or redundant area that can be expected.
S450: when the discrete candidate defect points are detected, fine detection is performed on the discrete candidate defect points along the ideal edge curve, wherein the detection granularity of the fine detection is smaller than that of the discrete detection, and the detection density of the fine detection is greater than that of the discrete detection.
This step can be considered to be substantially the same as the S130 principle in fig. 1, and as an alternative optimization procedure, a mask may be further loaded in the detection area of the target image before this step to shield the interference or redundant area that can be expected.
S460: and determining regional defects according to the distribution condition of the fine candidate defect points obtained by fine detection.
This step can be considered to be substantially the same as the S140 principle in fig. 1.
Fig. 5a to 5c are schematic diagrams of examples of manual setting of detection areas based on the expansion flow shown in fig. 4. In the examples shown in fig. 5a to 5c, any template matching algorithm may be used to register and locate the ideal edge curve (taking the ideal edge curve as a straight line segment for example) with the target image, so that the ideal edge curve is rotationally translated to a pose close to the edge feature, and then:
referring to fig. 5a, for a manually set detection region 511 (taking a rectangular detection region as an example), if both ends of the ideal edge curve 512 after registration positioning are retracted within the detection region 511, the both ends of the ideal edge curve 512 are extended to the boundary of the detection region 511, that is, extended sections are formed outside both ends of the original model section of the ideal edge curve 512 (extended sections are shown as dotted line sections in fig. 5 a);
referring to fig. 5b, for a manually set detection area 521 (taking a rectangular detection area as an example), if both ends of the ideal edge curve 522 after registration positioning extend beyond the detection area 521, then cutting is performed at the intersection of both ends of the ideal edge curve 522 and the boundary of the detection area 521, that is, cutting is performed at both ends of the original model segment of the ideal edge curve 522 with the boundary of the detection area 521 (the cut portion is shown as a dotted line portion in fig. 5 b);
Referring to fig. 5c, for the manually set detection region 531 (taking a rectangular detection region as an example), if one end of the ideal edge curve 532 after registration positioning is retracted within the detection region 531 and the other end extends out of the detection region 531, then the retracted end of the ideal edge curve 532 is extended to the corresponding boundary of the detection region 531 and a cut is made at the intersection of the extended end of the ideal edge curve 532 and the boundary of the detection region 531, that is, an extended section is formed outside one end of the original model section of the ideal edge curve 532, and the other end of the original model section of the ideal edge curve 532 is cut with the boundary of the detection region 531 (the extended and cut sections are shown as dashed line sections in fig. 5 c).
It will be appreciated that although the above examples are given by way of example of ideal edge curves in the form of rectangular detection areas and straight segments, the adaptation principle on which the above examples are based is equally applicable to the case of ideal edge curves in the form of circular segments in combination with circular, annular, and sector detection areas.
FIG. 6 is a schematic diagram of another expansion flow of the edge defect detection method shown in FIG. 1 based on ideal edge curve adaptation. Referring to fig. 6, in order to support the adaptation of the ideal edge curve in the case of automatically setting the detection area, the process shown in fig. 1 may be further extended to include the following steps:
S610: and loading a preset ideal edge curve in a detection area of the target image. Wherein the target image may be obtained in advance or in real time prior to this step and the detection area may cover edge features present in the target image.
This step can be considered to be basically the same as the S110 principle in fig. 1, and in this step, the loaded ideal edge curve can be further subjected to pose matching correction with the target image.
S620: a detection region is created from the extent of the ideal edge curve to locate a boundary at the end point of the ideal edge curve.
S630: discrete detection is performed in a detection area of the target image along the ideal edge curve.
This step can be considered to be substantially the same as the S120 principle in fig. 1, and as an alternative optimization procedure, a mask can be further loaded in the detection area of the target image before this step to shield the interference or redundant area that can be expected.
S640: when the discrete candidate defect points are detected, fine detection is performed on the discrete candidate defect points along the ideal edge curve, wherein the detection granularity of the fine detection is smaller than that of the discrete detection, and the detection density of the fine detection is greater than that of the discrete detection.
This step can be considered to be substantially the same as the S130 principle in fig. 1, and as an alternative optimization procedure, a mask may be further loaded in the detection area of the target image before this step to shield the interference or redundant area that can be expected.
S650: and determining regional defects according to the distribution condition of the fine candidate defect points obtained by fine detection.
This step can be considered to be substantially the same as the S140 principle in fig. 1.
In the method of the above embodiment, both discrete detection and fine detection may refer to the detection creation process of the ideal edge curve, a molecular region detection manner is adopted, and the sub-region density used for fine detection may be greater than that for discrete detection. For a better understanding of the implementation of discrete detection and fine detection based on sub-regions, an example flow is described below.
FIG. 7 is a flowchart illustrating an example of the edge defect detection method shown in FIG. 1. Referring to fig. 7, the edge defect detection method shown in fig. 1 in this embodiment can implement discrete detection and fine detection based on the sub-region, and can thus be extended to include the following steps:
s700: and loading a preset ideal edge curve in a detection area of the target image. Wherein the target image may be obtained in advance or in real time prior to this step.
This step can be considered to be basically the same as the S110 principle in fig. 1, and in this step, the loaded ideal edge curve can be further subjected to pose matching correction with the target image. In addition, this step may be followed by manually setting the detection area and adapting the ideal edge curve to the detection area according to S420 to S430 shown in fig. 4, or may be followed by automatically setting and adapting the detection area based on the ideal edge curve according to S620 shown in fig. 6.
S710: a plurality of discrete detection sub-regions arranged at predetermined intervals are created in the detection region along the ideal edge curve.
Wherein the size of the single discrete detection subarea set in this step, and the spacing between adjacent discrete detection subareas can be adjusted by setting.
S711: discrete edge points are detected in each discrete detection sub-area.
Any edge point searching algorithm, such as Canny algorithm, sobel algorithm, prewitt algorithm, roberts algorithm, etc., can be used for detecting discrete edge points in the step, and a pre-created mask can be loaded during edge point searching to mask the edge points which are not expected to be detected; if a plurality of discrete edge points are found in the same discrete detection sub-area, one of the strongest edge points can be selected as the discrete edge point in the discrete detection sub-area by utilizing a preset screening condition.
S712: and measuring the deviation distance of each detected discrete edge point relative to the ideal edge curve, and determining the discrete edge points with the deviation exceeding a preset first deviation threshold value as discrete candidate defect points. If the deviation distance between all the discrete candidate defect points detected and the ideal edge curve does not exceed the first deviation threshold, that is, any discrete candidate defect point is not obtained through discrete detection, the target image can be considered to have no edge defect, and the process can be directly ended.
The above-described S710 to S712 can be regarded as extensions to S120 shown in fig. 1, and as an alternative optimization processing manner.
S720: when the discrete candidate defect points are detected, selecting a subarea set of a plurality of discrete detection subareas which take the discrete detection subareas where each discrete candidate defect point is located as the center.
S721: creating a plurality of fine detection subregions along the ideal edge curve with the outermost boundary cut of the selected subregion set as a cut-off point. Wherein the number of the plurality of fine detection sub-regions is greater than the number of the plurality of discrete detection sub-regions comprised by the collection of sub-regions, and the span size of a single fine detection sub-region along the desired edge curve is less than the span size of a single discrete detection sub-region along the desired edge curve.
For example, the step creates a plurality of fine detection sub-regions that are sequentially contiguous along the ideal edge curve with the outermost boundary cut of the selected set of sub-regions as a cut-off, wherein the span size of a single fine detection sub-region along the ideal edge curve may not exceed half the span size of a single discrete detection sub-region along the ideal edge curve.
S722: fine edge points are detected in each fine detection sub-area, respectively.
Any edge point searching algorithm, such as Canny algorithm, sobel algorithm, prewitt algorithm, roberts algorithm, etc., can be used for detecting the fine edge points in the step, and a pre-created mask can be loaded during the edge point searching to mask the edge points which are not wanted to be detected.
In theory, in the case of performing fine detection around discrete candidate defect points, the obtained fine candidate defect points include at least the discrete candidate defect points, and further include other fine candidate defect points whose deviation distances exceed the second deviation threshold. The second deviation threshold value may be the same as the first deviation threshold value or may be different from the first deviation threshold value.
S723: and measuring the deviation distance of each detected fine edge point relative to the ideal edge curve, and delineating the fine edge points with the deviation distance exceeding a preset second deviation threshold value into at least one fine candidate defect point set according to the position distribution.
In this step, the fine edge points whose deviation distances exceed the predetermined second deviation threshold are plotted according to the position distribution, which is understood as when fine edge points whose deviation distances exceed the second deviation threshold are detected in one fine detection sub-area:
if no fine edge points with the deviation distances exceeding a second deviation threshold exist in the adjacent fine detection sub-areas at two sides of the fine detection sub-area, the fine edge points with the deviation distances exceeding the second deviation threshold in the fine detection sub-area are defined as a fine candidate defect point set;
and if the fine edge points with the deviation distances exceeding the second deviation threshold value exist in the adjacent fine detection subareas on at least one side of the fine detection subareas, the fine edge points with the deviation distances exceeding the second deviation threshold value in the fine detection subareas and the adjacent fine detection subareas on at least one side are jointly defined as a fine candidate defect point set.
That is, the number of fine candidate defect point sets depends on the number of fine edge points for which the deviation distance exceeds the second deviation threshold, and the distribution continuity of such fine edge points.
In addition, some of the dentate concave-convex defects have some edge points deviated from the ideal edge curve and some other edge points close to the ideal edge curve, so that if the deviation distance does not exceed the fine edge point of the second deviation threshold, the fine edge points should be additionally identified as fine candidate defect points if both sides thereof are adjacent to the fine candidate defect point set. Adjacent as described herein may refer to fine detection sub-areas that are not more than a predetermined number (three or five) apart from fine edge points whose deviation distance does not exceed the second deviation threshold.
S724: and additionally delineating fine edge points, which are adjacent to the fine candidate defect point set on both sides and have deviation distances not exceeding a predetermined second deviation threshold, as the fine candidate defect point set.
S725: the distribution area size of each fine candidate defect point set is measured, and the fine candidate defect point set whose distribution area size exceeds a predetermined size threshold is determined as a defect edge point set. The size of the distribution area measured in this step may be the size of the distribution area formed by the fine candidate defect point set in the extending direction along the ideal edge curve, and the size may be regarded as the projection size of the distribution area formed by the fine candidate defect point set on the ideal edge curve.
The above-described S720 to S725 may be regarded as an extension to S130 shown in fig. 1, and as an alternative optimization processing, a mask may be further loaded in the detection area of the target image before S722 to shield the interference or redundancy area that can be expected.
S730: the defect edge point set is determined as a concave-convex defect region, and/or a region in which fine edge point detection fails is determined as a fracture defect region. The number and form of the localized defects determined in this step may be determined according to input settings detected at the human-computer interaction interface.
For example, the present step may create bounding boxes for each fine defect edge point set and areas where fine edge point detection fails, respectively, determine defect attributes of each bounding box (defect attributes of bounding boxes of defect edge point areas are concave-convex defects, defect attributes of bounding boxes of fine detection sub-areas where fine edge point detection fails are fracture defects), and merge bounding boxes that have the same defect attributes and intersect.
In addition, the step can further perform statistical treatment on the regional defects, and specifically can include: determining image coordinates of the central position of each regional defect in the target image, and/or determining the image area of each regional defect in the target image, and/or determining the maximum deviation of each regional defect compared with an ideal edge curve, and/or intercepting the local graph of the regional defect in the target image.
In addition, there is a theoretical case where the detected fine candidate defect point includes only the discrete candidate defect point detected in S713 and does not include other defect edge points in addition thereto, and the localized defect at this time may be determined as a defect-free conclusion indicating that the discrete candidate defect point is a suspected noise point, or may be determined as a burr defect indicating that the edge is severely worn out, and specifically may be set according to the product attribute and the detection experience value of the actual detected object.
Fig. 8 is a schematic diagram of an example of discrete detection based on the example flow shown in fig. 7. Please refer to fig. 8:
in the implementation of S710 in the above-described flow shown in fig. 7, the detection area 300 may be divided into a plurality of discrete detection sub-areas 810 along the ideal edge curve 800 (in fig. 8, the ideal edge curve 800 is taken as a straight line segment for example) (in fig. 8, the discrete detection sub-areas 810 are taken as rectangular areas for example);
in the implementation of S711 in the above-mentioned flow shown in fig. 7, any one of the edge point searching algorithms may be used for searching the discrete edge points 820 for each discrete detection sub-region 810, where if a plurality of discrete edge points 820 are found in the same discrete detection sub-region 810, one of the strongest edge points may be selected by using a preset screening condition;
In the implementation of S712 in the above-described flow as shown in fig. 7, the projection distance of the discrete edge points 820 in the discrete detection sub-region 810 from the ideal edge curve 800 may be detected as a deviation, and the discrete edge points 820 whose deviation exceeds the first deviation threshold may be determined as discrete candidate defect points (discrete candidate defect points are indicated by bolded solid line symbols "x" and broken line symbols "x" in fig. 8 represent non-discrete candidate defect points).
Fig. 9 is a schematic diagram of an example of fine detection based on the example flow shown in fig. 7. Please refer to fig. 9 and also refer back to fig. 8:
in the implementation of S720 in the above-described flow as shown in fig. 7, a sub-region set of a plurality of discrete detection sub-regions centered on the discrete detection sub-region where each discrete candidate defect point is located, that is, three discrete detection sub-regions between boundary points identified as E1 and E2 along the ideal edge curve 800 in fig. 8, may be selected;
in embodying S721 in the above-described flow as shown in fig. 7, sixteen fine detection sub-regions 830 are created along the ideal edge curve 800, sixteen fine detection sub-regions 830 are arranged adjacent to each other between boundary points E1 and E2, and the span size of a single fine detection sub-region 830 along the ideal edge curve 800 is one-fourth of the span size of a single discrete detection sub-region 820 along the ideal edge curve, i.e., no more than half of the span size of a single discrete detection sub-region 820 along the ideal edge curve;
In particular implementing S722 in the above-described flow as shown in fig. 7, the fine edge points 840 may be detected in each fine detection sub-region 830, respectively, each fine detection sub-region 830 allowing detection of one or more fine edge points 840;
in the implementation of S723 in the above-described flow as shown in fig. 7, the fine edge points whose deviation distances exceed the predetermined second deviation threshold may be delineated as a fine candidate defect point set (as the set of fine edge points 840 delineated by the dashed boxes 851, 853, and 855 in fig. 9);
in the implementation of S724 in the above-described flowchart shown in fig. 7, the fine edge points whose deviation distance does not exceed the predetermined second deviation threshold and whose both sides are adjacent to the fine candidate defect point set may be additionally delineated as the fine candidate defect point set (the set of fine edge points 840 delineated as the dashed box 852 in fig. 9) to be determined as the fine defect edge point set;
in embodying S725 in the above-described flow as shown in fig. 7, a fine candidate defect point set whose distribution area size in the extending direction of the ideal edge curve 800 (i.e., the projected size on the ideal edge curve 800) exceeds a predetermined size threshold may be determined as a defect edge point set (a set of fine edge points 840 as outlined by dotted boxes 851, 852 and 853 in fig. 9), whereas a fine candidate defect point set whose distribution area size in the extending direction of the ideal edge curve 800 (i.e., the projected size on the ideal edge curve 800) does not exceed a predetermined size threshold (isolated fine edge points 840 as outlined by dotted boxes 855 in fig. 9) may be regarded as noise;
In the implementation of S730 in the flow shown in fig. 7, in addition to identifying the defect edge point set as a localized defect identifying the concave-convex defect, the area where the fine edge point detection outlined by the dashed line box 854 fails may be converted into a localized defect identifying the broken defect.
In specific implementations, the dashed boxes 851, 852, 853, and 854 may be actually represented as bounding boxes bounding the localized defect, and the corresponding defect attributes (the defect attributes of the dashed boxes 851 and 852 and 853 are concave-convex defects, the defect attribute of the dashed box 854 is a broken defect) may be set, respectively, and bounding boxes having the same defect attribute and intersecting may be merged.
Fig. 10 is a schematic diagram illustrating an exemplary structure of an edge defect detecting apparatus in another embodiment. Referring to fig. 10, in another embodiment, an edge defect detecting apparatus may include:
the edge curve loading module 1010 is configured to load a preset ideal edge curve in a detection area of the target image. The target image may be captured in advance or in real time.
A defect discrete detection module 1020 for performing discrete detection in a detection area of the target image along the ideal edge curve.
For example, the defect discrete detection module 1020 may detect discrete edge points in each discrete detection sub-region, detect a deviation distance of the discrete edge points detected in each discrete detection sub-region from the ideal edge curve, and determine the discrete edge points having a deviation exceeding a predetermined first deviation threshold as discrete candidate defect points.
The defect fine detection module 1030 is configured to perform fine detection on the discrete candidate defect points along the ideal edge curve when the discrete candidate defect points are detected, wherein a detection granularity of the fine detection is smaller than a detection granularity of the discrete detection, and a detection density of the fine detection is greater than a detection density of the discrete detection.
For example, when discrete candidate defect points are detected, the defect fine detection module 1030 may select a sub-region set of a plurality of discrete detection sub-regions centered on the discrete detection sub-region in which each discrete candidate defect point is located, create a plurality of fine detection sub-regions along the ideal edge curve with an outermost boundary section of the selected sub-region set as a cutoff point (the number of the plurality of fine detection sub-regions is greater than the number of the plurality of discrete detection sub-regions included in the sub-region set and a span size of the single fine detection sub-region along the ideal edge curve is smaller than a span size of the single discrete detection sub-region along the ideal edge curve), detect fine edge points in the respective fine detection sub-regions, and measure a deviation distance of each detected fine edge point with respect to the ideal edge curve, circle the fine edge points whose deviation distance exceeds a predetermined second deviation threshold as at least one fine candidate defect point set according to a position distribution, measure a distribution region size of each fine candidate defect point set, and determine the fine candidate point set whose distribution region size exceeds the predetermined size threshold as the defect edge point set. In addition, the defect fine detection module 1030 may additionally delineate, as the fine candidate defect point set, fine edge points whose deviation distance does not exceed a predetermined second deviation threshold and which are adjacent to the fine candidate defect point set on both sides.
If the defect discrete detection module 1020 detects that the deviation distance of all the discrete candidate defect points from the ideal edge curve does not exceed the first deviation threshold, that is, any discrete candidate defect point is not obtained through discrete detection, it may be considered that no edge defect exists in the target image, and the defect fine detection module 1030 may not be activated at this time.
The area defect identifying module 1040 is configured to determine an area defect according to the distribution of the fine candidate defect points obtained by fine detection.
Based on the device, the preset ideal edge curve can be used as a detection reference for the target image, so that compared with the edge curve obtained by detection fitting from the target image, the interference of image noise on the accuracy of the edge curve can be reduced; in addition, when discrete candidate defect points are detected along the ideal edge curve, each discrete candidate defect point can be finely detected, and regional defects can be defined according to the distribution of the fine candidate defect points obtained through fine detection, so that compared with a detection mode of representing the defects through isolated points obtained through discrete detection, the probability of missing detection of the defects can be reduced, and the accuracy of defect detection can be improved. In addition, if the above procedure introduces a mask in discrete detection and/or fine detection, it may also help to shield the influence of the predictable strong interference area on the detection accuracy.
In addition, in order to accurately identify the localized defect, the region defect identification module 1040 may be further configured to determine the fine defect edge point set as a concave-convex defect region and/or determine a region in which the fine edge point detection fails as a broken defect region.
For example, the region defect discrimination module 1040 may further create bounding boxes for each fine defect edge point set, determine defect attributes of each bounding box (defect attributes of bounding boxes of defect edge point regions are concave-convex defects, defect attributes of bounding boxes of fine detection sub-regions that failed fine edge point detection are fracture defects), and merge bounding boxes that have the same defect attributes and intersect. In addition, the area defect identification module 1040 may further perform further statistical processing on the localized defect, which may specifically include: determining image coordinates of the central position of each regional defect in the target image, and/or determining the image area of each regional defect in the target image, and/or determining the maximum deviation of each regional defect compared with an ideal edge curve, and/or intercepting the local graph of the regional defect in the target image.
FIG. 11 is a schematic diagram showing an expanded structure of the edge defect detecting device shown in FIG. 10. Referring to fig. 11, in order to support manual setting or automatic detection setting of an ideal edge curve, the edge defect detecting apparatus as shown in fig. 10 may further include: the ideal edge creating module 1050 is configured to visually present the obtained sample image on the human-computer interaction interface and store the input curve detected in the human-computer interaction interface as an ideal edge curve before loading a preset ideal edge curve in the detection area of the captured target image, or detect a sample edge point in the obtained sample image and fit the detected sample edge point to form an ideal edge curve. Wherein the sample image contains the desired edge of the target image.
Fig. 12 is a schematic view of another extended structure of the edge defect detecting device shown in fig. 10. Referring to fig. 12, in order to support the adaptation of the setting of the detection area and the ideal edge curve, the edge defect detection apparatus as shown in fig. 10 may further include: the detection area setting module 1060 is configured to determine a detection area of the target image according to the human-computer interaction input information and correct the loaded ideal edge curve to take a boundary of the detection area as a cut-off endpoint before performing discrete detection in the detection area of the target image along the ideal edge curve, or create a detection area with a boundary positioned by an endpoint of the ideal edge curve according to an extension range of the ideal edge curve.
It will be appreciated that the ideal edge creation module 1050 included in the expanded structure shown in fig. 11 may be further incorporated into the expanded structure shown in fig. 12.
Fig. 13 is a schematic view of still another expansion structure of the edge defect detecting device shown in fig. 10. Referring to fig. 13, in order to selectively shield an interference area, the edge defect detecting apparatus as shown in fig. 10 may further include: the local area mask module 1070 is configured to load a mask in the detection area of the target image before the discrete detection module 1020 performs discrete detection in the detection area of the target image along the ideal edge curve, and/or the fine discrete detection module 1030 performs fine detection on discrete candidate defect points obtained by the discrete detection along the ideal edge curve.
It will be appreciated that the ideal edge creation module 1050 included in the extended structure shown in fig. 11 and/or the detection region setting module 1060 included in the extended structure shown in fig. 11 may be further incorporated in the extended structure shown in fig. 13.
Fig. 14 is a schematic structural view of a quality inspection apparatus in another embodiment. Referring to fig. 14, in another embodiment, a quality detection apparatus may include a target image acquisition module 1410 (e.g., an imaging element or an image entry element) and a processor 1420, wherein the processor 1420 is configured to perform the steps in the edge defect detection method as in the previous embodiments. Also, the quality detection apparatus may further comprise a non-transitory computer readable storage medium 1430, which may store instructions that when executed by the processor 1420 cause the processor 1420 to perform the steps in the edge defect detection method as in the previous embodiments.
The foregoing description of the preferred embodiments of the invention is not intended to be limiting, but rather to enable any modification, equivalent replacement, improvement or the like to be made within the spirit and principles of the invention.

Claims (18)

1. An edge defect detection method, comprising:
loading a preset ideal edge curve in a detection area of the target image, wherein the detection area covers edge features presented in the target image, and the ideal edge curve is set by referring to an expected edge of a target detection object corresponding to the target image;
performing discrete detection in a detection region of the target image along the ideal edge curve, wherein the discrete detection comprises discrete sampling of the target image along the ideal edge curve, and wherein the discrete detection is for detecting discrete candidate defect points having a deviation distance from the ideal edge curve exceeding a predetermined first deviation threshold;
when the discrete candidate defect points are detected, carrying out fine detection on the discrete candidate defect points along an ideal edge curve, wherein the detection granularity of the fine detection is smaller than that of the discrete detection, and the detection density of the fine detection is greater than that of the discrete detection;
Determining a regional defect according to the distribution condition of the fine candidate defect points obtained by fine detection, wherein the regional defect comprises the following components: region edge features surrounding discrete candidate defect points.
2. The edge defect detection method according to claim 1, further comprising, before loading a predetermined ideal edge curve in a detection area of the photographed target image:
visually presenting the acquired sample image on a human-computer interaction interface, and storing an input curve detected in the human-computer interaction interface as an ideal edge curve; or alternatively
Detecting sample edge points in the acquired sample image, and fitting the detected sample edge points to form an ideal edge curve;
wherein the sample image contains the desired edge of the target image.
3. The edge defect detection method of claim 1, further comprising, prior to performing discrete detection in the detection area of the target image along the ideal edge curve:
and carrying out pose matching correction on the loaded ideal edge curve and the target image.
4. The edge defect detection method of claim 1, further comprising, prior to performing discrete detection in the detection area of the target image along the ideal edge curve:
Determining a detection area of the target image according to the man-machine interaction input information, and correcting the loaded ideal edge curve to take the boundary of the detection area as a cut-off endpoint; or alternatively
A detection region is created from the extent of the ideal edge curve to locate a boundary at the end point of the ideal edge curve.
5. The edge defect detection method according to claim 1, further comprising, before performing discrete detection in the detection area of the target image along the ideal edge curve and/or performing fine detection of discrete candidate defect points obtained by the discrete detection along the ideal edge curve:
a mask is loaded in the detection area of the target image.
6. The edge defect detection method of claim 1, wherein performing discrete detection in the detection area of the target image along the ideal edge curve comprises:
creating a plurality of discrete detection sub-regions arranged at predetermined intervals along an ideal edge curve in the detection region;
detecting discrete edge points in each discrete detection sub-area respectively;
measuring the deviation distance of each detected discrete edge point relative to an ideal edge curve;
and determining the discrete edge points with the deviation distance exceeding a preset first deviation threshold value as discrete candidate defect points.
7. The edge defect detection method of claim 6, wherein fine detection of discrete candidate defect points along an ideal edge curve comprises:
selecting a sub-region set of a plurality of discrete detection sub-regions centering on the discrete detection sub-region where each discrete candidate defect point is located;
creating a plurality of fine detection subareas along the ideal edge curve by taking the outermost boundary section of the selected subarea set as a cutoff point, wherein the number of the plurality of fine detection subareas is greater than the number of the plurality of discrete detection subareas included in the subarea set, and the span size of a single fine detection subarea along the ideal edge curve is smaller than the span size of a single discrete detection subarea along the ideal edge curve;
detecting fine edge points in each fine detection subarea respectively;
measuring the deviation distance of each detected fine edge point relative to an ideal edge curve;
the fine edge points with the deviation distance exceeding a preset second deviation threshold value are defined as at least one fine candidate defect point set according to the position distribution;
measuring the size of a distribution area of each fine candidate defect point set;
a fine candidate defect point set whose distribution area size exceeds a predetermined size threshold is determined as a defect edge point set.
8. The edge defect detection method of claim 7, wherein creating a plurality of fine detection sub-regions along the ideal edge curve with the outermost boundary cut of the selected set of sub-regions as a cutoff point comprises:
and creating a plurality of fine detection subareas which are sequentially adjacent along the ideal edge curve by taking the outermost boundary section of the selected subarea set as a cutoff point, wherein the span size of the single fine detection subarea along the ideal edge curve is not more than half of the span size of the single discrete detection subarea along the ideal edge curve.
9. The edge defect detection method of claim 7, wherein performing fine detection of discrete candidate defect points along an ideal edge curve further comprises:
and additionally delineating fine edge points, which are adjacent to the fine candidate defect point set on both sides and have deviation distances not exceeding a predetermined second deviation threshold, as the fine candidate defect point set.
10. The edge defect detection method according to claim 7, wherein determining the localized defect based on the distribution of fine candidate defect points obtained by fine detection comprises:
the defect edge point set is determined as a concave-convex defect region, and/or a region in which fine edge point detection fails is determined as a fracture defect region.
11. The edge defect detection method according to claim 10, wherein determining the set of fine defect edge points as the concave-convex defect region and/or determining the region where fine edge point detection fails as the broken defect region comprises:
creating bounding boxes for each defective edge point set and areas with failure in fine edge point detection;
determining defect attributes of each bounding box, wherein the defect attributes comprise concave-convex defects and fracture defects;
bounding boxes having the same defect attributes and intersecting are merged.
12. An edge defect detecting apparatus, comprising:
the edge curve loading module is used for loading a preset ideal edge curve in a detection area of the shot target image, and the ideal edge curve is set by referring to the expected edge of the target detection object corresponding to the target image;
a defect discrete detection module for performing discrete detection in a detection region of the target image along an ideal edge curve, wherein the discrete detection comprises discrete sampling of the target image along the ideal edge curve, and the discrete detection is used for detecting discrete candidate defect points whose deviation distance from the ideal edge curve exceeds a predetermined first deviation threshold;
The defect fine detection module is used for carrying out fine detection on the discrete candidate defect points along an ideal edge curve when the discrete candidate defect points are detected, wherein the detection granularity of the fine detection is smaller than that of the discrete detection, and the detection density of the fine detection is larger than that of the discrete detection;
the regional defect identification module is used for determining regional defects according to the distribution condition of the fine candidate defect points obtained through fine detection, wherein the regional defects comprise: region edge features surrounding discrete candidate defect points.
13. The edge defect detection apparatus of claim 12, further comprising:
the ideal edge creating module is used for visually presenting the acquired sample image on a human-computer interaction interface and storing an input curve detected in the human-computer interaction interface as an ideal edge curve before a preset ideal edge curve is loaded in a detection area of the shot target image, or detecting sample edge points in the acquired sample image and fitting the detected sample edge points to form the ideal edge curve; wherein the sample image contains the desired edge of the target image.
14. The edge defect detection apparatus of claim 12, further comprising:
and the detection area setting module is used for determining the detection area of the target image according to the man-machine interaction input information before performing discrete detection in the detection area of the target image along the ideal edge curve, correcting the loaded ideal edge curve to take the boundary of the detection area as a cut-off endpoint, or creating the detection area with the boundary positioned by the endpoint of the ideal edge curve according to the extension range of the ideal edge curve.
15. The edge defect detection apparatus of claim 12, further comprising:
and the regional local shielding module is used for loading a mask in the detection region of the target image before performing discrete detection in the detection region of the target image along the ideal edge curve and/or performing fine detection on discrete candidate defect points obtained by the discrete detection along the ideal edge curve.
16. The edge defect detecting apparatus of claim 12, wherein,
the region defect discriminating module is further configured to determine a set of defective edge points determined by the fine detection as a concave-convex defective region and a fine detection sub-region in which the fine edge point detection fails as a broken defective region.
17. A quality inspection apparatus comprising a processor for performing the steps in the edge defect inspection method of any one of claims 1 to 11.
18. A non-transitory computer readable storage medium storing instructions which, when executed by a processor, cause the processor to perform the steps in the edge defect detection method of any of claims 1 to 11.
CN201910559978.4A 2019-06-26 2019-06-26 Edge defect detection method, edge defect detection device and quality detection equipment Active CN112147147B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910559978.4A CN112147147B (en) 2019-06-26 2019-06-26 Edge defect detection method, edge defect detection device and quality detection equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910559978.4A CN112147147B (en) 2019-06-26 2019-06-26 Edge defect detection method, edge defect detection device and quality detection equipment

Publications (2)

Publication Number Publication Date
CN112147147A CN112147147A (en) 2020-12-29
CN112147147B true CN112147147B (en) 2023-12-22

Family

ID=73869705

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910559978.4A Active CN112147147B (en) 2019-06-26 2019-06-26 Edge defect detection method, edge defect detection device and quality detection equipment

Country Status (1)

Country Link
CN (1) CN112147147B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113658133B (en) * 2021-08-16 2022-06-21 江苏鑫丰源机电有限公司 Gear surface defect detection method and system based on image processing
CN114565771B (en) * 2022-04-29 2022-07-26 广东粤港澳大湾区硬科技创新研究院 Defect detection method and device for facilities on two sides of road
CN115063618B (en) * 2022-08-17 2022-11-11 成都数之联科技股份有限公司 Defect positioning method, system, equipment and medium based on template matching

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103439348A (en) * 2013-08-16 2013-12-11 中国科学院半导体研究所 Remote controller key defect detection method based on difference image method
CN105335963A (en) * 2015-09-24 2016-02-17 凌云光技术集团有限责任公司 Edge defect detection method and apparatus
CN105405142A (en) * 2015-11-12 2016-03-16 冯平 Edge defect detection method and system for glass panel
CN106251352A (en) * 2016-07-29 2016-12-21 武汉大学 A kind of cover defect inspection method based on image procossing
CN106408583A (en) * 2016-08-25 2017-02-15 凌云光技术集团有限责任公司 Multi-edge defect detecting method and device
CN106447649A (en) * 2016-08-25 2017-02-22 凌云光技术集团有限责任公司 Detection method and device of bead body position defect
CN107633507A (en) * 2017-09-02 2018-01-26 南京理工大学 LCD defect inspection methods based on contour detecting and characteristic matching
CN108956616A (en) * 2018-05-31 2018-12-07 南京航空航天大学 A kind of workpiece, defect detection method based on image

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103439348A (en) * 2013-08-16 2013-12-11 中国科学院半导体研究所 Remote controller key defect detection method based on difference image method
CN105335963A (en) * 2015-09-24 2016-02-17 凌云光技术集团有限责任公司 Edge defect detection method and apparatus
CN105405142A (en) * 2015-11-12 2016-03-16 冯平 Edge defect detection method and system for glass panel
CN106251352A (en) * 2016-07-29 2016-12-21 武汉大学 A kind of cover defect inspection method based on image procossing
CN106408583A (en) * 2016-08-25 2017-02-15 凌云光技术集团有限责任公司 Multi-edge defect detecting method and device
CN106447649A (en) * 2016-08-25 2017-02-22 凌云光技术集团有限责任公司 Detection method and device of bead body position defect
CN107633507A (en) * 2017-09-02 2018-01-26 南京理工大学 LCD defect inspection methods based on contour detecting and characteristic matching
CN108956616A (en) * 2018-05-31 2018-12-07 南京航空航天大学 A kind of workpiece, defect detection method based on image

Also Published As

Publication number Publication date
CN112147147A (en) 2020-12-29

Similar Documents

Publication Publication Date Title
CN112147147B (en) Edge defect detection method, edge defect detection device and quality detection equipment
CN110765951B (en) Remote sensing image airplane target detection method based on bounding box correction algorithm
US9171364B2 (en) Wafer inspection using free-form care areas
TWI475187B (en) Image processing devices and computer programs
KR101667471B1 (en) Defect determination device, radiography system, and defect determination method
WO2014129307A1 (en) Pattern-measuring apparatus and semiconductor-measuring system
JP5651428B2 (en) Pattern measuring method, pattern measuring apparatus, and program using the same
JP2012014475A (en) Pattern matching method, image processor and computer program
JP2014215301A (en) Method of detecting edge
JP2013115751A5 (en)
JP5094033B2 (en) Pattern matching method and computer program for performing pattern matching
CN113340909A (en) Glue line defect detection method based on machine vision
US10643326B2 (en) Semiconductor measurement apparatus and computer program
JP5647999B2 (en) Pattern matching apparatus, inspection system, and computer program
KR101733017B1 (en) Apparatus and method for detecting defect of optical film
CN110322508B (en) Auxiliary positioning method based on computer vision
KR101733018B1 (en) Apparatus and method for detecting defect of optical film
JP5308766B2 (en) PATTERN SEARCH CONDITION DETERMINING METHOD AND PATTERN SEARCH CONDITION SETTING DEVICE
US10317203B2 (en) Dimension measuring apparatus and computer readable medium
US20140291513A1 (en) Automatic filtering of sem images
KR102221526B1 (en) Melt pool width and deflection measurement method through melt pool image processing
JP2008218115A (en) Pattern measurement method and electron microscope
JP2008269264A (en) Method, device and program for tracking multiconductor cable by image processing, and method, device and program for detecting abnormality of multiconductor cable using the same
KR101646838B1 (en) Counting method for track images
TW202011121A (en) Target selection improvements for better design alignment

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
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 310051 room 304, B / F, building 2, 399 Danfeng Road, Binjiang District, Hangzhou City, Zhejiang Province

Applicant after: Hangzhou Hikvision Robot Co.,Ltd.

Address before: 310052 5 / F, building 1, building 2, no.700 Dongliu Road, Binjiang District, Hangzhou City, Zhejiang Province

Applicant before: HANGZHOU HIKROBOT TECHNOLOGY Co.,Ltd.

GR01 Patent grant
GR01 Patent grant