Method and device for determining alignment area, equipment and storage medium

By processing and screening the image of the sample to be tested in wafer detection, the alignment area is automatically identified, which solves the problem of manual selection of the alignment area in the prior art, resulting in low detection accuracy, and improves the accuracy of the detection results.

CN120013848AActive Publication Date: 2025-05-16SKYVERSE TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202311543713.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-16
Publication Date
2025-05-16
Estimated Expiration
2043-11-16

AI Technical Summary

Technical Problem

In the field of wafer detection, the alignment area in the prior art is usually manually selected, resulting in low accuracy of detection results and cannot meet the requirements of the alignment algorithm used during detection.

Method used

By determining a plurality of first regions in the sample image of the sample to be tested, the pixels of each region are processed in gradient distribution information, and the alternative regions that meet specific conditions are selected, and the alignment regions are identified based on local uniqueness conditions.

Benefits of technology

Automatically determine the alignment area, improve the accuracy of the detection results, and better meet the requirements of the alignment algorithm used during detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120013848A_ABST
    Figure CN120013848A_ABST
Patent Text Reader

Abstract

The invention discloses a method and device for determining an alignment area, equipment and a storage medium. The method comprises the following steps: determining a first area in a sample image of a to-be-detected sample; processing the pixels of each first region to obtain gradient distribution information including the gradient direction of each pixel in the first region; according to the gradient distribution information corresponding to the first regions, screening out a plurality of alternative regions from the plurality of first regions; the positive gradient number of the alternative region is greater than the positive gradient number of the non-alternative region, the negative gradient number of the alternative region is greater than or equal to a preset number threshold, the positive gradient number is the number of pixels with a positive gradient direction, and the negative gradient number is the number of pixels with a negative gradient direction; the positive gradient direction comprises a gradient direction corresponding to the most pixels in the first area, and the negative gradient direction and the positive gradient direction are orthogonal; and identifying the alternative region meeting the local uniqueness condition in the plurality of alternative regions as an alignment region of the sample image.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] Technology Neighborhood

[0002] The present application belongs to the field of sample detection technology, and in particular, relates to a method, device, equipment and storage medium for determining an alignment area. Background Art

[0003] In the field of wafer inspection, when inspecting a die, it is necessary to divide the die into multiple test areas (site areas), and set a positioning area (pattern area) for each test area for alignment during the inspection process.

[0004] In the related technical field, the alignment area is usually set by manual selection. Affected by subjective factors during manual selection, the alignment area set in this way often cannot meet the requirements of the alignment algorithm used during detection, resulting in low accuracy of the detection results. Summary of the invention

[0005] To this end, the present application discloses the following technical solution to automatically determine the alignment area when detecting defects in a wafer.

[0006] The first aspect of the present application provides a method for determining an alignment area, comprising:

[0007] Determining a plurality of first regions in a sample image of the sample to be tested;

[0008] Processing each pixel of the first region to obtain gradient distribution information of each first region; wherein the gradient distribution information includes gradient directions of a plurality of pixels in the first region;

[0009] Screening out a plurality of candidate regions from the plurality of first regions according to the gradient distribution information corresponding to the first region; wherein the first region includes a plurality of candidate regions and a plurality of non-candidate regions, the number of positive gradients of the candidate regions is greater than the number of positive gradients of the non-candidate regions, and the number of negative gradients of the candidate regions is greater than or equal to a preset number threshold, the number of positive gradients is the number of pixels having a positive gradient direction, the number of negative gradients is the number of pixels having a negative gradient direction, the positive gradient direction includes the gradient direction corresponding to the largest number of pixels in the first region, and the negative gradient direction includes the gradient direction orthogonal to the positive gradient direction;

[0010] Among the multiple candidate areas, the candidate area that meets the local uniqueness condition is identified as the alignment area of ​​the sample image; wherein the local uniqueness condition is that the matching degree between the candidate area and the search area corresponding to the candidate area is less than or equal to a preset matching threshold, the search area contains the corresponding candidate area, and the size of the search area is larger than the size of the candidate area.

[0011] Optionally, determining a plurality of first regions in the sample image of the sample to be tested includes:

[0012] Determining a plurality of first regions in a sample image of the sample to be tested according to a first size parameter;

[0013] After identifying the candidate region that meets the local uniqueness condition among the plurality of candidate regions as the alignment region of the sample image, the method further includes:

[0014] When none of the multiple candidate regions meets the local uniqueness condition, increasing the first size parameter;

[0015] Return to the step of determining a plurality of first regions in the sample image of the sample to be tested according to the first size parameter.

[0016] Optionally, after increasing the first size parameter, the method further includes:

[0017] If the first size parameter is greater than a preset size threshold, a failure prompt message is output; wherein the failure prompt message is used to indicate that the alignment area of ​​the sample image cannot be determined.

[0018] Optionally, determining a plurality of first regions in the sample image of the sample to be tested according to the first size parameter includes:

[0019] Dividing the sample image of the sample to be tested into a plurality of small blocks according to the small block size in the first size parameter;

[0020] For each of the small blocks, the small block and other small blocks adjacent to the small block are determined as a first area according to the neighborhood size in the first size parameter.

[0021] Optionally, before processing the pixels of each first region to obtain the gradient distribution information of each first region, the method further includes:

[0022] Binarization is performed on the sample image to obtain a binary image composed of binary pixels;

[0023] The processing of the pixels of each of the first regions to obtain the gradient distribution information of each of the first regions includes:

[0024] The binary pixels of each of the first regions are processed to obtain the gradient distribution information of each of the first regions.

[0025] Optionally, the binarization processing of the sample image to obtain a binarized image composed of binarized pixels includes:

[0026] The sample image is binarized using the Otsu method to obtain a binarized image composed of binarized pixels.

[0027] Optionally, screening out a plurality of candidate regions from a plurality of the first regions according to the gradient distribution information corresponding to the first region includes:

[0028] For each of the first regions, determining the gradient direction corresponding to the largest number of pixels in the gradient distribution information corresponding to the first region as the positive gradient direction of the first region, and determining the gradient direction orthogonal to the positive gradient direction as the negative gradient direction of the first region;

[0029] A plurality of candidate regions are screened out from a plurality of the first regions according to the gradient distribution information, the positive gradient direction, and the negative gradient direction of each of the first regions.

[0030] Optionally, screening out a plurality of candidate regions from a plurality of the first regions according to the gradient distribution information corresponding to the first region includes:

[0031] For each of the first regions, determining a gradient direction having the largest number of corresponding pixels in the gradient distribution information corresponding to the first region as a first gradient direction of the first region, and determining the first gradient direction and two gradient directions adjacent to the first gradient direction as positive gradient directions of the first region;

[0032] For each of the first regions, determining a gradient direction orthogonal to the positive gradient direction as a negative gradient direction of the first region;

[0033] A plurality of candidate regions are screened out from a plurality of the first regions according to the gradient distribution information, the positive gradient direction, and the negative gradient direction of each of the first regions.

[0034] Optionally, the step of identifying a candidate region that meets a local uniqueness condition among the plurality of candidate regions as the alignment region of the sample image includes:

[0035] When there are multiple candidate regions that meet the local uniqueness condition among the multiple candidate regions, the candidate region that meets the local uniqueness condition and has the largest number of positive gradients is identified as the alignment region of the sample image.

[0036] A second aspect of the present application provides a device for determining an alignment area, comprising:

[0037] A determination unit, used to determine a plurality of first regions in a sample image of a sample to be tested;

[0038] A processing unit, configured to process the pixels of each of the first regions to obtain gradient distribution information of each of the first regions; wherein the gradient distribution information includes gradient directions of a plurality of pixels in the first regions;

[0039] A screening unit, configured to screen out a plurality of candidate regions from a plurality of the first regions according to the gradient distribution information corresponding to the first region; wherein the first region includes a plurality of candidate regions and a plurality of non-candidate regions, the number of positive gradients of the candidate regions is greater than the number of positive gradients of the non-candidate regions, and the number of negative gradients of the candidate regions is greater than or equal to a preset number threshold, the number of positive gradients is the number of pixels having a positive gradient direction, the number of negative gradients is the number of pixels having a negative gradient direction, the positive gradient direction includes the gradient direction corresponding to the largest number of pixels in the first region, and the negative gradient direction includes the gradient direction orthogonal to the positive gradient direction;

[0040] An identification unit is used to identify a candidate area that meets a local uniqueness condition among the multiple candidate areas as an alignment area of ​​the sample image; wherein the local uniqueness condition is that the degree of matching between the candidate area and the search area corresponding to the candidate area is less than or equal to a preset matching threshold, the search area contains the corresponding candidate area, and the size of the search area is larger than the size of the candidate area.

[0041] The third aspect of the present application provides a computer storage medium for storing a computer program. When the computer program is executed, it is specifically used to implement the method for determining the alignment area provided in any one of the first aspects of the present application.

[0042] A fourth aspect of the present application provides an electronic device, including a memory and a processor;

[0043] The memory is used to store computer programs;

[0044] The processor is used to execute the computer program, specifically to implement the method for determining the alignment area provided in any one of the first aspects of the present application.

[0045] The beneficial effects of this application are:

[0046] According to the distribution of the number of pixels in different gradient directions in the first area, and the matching degree between the first area and other surrounding areas, the alignment area is automatically identified in the sample image. Compared with the method relying on manual selection in the related art, the alignment area determined by the method of the present application can better meet the requirements of the alignment algorithm used in detection, thereby improving the accuracy of the detection results. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0048] Figure 1 is a flow chart of a method for determining an alignment area provided in an embodiment of the present application;

[0049] Figure 2 is a schematic diagram of a first region provided in an embodiment of the present application;

[0050] Figure 3 is a schematic diagram of a gradient direction provided in an embodiment of the present application;

