Defect detection method and automatic optical detection system comprising same

By establishing and matching point clouds, performing rotation, translation, and stretching corrections, and using KD trees and cluster analysis methods, the problems of difficult positioning and slow speed of traditional defect detection methods under color differences and multiple repetitive features are solved, achieving It provides efficient defect detection and can identify boundaries with different directions.

CN118735847APending Publication Date: 2024-10-01UTECHZONE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311359761.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2023-03-31
Filing Date
2023-10-19
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

Traditional defect detection methods rely on computer-aided manufacturing drawings and binary processing. It is difficult to find effective positioning points in objects with large color differences or repeated features, and cannot identify boundaries with different directions. The iterative nearest point algorithm is slow. slow.

Method used

By establishing point clouds of the master image and the image to be tested, performing rotation, translation, and stretching corrections, and using KD tree and cluster analysis methods for matching, defect detection can be achieved, avoiding the need to rely on computer-aided manufacturing of drawing files and binary processing. Identify rounded and right angles and speed up the inspection process.

Benefits of technology

It realizes defect detection under different colors and repeated feature conditions, reduces detection time, improves detection versatility and speed, and can identify boundaries with different directions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118735847A_ABST
    Figure CN118735847A_ABST
Patent Text Reader

Abstract

The invention relates to a flaw detection method and an automatic optical detection system comprising the same. The flaw detection method comprises the following steps: establishing a point cloud of a parent image and a point cloud of an image to be detected; performing rotation correction according to a rotation vector between the point cloud of the parent image and the point cloud of the to-be-measured image; according to a KD tree method, calculating a translation vector between the point cloud of the mother image and the point cloud of the to-be-detected image so as to perform translation correction; correspondingly setting at least one object on the point cloud of the parent image and the point cloud of the to-be-detected image through a clustering analysis method; matching at least one object on the point cloud of the parent image with at least one object on the point cloud of the to-be-detected image to calculate a deformation value, and performing stretching correction according to the deformation value; and individually constructing and matching the fine point cloud of the parent image and the fine point cloud of the to-be-detected image so as to complete flaw detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a defect detection method based on contour boundary reverse matching positioning and an automatic optical detection system comprising the same. Background Art

[0002] In the past defect detection process, the image of the object to be tested must first be binarized or a computer-aided manufacturing drawing (CAM) must be used to find the contour points of the cuttable object as a positioning standard. In the prior art, if there is a lack of computer-aided manufacturing drawings or when the binarization process cannot effectively segment the object, the traditional algorithm will not be able to find the contour points.

[0003] Furthermore, in the past, traditional algorithms used templates between the master and the image of the object to be tested to find the positioning point (Normailized Cross Correlation, NCC), but if the color difference of the object to be tested is too large or there are multiple highly repeated features in a single image (such as PCB, wafer and other industrial products), it will be difficult to find effective positioning points, resulting in positioning failure. In addition, traditional algorithms use the distance between the point cloud connection and the reasonable value to find abnormal contour points by this method, but this method cannot identify rounded corners and right angles, and the use of the iterative closest point algorithm (Iterative Closest Point, ICP) for point cloud matching has the problem of slow search speed. Summary of the invention

[0004] The main purpose of the present invention is to provide a defect detection method, which includes the following steps: establishing a point cloud of a mother image and a point cloud of an image to be tested; performing rotation correction according to the rotation vector between the point cloud of the mother image and the point cloud of the image to be tested; calculating the translation vector between the point cloud of the mother image and the point cloud of the image to be tested according to the KD tree method to perform translation correction; setting at least one object on the point cloud of the mother image and the point cloud of the image to be tested correspondingly through a cluster analysis method; matching at least one object on the point cloud of the mother image with at least one object on the point cloud of the image to be tested to calculate a deformation value, and performing stretching correction based on the deformation value; and individually constructing and matching the detailed point cloud of the mother image and the detailed point cloud of the image to be tested to complete defect detection.

