Detection method and detection device, equipment and storage medium
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-14
- Publication Date
- 2026-08-11
AI Technical Summary
[0004]但是,目前检测结果的准确性仍有待提高
[0011]This invention provides a detection method, comprising: acquiring a test image of an object to be tested, the test image including the relationship between the positions of multiple test points and detection parameters, wherein the detection parameters are positively correlated with the image grayscale; acquiring a first statistical map based on the test image, the first statistical map including the correspondence between the detection parameters of the test points in the test image, a first gradient, and the number of test points, wherein the first gradient is the gradient value of the detection parameters of the test points in the test image as the position of the test points changes; dividing the first statistical map into multiple blocks by dividing the detection parameters and the first gradient, wherein the span of the detection parameters corresponding to the same first gradient in different blocks does not overlap, and the span of the first gradient corresponding to the same detection parameter in different blocks does not overlap; acquiring threshold conditions for each block based on the detection parameters of the test points indicated by the number of test points in each block, such that each test point in the same block has the same threshold condition, wherein the threshold conditions correspond one-to-one with the multiple blocks; acquiring test points that satisfy the corresponding threshold conditions from the test image based on the multiple blocks, as candidate points; and acquiring target points based on the candidate points.
Smart Images

Figure CN117934357B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of optical inspection technology, and in particular to a detection method, detection device, equipment, and storage medium. Background Technology
[0002] With the continuous development of technology, precision machining is being used in more and more fields, and at the same time, there are increasingly higher requirements for machining accuracy. In order to meet the requirements for machining accuracy and improve the product qualification rate, it is necessary to perform online inspection on the products (for example, by performing defect detection to determine whether there are defects in the products and to detect the location and size of the defects) to ensure that the relevant indicators of product manufacturing are met.
[0003] Among existing testing methods, optical inspection is a general term for methods that utilize the interaction between light and the object being tested to achieve detection. Optical inspection does not involve contact with the object being tested, and it features high detection speed, no additional pollution, and the ability to perform online inspection. Therefore, optical inspection is widely used in the field of quality control in product manufacturing.
[0004] However, the accuracy of the current test results still needs to be improved. Summary of the Invention
[0005] The problem solved by this invention is to provide a detection method, detection device, equipment, and storage medium to improve the accuracy of detection results.
[0006] To address the aforementioned problems, this invention provides a detection method, comprising: acquiring a test image of an object to be tested, the test image including the relationship between the positions of multiple test points and detection parameters, wherein the detection parameters are positively correlated with image grayscale; acquiring a first statistical graph based on the test image, the first statistical graph including the correspondence between the detection parameters of the test points in the test image, a first gradient, and the number of test points, wherein the first gradient is the gradient value of the detection parameters of the test points in the test image as the position of the test points changes; and dividing the detection parameters and the first gradient to classify the test object into... The first statistical image is divided into multiple blocks. The range of detection parameters corresponding to the same first gradient in different blocks does not overlap, and the range of the first gradient corresponding to the same detection parameter in different blocks does not overlap. The threshold conditions of each block are obtained according to the detection parameters of the test points indicated by the number of test points in each block, so that each test point in the same block has the same threshold condition. The threshold conditions correspond one-to-one with the multiple blocks. Test points that meet the corresponding threshold conditions are obtained from the image to be detected according to the multiple blocks, as candidate points. The target point is obtained according to the candidate points.
[0007] Accordingly, embodiments of the present invention also provide a detection device, comprising: a first acquisition unit, adapted to acquire a test image of an object to be tested, the test image including the relationship between the positions of multiple test points and detection parameters, the detection parameters being positively correlated with image grayscale; a second acquisition unit, adapted to acquire a first statistical graph based on the test image, the first statistical graph including the correspondence between the detection parameters of the test points in the test image, a first gradient and the number of test points, the first gradient being the gradient value of the detection parameters of the test points in the test image as the position of the test points changes; and a block division unit, adapted to divide the test parameters and the first gradient to divide the test image into blocks. The first statistical graph is divided into multiple blocks, and the range of detection parameters corresponding to the same first gradient in different blocks does not overlap, and the range of the first gradient corresponding to the same detection parameter in different blocks does not overlap; the third acquisition unit is adapted to acquire the threshold conditions of each block according to the detection parameters of the test points in the block, so that each test point in the same block has the same threshold condition, and the threshold conditions correspond one-to-one with the multiple blocks; the fourth acquisition unit is adapted to acquire test points that meet the corresponding threshold conditions from the image to be detected according to the multiple blocks, as candidate points; the fifth acquisition unit is adapted to acquire target points according to the candidate points.
[0008] Accordingly, embodiments of the present invention also provide an apparatus including at least one memory and at least one processor, wherein the memory stores one or more computer instructions, wherein the one or more computer instructions are executed by the processor to implement the detection method according to any of the preceding claims.
[0009] Accordingly, embodiments of the present invention also provide a storage medium storing one or more computer instructions, the one or more computer instructions being used to implement the detection method described in any of the above claims.
[0010] Compared with the prior art, the technical solution of the present invention has the following advantages:
[0011] This invention provides a detection method, comprising: acquiring a test image of an object to be tested, the test image including the relationship between the positions of multiple test points and detection parameters, wherein the detection parameters are positively correlated with the image grayscale; acquiring a first statistical map based on the test image, the first statistical map including the correspondence between the detection parameters of the test points in the test image, a first gradient, and the number of test points, wherein the first gradient is the gradient value of the detection parameters of the test points in the test image as the position of the test points changes; dividing the first statistical map into multiple blocks by dividing the detection parameters and the first gradient, wherein the span of the detection parameters corresponding to the same first gradient in different blocks does not overlap, and the span of the first gradient corresponding to the same detection parameter in different blocks does not overlap; acquiring threshold conditions for each block based on the detection parameters of the test points indicated by the number of test points in each block, such that each test point in the same block has the same threshold condition, wherein the threshold conditions correspond one-to-one with the multiple blocks; acquiring test points that satisfy the corresponding threshold conditions from the test image based on the multiple blocks, as candidate points; and acquiring target points based on the candidate points.
[0012] As can be seen, firstly, a first statistical map is obtained based on the image to be detected. The first statistical map is divided into multiple blocks, and further divided by the detection parameters and the first gradient. Then, the threshold conditions of each block are obtained based on the detection parameters of the points to be tested in the blocks, so that each point to be tested in the same block has the same threshold conditions. Points that meet the threshold conditions are obtained from the image to be detected as candidate points, and target points are obtained based on the candidate points. Compared with the scheme of using a fixed threshold for target point detection, different threshold conditions can be set for the points to be tested based on the detection parameters and the first gradient of the points to be tested in the image to be detected, which can improve the accuracy of detection. Attached Figure Description
[0013] Figure 1 The flowcharts of each step in an embodiment of the detection method provided by the present invention are shown.
[0014] Figure 2 A schematic diagram of an image to be detected is shown;
[0015] Figure 3 A schematic diagram of the target image to be tested is shown;
[0016] Figure 4 A schematic diagram of a reference image is shown;
[0017] Figure 5 A schematic diagram of a first statistical graph is shown;
[0018] Figure 6This diagram illustrates the positional relationship between a point to be detected in the image and its surrounding points when acquiring the first gradient.
[0019] Figure 7 A flowchart illustrating the threshold conditions for obtaining each block is shown in one embodiment of the detection method provided by the present invention.
[0020] Figure 8 A schematic diagram of a second statistical chart is shown;
[0021] Figure 9 A schematic diagram of the frame structure of an embodiment of the detection device provided by the technical solution of the present invention is shown;
[0022] Figure 10 A schematic diagram of an optional hardware structure of an electronic device provided in an embodiment of the present invention is shown. Detailed Implementation
[0023] As can be seen from the background technology, the accuracy of current detection methods still needs to be improved.
[0024] To address the aforementioned problems, this invention provides a detection method, comprising: acquiring a test image of an object to be tested, the test image including the relationship between the positions of multiple test points and detection parameters, wherein the detection parameters are positively correlated with image grayscale; acquiring a first statistical graph based on the test image, the first statistical graph including the correspondence between the detection parameters of the test points in the test image, a first gradient, and the number of test points, wherein the first gradient is the gradient value of the detection parameters of the test points in the test image as the position of the test points changes; and dividing the detection parameters and the first gradient to classify the test object into... The first statistical image is divided into multiple blocks. The range of detection parameters corresponding to the same first gradient in different blocks does not overlap, and the range of the first gradient corresponding to the same detection parameter in different blocks does not overlap. The threshold conditions of each block are obtained according to the detection parameters of the test points indicated by the number of test points in each block, so that each test point in the same block has the same threshold condition. The threshold conditions correspond one-to-one with the multiple blocks. Test points that meet the corresponding threshold conditions are obtained from the image to be detected according to the multiple blocks, as candidate points. The target point is obtained according to the candidate points.
[0025] As can be seen, firstly, a first statistical map is obtained based on the image to be detected. The first statistical map is divided into multiple blocks, and further divided by the detection parameters and the first gradient. Then, the threshold conditions of each block are obtained based on the detection parameters of the points to be tested in the blocks, so that each point to be tested in the same block has the same threshold conditions. Points that meet the threshold conditions are obtained from the image to be detected as candidate points, and target points are obtained based on the candidate points. Compared with the scheme of using a fixed threshold for target point detection, different threshold conditions can be set for the points to be tested based on the detection parameters and the first gradient of the points to be tested in the image to be detected, which can improve the accuracy of detection.
[0026] To make the above-mentioned objects, features and advantages of the embodiments of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0027] Figure 1 A flowchart illustrating the steps of an embodiment of the detection method provided by the present invention is shown. See also... Figure 1 A detection method may specifically include the following steps:
[0028] Step S110: Obtain the image to be detected of the object to be tested. The image to be detected includes the relationship between the positions of multiple test points and the detection parameters. The detection parameters are positively correlated with the image grayscale.
[0029] Step S120: Obtain a first statistical map based on the image to be detected. The first statistical map includes the detection parameters of the test points in the image to be detected, the correspondence between the first gradient and the number of test points, and the first gradient is the gradient value of the detection parameters of the test points in the image to be detected as the position of the test points changes.
[0030] Step S130: The first statistical graph is divided into multiple blocks by dividing the detection parameters and the first gradient. The range of the detection parameters corresponding to the same first gradient in different blocks does not overlap, and the range of the first gradient corresponding to the same detection parameter in different blocks does not overlap.
[0031] Step S140: Obtain the threshold conditions for each block according to the detection parameters of the test points indicated by the number of test points in each block, so that each test point in the same block has the same threshold conditions, and the threshold conditions correspond one-to-one with multiple blocks.
[0032] Step S150: Based on multiple blocks, obtain the test points that meet the corresponding threshold conditions from the image to be detected, and use them as candidate points;
[0033] Step S160: Based on the candidate points, obtain the target points present in the image to be detected.
[0034] Figure 2 A schematic diagram of an image to be detected is shown; Figure 3 A schematic diagram of a target image to be tested is shown; Figure 4 A schematic diagram of a reference image is shown. (In conjunction with the reference image) Figure 1 and Figure 4 Execute step S110 to obtain the image 100 to be detected of the object to be tested. The image 100 to be detected includes the relationship between the positions of multiple test points and the detection parameters. The detection parameters are positively correlated with the image grayscale.
[0035] The test image 100 of the object to be tested is obtained, which provides the basis for obtaining the first statistical chart based on the test image 100.
[0036] In this embodiment, the step of acquiring the image to be detected 100 includes: acquiring the target image to be detected 200 and the reference image 300 of the object to be tested; acquiring the difference image between the target image to be detected 200 and the reference image 300 as the image to be detected 100.
[0037] The target image 200 is the image that needs to be inspected. As an example, the target image 200 is an image that needs to be defect-detected.
[0038] In this embodiment, the steps of acquiring the target image to be tested 200 include: providing an imaging system and an object to be tested; using the imaging system to capture an image of the object to be tested, which is then used as the target image to be tested 200.
[0039] In this embodiment, the object under test includes multiple repeating unit structures, the target image under test 200 is an image of the unit structure, and the target image under test 200 is an image of any unit structure in the object under test.
[0040] In this embodiment, the target image to be tested 200 includes the relationship between the positions of multiple points to be detected on the surface of the object to be tested and the detection parameters. Subsequently, by detecting the image to be tested 100, the multiple points to be detected in the target image to be tested 200 are detected, thereby realizing the detection of the points to be detected in the target image to be tested 200.
[0041] In this embodiment, the target image to be tested 200 is a grayscale image. Specifically, the grayscale value of the test point in the target image to be tested 200 is 0 to 255. In other embodiments, the target image to be tested can also be a single-channel image, a black and white image, or a color image, etc.
[0042] In this embodiment, the target image 200 is a dark-field image. The dark-field image is obtained through dark-field inspection.
[0043] In optical inspection, based on the source of the collected signal light, methods can include bright-field inspection and dark-field inspection. Dark-field inspection, in particular, detects the surface of an object by probing the intensity of scattered light from its surface.
[0044] In other embodiments, the target image to be tested can also be a bright field image.
[0045] The reference image 300 serves as a comparison benchmark when performing detection processing on the target image 200. By obtaining the difference between the detection parameters of the points to be detected in the target image 200 and the corresponding points to be detected in the reference image 300, it is determined whether the points in the target image 200 are target points.
[0046] In this embodiment, the object under test includes multiple unit structures arranged periodically. The target image under test 200 is an image of the unit structures in the object under test. Correspondingly, the reference image 300 is an image of the unit structures in the object under test that are adjacent to the unit structures in the target image under test 200.
[0047] In other embodiments, a standard image can also be used as a reference image. The standard image is an image of a standard object that is identical to the object under test.
[0048] As an example, a standard image is a computer-aided design (CAD) drawing of a standard object. As another example, a standard image is a defect-free measurement image of a standard object.
[0049] In this embodiment, the target image 200 is a grayscale image, and the reference image 300 is also a grayscale image. In other embodiments, the reference image may also be a single-channel image, a black and white image, or a color image, etc.
[0050] In this embodiment, there are multiple reference images 300. In other embodiments, there may be only one reference image 300.
[0051] There are multiple reference images 300. By acquiring the difference images between the target image to be tested 200 and the multiple reference images 300, each image is used as a detection image 100. Based on the multiple detection images 100, multiple detection results of the target image to be tested 200 are obtained, so that the multiple detection results of the target image to be tested 200 can corroborate each other, thereby improving the accuracy of detection.
[0052] In other embodiments, when a standard image is used as a reference image, there are one or more reference images. Accordingly, the multiple reference images are images of the unit structures in one or more standards consistent with the object under test.
[0053] In this embodiment, the image to be detected 100 is a difference image between the target image to be detected 200 and the reference image 300. Accordingly, the image to be detected 100 includes the relationship between the positions of multiple test points and detection parameters, referring to the relationship between the positions of the test points in the target image to be detected 200 and the differences in detection parameters between the test points in the target image to be detected 200 and the corresponding test points in the reference image 300. In other words, there is a one-to-one correspondence between the test points in the image to be detected 100 and the test points in the target image to be detected 200, and the detection parameters of the test points in the image to be detected 100 are the differences in detection parameters between the positions of the test points in the target image to be detected 200 and the corresponding test points in the reference image 300.
[0054] In this embodiment, there are multiple reference images 300, and the image to be detected 100 is the difference image between the target image to be detected 200 and the reference image 300. Accordingly, there are multiple images to be detected 100, and there is a one-to-one correspondence between the image to be detected 100 and the reference image 300.
[0055] In this embodiment, the detection parameters of the test point 110 in the image to be detected 100 are positively correlated with the image grayscale. In other words, the larger the image grayscale of the test point 110 in the image to be detected 100, the larger the detection parameters of the test point 110; the smaller the image grayscale of the test point 110 in the image to be detected 100, the smaller the detection parameters of the test point 110.
[0056] In this embodiment, the larger the absolute value of the detection parameter of the test point 110 in the image to be detected 100, the larger the absolute value of the difference in detection parameters between the test point in the target image to be detected 200 and the corresponding test point in the reference image 300, and the larger the difference in detection parameters between the test point in the target image to be detected 200 and the corresponding test point in the reference image 300. Conversely, the smaller the absolute value of the detection parameter of the test point 110 in the image to be detected 100, the smaller the absolute value of the difference in detection parameters between the test point in the target image to be detected 200 and the corresponding test point in the reference image 300, and the smaller the difference in detection parameters between the test point in the target image to be detected 200 and the corresponding test point in the reference image 300.
[0057] In other embodiments, the image to be detected can also be the target image of the object to be tested. Accordingly, the relationship between the positions of multiple test points in the image to be detected and the detection parameters is the same as the relationship between the positions of the test points in the target image and the detection parameters.
[0058] In this embodiment, the object under test is a wafer, which typically contains multiple repeating dies. Accordingly, the target image under test 200 is a die image.
[0059] In other embodiments, the object under test can also be other types of products such as a glass panel. It is understood that the glass panel can also have multiple repeating unit structures. For example, each unit structure can be used to form an electronic product display screen.
[0060] Figure 5 A schematic diagram of a first statistical graph is shown; Figure 6 This diagram illustrates the positional relationship between a target point in the image to be detected and its surrounding target points when acquiring the first gradient. (Refer to reference...) Figure 1 and Figure 6 Execute step S120 to obtain a first statistical graph 400 based on the image to be detected 100. The first statistical graph 400 includes the correspondence between the detection parameters of the test point 110 in the image to be detected 100, the first gradient and the number of test points 110. The first gradient is the gradient value of the detection parameters of the test point in the image to be detected as the position of the test point changes.
[0061] The first statistical map 400 is obtained from the image to be detected 100, in preparation for dividing the first statistical map 400 into multiple blocks.
[0062] The first statistical graph 400 includes the correspondence between the detection parameters of the test points 110 in the image to be detected 100, the first gradient, and the number of test points 110. In other words, the first statistical graph 400 is a graph showing the correspondence between the detection parameters of the test points 110 in the image to be detected 100, the first gradient, and the number of test points 110.
[0063] In this embodiment, the first gradient is the gradient value of the detection parameter of the test point 110 in the image to be detected as the position of the test point 110 changes.
[0064] As an example, the first gradient of the test point 110 in the image to be detected 100 is the difference between the maximum and minimum detection parameters of the test point 110 and other test points 110 around the test point 110.
[0065] Specifically, such as Figure 6 As shown, the test point 111 and its surrounding test points 112 are arranged in a 3*3 array. Correspondingly, the first gradient of the test point 111 is the difference between the maximum and minimum detection parameters of the test point 111 and its eight surrounding test points 112. It can be understood that the number of test points 111 and its surrounding test points 112 is not limited to nine, but can be more or less, such as five, 25, etc.
[0066] In other embodiments, the first gradient of the point to be tested in the image to be detected can also be the mean of the detection parameters of the point to be tested and its surrounding points to be tested, etc., which is not limited here.
[0067] In this embodiment, the first statistical graph 400 is a distribution graph of the number of test points at each distribution point, and each distribution point corresponds to a detection parameter and a first gradient.
[0068] As an example, such as Figure 5 As shown, in the first statistical graph 400, the horizontal axis represents the distribution point detection parameter, the vertical axis represents the first gradient of the distribution point detection parameter, and the brightness of the distribution point represents the number of test points in the image 100 that have the detection parameter and the first gradient. The detection parameters and the first gradient of the detection parameters in the first statistical graph 400 are arranged in order of size.
[0069] The brightness of the distribution points indicates the number of test points in the image 100 that have the detection parameter and the first gradient. This means that the brighter the distribution points, the more test points in the image 100 that have the corresponding detection parameter and the first gradient; the darker the distribution points, the fewer test points in the image 100 that have the corresponding detection parameter and the first gradient.
[0070] In other embodiments, the first statistical chart may also take other forms of representation, which are not limited here.
[0071] Reference Figures 1 to 6 Step S130 is executed, in which the first statistical graph 400 is divided into multiple blocks 401 by dividing the detection parameters and the first gradient. The range of the detection parameters corresponding to the same first gradient in different blocks 401 does not overlap, and the range of the first gradient corresponding to the same detection parameter in different blocks 401 does not overlap.
[0072] The first statistical graph 400 is divided into multiple blocks 401, which provides a basis for setting corresponding threshold conditions for each of the multiple blocks 401 in the future.
[0073] The first statistical graph 400 is divided into multiple blocks 401. The range of detection parameters corresponding to the same first gradient in different blocks 401 does not overlap, and the range of the first gradient corresponding to the same detection parameter in different blocks 401 does not overlap. In other words, the range of detection parameters and the range of the first gradient in multiple blocks 401 do not overlap. In simpler terms, the detection parameters of the same first gradient at points distributed within one block 401 are all less than, or all greater than, the detection parameters of the same first gradient at points distributed within another block 401; the first gradients of points with the same detection parameter within one block 401 are all less than, or all less than, the first gradients of the same detection parameter in another block 401.
[0074] In this embodiment, the step of dividing the distribution points of the first statistical graph 400 into multiple blocks 401 by dividing the detection parameters and the first gradient includes: dividing the distribution points of the first statistical graph 400 into multiple blocks 401 according to the number of test points 110 of each distribution point determined by the detection parameters and the first gradient in the first statistical graph 400.
[0075] Specifically, in this embodiment, by arranging the detection parameters and the first gradient in ascending order and using them as different coordinate axes, the detection parameters and the first gradient form a distribution image composed of distribution points. The grayscale value of the distribution image is proportional to the number of test points at the corresponding distribution point. In other embodiments, the first statistical graph is a surface graph, where any point on the surface represents the corresponding first gradient, detection parameters, and the number of test points.
[0076] In this embodiment, block 401 is obtained by dividing the distribution image into geometric regions.
[0077] In this embodiment, the step of dividing the distribution points of the first statistical graph 400 according to the detection parameters and the number of test points of each distribution point determined by the first gradient includes: obtaining the gradient value of the number of test points changing with each distribution point to obtain the second gradient; obtaining the distribution points corresponding to the second gradient with extreme values or greater than preset values to obtain the division points; and dividing the first statistical graph 400 into multiple blocks 401 according to the division points.
[0078] In this embodiment, the second gradient is the gradient value of the number of test points varying with each distribution point. Accordingly, the second gradient is obtained by acquiring the number of test points at each distribution point and the number of test points at the surrounding distribution points.
[0079] As an example, when obtaining the second gradient of a distribution point, the maximum and minimum values of the number of test points at that distribution point and the number of test points at other surrounding distribution points are obtained, and the difference between the maximum and minimum values of the number of test points is taken as the second gradient of that distribution point.
[0080] After calculating and obtaining the second gradient of each distribution point in the first statistical graph, the distribution points corresponding to the second gradient with extreme values or greater than preset values are obtained to obtain the division points, and the distribution points of the first statistical graph 400 are divided into multiple blocks 401 according to the obtained division points.
[0081] The distribution points corresponding to the second gradient with extreme values or values greater than preset values are obtained as dividing points. Correspondingly, the number of test points on the dividing points and the distribution points around them varies greatly. Subsequently, the distribution points in the second statistical graph 400 are divided by dividing points, which can divide the distribution points with large differences in the number of test points into different blocks, thereby improving the accuracy of block division. Subsequently, the threshold conditions of each block are obtained according to the detection parameters of the test points indicated by the number of test points in each block, so that the obtained threshold conditions are adapted to the distribution of the number of test points on the distribution points in the block, thereby improving the detection accuracy.
[0082] The preset values can be selected according to actual needs. As an example, the preset values are the mean of the second gradient of each distribution point in the first statistical graph or preset values determined based on prior experience.
[0083] In this embodiment, the step of dividing the distribution points of the first statistical graph 400 into multiple blocks 401 according to the dividing points includes: dividing the blocks 401 according to a preset block direction, such that the number of dividing points through which the edge of the block 401 passes is greater than a predetermined value or reaches a maximum value, or, taking the area divided by the dividing points as the block 401.
[0084] The block 401 is divided according to the preset block direction, so that the number of division points that the edge of the block 401 passes through is greater than a predetermined value or reaches the maximum value, or the area divided by the division points is taken as a block, which can divide the distribution points with large differences in the number of test points into two adjacent blocks.
[0085] The preset block direction can be determined based on the division points in the first statistical chart 400. As an example, the preset block direction is the distribution direction of the division points in the first statistical chart 400.
[0086] In other embodiments, it is also possible to divide the distribution points in the first statistical chart into multiple blocks directly based on prior experience and observations of the first statistical chart, without calculating the second gradient value of the number of test points in the first statistical chart as a function of each distribution point.
[0087] It should be noted that the number of blocks 401 obtained by dividing the first statistical graph 400 should not be too many or too few. If the number of blocks 401 is too few, it will be detrimental to improving the accuracy of candidate point identification; if the number of blocks 401 is too many, it will increase the subsequent processing load and will also be detrimental to improving the accuracy of candidate point identification. Therefore, in this embodiment, the number of blocks 401 obtained by dividing the first statistical graph 400 is 3 to 4.
[0088] In other embodiments, the distribution points of the first statistical graph can be evenly divided into multiple blocks according to preset rules. As an example, the first statistical graph is evenly divided into multiple blocks by equally dividing the ranges of the detection parameters and the first gradient.
[0089] Reference Figures 1 to 6 In step S140, the threshold conditions of each block 401 are obtained according to the detection parameters of the test points 110 indicated by the number of test points in each block 401, so that each test point 110 in the same block 401 has the same threshold conditions, and the threshold conditions correspond one-to-one with multiple blocks.
[0090] The threshold conditions of each block 401 are obtained according to the detection parameters of the test points 110 indicated by the number of test points in each block 401, so that each test point 110 in the same block 401 has the same threshold conditions. The threshold conditions correspond one-to-one with multiple blocks, which provides a basis for subsequent detection of test points 110 in the image to be detected that are located in different blocks 401 with different threshold conditions.
[0091] Figure 7 This diagram illustrates a flowchart of obtaining threshold conditions for each block in one embodiment of the detection method provided by the present invention. Figure 8 A schematic diagram of a second statistical chart is shown. (Refer to the reference.) Figures 1 to 8 In this embodiment, the threshold conditions of each block 401 are obtained according to the detection parameters of the test points 110 indicated by the number of test points in each block 401, so that each test point 110 in the same block 401 has the same threshold condition. The step of the threshold conditions corresponding one-to-one with multiple blocks may specifically include:
[0092] Step S141: Obtain the number of test points in each block and form a target image. The target image corresponds one-to-one with multiple blocks. The target image includes the relationship between the position of the test points in the block and the detection parameters.
[0093] Step S142: Obtain a second statistical chart that corresponds one-to-one with each target image. The second statistical chart includes the correspondence between the detection parameter and the number of points with the detection parameter in the corresponding target image.
[0094] Step S143: Obtain the threshold conditions for the detection parameters based on the second statistical chart. The threshold conditions correspond one-to-one with multiple blocks.
[0095] The number of test points 110 in each block 401 is used to form a target image, and correspondingly, the target image corresponds one-to-one with multiple blocks 401. Therefore, the number of test points 110 in each target image is the sum of the number of test points located on the distribution points in the corresponding block 401, and the detection parameters and first gradient of the test points 110 in each target image are the detection parameters and first gradient of the distribution points in the corresponding block 401, respectively.
[0096] In this embodiment, the image to be detected 100 is the difference image between the target image to be detected 200 and the reference image 300. The detection parameter of the test point 110 in the image to be detected 100 is the difference in detection parameters between the test point in the target image to be detected and the corresponding test point in the reference image. Correspondingly, the detection parameter of the test point in the target image is also the difference in detection parameters between the test point in the target image to be detected and the corresponding test point in the reference image 300.
[0097] Therefore, the larger the absolute value of the detection parameter of the test point 110 in the target image, the larger the absolute value of the difference in detection parameters between the test point in the target test image 200 and the corresponding test point in the reference image, which in turn indicates a larger difference in detection parameters between the test point in the target test image 200 and the corresponding test point in the reference image.
[0098] Conversely, the smaller the absolute value of the detection parameter of the test point 110 in the target image, the smaller the absolute value of the difference in detection parameters between the test point in the target test image 200 and the corresponding test point in the reference image, which in turn indicates that the difference in detection parameters between the test point in the target test image 200 and the corresponding test point in the reference image is smaller.
[0099] Taking grayscale values as the detection parameter as an example, the detection parameter of the point to be detected in the target image 200 is 0 to 255, the detection parameter of the point to be detected in the reference image 300 is 0 to 255, and the detection parameter of the point to be detected in the image 100 is -255 to 255. Accordingly, the detection parameter of the point to be detected in the target image is between -255 and 255.
[0100] In other embodiments, the image to be detected can also be a target image of the object to be tested. Accordingly, the points to be tested in the target image are the points to be detected in the target image.
[0101] The second statistical graph 500 of the target image is obtained, which provides a basis for obtaining the threshold conditions for detection processing of the target image based on the second statistical graph 500.
[0102] In this embodiment, the second statistical graph 500 includes the correspondence between the detection parameters of the points to be tested in the target image and the number of points to be tested.
[0103] In the second statistical graph 500, the absolute values of the detection parameters of the test points 110 located in the edge region are larger and the number is smaller, while the absolute values of the detection parameters of the test points 110 located in the middle region are smaller and the number is larger.
[0104] In the second statistical graph 500, the detection parameters of the test point 110 located in the edge region are relatively large, indicating that the difference in detection parameters between the test point in this part of the target test image 200 and the corresponding test point in the reference image 300 is relatively large. Accordingly, it indicates that the difference in detection parameters between the test point in this part of the target test image 200 and the corresponding test point in the reference image 300 is relatively large. Therefore, the probability that the test point in this part of the target image is the target point is relatively high.
[0105] Conversely, the detection parameters of the test point 110 located in the middle region of the second statistical graph 500 are relatively small, indicating that the difference in detection parameters between the test point in this part of the target test image 200 and the corresponding test point in the reference image 300 is small. Accordingly, it indicates that the difference in detection parameters between the test point in this part of the target test image 200 and the corresponding test point in the reference image 300 is small. Therefore, the probability that the test point in this part of the target image is the target point is relatively small.
[0106] Therefore, obtaining the second statistical graph 500 can intuitively show the pattern of the number of test points in the target image affecting the change of detection parameters. Correspondingly, it can intuitively show the relationship between the difference in detection parameters and the number of test points between the test points in the target image 200 and the corresponding test points in the reference image 300, which helps to obtain more accurate threshold conditions and improve the accuracy of detection.
[0107] See Figure 8 In the second statistical graph 500, the horizontal axis represents the detection parameters of the test points in the target image, and the vertical axis represents the number of test points with corresponding detection parameters.
[0108] It should be pointed out that, Figure 8 The second statistical chart is shown using grayscale values as the detection parameter as an example. Figure 8 The second statistical graph 500 is obtained by shifting the detection parameters of the test point to the right by 255. Accordingly, the detection parameters of the second statistical graph 500 are in the range of 0 to 510.
[0109] In this embodiment, there are multiple target images. Accordingly, a second statistical graph 500 of the target images is obtained, that is, a second statistical graph 500 of each target image is obtained. Therefore, there are multiple second statistical graphs 500, and there is a one-to-one correspondence between the second statistical graphs 500 and the target images.
[0110] In this embodiment, the step of obtaining the threshold condition of the detection parameter according to the second statistical chart includes: setting a quantity condition; obtaining the threshold condition of the detection parameter according to the quantity condition in the second statistical chart, so that the number of test points in the target image that meets the threshold condition meets the quantity condition, and correspondingly making the number of test points in the block 401 of the threshold condition meet the quantity condition.
[0111] Specifically, the steps for setting the quantity conditions include: setting a first quantity threshold and a second quantity threshold, both of which are less than the total number of test points in the target image. Correspondingly, the steps for obtaining threshold conditions for detection parameters in the second statistical graph based on the quantity conditions, such that the number of test points in the target image satisfying the threshold conditions, include: obtaining a first detection parameter and a second detection parameter based on the second statistical graph, where the first detection parameter is less than the second detection parameter, the number of test points in the second statistical graph less than the first detection parameter equals the first quantity threshold, and the number of test points in the second statistical graph greater than the second detection parameter equals the second quantity threshold; obtaining a first threshold detection parameter based on the first detection parameter; obtaining a second threshold detection parameter based on the second detection parameter; the threshold condition is either less than the first threshold detection parameter or greater than the second threshold detection parameter.
[0112] The inventors of this application discovered a certain relationship between candidate points in a target image and the total number of test points in the target image. Accordingly, based on the total number of test points in the target image, a quantity condition is obtained, enabling the subsequent acquisition of a threshold condition for detection parameters from a second statistical graph based on the quantity threshold. This allows the threshold condition to identify a corresponding number of candidate points from the target image, and consequently, to identify a corresponding number of candidate points from the image to be detected 100. This helps avoid an increase in the false detection rate or false negative rate caused by too many or too few identified candidate points, thereby improving the accuracy of candidate point identification.
[0113] Therefore, in this embodiment, the first quantity threshold is a linear combination of the total number of test points in the target image and a preset offset, the second quantity threshold is a linear combination of the total number of test points in the target image and a preset offset, and the coefficient of the total number in the first quantity threshold is less than 1, the coefficient of the total number in the second quantity threshold is less than 1, and the preset offset is equal to or greater than zero.
[0114] As an example, the first and second quantity thresholds are calculated using the following formulas:
[0115] N th1 =α*M+offset (1)
[0116] N th2 =β*M+offset (2)
[0117] Where, N th1 N represents the first quantity threshold. th2 α represents the coefficient of the total number of test points in the target image in the first quantity threshold, M represents the total number of test points in the target image, β represents the coefficient of the total number of test points in the target image in the second quantity threshold, and offset represents the preset offset.
[0118] In this embodiment, the coefficient for the total number of items in the first quantity threshold is (0.1~5)×10. -3 The coefficient for the total number of items in the second quantity threshold is (0.1~5)×10. -3 The preset offset is 0 or greater than 0, and the coefficient of the preset offset is 1.
[0119] First quantity threshold N th1 Second quantity threshold N th2 Same or different. As an example, the first quantity threshold is the same as the second quantity threshold, and correspondingly, the coefficients α and β of the total number of test points M in the target image in formulas (1) and (2) are both 10. -3 And the preset offset is 0.
[0120] After obtaining the first quantity threshold and the second quantity threshold, the first detection parameter and the second detection parameter are obtained in the second statistical graph 500 based on the first quantity threshold and the second quantity threshold.
[0121] Specifically, the number of points in the second statistical graph 500 whose detection parameter is less than the first detection parameter is the first quantity threshold, and the number of points in the second statistical graph 500 whose detection parameter is greater than the second detection parameter is the second quantity threshold.
[0122] Accordingly, when acquiring the first detection parameter and the second detection parameter, starting from the maximum and minimum detection parameters of the second statistical graph 500, the number of points in the second statistical graph 500 is acquired along the directions of gradually decreasing detection parameters and gradually increasing detection parameters, respectively, until the number of test points acquired along the direction of gradually decreasing detection parameters and the number of test points acquired along the direction of gradually increasing detection parameters reach the first quantity threshold and the second quantity threshold, respectively. Then, the corresponding detection parameters of the second statistical graph 500 are used as the first detection parameter and the second detection parameter, respectively.
[0123] Therefore, in the second statistical graph 500, the number of test points whose detection parameters are outside the range of the first and second detection parameters is the sum of the first and second quantity thresholds.
[0124] In this embodiment, after obtaining the first detection parameter and the second detection parameter, compensation is also performed on the first detection parameter and the second detection parameter.
[0125] Specifically, the steps for compensating the first detection parameter include: setting a first preset compensation amount, and compensating the first detection parameter by summing the first preset compensation amount with the first detection parameter. In other words, the sum of the first preset compensation amount and the first detection parameter is used as the compensated first detection parameter. In this embodiment, the first preset compensation amount is -255 to 0.
[0126] The steps for compensating the second detection parameter include: setting a second preset compensation amount, and compensating the second detection parameter by summing the second preset compensation amount with the second detection parameter. In other words, the sum of the second preset compensation amount and the second detection parameter is used as the compensated second detection parameter. In this embodiment, the second preset compensation amount is 0 to 255.
[0127] Setting a first preset compensation amount and a second preset compensation amount allows for subsequent adjustments to the compensated first detection parameter and the compensated second detection parameter by adjusting the first preset compensation amount and the second preset compensation amount, respectively.
[0128] In this embodiment, the step of obtaining the first threshold detection parameter based on the first detection parameter after compensating the first detection parameter includes: comparing the compensated first detection parameter with the minimum threshold and obtaining the larger one as the first threshold detection parameter.
[0129] Using the larger of the compensated first detection parameter and the minimum threshold as the first threshold detection parameter can limit the first threshold detection parameter to the minimum threshold or greater than the minimum threshold. This can avoid the increase in the false negative rate caused by setting the first threshold detection parameter too small, and thus improve the accuracy of detection.
[0130] In this embodiment, the minimum threshold is obtained through a first preset compensation amount. Specifically, the sum of the first preset compensation amount and the first preset constant is used as the minimum threshold.
[0131] In this embodiment, the step of obtaining a second threshold detection parameter after compensating the second detection parameter includes: comparing the compensated second detection parameter with the maximum threshold and obtaining the smaller one as the second threshold detection parameter.
[0132] By comparing the compensated second detection parameter with the maximum threshold and taking the smaller one as the second threshold detection parameter, the second threshold detection parameter can be limited to the maximum threshold or less. This can avoid the increase in the false negative rate caused by setting the second threshold detection parameter too high, and thus improve the accuracy of detection.
[0133] In this embodiment, the maximum threshold is obtained through a second preset compensation amount. Specifically, the sum of the second preset compensation amount and the second preset constant is used as the maximum threshold.
[0134] In this embodiment, the first preset compensation amount is -255 to 0, the second preset compensation amount is 0 to 255, the first preset constant is -255 to 0, the second preset constant is 0 to 255, the maximum threshold is 0 to 255, and the minimum threshold is -255 to 0. Specifically, the first preset compensation amount is -30, the second preset compensation amount is 30, the first preset constant is -64, and the second preset constant is 64.
[0135] It should be noted that the first preset compensation amount is -255 to 0, the first preset constant is -255 to 0, and the minimum threshold is -255 to 0. If the sum of the first preset compensation amount and the first preset constant is less than -255, the minimum threshold is set to -255; if the sum of the first preset compensation amount and the first preset constant is greater than 0, the minimum threshold is set to 0.
[0136] Similarly, the second preset compensation amount is 0 to 255, the second preset constant is 0 to 255, and the maximum threshold is 0 to 255. If the sum of the second preset compensation amount and the second preset constant is greater than 255, the maximum threshold is set to 255; if the sum of the second preset compensation amount and the second preset constant is less than 0, the maximum threshold is set to 0.
[0137] In another embodiment, after obtaining the first detection parameter and the second detection parameter from the second statistical chart, the first detection parameter can be directly used as the first threshold detection parameter and the second detection parameter can be used as the second threshold detection parameter. Alternatively, after compensating the first detection parameter and the second detection parameter with the first preset compensation amount and the second preset compensation amount respectively, the compensated first detection parameter can be directly used as the first threshold detection parameter and the compensated second detection parameter can be used as the second threshold detection parameter.
[0138] In other embodiments of the present invention, the quantity condition may also include setting only a second quantity threshold, that is, setting the first quantity threshold to zero.
[0139] Specifically, the first quantity threshold is a linear combination of the total number of test points in the target image and a preset offset, and the second quantity threshold is also a linear combination of the total number of test points in the target image and the preset offset. The coefficient of the total number in the first quantity threshold is less than 1, the coefficient of the total number in the second quantity threshold is less than 1, and the preset offset is equal to or greater than zero. If the first quantity threshold is zero, then both the coefficient of the total number of test points in the target image and the preset offset in the first quantity threshold are zero. Correspondingly, the second quantity threshold is the product of the total number of test points in the target image and the coefficient of the total number of test points in the target image.
[0140] As an example, please refer to formulas (1) and (2), the first quantity threshold N th1 If it is zero, then the first quantity threshold N th1 The coefficient α of the total number of test points M in the target image and the preset offset are both zero, and the second quantity threshold N th2 The corresponding product is the total number of points M in the target image 300 and the coefficient β.
[0141] In this embodiment, either the first or second quantity threshold can be zero. That is, the first quantity threshold is zero in this embodiment when the detection parameters obtained from the second statistical chart do not include the first detection parameters and only include the second detection parameters. Therefore, the number of points obtained from the target image is the second quantity threshold.
[0142] If the first quantity threshold is zero, then in the step of obtaining the first and second detection parameters according to the second statistical chart, the first detection parameter is less than the minimum value of the detection parameters, that is, the first threshold detection parameter is less than the minimum value of the detection parameters. Therefore, the first threshold detection parameter has no effect on screening candidate points, which is a scheme where the first threshold detection parameter is not set. Therefore, a threshold condition that is less than the first threshold detection parameter or greater than the second threshold detection parameter is considered as a point greater than the second threshold detection parameter, that is, the test point in the corresponding block whose detection parameter is greater than the second threshold detection parameter is taken as a candidate point. Here, the second threshold detection parameter is the second detection parameter or the smaller of the second detection parameter and the maximum threshold.
[0143] Accordingly, if the first quantity threshold is zero, when obtaining the second detection parameter, the number of test points is obtained starting from the maximum detection parameter in the second statistical graph and gradually decreasing along the direction of the detection parameter until the number of points obtained is equal to the second quantity threshold, and the corresponding detection parameter is used as the second detection parameter.
[0144] As an example, in the inspection of patternless wafers, the image of the patternless wafer to be inspected is used as the target image. The detection parameters of non-candidate points in the target image are all the same, and the detection parameters of candidate points are greater than those of non-candidate points. Accordingly, test points with detection parameters greater than a second threshold detection parameter are obtained from the target image and used as candidate points. Specifically, when the image to be inspected is a dark field image, the grayscale of the background is essentially zero, while the grayscale of the defect point image is greater than zero. A second quantity threshold can be set, and the second detection parameter corresponding to the second quantity threshold is greater than zero. This is a technical solution where the first quantity threshold is equal to zero, the second detection parameter is less than zero, and the second threshold detection parameter is less than zero.
[0145] In another embodiment, the step of setting the quantity condition includes: setting a third quantity threshold, which limits the number of non-candidate points. Correspondingly, the step of obtaining threshold conditions for detection parameters in the second statistical graph based on the quantity condition, such that the number of test points in the target image satisfying the threshold condition meets the quantity condition, includes: obtaining a first detection parameter and a second detection parameter based on the second statistical graph, wherein the first detection parameter is less than the second detection parameter, the number of test points in the second statistical graph that is greater than the first detection parameter and less than the second detection parameter is equal to the third quantity threshold, and the detection parameter with the largest number is located between the first and second detection parameters.
[0146] In this embodiment, the third quantity threshold is used to limit the number of non-candidate points in the target image, so that the first detection parameter and the second detection parameter can be obtained from the second statistical graph simultaneously by using only the uniquely set third quantity threshold, thereby simplifying the acquisition operation of the first detection parameter and the second detection parameter.
[0147] As an example, the number of test points can be obtained starting from the detection parameter with the largest number of test points in the second statistical graph, respectively, along the direction of gradually increasing detection parameter and the direction of gradually decreasing detection parameter, until the sum of the number of test points obtained along the direction of gradually increasing detection parameter and the direction of gradually decreasing detection parameter reaches the third quantity threshold. Then, the corresponding detection parameters in the second statistical graph are used as the first detection parameter and the second detection parameter, respectively.
[0148] In other embodiments, the step of setting quantity conditions includes setting a fourth quantity threshold and a fifth quantity threshold. Correspondingly, the step of obtaining threshold conditions for detection parameters in the second statistical graph based on the quantity conditions, such that the number of test points in the target image satisfying the threshold conditions meets the quantity conditions, includes: obtaining the detection parameter with the highest number of test points as the center parameter; obtaining a first detection parameter and a second detection parameter based on the second statistical graph, wherein the first detection parameter is less than the second detection parameter, the number of test points in the second statistical graph that are greater than the first detection parameter and less than the center parameter is equal to the fourth quantity threshold, and the number of test points in the second statistical graph that are greater than the center parameter and less than the second detection parameter is equal to the fifth quantity threshold.
[0149] In this embodiment, the detection parameter with the largest number of test points is obtained as the central parameter, that is, the detection parameter corresponding to the maximum value of the vertical axis in the second statistical graph is used as the central parameter.
[0150] The first detection parameter and the second detection parameter are obtained based on the second statistical chart. The first detection parameter is less than the second detection parameter. The number of test points in the second statistical chart that are greater than the first detection parameter and less than the center parameter is equal to the fourth quantity threshold. The number of test points in the second statistical chart that are greater than the center parameter and less than the second detection parameter is equal to the fifth quantity threshold. In other words, the number of non-candidate points in the second statistical chart is limited to the sum of the fourth quantity threshold and the fifth quantity threshold. Correspondingly, the number of candidate points in the second statistical chart is the total number of test points in the second statistical chart minus the sum of the fourth quantity threshold and the fifth quantity threshold.
[0151] In other embodiments, the threshold conditions of each block are obtained according to the detection parameters of the test points indicated by the number of test points in each block, so that each test point in the same block has the same threshold condition. The step of the threshold conditions corresponding one-to-one with multiple blocks includes: obtaining the mean and standard deviation of the detection parameters of the test points indicated by the number of test points in each block; obtaining the detection threshold of each block according to the linear combination of the mean and standard deviation of the detection parameters of the test points indicated by the number of test points in each block, wherein the combination coefficient of the mean is 1, and the threshold condition is that the detection parameter is greater than the detection threshold.
[0152] The detection threshold for each block can be obtained directly from the linear combination of the mean and standard deviation of the detection parameters of the test points indicated by the number of test points in each block. This simplifies the process of obtaining the threshold conditions for each block and improves the detection efficiency.
[0153] The detection threshold for each block is obtained by linearly combining the mean and standard deviation of the detection parameters of the test points indicated by the number of test points in each block. The combination coefficient of the mean is 1. Therefore, in the detection threshold of each block, the mean of the detection parameters, the combination coefficient of the mean, and the standard deviation are all constant values. Thus, by adjusting the coefficient of the standard deviation, the detection threshold of each block can be adjusted.
[0154] In this embodiment, the detection method further includes: repeatedly performing iterative steps until the false negative rate and / or false positive rate meet preset requirements.
[0155] The process involves iterative steps until the false negative rate and / or false positive rate meet the preset requirements. This ensures that the false negative rate and / or false positive rate under the adjusted threshold conditions meet the preset requirements, thereby achieving a balance between the false negative rate and false positive rate of candidate points in the image to be detected and improving the accuracy of detection.
[0156] In this embodiment, the iterative step includes: providing a preset reference image, which includes a certain number of known reference target points; obtaining points that meet the threshold conditions from the preset reference image as initial reference points; comparing the initial reference points and the reference target points to obtain information on the false detection rate and / or false negative rate under the current threshold conditions; if the false detection rate and / or false negative rate meet the preset requirements, then the initial reference points are used as candidate points; if the false detection rate and / or false negative rate under the current threshold conditions do not meet the preset requirements, then the threshold conditions are adjusted.
[0157] The preset reference image includes a certain number of known reference points. By comparing the initial reference points that meet the threshold conditions obtained from the preset reference image with the known reference points, information on the false detection rate and / or false negative rate under the current threshold conditions can be obtained.
[0158] Specifically, if there are initial reference points that are not known reference points among the initial reference points that meet the threshold conditions obtained from the preset reference image, it indicates that there is a false detection; if all the initial reference points that meet the threshold conditions obtained from the preset reference image are known reference points, and the number of initial reference points obtained is less than the number of known reference points, it indicates that there is a missed detection.
[0159] In this embodiment, if the false detection rate under the current threshold condition is greater than the preset false detection rate threshold, it indicates that the first threshold detection parameter under the current threshold condition is set too high and the second threshold detection parameter is set too low, thereby increasing the probability of identifying non-candidate points in the corresponding block 401 as candidate points. At this time, the threshold condition is adjusted so that the first threshold detection parameter decreases and the second threshold detection parameter increases, thereby reducing the false detection rate.
[0160] If the false negative rate under the current threshold condition is greater than the preset false negative rate threshold, it indicates that the first threshold detection parameter under the current threshold condition is set too small and the second threshold detection parameter is set too large, thus increasing the probability of missing candidate points in the corresponding block 401. In this case, the threshold conditions are adjusted so that the first threshold detection parameter increases and the second threshold detection parameter decreases, thereby reducing the false positive rate.
[0161] Specifically, referring to the aforementioned formulas (1) and (2), the first quantity threshold N th1 The second quantity threshold N is a linear combination of the total number M of test points in the target image and the preset offset. th2 The number of test points N is a linear combination of the total number M in the target image and the preset offset. The coefficient α of the total number in the first quantity threshold is less than 1, the coefficient β of the total number in the second quantity threshold is less than 1, and the preset offset is either 0 or greater than zero. Therefore, by adjusting the first quantity threshold N... th1 The coefficient α of the total number M, and the second quantity threshold N th2 The coefficient β of the total number M and / or the preset offset, relative to the first quantity threshold N. th1 Second quantity threshold N th1 Adjustments are made to the first and second detection parameters obtained from the statistical chart 400, thereby adjusting the threshold conditions.
[0162] Furthermore, in this embodiment, after obtaining the first and second detection parameters from the statistical chart, the first detection parameter is compensated using a first preset compensation amount, and the second detection parameter is compensated using a second preset compensation amount. The minimum threshold is the sum of the first preset compensation amount and a first preset constant, and the maximum threshold is the sum of the second preset compensation amount and a second preset constant. Accordingly, adjusting the first and second preset compensation amounts respectively allows for adjustments to the compensated first and second detection parameters, the minimum threshold, and the maximum threshold, thereby enabling adjustments to the first and second threshold detection parameters and ultimately, the threshold conditions.
[0163] Therefore, in this embodiment, by adjusting at least one of the coefficient of the total number of items in the first quantity threshold, the coefficient of the total number of items in the second quantity threshold, the preset offset, the first preset compensation amount, and the second preset compensation amount, the adjustment of the first threshold detection parameter and / or the second threshold detection parameter can be achieved, thereby achieving the adjustment of the threshold condition.
[0164] In another embodiment, when the first detection parameter and the second detection parameter obtained from the statistical chart are used as the first threshold detection parameter and the second threshold detection parameter, respectively, the first quantity threshold and the second quantity threshold can be adjusted by adjusting the coefficient of the total number in the first quantity threshold, the coefficient of the total number in the second quantity threshold and / or the preset offset, thereby adjusting the first detection parameter and the second detection parameter obtained from the statistical chart, thereby achieving the adjustment of the first threshold detection parameter and the second threshold detection parameter, and thus achieving the purpose of adjusting the threshold conditions.
[0165] In another embodiment, after obtaining the first detection parameter and the second detection parameter from the statistical chart, the first detection parameter is compensated by a first preset compensation amount, and the second detection parameter is compensated by a second preset compensation amount. The compensated first detection parameter and the compensated second detection parameter are used as the first threshold detection parameter and the second threshold detection parameter, respectively. The first threshold detection parameter and the second threshold detection parameter can be adjusted by adjusting at least one of the coefficient of the total number of items in the first quantity threshold, the coefficient of the total number of items in the second quantity threshold, the preset offset, the first preset compensation amount, and the second preset compensation amount, thereby adjusting the threshold condition.
[0166] In other embodiments of the present invention, when the first quantity threshold is zero, the second detection parameter is adjusted by adjusting at least one of the coefficient of the total number in the second quantity threshold and the second preset compensation amount, thereby enabling the adjustment of the second threshold detection parameter and thus the adjustment of the threshold condition.
[0167] In other embodiments, threshold conditions for each block are obtained based on the detection parameters of the test points indicated by the number of test points in each block. The threshold conditions correspond one-to-one with multiple blocks, including: obtaining the mean and standard deviation of the detection parameters of the test points indicated by the number of test points in each block; obtaining the detection threshold for each block based on a linear combination of the mean and standard deviation of the detection parameters of the test points indicated by the number of test points in each block, where the combination coefficient of the mean is 1, and the threshold condition is that the detection parameter is greater than the detection threshold.
[0168] Correspondingly, by adjusting the coefficient of the standard deviation of the detection parameters of the test points in each block, the detection threshold of each block can be adjusted, thereby achieving the adjustment of the threshold conditions.
[0169] Reference Figures 1 to 6 In step S150, test points that meet the corresponding threshold conditions are obtained from the image to be detected 100 according to multiple blocks 401, and these points are used as candidate points.
[0170] Based on multiple blocks 401, test points that meet the threshold conditions are obtained from the image to be detected 100 as candidate points, which provide a basis for obtaining target points in the subsequent process.
[0171] In this embodiment, test points that meet the threshold conditions are obtained from the image to be detected 100 according to multiple blocks 401 as candidate points. That is, for test point 110 in the image to be detected 100, it is first determined that the test point 110 is located in block 401 of the first statistical graph 200, and then the test point 110 is identified by the threshold conditions corresponding to the block 401 to which the test point 110 belongs, and the test point 110 that meets the corresponding threshold conditions is taken as candidate points.
[0172] It should be noted that when there are multiple images to be detected, the candidate points obtained from one image to be detected are used as one candidate point set, and the candidate points obtained from multiple images to be detected are used to form multiple candidate point sets.
[0173] Reference Figures 1 to 6 Execute step S160 to obtain the target point based on the candidate points.
[0174] In this embodiment, target points are obtained based on candidate points; that is, target points existing in the target image to be tested 200 are obtained based on the candidate points obtained from the image to be tested 100. Specifically, the target points are defect points.
[0175] In this embodiment, multiple candidate point sets are formed by using candidate points obtained from multiple images to be detected 100. Accordingly, target points are obtained based on the candidate points. That is, a bitwise AND operation is performed on the multiple candidate point sets formed by the candidate points obtained from multiple images to be detected 100 to obtain the candidate points that exist in each candidate point set as the target points.
[0176] In other embodiments, the reference image can also be a single image, and accordingly, the candidate points can be directly used as target points present in the image to be detected.
[0177] In this embodiment, the detection parameter is the grayscale value. In other embodiments, the detection parameter may also be light intensity, charge, voltage, or light wavelength, etc.
[0178] Accordingly, embodiments of the present invention also provide a detection device.
[0179] Figure 9 A schematic diagram of the frame structure of an embodiment of the detection device provided according to the technical solution of the present invention is shown. (See also...) Figures 1 to 9A detection device 90 includes: a first acquisition unit 901, adapted to acquire a test image of an object to be tested, the test image including the relationship between the positions of multiple test points and detection parameters, wherein the detection parameters are positively correlated with the image grayscale; a second acquisition unit 902, adapted to acquire a first statistical graph based on the test image, the first statistical graph including the correspondence between the detection parameters of the test points in the test image, a first gradient and the number of test points, wherein the first gradient is the gradient value of the detection parameters of the test points in the test image as the position of the test points changes; and a block division unit 903, adapted to divide the first statistical graph into multiple blocks by dividing the detection parameters and the first gradient. The detection parameters corresponding to the same first gradient in different blocks do not overlap in their span range, and the first gradient corresponding to the same detection parameter in different blocks does not overlap in their span range; the third acquisition unit 904 is adapted to acquire the threshold conditions of each block according to the detection parameters of the test points indicated by the number of test points in each block, so that each test point in the same block has the same threshold conditions, and the threshold conditions correspond one-to-one with multiple blocks; the fourth acquisition unit 905 is adapted to acquire test points that meet the corresponding threshold conditions from the image to be detected according to multiple blocks, as candidate points; the fifth acquisition unit 906 is adapted to acquire target points according to the candidate points.
[0180] The detection device of this embodiment is used to perform the detection method of the foregoing embodiments. Other devices may also be used to perform the detection method of the foregoing embodiments. For a detailed description of the detection device of this embodiment, please refer to the corresponding description of the detection method in the foregoing embodiments. This embodiment will not repeat the description here.
[0181] Accordingly, embodiments of the present invention also provide an apparatus including at least one memory and at least one processor, wherein the memory stores one or more computer instructions, and the one or more computer instructions are executed by the processor to implement the detection method.
[0182] An optional hardware structure for the electronic device provided in this embodiment of the invention can be as follows: Figure 10 As shown, it includes: at least one processor 01, at least one communication interface 02, at least one memory 03, and at least one communication bus 04.
[0183] In this embodiment of the invention, the number of processor 01, communication interface 02, memory 03 and communication bus 04 is at least one, and processor 01, communication interface 02 and memory 03 communicate with each other through communication bus 04.
[0184] Communication interface 02 can be an interface for a communication module used for network communication, such as the interface of a GSM module.
[0185] Processor 01 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present invention.
[0186] Memory 03 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk storage device.
[0187] The memory 03 stores one or more computer instructions, which are executed by the processor 01 to implement the detection method of this embodiment of the invention.
[0188] It should be noted that the aforementioned terminal device may also include other devices (not shown) that may not be essential to understanding the content disclosed in the embodiments of the present invention; given that these other devices may not be essential for understanding the content disclosed in the embodiments of the present invention, the embodiments of the present invention will not describe them one by one.
[0189] This invention also provides a storage medium storing one or more computer instructions for implementing the detection method provided in this invention. The detection method is described in the foregoing section and will not be repeated here.
[0190] The embodiments of the present invention described above are combinations of elements and features of the present invention. Unless otherwise stated, elements or features may be considered optional. Individual elements or features may be practiced without combination with other elements or features. Furthermore, embodiments of the present invention may be constructed by combining some elements and / or features. The order of operations described in the embodiments of the present invention may be rearranged. Some constructions of any embodiment may be included in another embodiment and may be replaced by corresponding constructions of another embodiment. It will be apparent to those skilled in the art that claims in the appended claims that are not expressly referenced in each other may be combined to form embodiments of the present invention, or may be included as new claims in amendments made after the filing of this application.
[0191] Embodiments of the present invention can be implemented by various means, such as hardware, firmware, software, or combinations thereof. In a hardware configuration, the method according to an exemplary embodiment of the present invention can be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), processors, controllers, microcontrollers, microprocessors, etc.
[0192] In firmware or software configuration, embodiments of the present invention can be implemented in the form of modules, processes, functions, etc. Software code can be stored in a memory unit and executed by a processor. The memory unit is located inside or outside the processor and can send data to and receive data from the processor via various known means.
[0193] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is accorded the widest scope consistent with the principles and novel features disclosed herein.
[0194] While the present invention has been disclosed above, it is not limited thereto. Any person skilled in the art can make various modifications and alterations without departing from the spirit and scope of the invention; therefore, the scope of protection of the present invention should be determined by the scope defined in the claims.
Claims
1. A detection method, characterized in that, include: Acquire a test image of the object to be tested, wherein the test image includes the relationship between the positions of multiple test points and detection parameters, and the detection parameters are positively correlated with the image grayscale. A first statistical map is obtained based on the image to be detected. The first statistical map includes the correspondence between the detection parameters of the test points in the image to be detected, the first gradient, and the number of test points. The first gradient is the gradient value of the detection parameters of the test points in the image to be detected as the position of the test points changes. The first statistical map is divided into multiple blocks by dividing the detection parameters and the first gradient. The span of the detection parameters corresponding to the same first gradient in different blocks does not overlap, and the span of the first gradient corresponding to the same detection parameter in different blocks does not overlap. The number of test points in each block is used to obtain the test points and form a target image. The target image corresponds one-to-one with the multiple blocks. The target image includes the relationship between the position of the test points in the block and the detection parameters. A second statistical chart is obtained that corresponds one-to-one with each of the target images. The second statistical chart includes the correspondence between the detection parameter and the number of points with the detection parameter in the corresponding target image. The threshold conditions for the detection parameters are obtained based on the second statistical chart, and the threshold conditions correspond one-to-one with the plurality of blocks; Based on the multiple blocks, test points that meet the corresponding threshold conditions are obtained from the image to be detected, and these are used as candidate points. Based on the candidate points, obtain the target point.
2. The detection method according to claim 1, characterized in that, The detection parameters of the first statistical graph are arranged in ascending order, and the first gradients of the first statistical graph are also arranged in ascending order. The first statistical graph is a distribution map of the number of test points at various distribution points, where each distribution point is determined by the detection parameters and the first gradient, and each distribution point corresponds to one detection parameter and one first gradient. By dividing the detection parameters and the first gradient, the distribution points of the first statistical graph are divided into multiple blocks, including: Based on the number of test points determined by the detection parameters and the first gradient in the first statistical graph, the distribution points of the first statistical graph are divided into multiple blocks; or, the distribution points of the first statistical graph are divided into multiple blocks by equally dividing the range of the detection parameters and the first gradient.
3. The detection method according to claim 2, characterized in that, Based on the detection parameters and the number of test points determined by the first gradient in the first statistical graph, the distribution points of the first statistical graph are divided into multiple blocks, including: obtaining the gradient value of the number of test points changing with each distribution point to obtain a second gradient; obtaining the distribution points corresponding to the second gradient that have extreme values or are greater than a preset value to obtain division points; and dividing the distribution points of the first statistical graph into multiple blocks according to the division points.
4. The detection method according to claim 3, characterized in that, The distribution points of the first statistical chart are divided into multiple blocks based on the defined dividing points, including: The blocks are divided according to a preset block direction, such that the number of division points through which the block edge passes is greater than a predetermined value or reaches a maximum value. Alternatively, the area divided by the dividing point can be used as the block.
5. The detection method according to claim 1, characterized in that, The threshold conditions for each block are obtained based on the detection parameters of the test points indicated by the number of test points in each block, so that each test point in the same block has the same threshold condition, and the threshold condition corresponds one-to-one with the plurality of blocks: Obtain the mean and standard deviation of the detection parameters of the test points indicated by the number of test points in each block; obtain the detection threshold of each block based on the linear combination of the mean and standard deviation of the detection parameters of the test points indicated by the number of test points in each block, wherein the combination coefficient of the mean is 1, and the threshold condition is that the detection parameter is greater than the detection threshold.
6. The detection method according to claim 1, characterized in that, The threshold conditions for obtaining the detection parameters based on the second statistical chart include: Set quantity conditions, which limit the range of the number of candidate points; Based on the quantity condition, a threshold condition for the detection parameters is obtained in the second statistical graph, so that the number of test points in the target image that meets the threshold condition satisfies the quantity condition.
7. The detection method according to claim 6, characterized in that, The threshold conditions for obtaining detection parameters based on the second statistical chart include: setting a first quantity threshold and a second quantity threshold, both of which are less than the total number of test points in the target image; obtaining a first detection parameter and a second detection parameter based on the second statistical chart, wherein the first detection parameter is less than the second detection parameter, the number of test points in the second statistical chart that are less than the first detection parameter is equal to the first quantity threshold, and the number of test points in the second statistical chart that are greater than the second detection parameter is equal to the second quantity threshold; obtaining a first threshold detection parameter based on the first detection parameter; obtaining a second threshold detection parameter based on the second detection parameter, wherein the second threshold detection parameter is greater than the second threshold detection parameter; the threshold condition is either less than the first threshold detection parameter or greater than the second threshold detection parameter.
8. The detection method according to claim 7, characterized in that, Obtaining a first threshold detection parameter based on the first detection parameter includes: using the first detection parameter as the first threshold detection parameter, or comparing the first detection parameter with a minimum threshold and obtaining the larger one as the first threshold detection parameter. Obtaining a second threshold detection parameter based on the second detection parameter includes: using the second detection parameter as the second threshold detection parameter, or comparing the second detection parameter with the maximum threshold and obtaining the smaller one as the second threshold detection parameter.
9. The detection method according to claim 8, characterized in that, Before obtaining the first threshold detection parameter based on the first detection parameter, the method further includes: setting a first preset compensation amount; and compensating the first detection parameter by summing the first preset compensation amount with the first detection parameter. Before obtaining the second threshold detection parameter based on the second detection parameter, the method further includes: setting a second preset compensation amount; and compensating the second detection parameter by summing the second preset compensation amount with the second detection parameter.
10. The detection method according to claim 9, characterized in that, The minimum threshold is the sum of the first preset compensation amount and the first preset constant, and the maximum threshold is the sum of the second preset compensation amount and the second preset constant.
11. The detection method according to claim 7, characterized in that, The first quantity threshold is a linear combination of the total number of test points in the target image and a preset offset; the second quantity threshold is a linear combination of the total number of test points in the target image and a preset offset; the coefficient of the total number in the first quantity threshold is less than 1, and the coefficient of the total number in the second quantity threshold is less than 1; The preset offset is equal to 0 or greater than zero.
12. The detection method according to any one of claims 1-11, characterized in that, Also includes: Repeatedly perform iterative steps until the false negative rate and / or false positive rate meet preset requirements. The iterative steps include: providing a preset reference image, which includes a certain number of known reference target points; obtaining points from the preset reference image that meet the threshold conditions as initial reference points; comparing the initial reference points and the reference target points to obtain information on the false positive rate and / or false negative rate under the current threshold conditions; if the false positive rate and / or false negative rate meet the preset requirements, then using the initial reference points as candidate points; if the false positive rate and / or false negative rate under the current threshold conditions do not meet the preset requirements, then adjusting the threshold conditions.
13. The detection method according to claim 12, characterized in that, The threshold condition is: the detection parameter is less than the first detection parameter, or the detection parameter is greater than the second detection parameter; The threshold conditions for obtaining the detection parameters based on the second statistical chart include: the number of test points in the second statistical chart that are less than the first detection parameter is less than the first quantity threshold, or the number of test points in the second statistical chart that are greater than the second detection parameter is greater than the second quantity threshold. The first quantity threshold is a linear combination of the total number of test points in the target image and a preset offset; The second quantity threshold is a linear combination of the total number of test points in the target image and a preset offset; The adjustment of the threshold condition includes: adjusting the coefficient of the preset offset and / or the total number; and / or, compensating the first detection parameter by summing the first preset compensation amount with the first detection parameter; and compensating the second detection parameter by summing the second preset compensation amount with the second detection parameter; the adjustment of the threshold condition includes: adjusting at least one of the preset offset, the coefficient of the total number, the first preset compensation amount, and the second preset compensation amount.
14. The detection method according to claim 1, characterized in that, The second statistical chart includes a grayscale histogram.
15. The detection method according to claim 1, characterized in that, The image to be detected is the target image of the object to be tested, or the image to be detected is the difference image between the target image and the reference image; If the image to be detected is a difference image between the target image to be detected and the reference image, the detection parameter of the point to be detected in the target image is the difference in detection parameters between the point to be detected in the target image and the corresponding point to be detected in the reference image block; the detection parameter is gray value, light intensity, charge, voltage or light wavelength.
16. The detection method according to claim 15, characterized in that, The image to be detected may be one or more; The image to be detected consists of multiple images. The target point is obtained based on the candidate points, including performing an AND operation on the candidate points obtained from the multiple images to be detected to obtain the same candidate point as the target point.
17. The detection method according to claim 15, characterized in that, The reference image is either a design image or a defect-free measurement image of the object under test.
18. The detection method according to claim 1, characterized in that, The first statistical chart includes a grayscale gradient chart.
19. A detection device, characterized in that, include: The first acquisition unit is adapted to acquire a test image of the object to be tested, wherein the test image includes the relationship between the positions of multiple test points and detection parameters, and the detection parameters are positively correlated with the image grayscale. The second acquisition unit is adapted to acquire a first statistical map based on the image to be detected. The first statistical map includes the correspondence between the detection parameters of the test points in the image to be detected, the first gradient and the number of test points. The first gradient is the gradient value of the detection parameters of the test points in the image to be detected as the position of the test points changes. The block division unit is adapted to divide the first statistical graph into multiple blocks by dividing the detection parameters and the first gradient, wherein the span of the detection parameters corresponding to the same first gradient in different blocks does not overlap, and the span of the first gradient corresponding to the same detection parameter in different blocks does not overlap. The third acquisition unit is adapted to acquire the threshold conditions of each block according to the detection parameters of the test points in the block, so that each test point in the same block has the same threshold conditions, and the threshold conditions correspond one-to-one with the plurality of blocks. The fourth acquisition unit is adapted to acquire, according to the plurality of blocks, test points that meet the corresponding threshold conditions from the image to be detected, as candidate points; The fifth acquisition unit is adapted to acquire the target point based on the candidate points; The third acquisition unit is specifically used for: The number of test points in each block is used to obtain the test points and form a target image. The target image corresponds one-to-one with the multiple blocks. The target image includes the relationship between the position of the test points in the block and the detection parameters. A second statistical chart is obtained that corresponds one-to-one with each of the target images. The second statistical chart includes the correspondence between the detection parameter and the number of points with the detection parameter in the corresponding target image. The threshold conditions for the detection parameters are obtained based on the second statistical chart, and the threshold conditions correspond one-to-one with the plurality of blocks.
20. A testing device, characterized in that, It includes at least one memory and at least one processor, the memory storing one or more computer instructions, wherein the one or more computer instructions are executed by the processor to implement the detection method according to any one of claims 1 to 18.
21. A storage medium, characterized in that, The storage medium stores one or more computer instructions, which are used to implement the detection method according to any one of claims 1 to 18.
Citation Information
Patent Citations
Rapid threshold segmentation method based on gray level-gradient two-dimensional symmetrical Tsallis cross entropy
CN103390280A
Method and apparatus for determining main disparity value in disparity map
CN104915943A