[0051] Figure 4 is a structural schematic diagram of a device for determining an alignment area provided in an embodiment of the present application;

[0052] Figure 5 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0053] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0054] This application embodiment provides a method for determining an alignment area. Figure 1 , is a flow chart of the method, and the method may include the following steps.

[0055] S101, determining a plurality of first regions in a sample image of a sample to be tested.

[0056] The sample to be tested may be a wafer, a die, or other semiconductor product that needs to be tested for defects.

[0057] The sample image may be an image obtained by photographing a pre-specified test area on the sample to be tested, for example, an image obtained by photographing any site area on a die.

[0058] When determining the first area, a preset first size parameter may be obtained first, and then a plurality of first areas may be determined in the sample image of the sample to be tested according to the first size parameter.

[0059] The first size parameter may be a fixed value set based on experience, or may be determined based on the size of the sample image and the number of first regions to be divided. For example, the first size parameter may be obtained by dividing the size of the sample image by the number of first regions.

[0060] The first regions may not overlap each other. For example, the first size parameter may be 20*20, in which case the sample image may be divided into a number of square regions of 20 pixels by 20 pixels, each of which is a first region.

[0061] The advantage of dividing the sample image into non-overlapping first areas is that it ensures that different first areas do not overlap with each other, so that different first areas can be more clearly distinguished. When screening alignment areas from the first areas, it is easier to screen out alignment areas that meet the local uniqueness conditions, thereby improving the execution efficiency of the method of this embodiment.

[0062] Optionally, each first region may partially overlap, in which case the first size parameter may include a small block size and a neighborhood size, wherein the small block size is used to specify the size of each small block, and the neighborhood size is used to specify how many small block regions constitute a first region.

[0063] Dividing the sample image into partially overlapping first areas can achieve finer-grained division of the sample image, which is conducive to determining a more accurate alignment area.

[0064] At this time, the implementation of step S101 may include:

[0065] Dividing the sample image of the sample to be tested into a plurality of small blocks according to the small block size in the first size parameter;

[0066] For each small block, the small block and other small blocks adjacent to the small block are determined as a first area according to the neighborhood size in the first size parameter.

[0067] For example, assuming that the block size is 5*5 and the neighborhood size is 3*3, the sample image can be first divided into several small blocks of 5 pixels by 5 pixels. Then, for each small block, an area consisting of 3 by 3 small blocks centered on the small block is determined as a first area.

[0068] by Figure 2 For example, for small block 5, an area consisting of 3 times 3 small blocks centered on small block 5, that is, small blocks 1 to 9, can be determined as a first area.

[0069] The advantage of dividing the first area in this way is that a finer division of the sample image can be achieved, which is conducive to determining a more accurate alignment area.

[0070] S102, processing pixels in each first region to obtain gradient distribution information of each first region.

[0071] The gradient distribution information includes the gradient directions of a plurality of pixels in the first area.

[0072] In some optional embodiments, before executing S102, the following steps may be performed to convert the sample image into a binary image:

[0073] Binarization is performed on the sample image to obtain a binary image composed of binary pixels;

[0074] If the above binarization process is performed, S102 is equivalent to:

[0075] The binary pixels of each first region are processed to obtain the gradient distribution information of each first region.

[0076] In this embodiment, any binarization algorithm in the relevant technical field can be applied to perform binarization processing on the sample image. The specific implementation process can be found in the relevant technical literature and will not be described in detail.

[0077] Among them, the advantage of binarizing the sample image before obtaining the gradient distribution information is that binarization can reduce the interference of small background gradients in the sample image on the subsequent process of determining the gradient distribution information, thereby improving the accuracy of the obtained gradient distribution information.

[0078] Optionally, when binarizing the sample image, the Otsu method can be used to binarize the sample image. Compared with other binarization algorithms, the Otsu method can dynamically determine the threshold for binarization according to the local features of the sample image during the binarization process, so that the obtained binarized image can more comprehensively retain the gradient features of the sample image, making the subsequent gradient distribution information obtained based on the binarized image more accurate.

[0079] In step S102, various algorithms for calculating image gradients may be used to process the binary image in the first region to obtain the gradient value of each pixel in the first region, and then obtain gradient distribution information according to the gradient value. The algorithm for calculating gradients used in this embodiment is not limited.

[0080] Exemplarily, the Sobel algorithm may be used to process the binary image in the first region to obtain the gradient distribution information.

[0081] When the Sobel algorithm is used, the two Sobel operators shown in formula (1) can be used to perform convolution operations on the binary image in the first region respectively. The image obtained after the convolution operation of the x operator is denoted as Gx, and the image obtained after the convolution operation of the y operator is denoted as Gy.

[0082]

[0083] Subsequently, for the pixel in the i-th row and the k-th column in the first region, the gradient value grad-ik of the pixel can be calculated using formula (2).

[0084] grad-ik=arctan(Gy ik / Gx ik ) (2)

[0085] Among them, Gy ik represents the value of the i-th row and k-th column in Gy, Gx ik Represents the value of the i-th row and k-th column in Gx.