[0005] Another object of the present invention is to provide an automatic optical inspection system, comprising an inspection platform, at least one image capture device and an inspection device. The inspection platform is used to set a sample to be tested. The image capture device is arranged on one side of the inspection platform and is used to photograph the sample to be tested on the inspection platform. The inspection device is connected to the image capture device, and after the image capture device obtains the image to be tested of the sample to be tested, the defect detection method as described above is executed to complete the defect detection.

[0006] Therefore, since the present invention is based on the grayscale change search method for reverse matching, it does not need to rely on computer-aided manufacturing drawings and binarization processing, and can perform rotation, translation, stretching correction and detection, and only needs to compare the master image and the image to be tested for detection, and is not affected by the color difference and repeated features of the object to be tested, and has good versatility in use. In addition, boundaries with different directions that could not be identified in the past (such as rounded corners and right angles) can also be detected, and the time spent on detection is reduced. BRIEF DESCRIPTION OF THE DRAWINGS

[0007] Figure 1 It is a block diagram of the automatic optical inspection system of the present invention.

[0008] Figure 2 It is a schematic diagram of the process of the defect detection method of the present invention.

[0009] Figure 3 It is a schematic diagram of the process of finding the closest features of two images in the KD tree in the present invention.

[0010] Figure 4 Schematic diagram of reverse matching positioning image matching in the present invention (I).

[0011] Figure 5 This is a schematic diagram of reverse matching positioning image matching in the present invention (II).

[0012] Figure 6 This is a schematic diagram of reverse matching positioning image matching in the present invention (III).

[0013] Figure 7 This is a schematic diagram of reverse matching positioning image matching in the present invention (IV).

[0014] Figure 8 This is a schematic diagram of reverse matching positioning image matching in the present invention (V).

[0015] Fig. 9 This is a schematic diagram of reverse matching positioning image matching in the present invention (VI).

[0016] The following are marked in the figure:

[0017] 100 Automatic Optical Inspection System

[0018] 10. Detection Platform

[0019] 20 Image capture device

[0020] 30 Auxiliary light source device

[0021] 40 Detection device

[0022] 41 Processor

[0023] 42 Storage Units

[0024] WP Samples to be tested

[0025] C1 Limit center point

[0026] C2 Limit Center Point

[0027] P1 Data Point

[0028] P2 Data Point

[0029] N1 Data Point DETAILED DESCRIPTION

[0030] The detailed description and technical contents of the present invention are described as follows with reference to the accompanying drawings.

[0031] The "one side" mentioned in the present invention can specifically be the upper side, lower side, left side, right side, front side, rear side of the corresponding object, or any position arranged near the object, or directly or indirectly connected to the object, etc., and is not limited in the present invention.

[0032] The following is a description of one embodiment of the present invention. For the hardware device of the present invention, please refer to Figure 1 , which is a block diagram of the automatic optical inspection system of the present invention, as shown in the figure: This embodiment discloses an automatic optical inspection system 100, which mainly includes a detection platform 10, an image capture device 20 arranged corresponding to the detection platform 10, an auxiliary light source device 30 arranged corresponding to the detection platform 10, used to provide auxiliary lighting for the sample WP to be tested, and a detection device 40 electrically connected or coupled to the image capture device 20.

[0033] The detection platform 10 is used to set the sample WP to be tested. In one embodiment, the detection platform 10 can be a simple setting platform for placing the sample WP to be tested for the image capture device 20 to shoot; in another embodiment, the detection platform 10 can be a vacuum adsorption platform for adsorbing the sample WP to be tested and leveling the sample WP to be tested, so that the image capture device 20 can shoot the leveled sample WP to be tested; in another embodiment, the detection platform 10 can be, for example, but not limited to, a linear stage, a conveyor belt, or a transfer device, and the sample WP to be tested is moved to the shooting range of the image capture device 20 to shoot the sample WP to be tested. The changes in these embodiments are not within the scope of the present invention.

