Detection method and apparatus, detection device, and storage medium

By acquiring and comparing the region images of the preset template and the image to be inspected in the detection method, the problem of insufficient template matching accuracy is solved, and high-precision defect detection of workpieces is realized.

CN115375610BActive Publication Date: 2025-12-30SKYVERSE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110558116.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-05-21
Publication Date
2025-12-30
Estimated Expiration
2041-05-21

AI Technical Summary

Technical Problem

In existing technologies, template matching methods cannot guarantee accurate matching of each part to be tested within the test area during workpiece inspection, resulting in poor inspection accuracy.

Method used

By acquiring the first region image corresponding to the image to be inspected from the preset template, identifying the line area of ​​the image to be inspected, generating the second region image, and finding the third region image corresponding to the second region image in the preset template, the comparison is performed to detect defects.

Benefits of technology

It achieves precise matching between the image to be inspected and the preset template, improves the detection effect, and ensures that defects in each part to be inspected can be accurately detected.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115375610B_ABST
    Figure CN115375610B_ABST
Patent Text Reader

Abstract

The application provides a detection method, a detection device, a detection equipment and a nonvolatile computer readable storage medium. The detection method comprises the following steps: acquiring a first area image corresponding to a to-be-detected image in a preset template; identifying a line area of the to-be-detected image to generate a second area image; acquiring a third area image corresponding to the second area image in the first area image; and comparing the second area image and the third area image to detect defects of the to-be-detected image. The detection method, the detection device, the detection equipment and the nonvolatile computer readable storage medium can improve the matching effect of the to-be-detected image and the preset template by matching the to-be-detected image as a whole and then accurately matching each to-be-detected part in the to-be-detected image. Then, each to-be-detected part and the corresponding third area image are compared to determine the defects of each to-be-detected part, complete the defect detection of the to-be-detected image, and the detection effect is good.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of testing technology, and in particular to a testing method, testing device, testing equipment, and a non-volatile computer-readable storage medium. Background Technology

[0002] When inspecting a workpiece to determine its defects, template matching can be used to match the image of the area to be tested on the workpiece with the corresponding area in a standard template, thereby completing the overall matching of the area to be tested. However, the accuracy of the overall matching cannot guarantee that each part to be tested within the area to be tested will be accurately matched, resulting in poor detection accuracy. Summary of the Invention

[0003] This application provides a detection method, a detection apparatus, a detection device, and a non-volatile computer-readable storage medium.

[0004] The detection method of this application includes acquiring a first region image corresponding to an image to be inspected in a preset template; identifying the line region of the image to be inspected to generate a second region image; acquiring a third region image corresponding to the second region image in the first region image; and comparing the second region image and the third region image to detect defects in the image to be inspected.

[0005] The detection device according to this application includes a first acquisition module, an identification module, a second acquisition module, and a comparison module. The first acquisition module acquires a first region image corresponding to the image to be inspected from a preset template; the identification module identifies line regions in the image to be inspected to generate a second region image; the second acquisition module acquires a third region image corresponding to the second region image from the first region image; and the comparison module compares the second region image and the third region image to detect defects in the image to be inspected.

[0006] The detection device according to this application includes a processor. The processor is used to acquire a first region image corresponding to an image to be inspected from a preset template; identify line regions of the image to be inspected to generate a second region image; acquire a third region image corresponding to the second region image from the first region image; and compare the second region image and the third region image to detect defects in the image to be inspected.

[0007] This application provides a non-volatile computer-readable storage medium containing a computer program, which, when executed by one or more processors, causes the processors to perform the detection method. The detection method includes acquiring a first region image corresponding to an image to be inspected from a preset template; identifying line regions in the image to be inspected to generate a second region image; acquiring a third region image from the first region image corresponding to the second region image; and comparing the second region image and the third region image to detect defects in the image to be inspected.

[0008] The detection method, detection device, detection equipment, and non-volatile computer-readable storage medium of this application obtain a first region image that is completely matched with the image to be inspected by matching the image to be inspected with a preset template. Then, the line region in the image to be inspected is identified to obtain one or more second region images. Then, the second region images and the first region images are matched again to find a third region image corresponding to the second region image in the preset template. This completes the accurate matching of each part to be tested (corresponding to the second region image) in the image to be inspected, which can improve the matching effect between the image to be inspected and the preset template. Then, each part to be tested is compared with the corresponding third region image to determine the defects of each part to be tested, thus completing the defect detection of the image to be inspected. The detection effect is good.