[0086] In the above steps, if the binarization process is not performed in advance, the object to be processed can be replaced from the binarized image in the first area to the sample image in the first area.

[0087] For each first region, after the gradient value of each pixel therein is obtained in the above manner, the gradient distribution information of the first region can be determined in the following manner.

[0088] First, the range of gradient values ​​is divided into multiple intervals at certain intervals, and each gradient direction corresponds to at least one interval.

[0089] by Figure 3 For example, the range of gradient values, i.e., 0 to 360 degrees, can be divided into 16 intervals at intervals of 22.5 degrees, where every two opposite intervals correspond to a gradient direction, thus obtaining Figure 3 The 8 gradient directions are shown.

[0090] Then, for each gradient direction, the number of pixels in the first region whose gradient values ​​are within the interval corresponding to the gradient direction is counted, and the statistical result is used as the number of pixels corresponding to the gradient direction. Finally, the number of pixels in the first region in each gradient direction is summarized to obtain the gradient distribution information of the first region.

[0091] Still Figure 3 For example, for a first region, the gradient distribution information of the first region obtained through statistics can be expressed as:

[0092] Gradient direction 0, corresponding to the number of pixels Sum0; gradient direction 1, corresponding to the number of pixels Sum1; gradient direction 2, corresponding to the number of pixels Sum2; gradient direction 3, corresponding to the number of pixels Sum3; gradient direction 4, corresponding to the number of pixels Sum4; gradient direction 5, corresponding to the number of pixels Sum5; gradient direction 6, corresponding to the number of pixels Sum6; gradient direction 7, corresponding to the number of pixels Sum7.

[0093] Optionally, when obtaining the gradient distribution information of the first region, the gradient distribution information of each small block constituting the first region may be obtained first, and then the gradient distribution information of each small block may be aggregated to obtain the gradient distribution information of the first region.

[0094] The gradient distribution information of a first region can be represented by a gradient direction distribution histogram.

[0095] S103: Screen out a plurality of candidate regions from the plurality of first regions according to the gradient distribution information corresponding to the first region.

[0096] Among them, the number of positive gradients in the candidate area is greater than the number of positive gradients in the non-candidate area, and the number of negative gradients in the candidate area is greater than or equal to a preset number threshold, the number of positive gradients is the number of pixels with a positive gradient direction, the number of negative gradients is the number of pixels with a negative gradient direction, the positive gradient direction includes the gradient direction corresponding to the largest number of pixels in the first area, and the negative gradient direction includes the gradient direction orthogonal to the positive gradient direction.

[0097] The first optional way to filter candidate areas is:

[0098] For each first region, determining the gradient direction corresponding to the largest number of pixels in the gradient distribution information corresponding to the first region as the positive gradient direction of the first region, and determining the gradient direction orthogonal to the positive gradient direction as the negative gradient direction of the first region;

[0099] A plurality of candidate regions are screened out from the plurality of first regions according to the gradient distribution information, the positive gradient direction, and the negative gradient direction of each first region.

[0100] In this embodiment, the two gradient directions are orthogonal, which can be understood as the midpoints of the gradient value intervals corresponding to the two gradient directions differ by 90 degrees. Figure 3 For example, the gradient directions 0 and 4 are orthogonal to each other, and the gradient directions 1 and 5 are orthogonal to each other.

[0101] Exemplarily, assuming that in a first region, the number of pixels corresponding to gradient direction 0 is the largest, gradient direction 0 is determined as the positive gradient direction of the first region, and gradient direction 4 orthogonal to gradient direction 0 is determined as the negative gradient direction of the first region.

[0102] When multiple candidate regions are screened out from multiple first regions based on the gradient distribution information, the positive gradient direction, and the negative gradient direction of each first region, each first region can be first sorted from most to least according to the number of pixels in the positive gradient direction. For example, the positive gradient direction of a first region is gradient direction 1, and the corresponding number of pixels is 100, and the positive gradient direction of another first region is gradient direction 2, and the corresponding number of pixels is 200, then the latter is ranked ahead of the former when sorting.

[0103] After sorting, the number of negative gradients in each first region is detected one by one from front to back to see whether it satisfies the condition that the number of negative gradients is greater than or equal to a preset number threshold. Whenever a first region is detected to meet the condition, the first region is determined as a candidate region. When the cumulative number of determined candidate regions reaches the upper limit of the number of candidate regions, the process ends, thereby obtaining several candidate regions.

[0104] The quantity threshold and the upper limit of the number of candidate areas can be set as needed. For example, the upper limit of the number of candidate areas can be set to 3.

[0105] The advantage of determining the candidate areas in the first way is that when screening the candidate areas, for each first area, it is only necessary to count the number of pixels corresponding to a positive gradient direction and the pixel data corresponding to a negative gradient direction, and the amount of data to be analyzed is small. Therefore, the candidate areas can be screened out more quickly in this way.

[0106] The second method to determine the candidate area is:

[0107] For each first region, determining the gradient direction corresponding to the largest number of pixels in the gradient distribution information corresponding to the first region as the first gradient direction of the first region, and determining the first gradient direction and two gradient directions adjacent to the first gradient direction as the positive gradient directions of the first region;

[0108] For each first region, determining a gradient direction orthogonal to the positive gradient direction as a negative gradient direction of the first region;

[0109] A plurality of candidate regions are screened out from the plurality of first regions according to the gradient distribution information, the positive gradient direction, and the negative gradient direction of each first region.

[0110] Exemplarily, in a first region, the number of pixels corresponding to gradient direction 1 is the largest, so gradient direction 1 is determined as its first gradient direction, and then two adjacent gradient directions, i.e., gradient directions 1 and 7, and gradient direction 0 are determined as positive gradient directions of the first region, and the corresponding gradient directions orthogonal to these three positive gradient directions are used as negative gradient directions of the first region.

[0111] In the second manner, for any first region, the positive gradient direction and the corresponding negative gradient direction of the first region that may be determined may be any one of those in Table 1.

[0112] Table 1

[0113] Positive gradient direction Negative gradient direction 0,1,7 3,4,5 0,1,2 4,5,6 1,2,3 5,6,7 2,3,4 6,7,0 3,4,5 7,0,1 4,5,6 0,1,2 5,6,7 1,2,3 0,6,7 2,3,4

[0114] After determining the positive gradient direction and the negative gradient direction, the method of screening out multiple candidate regions from multiple first regions according to the gradient distribution information, the positive gradient direction and the negative gradient direction of each first region is consistent with the first method described above and will not be repeated herein.

[0115] The advantages of determining candidate areas in the second way are:

[0116] When screening candidate areas in the second manner, more information on gradient directions in the candidate areas is combined. For example, in the aforementioned example, the number of pixels in the three directions of 0, 1, and 7 as positive gradient directions and the number of pixels in the three directions of 3, 4, and 5 as negative gradient directions in the first area are combined to determine whether the first area is a candidate area. Therefore, compared with the first manner of considering only one positive gradient direction and one negative gradient direction, screening in the second manner is conducive to screening out more accurate alignment areas.

[0117] It should be noted that, for different first regions, the gradient directions having the largest number of pixels may be different, and thus different first regions may have different positive gradient directions.

[0118] For example, in the first region A, the number of pixels in the gradient direction of 0 is the largest, and correspondingly, the positive gradient direction of the first region A may include 0, or 0, 1, and 7, while in the first region B, the number of pixels in the gradient direction of 4 is the largest, and correspondingly, the positive gradient direction of the first region B may include 4, or 3, 4, and 5.

[0119] S104: Identify, among the multiple candidate regions, a candidate region that meets the local uniqueness condition as an alignment region of the sample image.

[0120] The local uniqueness condition is that the matching degree between the candidate area and the search area corresponding to the candidate area is less than or equal to a preset matching threshold, the search area contains the corresponding candidate area, and the size of the search area is larger than the size of the candidate area.

[0121] Optionally, when identifying the alignment region, if there are multiple candidate regions that meet the local uniqueness condition, the alignment region may be determined as follows:

[0122] When there are multiple candidate regions that meet the local uniqueness condition among the multiple candidate regions, the candidate region that meets the local uniqueness condition and has the largest number of positive gradients is identified as the alignment region of the sample image.

[0123] The advantage of determining the alignment region in this way is that when there are multiple candidate regions that all meet the local uniqueness condition, the candidate region with the richest gradient features is determined as the alignment region, which is conducive to improving the subsequent alignment accuracy.

[0124] Optionally, if it is found that each candidate region does not meet the local uniqueness condition after identification, the following steps can be performed:

[0125] Output failure prompt information; wherein, the failure prompt information is used to indicate that the sample image cannot determine the alignment area.

[0126] Optionally, if it is found that each candidate region does not meet the local uniqueness condition after identification, the following steps can also be performed:

[0127] When multiple candidate regions do not meet the local uniqueness condition, increasing the first size parameter;

[0128] Return to the step of determining a plurality of first regions in the sample image of the sample to be tested according to the first size parameter.

[0129] When the first size parameter includes a small block size and a neighborhood size, the small block size and the neighborhood size may be increased simultaneously, only the small block size may be increased, or only the neighborhood size may be increased.

[0130] When increasing the first size parameter, the original first size parameter may be added with a preset step length to obtain the increased first size parameter.

[0131] The benefits of increasing the first size parameter when multiple candidate regions do not meet the local uniqueness condition are:

[0132] The initial first size parameter may be set unreasonably, resulting in the candidate region not meeting the local uniqueness condition. For example, when the first size parameter is too small, the candidate region contains fewer features and cannot be distinguished from the adjacent region. When the candidate region does not meet the local uniqueness condition, gradually increasing the first size parameter in the above manner can solve the problem of unreasonable initial first size parameter setting, which is conducive to determining a suitable first size parameter, and then determining the alignment region based on the suitable first size parameter.