[0034] The image capture device 20 is disposed on one side of the detection platform 10, and is used to photograph the sample WP on the detection platform 10 to obtain the image to be tested. In one embodiment, the image capture device 20 may be, for example, but not limited to, an area scan camera or a line scan camera, which is not limited in the present invention. The sample WP may be any object, such as a panel, a circuit board, or any workpiece, which is not limited in the present invention.

[0035] The auxiliary light source device 30 is disposed on any side of the detection platform 10 to provide auxiliary lighting for the sample WP to be tested. In one embodiment, the auxiliary light source device 30 may be, for example, but not limited to providing a backlight source, an ambient light source, a ring light source, a side light source, a coaxial light source, or a parallel light source, etc., which are not limited in the present invention. Based on the spectrum difference of light, the auxiliary light source device 30 may be, for example, but not limited to, a white light source, a red light source, a green light source, a blue light source, an excitation light source, or other lighting light sources, which are not limited in the present invention.

[0036] After the detection device 40 is connected or coupled to the image capture device 20 and obtains the image to be tested of the sample WP to be tested, it performs defect detection after reverse matching positioning based on the pre-stored master image. In one embodiment, the detection device 40 is directly connected to the image capture device 20. After the image capture device 20 takes a picture of the sample WP to be tested and performs preprocessing, the image to be tested is directly transmitted to the detection device 40 via a physical line or wirelessly; in another embodiment, the image capture device 20 can be connected to a centralized image storage device (such as a server for storing images), and the detection device 40 is connected to the centralized image storage device to access the image to be tested and then perform defect analysis; in another embodiment, the master image corresponding to the image to be tested can also be stored in the centralized image storage device, and downloaded when the detection device 40 performs defect detection. The variations of these embodiments are not limited in the present invention.

[0037] In one embodiment, the detection device 40 includes a processor 41 and a storage unit 42 connected to the processor 41. The processor 41 can be used to load the storage unit 42 to execute the program stored in the storage unit 42. In another embodiment, the processor 41 and the storage unit 42 can together constitute a computer or processor, such as a personal computer, a workstation, a host computer or other types of computers or processors, and their types are not limited here. In one embodiment, the processor 41 can be coupled to the storage unit 42. The processor 41 is, for example, a central processing unit (CPU), or other programmable general-purpose or special-purpose microprocessors (Microprocessors), digital signal processors (Digital Signal Processors, DSPs), programmable controllers, application-specific integrated circuits (Application Specific Integrated Circuits, ASICs), programmable logic devices (Programmable Logic Devices, PLDs) or other similar devices or combinations of these devices.

[0038] The detailed process of reverse matching positioning and defect detection is described in the following example. Figure 2 as well as Figure 3 , which are flowcharts of the defect detection method of the present invention and flowcharts of finding the closest features of two images from the KD tree of the present invention, will be referred to in the following description. Figures 4 to 9 , respectively, are schematic diagrams (I) to (VI) of the reverse matching positioning image matching in the present invention. This embodiment discloses a defect detection method, and the method steps are described as follows. It should be particularly explained that the rotation, translation, and stretching actions in the present invention are not limited to correcting the image to be tested with the image of the mother image as the standard, and can also be corrected with the image of the mother image as the standard. The latter can retain more details in the image to be tested than the former, and correcting the mother image can also reduce the amount of calculation when re-correcting other images to be tested. The changes in these embodiments are not within the scope of the present invention.