[0009] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description

[0010] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0011] Figure 1 This is a flowchart illustrating the detection method of some embodiments of this application;

[0012] Figure 2 This is a schematic diagram of the detection device according to some embodiments of this application;

[0013] Figure 3 This is a plan view of the detection device according to some embodiments of this application;

[0014] Figure 4 This is a schematic diagram of the image to be examined according to certain embodiments of this application;

[0015] Figure 5This is a schematic diagram of a preset template for certain embodiments of this application;

[0016] Figure 6 This is a flowchart illustrating the detection method of some embodiments of this application;

[0017] Figure 7 This is a schematic diagram of a second preset template for certain embodiments of this application;

[0018] Figure 8 This is a flowchart illustrating the detection method of some embodiments of this application;

[0019] Figure 9 This is a schematic diagram of a binarized image of the image to be examined according to certain embodiments of this application;

[0020] Figure 10 This is a schematic diagram of the circuit image under test of the image under test in some embodiments of this application;

[0021] Figure 11 This is a flowchart illustrating the detection method of some embodiments of this application;

[0022] Figure 12 and Figure 13 This is a schematic diagram illustrating the principle of the detection method according to certain embodiments of this application;

[0023] Figure 14a , Figure 14b and Figure 14c This is a schematic diagram illustrating the principle of the detection method according to certain embodiments of this application;

[0024] Figure 15 This is a flowchart illustrating the detection method of some embodiments of this application;

[0025] Figure 16a , Figure 16b , Figure 17a and Figure 17b This is a schematic diagram illustrating the principle of the detection method according to certain embodiments of this application; and

[0026] Figure 18 This is a schematic diagram showing the connection between a processor and a computer-readable storage medium in some embodiments of this application. Detailed Implementation

[0027] The embodiments of this application will be further described below with reference to the accompanying drawings. The same or similar reference numerals in the drawings denote the same or similar elements or elements having the same or similar functions throughout. Furthermore, the embodiments of this application described below with reference to the accompanying drawings are exemplary and are only used to explain the embodiments of this application, and should not be construed as limiting this application.

[0028] Please see Figures 1 to 3The detection method of this application includes the following steps:

[0029] 011: Obtain the first region image corresponding to the image to be inspected from the preset template;

[0030] 012: Identify the line region in the image to be inspected to generate a second region image;

[0031] 013: Obtain the third region image in the first region image that corresponds to the second region image;

[0032] 014: Compare the second region image and the third region image to detect defects in the image to be inspected.

[0033] The detection device 10 of this application includes a first acquisition module 11, an identification module 12, a second acquisition module 13, and a comparison module 14. The first acquisition module 11 acquires a first region image corresponding to the image to be inspected from a preset template; the identification module 12 identifies the line region of the image to be inspected to generate a second region image; the second acquisition module 13 acquires a third region image corresponding to the second region image from the first region image; and the comparison module 14 compares the second region image and the third region image to detect defects in the image to be inspected. That is, step 011 can be implemented by the first acquisition module 11, step 012 can be executed by the identification module 12, step 013 can be executed by the second acquisition module 13, and step 014 can be executed by the comparison module 14.

[0034] The detection device 100 of this application includes a processor 20. The processor 20 is used to acquire a first region image corresponding to the image to be inspected in a preset template; identify the line region of the image to be inspected to generate a second region image; acquire a third region image corresponding to the second region image in the first region image; and compare the second region image and the third region image to detect defects in the image to be inspected. That is to say, steps 011, 012, 013, and 014 can be executed by the processor 20.

[0035] Specifically, the testing device 100 can be a measuring machine. It is understood that the specific form of the testing device 100 is not limited to a measuring machine, but can be any device capable of testing the workpiece 200.