[0133] Optionally, after increasing the first size parameter, the following steps may be performed:

[0134] Determine whether the first size parameter after enlargement is greater than a preset size threshold, and if the first size parameter after enlargement is greater than the size threshold, output a failure prompt message;

[0135] If the enlarged first size parameter is less than or equal to the size threshold, the process returns to S101 until the alignment area is determined or the enlarged first size parameter is greater than the size threshold.

[0136] The size threshold can be determined according to the requirements of the alignment algorithm used during detection. For example, if the alignment algorithm can only identify alignment areas that do not exceed a specific size, the size threshold can be determined based on the specific size to ensure that the size of the alignment area finally determined does not exceed the specific size.

[0137] The benefit of setting the size threshold is to prevent the size of the determined alignment area from being too large and affecting the recognition of the subsequent alignment algorithm.

[0138] Optionally, when the first size parameter includes a small block size and a neighborhood size, if at least one of the small block size and the neighborhood size is greater than a corresponding size threshold, it can be determined that the increased first size parameter is greater than the size threshold.

[0139] A method for identifying whether an alternative region meets the local uniqueness condition may be to expand the first region according to a preset expansion size, and use the expanded area as the search area corresponding to the alternative region. Then, a template matching algorithm is used to calculate the matching degree between the alternative region and the corresponding search area. If the matching degree is less than or equal to a matching threshold, the alternative region is determined to be a positioning region.

[0140] The specific principle of the template matching algorithm can be found in relevant technical literature and will not be elaborated here.

[0141] The matching threshold can be set as needed without limitation, for example, it can be set to 0.6.

[0142] Figure 1 The method provided by the corresponding embodiment has the following beneficial effects:

[0143] According to the distribution of the number of pixels in different gradient directions in the first area, and the matching degree between the first area and other surrounding areas, the alignment area is automatically identified in the sample image. Compared with the method relying on manual selection in the related art, the alignment area determined by the method of the present application can better meet the requirements of the alignment algorithm used in detection, thereby improving the accuracy of the detection results.

[0144] The present application also provides a device for determining an alignment area. Figure 4 , is a schematic diagram of the structure of the device, which may include the following units:

[0145] A determination unit 401 is used to determine a plurality of first regions in a sample image of a sample to be tested;

[0146] A processing unit 402 is used to process the pixels of each first region to obtain gradient distribution information of each first region; wherein the gradient distribution information includes the gradient directions of the plurality of pixels in the first region;

[0147] A screening unit 403 is used to screen out a plurality of candidate regions from the plurality of first regions according to the gradient distribution information corresponding to the first region; wherein the first region includes a plurality of candidate regions and a plurality of non-candidate regions, the number of positive gradients of the candidate regions is greater than the number of positive gradients of the non-candidate regions, and the number of negative gradients of the candidate regions is greater than or equal to a preset number threshold, the number of positive gradients is the number of pixels having a positive gradient direction, the number of negative gradients is the number of pixels having a negative gradient direction, the positive gradient direction includes the gradient direction corresponding to the largest number of pixels in the first region, and the negative gradient direction includes the gradient direction orthogonal to the positive gradient direction;

[0148] The identification unit 404 is used to identify, among multiple candidate areas, a candidate area that meets the local uniqueness condition as the alignment area of ​​the sample image; wherein the local uniqueness condition is that the matching degree between the candidate area and the search area corresponding to the candidate area is less than or equal to a preset matching threshold, the search area contains the corresponding candidate area, and the size of the search area is larger than the size of the candidate area.

[0149] Optionally, when the determining unit 401 determines a plurality of first regions in the sample image of the sample to be tested, it is specifically configured to:

[0150] Determining a plurality of first regions in a sample image of the sample to be tested according to a first size parameter;

[0151] The determining unit 401 is further configured to:

[0152] When multiple candidate regions do not meet the local uniqueness condition, increasing the first size parameter;

[0153] Return to the step of determining a plurality of first regions in the sample image of the sample to be tested according to the first size parameter.

[0154] Optionally, before the processing unit 402 processes the pixels of each first region to obtain the gradient distribution information of each first region, it is further used to:

[0155] Binarization is performed on the sample image to obtain a binary image composed of binary pixels;

[0156] When the processing unit 402 processes the pixels of each first region to obtain the gradient distribution information of each first region, it is specifically used to:

[0157] The binary pixels of each first region are processed to obtain the gradient distribution information of each first region.

[0158] Optionally, when the processing unit 402 performs binarization processing on the sample image to obtain a binarized image composed of binarized pixels, it is specifically used to:

[0159] The sample image is binarized using the Otsu method to obtain a binary image composed of binary pixels.

[0160] Optionally, when the screening unit 403 screens out multiple candidate regions from multiple first regions according to the gradient distribution information corresponding to the first region, it is specifically used to:

[0161] For each first region, determining the gradient direction corresponding to the largest number of pixels in the gradient distribution information corresponding to the first region as the positive gradient direction of the first region, and determining the gradient direction orthogonal to the positive gradient direction as the negative gradient direction of the first region;

[0162] A plurality of candidate regions are screened out from the plurality of first regions according to the gradient distribution information, the positive gradient direction, and the negative gradient direction of each first region.

[0163] Optionally, when the screening unit 403 screens out multiple candidate regions from multiple first regions according to the gradient distribution information corresponding to the first region, it is specifically used to:

[0164] For each first region, determining the gradient direction corresponding to the largest number of pixels in the gradient distribution information corresponding to the first region as the first gradient direction of the first region, and determining the first gradient direction and two gradient directions adjacent to the first gradient direction as the positive gradient directions of the first region;

[0165] For each first region, determining a gradient direction orthogonal to the positive gradient direction as a negative gradient direction of the first region;

[0166] A plurality of candidate regions are screened out from the plurality of first regions according to the gradient distribution information, the positive gradient direction, and the negative gradient direction of each first region.

[0167] Optionally, when the identification unit 404 identifies a candidate region that meets the local uniqueness condition among multiple candidate regions as the alignment region of the sample image, it is specifically used to:

[0168] When there are multiple candidate regions that meet the local uniqueness condition among the multiple candidate regions, the candidate region that meets the local uniqueness condition and has the largest number of positive gradients is identified as the alignment region of the sample image.

[0169] Optionally, after increasing the first size parameter, the processing unit 402 is further configured to:

[0170] If the first size parameter is greater than a preset size threshold, a failure prompt message is output; wherein the failure prompt message is used to indicate that the alignment area of ​​the sample image cannot be determined.

[0171] Optionally, when the determining unit 401 determines a plurality of first regions in the sample image of the sample to be tested according to the first size parameter, it is specifically used to:

[0172] Dividing the sample image of the sample to be tested into a plurality of small blocks according to the small block size in the first size parameter;

[0173] For each small block, the small block and other small blocks adjacent to the small block are determined as a first area according to the neighborhood size in the first size parameter.

[0174] The specific working principle and beneficial effects of the device for determining the alignment area provided in the embodiment of the present application can be found in the method for determining the alignment area provided in the embodiment of the present application, and will not be described in detail.

[0175] An embodiment of the present application also provides a computer storage medium for storing a computer program. When the computer program is executed, it is specifically used to implement the method for determining the alignment area provided in any embodiment of the present application.

[0176] The present application also provides an electronic device. Figure 5 , is a schematic diagram of the structure of the electronic device, and the electronic device may include a memory 501 and a processor 502;

[0177] The memory 501 is used to store computer programs;

[0178] The processor 502 is used to execute a computer program, specifically to implement the method for determining an alignment area provided in any embodiment of the present application.

[0179] It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0180] For the convenience of description, the above system or device is described by dividing it into various modules or units according to its functions. Of course, when implementing the present application, the functions of each unit can be implemented in the same or multiple software and / or hardware.

[0181] Through the description of the above implementation methods, it can be known that the technicians in this field can clearly understand that the present application can be implemented by means of software plus a necessary general hardware platform. Based on this understanding, the technical solution of the present application can be essentially or the part that contributes to the prior art can be embodied in the form of a software product, which can be stored in a storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application or some parts of the embodiments.

[0182] Finally, it should be noted that, in this article, relational terms such as first, second, third and fourth are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0183] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A method for determining an alignment area, characterized in that: include: Determining a plurality of first regions in a sample image of the sample to be tested; Processing each pixel of the first region to obtain gradient distribution information of each first region; wherein the gradient distribution information includes gradient directions of a plurality of pixels in the first region; Screening out a plurality of candidate regions from the plurality of first regions according to the gradient distribution information corresponding to the first region; wherein the first region includes a plurality of candidate regions and a plurality of non-candidate regions, the number of positive gradients of the candidate regions is greater than the number of positive gradients of the non-candidate regions, and the number of negative gradients of the candidate regions is greater than or equal to a preset number threshold, the number of positive gradients is the number of pixels having a positive gradient direction, the number of negative gradients is the number of pixels having a negative gradient direction, the positive gradient direction includes the gradient direction corresponding to the largest number of pixels in the first region, and the negative gradient direction includes the gradient direction orthogonal to the positive gradient direction; Among the multiple candidate areas, the candidate area that meets the local uniqueness condition is identified as the alignment area of ​​the sample image; wherein the local uniqueness condition is that the matching degree between the candidate area and the search area corresponding to the candidate area is less than or equal to a preset matching threshold, the search area contains the corresponding candidate area, and the size of the search area is larger than the size of the candidate area.

2. The method according to claim 1, characterized in that The step of determining a plurality of first regions in the sample image of the sample to be tested comprises: Determining a plurality of first regions in a sample image of the sample to be tested according to a first size parameter; After identifying the candidate region that meets the local uniqueness condition among the plurality of candidate regions as the alignment region of the sample image, the method further includes: When none of the multiple candidate regions meets the local uniqueness condition, increasing the first size parameter; Return to the step of determining a plurality of first regions in the sample image of the sample to be tested according to the first size parameter.