[0039] Step S01: The detection device establishes a point cloud of the mother image and a point cloud of the image to be tested. In one embodiment, the point cloud of the mother image and the point cloud of the image to be tested can be established by a grayscale change finding method (Gauge). Specifically, the establishment of the point cloud can be based on sampling at a predetermined regular interval. By establishing a point cloud, the required computing power can be greatly reduced compared to processing based on all pixels in the image. The "grayscale change finding method" can, for example, scan in the horizontal and vertical directions (including +x, -x, +y, -y) at the coordinates of the corresponding point cloud mark to establish the gradient of each data point in the point cloud, thereby obtaining a gradient map of the entire image. The established mother image point cloud is as follows: Figure 4 (a), the data point P1 of the parent image point cloud is represented by points of the same grayscale color and continuous lines formed by the points. The established image point cloud to be tested is as follows: Figure 4 (b) shows that the data point P2 of the image point cloud to be tested is represented by points of the same grayscale color and continuous lines formed by the points. It is worth noting that since the parent image point cloud and the image point cloud to be tested construct the point cloud direction, defects can also be detected at boundaries with different directions (such as rounded corners and right angles). In one embodiment, each data point of the parent image point cloud and the image point cloud to be tested includes pixel coordinates, grayscale values, and gradient information.

[0040] In one embodiment, in order to reduce the noise of the mother image point cloud and the image point cloud to be tested, the mother image point cloud and the image point cloud to be tested are first iteratively and repeatedly subjected to mean filtering until the smoothness and noise level of the image reach the required level, thereby completing gradient diffusion, reducing the noise in the image and further enhancing the features in the image.