[0036] The testing device 100 includes a processor 20, a motion platform 30, and a sensor 40. Both the processor 20 and the sensor 40 can be mounted on the motion platform 30. The motion platform 30 can be used to carry the test piece 200. The motion platform 30 moves to move the test piece 200, so that the sensor 40 can collect information about the test piece 200 (such as collecting an image of the test area of ​​the test piece 200).

[0037] For example, the motion platform 30 includes an XY motion platform 31 and a Z motion platform 32. The device under test (DUT) 200 is disposed on the XY motion platform 31, and the sensor 40 is disposed on the Z motion platform 32. The XY motion platform 31 is used to control the movement of the DUT 200 along the horizontal plane, changing the relative position of the DUT 200 and the sensor 40 in the horizontal plane. The Z motion platform 32 is used to control the movement of the sensor 40 in the direction perpendicular to the horizontal plane. In this way, the three-dimensional position of the sensor 40 relative to the DUT 200 (i.e., the relative position in the horizontal plane and the relative position in the direction perpendicular to the horizontal plane) is realized through the cooperation of the XY motion platform 31 and the Z motion platform 32. Alternatively, the XY motion platform 31 is used to control the movement of the sensor 40 in the direction perpendicular to the horizontal plane, and the Z motion platform 32 is used to control the movement of the DUT 200 along the horizontal plane.

[0038] It is understood that the motion platform 30 is not limited to the above structure; it only needs to be able to change the three-dimensional position of the sensor 40 relative to the test piece 200.

[0039] The sensor 40 can be a visible light camera, a depth camera, a distance sensor 40, etc. In this embodiment, the sensor 40 is a visible light camera.

[0040] The sensor 40 can acquire the inspection image of the test piece 200. If the test piece 200 includes multiple test areas, the sensor 40 can acquire the inspection image of at least a part of the test area of ​​the test piece 200 each time. The motion platform 30 is used to cooperate to realize the acquisition of the inspection image of all areas of the test piece 200.

[0041] Then, when the processor 20 detects the image to be inspected, it first obtains a preset template that matches the image to be inspected. For example, the preset template can be determined according to the parameter information of the device under test 200 (such as type, model, etc.). The device under test 200 can be a wafer, a display panel, etc. In this embodiment, a wafer is used as an example for explanation. The wafer can be composed of multiple minimum repeating units (corresponding to a test area). The lines in each minimum repeating unit can be the same. There are channel gaps between different minimum repeating units. The field of view of the sensor 40 generally covers one minimum repeating unit. The image to be inspected is captured for one minimum repeating unit each time.

[0042] Then, the processor 20 matches the image to be inspected with the preset template. The matching process is to find the region in the preset template that is basically the same as the image to be inspected. Specifically, the preset template can be traversed by a traversal box of the same size as the image to be inspected. Each traversal calculates the similarity between the region image in the traversal box and the image to be inspected. The similarity can be determined by the difference in pixel values ​​at corresponding positions in the region image in the traversal box and the image to be inspected, such as the sum, average, or variance of the pixel value differences. After traversing the entire preset template, multiple similarities can be obtained. The region image with the highest similarity can be determined to match the image to be inspected. The region image with the highest similarity is the first region image.

[0043] This is understandable; please refer to [link / reference]. Figure 4 Since the imaging accuracy of sensor 40 cannot guarantee that it will always be directly facing the smallest repeating unit Q, thus just acquiring an image P1 of the smallest repeating unit Q, the possible situation is that the field of view of sensor 40 spans the channel H, and simultaneously captures a portion of multiple smallest repeating units Q.

[0044] In other embodiments, the test piece 200 contains a positioning marker O for matching. The processor 20 first identifies the positioning marker O in the image to be inspected P1 and the preset template, and then determines the first region image by matching the positioning marker O. For example, the positioning marker O is the center of the feature circle in the test piece 200. By matching the center of the feature circle in the image to be inspected P1 with the center of the feature circle in the preset template, the centers of the feature circles of the two are aligned, thereby determining the first region image.

[0045] Please combine Figure 5 The preset template P2 can include images of multiple standard minimum repeating units Q. Since the field of view of sensor 40 covers one minimum repeating unit Q, sensor 40 can simultaneously capture a portion of a maximum of four minimum repeating units Q across the channel. Therefore, the preset template P2 can include standard images of four minimum repeating units Q, and the four minimum repeating units Q are arranged in a 2*2 matrix. This ensures that regardless of which part of the test piece 200 it captures, sensor 40 can find a matching first region image A1 in the preset template P2. Figure 4 The image P1 to be inspected shown has a matching first region image A1 in the preset template P2.