3. The method according to claim 2, characterized in that After increasing the first size parameter, the method further includes: If the first size parameter is greater than a preset size threshold, a failure prompt message is output; wherein the failure prompt message is used to indicate that the alignment area of ​​the sample image cannot be determined.

4. The method according to claim 2, characterized in that: The step of determining a plurality of first regions in the sample image of the sample to be tested according to the first size parameter comprises: Dividing the sample image of the sample to be tested into a plurality of small blocks according to the small block size in the first size parameter; For each of the small blocks, the small block and other small blocks adjacent to the small block are determined as a first area according to the neighborhood size in the first size parameter.

5. The method according to claim 1, characterized in that Before the pixels of each first region are processed to obtain the gradient distribution information of each first region, the method further includes: Binarization is performed on the sample image to obtain a binary image composed of binary pixels; The processing of the pixels of each of the first regions to obtain the gradient distribution information of each of the first regions includes: The binary pixels of each of the first regions are processed to obtain the gradient distribution information of each of the first regions.

6. The method according to claim 5, characterized in that The binarization process is performed on the sample image to obtain a binarized image composed of binarized pixels, including: The sample image is binarized using the Otsu method to obtain a binarized image composed of binarized pixels.

7. The method according to claim 1, characterized in that The step of selecting a plurality of candidate regions from the plurality of first regions according to the gradient distribution information corresponding to the first region includes: For each of the first regions, determining the gradient direction corresponding to the largest number of pixels in the gradient distribution information corresponding to the first region as the positive gradient direction of the first region, and determining the gradient direction orthogonal to the positive gradient direction as the negative gradient direction of the first region; A plurality of candidate regions are screened out from a plurality of the first regions according to the gradient distribution information, the positive gradient direction, and the negative gradient direction of each of the first regions.

8. The method according to claim 1, characterized in that: The step of selecting a plurality of candidate regions from the plurality of first regions according to the gradient distribution information corresponding to the first region includes: For each of the first regions, determining a gradient direction having the largest number of corresponding pixels in the gradient distribution information corresponding to the first region as a first gradient direction of the first region, and determining the first gradient direction and two gradient directions adjacent to the first gradient direction as positive gradient directions of the first region; For each of the first regions, determining a gradient direction orthogonal to the positive gradient direction as a negative gradient direction of the first region; A plurality of candidate regions are screened out from a plurality of the first regions according to the gradient distribution information, the positive gradient direction, and the negative gradient direction of each of the first regions.

9. The method according to claim 1, characterized in that: The step of identifying a candidate region that meets the local uniqueness condition among the plurality of candidate regions as the alignment region of the sample image comprises: When there are multiple candidate regions that meet the local uniqueness condition among the multiple candidate regions, the candidate region that meets the local uniqueness condition and has the largest number of positive gradients is identified as the alignment region of the sample image.

10. A device for determining an alignment area, characterized in that: include: A determination unit, used to determine a plurality of first regions in a sample image of a sample to be tested; A processing unit, configured to process the pixels of each of the first regions to obtain gradient distribution information of each of the first regions; wherein the gradient distribution information includes gradient directions of a plurality of pixels in the first regions; A screening unit, configured to screen out a plurality of candidate regions from a plurality of the first regions according to the gradient distribution information corresponding to the first region; wherein the first region includes a plurality of candidate regions and a plurality of non-candidate regions, the number of positive gradients of the candidate regions is greater than the number of positive gradients of the non-candidate regions, and the number of negative gradients of the candidate regions is greater than or equal to a preset number threshold, the number of positive gradients is the number of pixels having a positive gradient direction, the number of negative gradients is the number of pixels having a negative gradient direction, the positive gradient direction includes the gradient direction corresponding to the largest number of pixels in the first region, and the negative gradient direction includes the gradient direction orthogonal to the positive gradient direction; An identification unit is used to identify a candidate area that meets a local uniqueness condition among the multiple candidate areas as an alignment area of ​​the sample image; wherein the local uniqueness condition is that the degree of matching between the candidate area and the search area corresponding to the candidate area is less than or equal to a preset matching threshold, the search area contains the corresponding candidate area, and the size of the search area is larger than the size of the candidate area.

11. A computer storage medium, characterized in that: Used to store a computer program, which, when executed, is specifically used to implement the method for determining an alignment area as described in any one of claims 1 to 9.

12. An electronic device, characterized in that: including memory and processor; The memory is used to store computer programs; The processor is used to execute the computer program, specifically to implement the method for determining the alignment area according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Alignment method and alignment system

    CN106054543A

  • Page detection method, device and equipment and storage medium

    CN111582184A

  • Image recognition method and device

    CN114549400A

  • Method, apparatus and computer program product for alignment of images

    WO2014199001A1

  • Image processing method and apparatus, and device

    WO2022237811A1