[0041] Step S02: Next, the detection device performs rotation correction according to the rotation vector between the parent image point cloud and the image point cloud to be tested. In one embodiment, before performing rotation correction, the detection device 40 first uses the limit center point (Limit Center) of the parent image point cloud and the image point cloud to be tested as the standard point alignment (the limit center point C1 of the parent image point cloud is as shown in FIG. Figure 5 As shown in (a), the limit center point C2 of the image point cloud to be tested is Figure 5 (b) shows that the closest data point is found from the parent image point cloud and the image point cloud to be tested for alignment, and the rotation vector between the parent image point cloud and the image point cloud to be tested is calculated; specifically, the limit center point is the full-plate center point of the point cloud contour, and the limit center point is used to correspond to the flat, deep, and feature-free sample WP to be tested, which is not prone to displacement of the standard point due to defects, and the obtained standard point has better reliability.

[0042] In one embodiment, at least one closest data point is obtained by establishing a KD tree search in the partitions of the mother image point cloud and the image point cloud to be tested. In one embodiment, the rotation correction method described above can, for example, align the mother image point cloud and the image point cloud to be tested with the extreme center point, and then use the KD tree to search for the nearest point, which will obtain the detection point of the image point cloud to be tested and the search point of the mother image point cloud. Based on the line vector between the detection point and the center point of the image point cloud to be tested and the line vector between the search point corresponding to the detection point and the center point of the mother image point cloud, the rotation error can be calculated. After obtaining multiple rotation errors through iterative calculations, the multiple rotation errors are statistically analyzed to obtain the best rotation iteration angle (such as the standard deviation or median of multiple rotation errors). In addition to the above embodiments, the rotation correction method may also be but is not limited to Scale-Invariant Feature Transform (SIFT), Speeded Up Robust Features (SURF), Oriented FAST and Rotated BRIEF (ORB), Homography, Radon Transform or other similar algorithms.

[0043] Step S03: Then, according to the KD tree method, the translation vector between the mother image point cloud and the image point cloud to be tested is calculated to perform translation correction. In one embodiment, before calculating the translation vector, the detection device 40 first removes the point cloud on the image point cloud to be tested that is far away from the contour on the mother image point cloud, and establishes a KD tree (KD-TREE) by partitioning the mother image point cloud and the image point cloud to be tested to search for the nearest point of the mother image point cloud and the image point cloud to be tested, and then calculates the translation vector between the mother image point cloud and the image point cloud to be tested; specifically, the mother image point cloud can be attached to the image to be tested according to the coordinates and compared with the image point cloud to be tested (such as Figure 6 As shown, conversely, the image point cloud to be tested can be pasted on the mother image point cloud according to the coordinates), and the data points of the image point cloud to be tested that are far away from the mother image point cloud are deleted after comparison (indicated as data point N1 in the attached figure). After deleting the data points far away from the mother image point cloud, the updated image point cloud to be tested can be matched with the mother image point cloud again, and the number of re-matching can be preset or not performed, which is not limited in the present invention.

[0044] In step S02 and step S03, the closest features of the two images are found in the KD tree, for example, but not limited to, by following the steps below. Figure 3:Step F01 (create KD tree): First, establish KD tree for the data points in the parent image point cloud and the image point cloud to be tested. The process includes treating each data point as a high-dimensional vector, and then constructing these vectors as nodes of the KD tree; then execute step F02 (find nearest neighbor): for the data points in the parent image point cloud and the image point cloud to be tested, perform nearest neighbor search in the KD tree to find another data point closest to each data point. This process can be quickly searched through the hierarchical structure and distance function of the KD tree. Then execute step F03 (compare distance): find the nearest neighbor of each data point, and then calculate the distance between them. The distance can be calculated using distance functions such as Euclidean distance or Manhattan distance. Finally, execute step F04 (select minimum distance): select the smallest one from all distances, which will be the closest data point between the parent image point cloud and the image point cloud to be tested. Calculate the translation vector between the parent image point cloud and the image point cloud to be tested based on the coordinates of the closest data points. In one embodiment, the KD tree can be established in multiple regions of the parent image point cloud and the image point cloud to be tested to improve the calculation speed. For example, the parent image point cloud and the image point cloud to be tested are divided into nine regions, and a KD tree is established in each region. The search by establishing a KD tree by partition can greatly speed up the calculation speed compared to the previous use of ICP point cloud matching program. For example, a 1000000×1000000 brute force search takes 61.229 seconds, while building a tree in nine regions only takes 721 milliseconds.

[0045] Step S04: Then, at least one object is set on the parent image point cloud and the image point cloud to be tested. In one embodiment, the parent image point cloud and the image point cloud to be tested are constructed with point clouds of different angles and features by clustering analysis (DbScan) and set objects, wherein the parent image point cloud is clustered by the result of clustering analysis. Figure 7 As shown in (a), the result of cluster analysis of the image point cloud to be tested is as follows Figure 7 (b) (In order to clearly distinguish the two pictures, Figure 7 (a) is in bold).

[0046] Step S05: Match at least one object on the parent image point cloud with at least one object on the image point cloud to be tested to calculate a deformation value, and perform stretch correction according to the deformation value. Specifically, through the cluster analysis method, the object point cloud reconstructed from the parent image point cloud and the image point cloud to be tested can be used to find the object with the closest center of gravity, and the object with the closest center of gravity can be used as the matching object; when the objects are matched, all the contour points (including features and angles) of each object are used to match the objects, so as to obtain a matching score for each matching object; when the matching score is reached, the center of gravity points of the two objects that have reached the matching score are used as correction points, and after the correction points are collected, they are used as parameter standards for subsequent stretch correction, so as to complete the stretch correction using these parameter standards.

[0047] Step S06: Finally, the detailed point cloud of the master image and the detailed point cloud of the image to be tested are individually constructed and matched to complete defect detection. In one embodiment, the construction of the detailed point cloud may include directional features (such as Figure 8 (a)) and strength characteristics (such as Figure 8 (b)). During defect detection, the point cloud determined as candidate defects on the image to be tested can be clustered to find the defect contour; specifically, the points that cannot be matched with the detailed point cloud of the parent image in the detailed point cloud of the image to be tested can be determined as candidate defect points, and all the unmatched points can be constructed by DbScan to find the defect contour (such as Fig. 9 Through the above steps, the correction and defect detection of the master image and the image to be tested can be completed quickly.

[0048] In summary, since the present invention is based on the grayscale change search method for reverse matching, it does not need to rely on computer-aided manufacturing drawings and binarization processing, and can perform rotation, translation, stretching correction and detection, and only needs to compare the mother image and the image to be tested for detection, and is not affected by the color difference and repeated features of the object to be tested, and has good versatility in use. In addition, boundaries with different directions that could not be identified in the past (such as rounded corners and right angles) can also be detected, and the time spent on detection is reduced.

[0049] The present invention has been described in detail above. The above is only one preferred embodiment of the present invention and should not be used to limit the scope of the present invention. That is, all equivalent changes and modifications made according to the scope of the patent application of the present invention should still fall within the scope of the patent of the present invention.

Claims

1. A defect detection method, characterized in that: The steps include: Creating a point cloud of a mother image and a point cloud of an image to be tested; Performing rotation correction according to a rotation vector between the point cloud of the mother image and the point cloud of the image to be measured; According to the KD tree method, a translation vector between the point cloud of the mother image and the point cloud of the image to be tested is calculated to perform translation correction; By using a cluster analysis method, at least one object is correspondingly set on the point cloud of the mother image and the point cloud of the image to be tested; Matching the at least one object on the point cloud of the mother image with the at least one object on the point cloud of the image to be measured to calculate a deformation value, and performing stretch correction according to the deformation value; as well as The detailed point cloud of the mother image and the detailed point cloud of the image to be tested are individually constructed and matched to complete defect detection.

2. The defect detection method according to claim 1, characterized in that: The rotation correction, the translation correction, and the stretching correction are performed on the mother image, or the rotation correction, the translation correction, and the stretching correction are performed on the image to be measured.

3. The defect detection method according to claim 1, characterized in that: The point cloud of the mother image and the point cloud of the image to be tested are established by using a grayscale change finding method, and the point cloud of the mother image and the point cloud of the image to be tested include pixel coordinates, grayscale values, and gradient information.

4. The defect detection method according to claim 1, characterized in that: When establishing the point cloud of the mother image and the point cloud of the image to be measured, gradient diffusion is first performed through mean filtering iteration.

5. The defect detection method according to claim 1, characterized in that: When calculating the rotation vector, at least one closest data point is found through the point cloud of the mother image and the point cloud of the image to be tested for alignment, and the at least one closest data point is obtained by establishing a KD tree search in the point cloud of the mother image and the point cloud partitions of the image to be tested.

6. The defect detection method according to claim 1, characterized in that: Before calculating the translation vector, the point cloud on the mother image that is far away from the contour on the point cloud of the image to be tested is removed. When calculating the translation vector, the nearest point of the point cloud of the mother image and the point cloud of the image to be tested is searched by establishing a KD tree.

7. The defect detection method according to claim 1, characterized in that: When calculating the deformation value, point clouds with different angles and features are constructed on the point cloud of the mother image and the point cloud of the image to be tested by cluster analysis to set the at least one object. The point cloud of the mother image and the point cloud of the image to be tested use the objects with the closest center of gravity as matching objects.

8. The defect detection method according to claim 7, characterized in that: A matching score is obtained by the similarity of the contour points of the two objects after matching, and the center of gravity points of the two objects that achieve the matching score are used as correction points.

9. The defect detection method according to claim 1, characterized in that: During defect detection, the point cloud of the image to be tested that cannot match the detailed point cloud of the parent image is determined to be a candidate defect, and the point cloud determined to be a candidate defect on the image to be tested is used to find the defect outline through cluster analysis.

10. An automatic optical inspection system, characterized in that: include: A testing platform, used to set a sample to be tested; At least one image capture device, disposed on one side of the detection platform, for photographing the sample to be detected on the detection platform; as well as A detection device is connected to the image capture device, and after obtaining an image of the sample to be tested through the image capture device, the method according to any one of claims 1 to 9 is executed to complete defect detection.