[0046] After matching the image to be inspected P1 with the preset template P2 to obtain the first region image A1, the overall matching of the image to be inspected P1 and the preset template P2 is completed. Then, the processor 20 can identify the line regions in the image to be inspected P1 to generate one or more second region images.

[0047] The circuit region is a region composed of pixels exceeding a preset threshold. It can be understood that the colors of circuits and substrates on a wafer differ significantly. For example, the substrate may be nearly black, while the circuits on the wafer may be red, yellow, or other colors. The image to be inspected acquired by sensor 40 can be a grayscale image. In a grayscale image, the area containing the circuit is nearly white. Therefore, by setting a preset threshold (e.g., 100, 150, etc.), pixels located within the circuit can be identified. Adjacent pixels that are part of the circuit are considered the same circuit region, thus identifying one or more circuit regions. The circuit region is the area where the circuit to be inspected is located. One or more second region images can be generated based on the pixels of the circuit region; or, a second region image can be generated based on the region image containing the bounding rectangle of the circuit region.

[0048] After obtaining the second region image within the image to be inspected, the second region image can be matched again with a preset template to find a third region image that matches the second region image in the preset template. The matching method between the second and third region images is similar to the matching method between the image to be inspected and the preset template, and will not be elaborated here. In this way, each line region in the image to be inspected can be accurately matched with the corresponding third region image in the preset template, thereby improving the matching accuracy.

[0049] Finally, the processor 20 compares the third region image with the second region image, and based on the differences between the two, defect detection can be achieved for each third region image. For example, a difference image can be generated based on the pixel value difference at corresponding positions in the third region image and the second region image, and then the difference between the two can be determined based on the difference image, thereby identifying the defects in each third region image.

[0050] The detection method, detection device 10, and detection equipment 100 of this application obtain a first region image that is fully matched with the image to be inspected by matching the image to be inspected with a preset template. Then, the line region in the image to be inspected is identified to obtain one or more second region images. Then, the second region images and the first region images are matched again to find a third region image corresponding to the second region image in the preset template. This completes the accurate matching of each part to be tested (corresponding to the second region image) in the image to be inspected, which can improve the matching effect between the image to be inspected and the preset template. Then, each part to be tested is compared with the corresponding third region image to determine the defect of each part to be tested, thus completing the defect detection of the image to be inspected. The detection effect is good.

[0051] Please see Figure 2 , Figure 3 and Figure 6In some embodiments, the preset template includes a first preset template and a second preset template. The first preset template is an image of the smallest repeating unit of the test piece 200, and the second preset template is a circuit image of the smallest repeating unit. Step 011 includes:

[0052] 0111: Match the image to be inspected with the first preset template to obtain the target region image;

[0053] 0112: Based on the mapping relationship between the first preset template and the second preset template, obtain the region image in the second preset template that corresponds to the target region image, and use it as the first region image.

[0054] In some embodiments, the first acquisition module 11 is further configured to match the image to be inspected and the first preset template to obtain a target region image; based on the mapping relationship between the first preset template and the second preset template, to obtain the region image in the second preset template that corresponds to the target region image, as the first region image. That is to say, steps 0111 and 0112 can be executed by the first acquisition module 11.

[0055] In some embodiments, the processor 20 is further configured to match the image to be inspected with a first preset template to obtain a target region image; based on the mapping relationship between the first preset template and the second preset template, to obtain a region image in the second preset template that corresponds to the target region image, as the first region image. That is to say, steps 0111 and 0112 can be executed by the processor 20.

[0056] Specifically, please refer to Figure 5 and Figure 7 The preset template P2 includes a first preset template P21 and a second preset template P22. The first preset template P21 is an image (such as a grayscale image) of the smallest repeating unit Q, and the second preset template P22 is a line image of the smallest repeating unit Q, containing only the line portion of the smallest repeating unit Q. Both the first preset template P21 and the second preset template P22 include images corresponding to four smallest repeating units Q, and the images corresponding to the four smallest repeating units Q are arranged in a 2*2 matrix, thereby ensuring that the image to be inspected has matching region images in both the first preset template P21 and the second preset template P22.

[0057] When matching the image to be inspected with the preset template P2, since the image to be inspected is generally a grayscale image, the image to be inspected is first matched with the first preset template P21 to determine the target region image (e.g., Figure 5The target region image A11 shown is used as an example. For the matching method, please refer to the matching method between the image to be inspected and the preset template P2 in the previous embodiment. The first preset template P21 and the second preset template P22 have a preset mapping relationship. It can be understood that the first preset template P21 and the second preset template P22 are the same size, and the images at corresponding positions correspond to the same local area of ​​the standard test piece 200. Therefore, after determining the target region image A11 in the first preset template P21, the region image A12 corresponding to the target region image A11 can be quickly found in the second preset template P22 according to the mapping relationship. Figure 7 The area within the white box in the image is used to detect defects in the circuit. Therefore, by using the area image A1 in the second preset template P22 that corresponds to the target area image A11 as the first area image A1, the matching of the circuit area in the image to be inspected can be achieved more accurately, thereby improving the accuracy of circuit defect detection.

[0058] The second preset template P22 can be generated based on the first preset template P21. For example, by annotating the line outline in the first preset template P21, the area image where the line is located is determined, thereby generating the second preset template P22. Alternatively, the line of the test piece 200 is designed based on a preset line drawing, such as a computer-aided design (CAD) line drawing. The second preset template P22 can also be generated based on the CAD line drawing. For example, since the line actually has a width, the lines in the CAD line drawing can be thickened so that the thickness of the line matches the thickness of the actual line in the second preset template P22, thereby generating the second preset template P22.

[0059] Please see Figure 2 , Figure 3 and Figure 8 In some implementations, step 012 includes:

[0060] 0121: Binarize the image to be inspected to generate a binarized image;

[0061] 0122: Identify one or more pixels in a binarized image with a spacing smaller than a predetermined spacing as the same line region; and

[0062] 0123: Generate a second region image based on the line region.

[0063] In some embodiments, the identification module 12 is further configured to binarize the image to be inspected to generate a binarized image; identify one or more pixels in the binarized image with a spacing smaller than a predetermined spacing as the same line region; and generate a second region image based on the line region. That is to say, steps 0121, 0122, and 0123 can be performed by the identification module 12.

[0064] In some embodiments, the processor 20 is further configured to binarize the image to be inspected to generate a binarized image; identify one or more pixels in the binarized image with a spacing smaller than a predetermined spacing as the same line region; and generate a second region image based on the line region. That is, steps 0121, 0122, and 0123 can be executed by the processor 20.

[0065] Specifically, please refer to Figure 9 When determining the line region M, adjacent pixels in the image P1 to be inspected that are located within the line region M and whose distance (the distance between the centers of two pixels) is less than a predetermined distance (such as 1 pixel, 2 pixels, etc.) can be considered as pixels within the same line region M. For example, taking a pixel as a rectangle, when the predetermined distance is 1 pixel, only pixels whose edges are adjacent and are within the line region M can be considered as pixels within the same line region M. When the predetermined distance is 2 pixels, pixels whose corners are adjacent and are within the line region M can also be considered as pixels within the same line region M, thus quickly determining pixels located within the same line region M.

[0066] It is understandable that, in order to more easily determine the line region M in the image P1 to be inspected, the image P1 to be inspected can be binarized according to a preset threshold to obtain a binarized image (such as...). Figure 9 In the image P1 to be inspected, if the pixel value of a pixel is greater than a preset threshold, it is determined to be a pixel of the line region M and its pixel value is set to 255. If the pixel value of a pixel is less than or equal to the preset threshold, it is determined to be a pixel of the non-line region and its pixel value is set to 0, thereby accurately identifying the line region M in the image to be inspected.

[0067] The preset threshold can be a fixed value set in advance, such as 100, 150, etc.; or, since the image to be inspected may be acquired under different lighting conditions, the preset threshold can also be determined according to the gray value distribution of the image to be inspected P1, thereby determining a preset threshold suitable for each image to be inspected P1 and improving the detection accuracy of the line area M.

[0068] It is understandable that, in order to better match the line drawing of the second preset template, after determining the binarized image of the image to be inspected P1 and the line region M, the line region M can be processed again so that the line region M in the binarized image is also a line drawing, thereby generating the second region image A2. Specifically, the edges of the line region M in the binarized image can be identified first. For example, a binary number can be generated based on the pixel values ​​of the 8 pixels surrounding each pixel, where the binary number corresponding to the pixel value 255 is 1 and the binary number corresponding to the pixel value 0 is 0. Then, the processor 20 searches for the binary number in a preset lookup table to determine whether the pixel corresponding to the binary number is an edge pixel (i.e., a pixel located at the edge of the line region).

[0069] Please see Figure 10 Then, the processor 20 determines the edge contour of the line region M based on the edge pixels in the binarized image. Then, based on the actual thickness of the line or the pixel width of the line in the second preset template, it determines the corresponding pixel width in the binarized image. Then, it processes the edge contour so that the line width in each line region M is adjusted to the pixel width, thereby generating the line image P3 to be tested. Then, based on the adjusted line region M in the line image P3 to be tested, the second region image A2 is generated. If the image region where the line region M is located is used as the second region image A2, the second region image A2 can better match the first region image in the second preset template.

[0070] In other embodiments, the processor 20 generates a second region image A2 based on the adjusted line region M. Specifically, the processor 20 extracts the region image where the minimum bounding rectangle N of the line region M is located, and uses it as the second region image A2 corresponding to the line region M, so as to facilitate subsequent comparison between the second region image A2 and the first region image to determine the third region image.

[0071] Please refer to 2. Figure 3 and Figure 11 In some implementations, step 013 includes:

[0072] 0131: Enlarge the second region image;

[0073] 0132: Obtain the fourth image region in the first region image that corresponds to the enlarged second region image;

[0074] 0133: Match the second region image and the fourth region image to obtain the third region image in the fourth region image that matches the second region image.

[0075] In some embodiments, the second acquisition module 13 is further configured to: enlarge the second region image; acquire a fourth image region in the first region image corresponding to the enlarged second region image; and match the second region image and the fourth region image to acquire a third region image in the fourth region image that matches the second region image. That is, steps 0131, 0132, and 0133 can be performed by the second acquisition module 13.

[0076] In some embodiments, the processor 20 is further configured to: enlarge the second region image; obtain a fourth image region in the first region image corresponding to the enlarged second region image; and match the second region image and the fourth region image to obtain a third region image in the fourth region image that matches the second region image. That is, steps 0131, 0132, and 0133 can be executed by the processor 20.

[0077] Specifically, please refer to Figure 7 and Figure 11 If the region image containing the minimum bounding rectangle N of the line region M in the image to be inspected, P1, is taken as the second region image A2, since the image to be inspected, P1, and the first region image A1 are aligned after matching, the second region image A2 has a corresponding region image in the first image region A1. However, since the line region M in the image to be inspected, P1, may have positional deviations (such as not being perfectly aligned with the standard line), if the minimum bounding rectangle N of the line region M is directly matched with the first image region A1, then some of the lines corresponding to the first image region A1 may not be within the region image corresponding to the minimum bounding rectangle N. Therefore, please refer to [the relevant documentation / reference needed]. Figure 12 and Figure 13 The processor 20 first needs to expand the minimum bounding rectangle N. The expansion can be centered on the center of the minimum bounding rectangle N, and the bounding rectangle can be expanded by a predetermined factor, which is the factor that increases the side length of the bounding rectangle, such as 1.1 times, 1.2 times, 1.5 times, etc. For example, if the minimum bounding rectangle N is 10*10 pixels in size, and the predetermined factor is 1.2 times, then the expanded bounding rectangle K will be 12*12 pixels. This ensures that even if there is a deviation in the line, the image area where the bounding rectangle K is located, corresponding to the fourth image area A4 in the first image area A1, can still cover the line.

[0078] Then, the processor 20 matches the second region image A2 and the fourth region image A4. Since the size of the fourth region image A4 is larger than that of the second region image A2, during matching, multiple fifth region images A5 of the fourth region image A4 with the same size as the second region image A2 can be obtained first. For details, please refer to [link to relevant documentation]. Figure 14a , Figure 14b and Figure 14c The processor 20 can iterate through the fourth region image A4 using a polling frame of the same size as the second region image A2, allowing the polling frame to iterate through the entire fourth region image A4 line by line, thus obtaining multiple fifth region images A5. Then, the processor 20 matches each fifth region image A5 with the second region image A2, calculating the matching degree between the fifth region image A5 and the second region image A2. This can be achieved by calculating the difference in pixel values ​​at corresponding positions in the fifth region image A5 and the second region image A2, and then using the sum and average of all pixel value differences as the matching degree. The processor 20 then selects the fifth region image A5 with the highest matching degree as the third region image A3 (e.g., A3) that matches the second region image A2. Figure 14c This allows for precise matching of each second region image A2, resulting in a third region image A3 corresponding to each second region image A2.

[0079] Please see Figure 2 , Figure 3 and Figure 15 In some implementations, step 014 includes:

[0080] 0141: Difference is performed between the second and third region images to generate a difference image;

[0081] 0142: Detect defects in the line area image based on the difference image.

[0082] In some embodiments, the comparison module 14 is further configured to perform differential analysis on the second region image and the third region image to generate a difference image; and to detect defects in the line region image based on the difference image. That is, steps 0141 and 0142 can be performed by the comparison module 14.

[0083] In some embodiments, the processor 20 is further configured to perform differential processing on the second region image and the third region image to generate a difference image; and to detect defects in the line region image based on the difference image. That is, steps 0141 and 0142 can be executed by the processor 20.

[0084] Specifically, such as Figure 16a and Figure 16b The examples shown are images A2 of the second region with and without line missing defects, respectively. Figure 17a and Figure 17b They are respectively Figure 16a and Figure 16b The corresponding difference image P4 is generated by obtaining the pixel value difference between corresponding positions in the second region image A2 and the third region image A3, and then generating the difference image P4 based on the absolute value of the pixel value difference. The difference image P4 represents the difference between the second region image A2 (the line region in the image to be inspected) and the third region image A3 (the corresponding line region in the second preset template), thereby realizing the detection of each line region in the image to be inspected.

[0085] Please see Figure 17bIn one embodiment, the processor 20 identifies connected components in the difference image. For example, the portion of the difference image containing pixels with a value greater than 0 (e.g., 255) is a connected component, which corresponds to the portion of the image to be inspected (specifically, a line region) that contains extra lines. The processor 20 can determine the location and area of ​​the added lines based on the location and area of ​​the connected components. It can be understood that when the area of ​​the connected component is small (e.g., less than a preset area threshold, such as 5, 7, or 10 pixels), this portion may simply be noise, not added lines; therefore, the line region can be determined to be defect-free. Conversely, when the area of ​​the connected component is large (e.g., greater than or equal to the preset area threshold), the connected component can be identified as a line region, thus determining that the line region contains a defect. In this way, the location and area of ​​defects in each line region can be accurately determined, thereby detecting defects in the image to be inspected.

[0086] Please see Figure 18 One or more non-volatile computer-readable storage media 300 containing a computer program 302 according to embodiments of this application enable the processor 20 to perform the calibration method of any of the above embodiments when the computer program 302 is executed by one or more processors 20.

[0087] For example, please combine Figures 1 to 3 When computer program 302 is executed by one or more processors 20, the processors 20 perform the following steps:

[0088] 011: Match the image to be inspected with the preset template to obtain the first region image;

[0089] 012: Identify the line regions in the first region image to generate the second region image;

[0090] 013: Obtain the third region image in the image to be inspected, which corresponds to the second region image;

[0091] 014: Compare the third region image with the second region image to detect defects in the image to be inspected.

[0092] For example, please combine Figure 2 , Figure 3 and Figure 5 When computer program 302 is executed by one or more processors 20, processor 20 may also perform the following steps:

[0093] 0121: Identify one or more pixels in the first region image whose spacing is less than a predetermined spacing as the same line region to generate a second region image.

[0094] In the description of this specification, the terms "one embodiment," "some embodiments," "illustrative embodiment," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with an embodiment or example that are included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

[0095] Any process or method description in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing a particular logical function or process, and the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as should be understood by those skilled in the art to which embodiments of this application pertain.

[0096] Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of this application.

Claims

1. A method of detection, characterized in that, The method comprises: obtaining a first region image corresponding to the to-be-detected image in a preset template; identifying a circuit region of the to-be-detected image to generate a second region image; obtaining a third region image corresponding to the second region image in the first region image; comparing the second region image and the third region image to detect defects of the to-be-detected image; the preset template comprises a first preset template and a second preset template, the first preset template is an image of a minimum repeating unit of a to-be-detected object, and the second preset template is a circuit image of the minimum repeating unit, the obtaining of the first region image corresponding to the to-be-detected image in the preset template comprises: matching the to-be-detected image and the first preset template to obtain a target region image; and based on a mapping relationship between the first preset template and the second preset template, obtaining a region image corresponding to the target region image in the second preset template as the first region image; the identifying of the circuit region of the to-be-detected image to generate the second region image comprises: binarizing the to-be-detected image to generate a binarized image; identifying one or more pixels with a spacing smaller than a predetermined spacing in the binarized image as the same circuit region; identifying edge pixels of the circuit region in the binarized image, determining an edge contour of the circuit region according to the edge pixels in the binarized image, determining a corresponding pixel width in the binarized image according to an actual thickness of the circuit or a pixel width of the circuit of the second preset template, processing the edge contour to adjust the circuit width in each circuit region to the pixel width, thereby generating a to-be-detected circuit image, and generating the second region image based on the adjusted circuit region.

2. The detection method according to claim 1, characterized in that, The first preset template comprises four images of the minimum repeating unit arranged in a 2*2 matrix, and the second preset template comprises four circuit images arranged in a 2*2 matrix.

3. The detection method according to claim 1, characterized in that, The method further comprises: labeling an outline of a circuit in the first preset template to generate the second preset template; or obtaining a preset circuit diagram and generating the second preset template according to the circuit diagram. The obtaining of the third region image corresponding to the second region image in the first region image comprises:

4. The method of claim 1, wherein enlarging the second region image; obtaining a fourth region image corresponding to the enlarged second region image in the first region image; matching the second region image and the fourth region image to obtain the third region image in the fourth region image that matches the second region image. The matching of the second region image and the fourth region image to obtain the third region image in the fourth region image that matches the second region image comprises:

5. The detection method according to claim 4, characterized in that, obtaining a plurality of fifth region images with the same size as the second region image in the fourth region image; matching the fifth region images and the second region image to obtain a matching degree of each fifth region image and the second region image; obtaining the fifth region image with the highest matching degree as the third region image. ​ 6. The method of claim 1, wherein, The comparing the second area image and the third area image to detect the defect of the image to be detected comprises: differencing the second area image and the third area image to generate a difference image; detecting the defect of the line area image according to the difference image.

7. The detection method according to claim 6, characterized in that, The detecting the defect of the line area image according to the difference image comprises: identifying a connected domain in the difference image; determining whether the line area image has a defect and a position of the defect according to a position and an area of the connected domain.

8. A detection device, characterized in that The detection device performs the detection method of any one of claims 1 to 7, comprising: a first obtaining module configured to obtain a first area image corresponding to an image to be detected in a preset template; an identifying module configured to identify a line area of the image to be detected to generate a second area image; a second obtaining module configured to obtain a third area image corresponding to the second area image in the first area image; and a comparing module configured to compare the second area image and the third area image to detect a defect of the image to be detected.

9. A detection device, characterized by The detection device performs the detection method of any one of claims 1 to 7, comprising a processor configured to: obtain a first area image corresponding to an image to be detected in a preset template; identify a line area of the image to be detected to generate a second area image; obtain a third area image corresponding to the second area image in the first area image; and compare the second area image and the third area image to detect a defect of the image to be detected.

10. A non-volatile computer-readable storage medium storing a computer program, which, when executed by one or more processors, causes the processors to perform the detection method of any one of claims 1 to 7.

Citation Information

Patent Citations

  • Defect identification method and system

    CN106803244A

  • Method for detecting screen printing defects of electronic product shell

    CN110533660A