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

By automatically determining the alignment region during wafer inspection and using gradient distribution information to filter out regions that meet the criteria, the problem of low inspection accuracy caused by manual selection is solved, and higher inspection accuracy is achieved.

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

Patent Information

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

AI Technical Summary

Technical Problem

In existing technologies, the setting of the alignment region during wafer inspection relies on manual selection, resulting in low accuracy of the inspection results.

Method used

By identifying multiple first regions in the sample image, analyzing gradient distribution information, filtering out candidate regions that meet the local uniqueness condition, and automatically identifying the corresponding regions.

Benefits of technology

This improves the accuracy of the detection results and meets the requirements of the alignment algorithm used in the detection process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120013848B_ABST
    Figure CN120013848B_ABST
Patent Text Reader

Abstract

The application discloses a method, device and equipment for determining a positioning area, and a storage medium. The method comprises the following steps: determining a first area in a sample image of a sample to be tested; processing pixels of each first area to obtain gradient distribution information comprising gradient directions of each pixel in the first area; screening a plurality of candidate areas from the plurality of first areas according to the gradient distribution information corresponding to the first areas; the number of positive gradient directions of the candidate areas is greater than the number of positive gradient directions of non-candidate areas, and the number of negative gradient directions of the candidate areas is greater than or equal to a preset number threshold; the number of positive gradient directions is the number of pixels with positive gradient directions, the number of negative gradient directions is the number of pixels with negative gradient directions, the positive gradient direction comprises a gradient direction with the largest number of corresponding pixels in the first area, and the negative gradient direction is orthogonal to the positive gradient direction; and identifying a candidate area meeting a local uniqueness condition from the plurality of candidate areas as a positioning area of the sample image.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] Technology Neighborhood

[0002] This application belongs to the field of sample testing technology, and particularly relates to a method, apparatus, device and storage medium for determining alignment regions. Background Technology

[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 an alignment area (pattern area) for each test area for alignment during the inspection process.

[0004] In related technical fields, alignment regions are usually set manually. Due to the subjective factors involved in manual selection, the alignment regions set in this way often fail to meet the requirements of the alignment algorithm used during detection, resulting in low accuracy of the detection results. Summary of the Invention

[0005] Therefore, this application discloses the following technical solution to automatically determine the alignment region when detecting defects in a wafer.

[0006] The first aspect of this application provides a method for determining alignment regions, comprising:

[0007] Multiple first regions were identified in the sample image of the sample to be tested;

[0008] Each pixel in the first region is processed to obtain gradient distribution information for each first region; wherein, the gradient distribution information includes the gradient directions of multiple pixels in the first region;

[0009] Based on the gradient distribution information corresponding to the first region, multiple candidate regions are selected from multiple first regions; wherein, the first region includes multiple candidate regions and multiple non-candidate regions, the number of positive gradients in each candidate region is greater than the number of positive gradients in each non-candidate region, and the number of negative gradients in each candidate region is greater than or equal to a preset threshold, the number of positive gradients is the number of pixels with positive gradient directions, the number of negative gradients is the number of pixels with negative gradient directions, the positive gradient directions include the gradient directions with the largest number of corresponding pixels in the first region, and the negative gradient directions include gradient directions orthogonal to the positive gradient directions;

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

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

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

[0013] Optionally, after the identifying, from the plurality of candidate regions, a candidate region that meets a local uniqueness condition as the alignment region of the sample image, the method further comprises:

[0014] in a case where none of the plurality of candidate regions meets the local uniqueness condition, increasing the first size parameter;

[0015] returning 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 the increasing the first size parameter, the method further comprises:

[0017] if the first size parameter is greater than a preset size threshold, outputting a failure prompt information; wherein the failure prompt information is used to represent that the sample image cannot determine an alignment region.

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

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

[0020] for each small block, determining the small block and other small blocks adjacent to the small block as a first region according to a neighborhood size in the first size parameter.

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

[0022] performing a binarization processing on the sample image to obtain a binarization image composed of binarization pixels;

[0023] the processing pixels of each first region to obtain gradient distribution information of each first region comprises:

[0024] processing binarization pixels of each first region to obtain gradient distribution information of each first region.

[0025] Optionally, the performing a binarization processing on the sample image to obtain a binarization image composed of binarization pixels comprises:

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

[0027] Optionally, the screening of the multiple candidate regions from the multiple first regions according to the gradient distribution information corresponding to the first regions comprises:

[0028] For each first region, a gradient direction with the largest number of corresponding pixels in the gradient distribution information corresponding to the first region is determined as a positive gradient direction of the first region, and a gradient direction orthogonal to the positive gradient direction is determined as a negative gradient direction of the first region.

[0029] The multiple candidate regions are screened from the multiple first regions according to the gradient distribution information, the positive gradient direction and the negative gradient direction of each first region.

[0030] Optionally, the screening of the multiple candidate regions from the multiple first regions according to the gradient distribution information corresponding to the first regions comprises:

[0031] For each first region, a gradient direction with the largest number of corresponding pixels in the gradient distribution information corresponding to the first region is determined as a first gradient direction of the first region, and the first gradient direction and two gradient directions adjacent to the first gradient direction are determined as positive gradient directions of the first region.

[0032] For each first region, a gradient direction orthogonal to the positive gradient direction is determined as a negative gradient direction of the first region.

[0033] The multiple candidate regions are screened from the multiple first regions according to the gradient distribution information, the positive gradient direction and the negative gradient direction of each first region.

[0034] Optionally, the identification of the candidate region meeting the local uniqueness condition as the alignment region of the sample image comprises:

[0035] In a case where there are multiple candidate regions meeting the local uniqueness condition in the multiple candidate regions, a candidate region with the largest number of positive gradients among the candidate regions meeting the local uniqueness condition is identified as the alignment region of the sample image.

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

[0037] A determination unit is configured to determine multiple first regions in a sample image of a sample to be tested.

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

[0039] a screening unit, configured to screen a plurality of candidate regions from the plurality of first regions according to the gradient distribution information corresponding to the first regions, wherein the first regions comprise 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 with a positive gradient direction, the number of negative gradients is the number of pixels with a negative gradient direction, the positive gradient direction comprises a gradient direction with the largest number of corresponding pixels in the first region, and the negative gradient direction comprises a gradient direction orthogonal to the positive gradient direction;

[0040] a recognition unit, configured to recognize, from the plurality of candidate regions, a candidate region that meets a local uniqueness condition as an alignment region of the sample image, wherein the local uniqueness condition is that a matching degree between the candidate region and a search region corresponding to the candidate region is less than or equal to a preset matching threshold, the search region contains the corresponding candidate region, and the size of the search region is greater than the size of the candidate region.

[0041] The third aspect of the present application provides a computer storage medium for storing a computer program, wherein the computer program is executed to specifically implement the method for determining an alignment region according to any one of the first aspect of the present application.

[0042] The fourth aspect of the present application provides an electronic device comprising a memory and a processor.

[0043] The memory is configured to store a computer program.

[0044] The processor is configured to execute the computer program, and specifically implement the method for determining an alignment region according to any one of the first aspect of the present application.

[0045] The beneficial effects of the present application are as follows:

[0046] According to the number distribution of pixels with different gradient directions in the first region and the matching degree between the first region and other surrounding regions, an alignment region is automatically identified in the sample image. Compared with the manual selection method in the related art, the alignment region 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 result. BRIEF DESCRIPTION OF DRAWINGS

[0047] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the accompanying drawings needed to be used in the embodiments or prior art description will be briefly introduced as follows. Obviously, the accompanying drawings in the following description only relate to the embodiments of the present application, and for those skilled in the art, other drawings can be obtained without creative effort based on the provided drawings.

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

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

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

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

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

[0053] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments only represent some of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative effort fall within the scope of the present application.

[0054] An embodiment of the present application provides a method for determining an alignment area, please refer to Figure 1 , which is a flow chart of the method. The method can include the following steps.

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

[0056] The sample to be tested can be a wafer, a die, or other semiconductor products that need to be tested for defects.

[0057] The sample image can 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 areas, a preset first size parameter can be obtained first, and then a plurality of first areas can be determined in the sample image of the sample to be tested according to the first size parameter.

[0059] The first size parameter can be a fixed value set based on experience, or it can 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 can be obtained by dividing the size of the sample image by the number of first regions.

[0060] The first regions do not need to overlap. For example, the first size parameter can be 20*20. In this case, the sample image can be divided into several 20-pixel by 20-pixel square regions, each of which is a first region.

[0061] The advantage of dividing the sample image into non-overlapping first regions is that it ensures that different first regions do not overlap with each other, making the differences between different first regions more obvious. When screening for alignment regions from the first regions, it is easier to screen for alignment regions that meet the local uniqueness condition, thereby improving the execution efficiency of the method in this embodiment.

[0062] Optionally, the first regions may partially overlap. In this case, the first size parameter may include the patch size and the neighborhood size, where the patch size specifies the size of each patch and the neighborhood size specifies how many patches constitute a first region.

[0063] Dividing the sample image into partially overlapping first regions allows for finer-grained segmentation of the sample image, which is beneficial for determining more accurate alignment regions.

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

[0065] The sample image of the sample to be tested is divided into multiple small blocks according to the small block size in the first size parameter;

[0066] For each small block, based on the neighborhood size in the first size parameter, the small block and other adjacent small blocks are defined as a first region.

[0067] For example, assuming the patch size is 5*5 and the neighborhood size is 3*3, the sample image can be divided into several 5-pixel by 5-pixel patches. Then, for each patch, the region consisting of 3 by 3 patches centered on that patch is defined as a first region.

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

[0069] The advantage of dividing the first region in this way is that it allows for a more refined division of the sample image, which helps to determine a more accurate alignment region.

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

[0071] The gradient distribution information comprises gradient directions of the plurality of pixels in the first region.

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

[0073] performing binary processing on the sample image to obtain a binary image composed of binary pixels;

[0074] If the binary processing is performed, S102 is equivalent to:

[0075] processing the binary pixels in each first region to obtain gradient distribution information of each first region.

[0076] In this embodiment, any binary algorithm in the related technical field can be applied to perform binary processing on the sample image, and the specific implementation process can be referred to the related technical literature, which will not be described herein.

[0077] The binary processing on the sample image before obtaining the gradient distribution information has the advantage that the binary processing can reduce the interference of the small background gradient 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 performing the binary processing on the sample image, the Otsu method can be used to perform the binary processing on the sample image. Compared with other binary algorithms, the Otsu method can dynamically determine the threshold value for binary processing according to the local features of the sample image in the process of binary processing, so that the binary image obtained can more comprehensively retain the gradient features of the sample image, and the subsequent gradient distribution information obtained based on the binary image is more accurate.

[0079] In step S102, a plurality of algorithms for calculating image gradients can 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 the gradient distribution information is obtained according to the gradient value. The algorithm for calculating the gradient used in this embodiment is not limited.

[0080] For example, the sobel algorithm can be used to process the binary image in the first region to obtain the gradient distribution information.

[0081] When the sobel algorithm is used, first, two sobel operators shown in formula (1) can be used to perform convolution operation on the binary image in the first region, and the image obtained by the convolution operation of the x operator is denoted as Gx, and the image obtained by 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-ikof the pixel can be calculated by formula (2).

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

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

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

[0087] After obtaining the gradient value of each pixel in the first region 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] Taking Figure 3 for example, the range of gradient values, i.e. 0 to 360 degrees, can be divided into 16 intervals at an interval of 22.5 degrees, wherein each two opposite intervals correspond to a gradient direction, thereby obtaining 8 gradient directions as shown in Figure 3 .

[0090] Then, for each gradient direction, the number of pixels in the first region whose gradient values are located in the interval corresponding to the gradient direction is counted, and the counting result is taken as the pixel number corresponding to the gradient direction. Finally, the pixel numbers of the first region in each gradient direction are summarized, thereby obtaining the gradient distribution information of the first region.

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

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

[0093] Optionally, when the gradient distribution information of the first region is obtained, the gradient distribution information of each small block constituting the first region is obtained first, and then the gradient distribution information of each small block is summarized 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] In S103, a plurality of candidate regions are selected from the plurality of first regions according to the gradient distribution information corresponding to each first region.

[0096] In the candidate region, the number of positive gradients is greater than the number of positive gradients in the non-candidate region, and the number of negative gradients in the candidate region 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, and the number of negative gradients is the number of pixels with a negative gradient direction. The positive gradient direction includes the gradient direction with the largest number of corresponding pixels in the first region, and the negative gradient direction includes the gradient direction orthogonal to the positive gradient direction.

[0097] The first optional way to select a candidate region is:

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

[0099] According to the gradient distribution information, the positive gradient direction and the negative gradient direction of each first region, a plurality of candidate regions are selected from the plurality of first regions.

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

[0101] For example, assume that in a certain first region, the gradient direction 0 corresponds to the largest number of pixels, and then the gradient direction 0 is determined as the positive gradient direction of the first region, and the gradient direction 4 orthogonal to the gradient direction 0 is determined as the negative gradient direction of the first region.

[0102] In the screening of the plurality of candidate regions 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, each first region can be first sorted in descending order of the number of pixels corresponding to the positive gradient direction, for example, the positive gradient direction of a first region is gradient direction 1, and the number of corresponding pixels is 100, the positive gradient direction of another first region is gradient direction 2, and the number of corresponding pixels is 200, so that the latter is arranged in front of the former in the sorting.

[0103] After sorting, whether the number of negative gradients of each first region meets the condition that the number of negative gradients is greater than or equal to a preset number threshold is detected from front to back one by one, and each first region meeting the condition is determined as a candidate region, and when the number of accumulated candidate regions reaches the upper limit of the number of candidate regions, the process ends, thereby obtaining a plurality of candidate regions.

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

[0105] The advantage of determining the candidate region in the first way is that, in the screening of the candidate region, for each first region, only the number of pixels corresponding to one positive gradient direction and the number of pixels corresponding to one negative gradient direction need to be counted, and the amount of data to be analyzed is small, so that the candidate region can be screened faster in this way.

[0106] The second way to determine the candidate region is:

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

[0108] For each first region, the gradient direction orthogonal to the positive gradient direction is determined as the negative gradient direction of the first region.

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

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

[0111] In the second way, for any first region, the positive gradient direction and the corresponding negative gradient direction that can be determined for the first region can be any one of 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 the positive gradient direction and the negative gradient direction are determined, the way of screening the multiple candidate regions from the 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 way, and thus will not be described again.

[0115] The advantage of determining the candidate regions in the second way is that:

[0116] When the candidate regions are screened in the second way, the information of more gradient directions in the candidate regions is combined, such as in the foregoing example, the number of pixels in the first region as the positive gradient direction of 0, 1 and 7, and as the negative gradient direction of 3, 4 and 5 is combined to determine whether the first region is a candidate region, so compared with the first way of considering only one positive gradient direction and one negative gradient direction, screening in the second way is beneficial to screening more accurate alignment regions.

[0117] It should be noted that for different first regions, the gradient direction with the most number of pixels can be different, and thus different first regions can have different positive gradient directions.

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

[0119] S104, identifying the candidate regions that meet the local uniqueness condition as the alignment region of the sample image from the multiple candidate regions.

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

[0121] Optionally, when identifying the alignment region, if there are multiple candidate regions that meet the local uniqueness condition, the alignment region can be determined in the following way:

[0122] In the case that there are multiple candidate regions satisfying the local uniqueness condition, the candidate region with the largest number of positive gradient features is identified as the alignment region of the sample image.

[0123] The advantage of determining the alignment region in this way is that, in the case that multiple candidate regions satisfy the local uniqueness condition, the candidate region with the most gradient features is determined as the alignment region, which is conducive to improving the subsequent alignment accuracy.

[0124] Optionally, if it is found through identification that none of the candidate regions satisfies the local uniqueness condition, the following steps can be performed:

[0125] outputting a failure prompt information; wherein the failure prompt information is used to represent that the sample image cannot determine the alignment region.

[0126] Optionally, if it is found through identification that none of the candidate regions satisfies the local uniqueness condition, the following steps can also be performed:

[0127] In the case that none of the multiple candidate regions satisfies the local uniqueness condition, the first size parameter is increased.

[0128] Return to performing the step of determining multiple 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 can be increased simultaneously, only the small block size can be increased, or only the neighborhood size can be increased.

[0130] When the first size parameter is increased, the original first size parameter can be added by a preset step to obtain the increased first size parameter.

[0131] The advantage of increasing the first size parameter in the case that none of the multiple candidate regions satisfies the local uniqueness condition is:

[0132] The initial first size parameter can be set unreasonably, resulting in that the candidate region does not satisfy the local uniqueness condition. For example, if the first size parameter is too small, the candidate region contains less features and cannot be distinguished from the adjacent region. Gradually increasing the first size parameter in the case that the candidate region does not satisfy the local uniqueness condition according to the above-mentioned manner can solve the problem of unreasonable setting of the initial first size parameter, 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 the first size parameter is increased, the following steps can also be performed:

[0134] determining whether the first size parameter after the increase is greater than a preset size threshold, and outputting a failure prompt if the first size parameter after the increase is greater than the size threshold;

[0135] If the first size parameter after the increase is less than or equal to the size threshold, the method returns to S101 until a positioning area is determined or the first size parameter after the increase is greater than the size threshold.

[0136] The size threshold can be determined according to the requirements of the positioning algorithm used for detection. For example, the positioning algorithm can only recognize a positioning area with a size not exceeding a specific size, and the size threshold can be determined according to the specific size to ensure that the size of the finally determined positioning area does not exceed the specific size.

[0137] The advantage of setting the size threshold is to avoid the size of the determined positioning area being too large to affect the subsequent recognition of the positioning 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 the corresponding size threshold, it can be determined that the first size parameter after the increase is greater than the size threshold.

[0139] The way to determine whether a candidate area meets the local uniqueness condition can be to expand the first area by a preset expansion size, to take the expanded area as a search area corresponding to the candidate area, and then to calculate the matching degree between the candidate area and the corresponding search area by using a template matching algorithm. If the matching degree is less than or equal to a matching threshold, the candidate area is determined to be a positioning area.

[0140] The specific principle of the template matching algorithm can be referred to in related technical documents, and will not be described here.

[0141] The matching threshold can be set as needed and is not limited, 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 number distribution of pixels in different gradient directions in the first area and the matching degree between the first area and other surrounding areas, a positioning area is automatically identified in the sample image. Compared with the manual selection method in the related art, the positioning area determined by the method of the present application can better meet the requirements of the positioning algorithm used for detection, thereby improving the accuracy of the detection result.

[0144] The present application also provides a device for determining a positioning area, please refer to Figure 4 The device can include the following units:

[0145] The determining unit 401 is configured to determine a plurality of first regions in a sample image of a sample to be tested.

[0146] The processing unit 402 is configured to process pixels of each first region to obtain gradient distribution information of each first region, wherein the gradient distribution information comprises gradient directions of a plurality of pixels in the first region.

[0147] The screening unit 403 is configured to screen a plurality of candidate regions from the plurality of first regions according to the gradient distribution information corresponding to the first regions, wherein the first regions comprise the plurality of candidate regions and a plurality of non-candidate regions, the number of positive gradients of each candidate region is greater than the number of positive gradients of each non-candidate region, and the number of negative gradients of each candidate region 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 comprises a gradient direction with the largest number of corresponding pixels in the first region, and the negative gradient direction comprises a gradient direction orthogonal to the positive gradient direction.

[0148] The identifying unit 404 is configured to identify a candidate region that meets a local uniqueness condition from the plurality of candidate regions as an alignment region of the sample image, wherein the local uniqueness condition is that a matching degree between the candidate region and a search region corresponding to the candidate region is less than or equal to a preset matching threshold, the search region contains the corresponding candidate region, and the size of the search region is greater than the size of the candidate region.

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

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

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

[0152] increase the first size parameter when none of the plurality of candidate regions meets the local uniqueness condition;

[0153] return to the step of determining the 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, the processing unit 402 is further configured to:

[0155] perform binaryzation processing on the sample image to obtain a binaryzation image composed of binaryzation pixels;

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

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

[0158] Optionally, the processing unit 402 performs binarization processing on the sample image to obtain a binarized image composed of binarized pixels, and specifically for:

[0159] The Otsu method is used to perform binarization processing on the sample image to obtain a binarized image composed of binarized pixels.

[0160] Optionally, the screening unit 403 screens a plurality of candidate regions from the plurality of first regions according to the gradient distribution information corresponding to the first regions, and specifically for:

[0161] For each first region, the gradient direction with the largest number of corresponding pixels in the gradient distribution information corresponding to the first region is determined as a positive gradient direction of the first region, and a gradient direction orthogonal to the positive gradient direction is determined as a negative gradient direction of the first region.

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

[0163] Optionally, the screening unit 403 screens a plurality of candidate regions from the plurality of first regions according to the gradient distribution information corresponding to the first regions, and specifically for:

[0164] For each first region, the gradient direction with the largest number of corresponding pixels in the gradient distribution information corresponding to the first region is determined as a first gradient direction of the first region, and the first gradient direction and two gradient directions adjacent to the first gradient direction are determined as positive gradient directions of the first region.

[0165] For each first region, a gradient direction orthogonal to the positive gradient direction is determined as a negative gradient direction of the first region.

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

[0167] Optionally, the recognition unit 404 recognizes a candidate region meeting a local uniqueness condition as an alignment region of the sample image from the plurality of candidate regions, and specifically for:

[0168] In a case where there are a plurality of candidate regions meeting the local uniqueness condition in the plurality of candidate regions, a candidate region with the largest number of positive gradients among the candidate regions meeting the local uniqueness condition is recognized as the alignment region of the sample image.

[0169] Optionally, after the processing unit 402 increases the first size parameter, it is further used for:

[0170] if the first size parameter is greater than the preset size threshold, outputting a failure prompt information; wherein the failure prompt information is used to represent that the sample image cannot determine the alignment area.

[0171] Optionally, when the determining unit 401 determines a plurality of first areas in the sample image of the sample to be tested according to the first size parameter, the determining unit 401 is specifically configured 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, determining the small block and other small blocks adjacent to the small block 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 embodiments of the present application can be referred to the method for determining the alignment area provided in the embodiments of the present application, and will not be repeated.

[0175] The embodiments of the present application further provide a computer storage medium for storing a computer program, and the computer program is executed to specifically implement the method for determining the alignment area provided in any of the embodiments of the present application.

[0176] The embodiments of the present application further provide an electronic device, please refer to Figure 5 The electronic device can include a memory 501 and a processor 502.

[0177] The memory 501 is used to store a computer program.

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

[0179] It should be noted that each of the embodiments in the present specification adopts a progressive manner for description, and each embodiment focuses on the different places from other embodiments, and the same and similar parts between each embodiment can be referred to each other.

[0180] In order to describe conveniently, the above system or device is described as various modules or units respectively. Of course, in the implementation of the present application, the functions of each unit can be implemented in the same or multiple software and / or hardware.

[0181] Those skilled in the art can clearly understand the implementation of the present application by means of software and the necessary universal hardware platform from the above description of the embodiments. Based on such an understanding, the technical solutions of the present application can be embodied in the form of a software product, and the computer software product can be stored in a storage medium, such as a ROM / RAM, a magnetic disk, or an optical disk, and includes a number of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments of the present application.

[0182] Finally, it should be noted that, in this document, the terms such as first, second, third, and fourth are merely used to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "contain", 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 not only includes those elements, but also includes other elements not explicitly listed or inherent to such a process, method, article, or device. Without more limitations, the element defined by the statement "includes a" does not exclude the presence of other identical elements in the process, method, article, or device that includes the element.

[0183] The above description is only the preferred embodiments of the present application, and it should be pointed out that those skilled in the art can make a number of improvements and refinements without departing from the principles of the present application, and these improvements and refinements should also be considered as the protection scope of the present application.

Claims

1. A method for determining the alignment region, characterized in that, include: Multiple first regions were identified in the sample image of the sample to be tested; Each pixel in the first region is processed to obtain gradient distribution information for each first region; wherein, the gradient distribution information includes the gradient directions of multiple pixels in the first region; Based on the gradient distribution information corresponding to the first region, multiple candidate regions are selected from multiple first regions; wherein, the first region includes multiple candidate regions and multiple non-candidate regions, the number of positive gradients in each candidate region is greater than the number of positive gradients in each non-candidate region, and the number of negative gradients in each candidate region is greater than or equal to a preset threshold, the number of positive gradients is the number of pixels with positive gradient directions, the number of negative gradients is the number of pixels with negative gradient directions, the positive gradient directions include the gradient directions with the largest number of corresponding pixels in the first region, and the negative gradient directions include gradient directions orthogonal to the positive gradient directions; Among the multiple candidate regions, the candidate region that meets the local uniqueness condition is identified as the corresponding region of the sample image; wherein, the local uniqueness condition is that the matching degree between the candidate region and the search region corresponding to the candidate region is less than or equal to a preset matching threshold, the search region contains the corresponding candidate region, and the size of the search region is greater than the size of the candidate region.

2. The method according to claim 1, characterized in that, The determination of multiple first regions in the sample image of the sample to be tested includes: Multiple first regions are determined in the sample image of the sample to be tested according to the first size parameter; After identifying the candidate regions that meet the local uniqueness condition from among the multiple candidate regions as the corresponding regions of the sample image, the method further includes: If none of the candidate regions meet the local uniqueness condition, increase the first size parameter; Return to the step of determining multiple 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 message is output; wherein, the failure message is used to indicate that the alignment region cannot be determined in the sample image.

4. The method according to claim 2, characterized in that, The determination of multiple first regions in the sample image of the sample to be tested according to the first size parameter includes: The sample image of the sample to be tested is divided into multiple small blocks according to the small block size in the first size parameter; For each of the small blocks, based on the neighborhood size in the first size parameter, the small block and other adjacent small blocks are determined as a first region.

5. The method according to claim 1, characterized in that, Before processing each pixel in the first region to obtain the gradient distribution information of each first region, the method further includes: The sample image is binarized to obtain a binarized image composed of binarized pixels; The step of processing each pixel in the first region to obtain gradient distribution information for each first region includes: The binarized 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 step of binarizing the sample image to obtain a binary image composed of binarized pixels includes: 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 multiple candidate regions from multiple first regions based on the gradient distribution information corresponding to the first region includes: For each of the first regions, the gradient direction with the most corresponding pixels in the gradient distribution information corresponding to the first region is determined as the positive gradient direction of the first region, and the gradient direction orthogonal to the positive gradient direction is determined as the negative gradient direction of the first region. Based on the gradient distribution information, positive gradient direction, and negative gradient direction of each first region, multiple candidate regions are selected from the multiple first regions.

8. The method according to claim 1, characterized in that, The step of selecting multiple candidate regions from multiple first regions based on the gradient distribution information corresponding to the first region includes: For each of the first regions, the gradient direction with the most corresponding pixels in the gradient distribution information corresponding to the first region is determined as the first gradient direction of the first region, and the first gradient direction and the two gradient directions adjacent to the first gradient direction are determined as the positive gradient direction of the first region. For each of the first regions, the gradient direction orthogonal to the positive gradient direction is determined as the negative gradient direction of the first region; Based on the gradient distribution information, positive gradient direction, and negative gradient direction of each first region, multiple candidate regions are selected from the multiple first regions.

9. The method according to claim 1, characterized in that, The step of identifying the candidate regions that meet the local uniqueness condition among the multiple candidate regions as the corresponding regions of the sample image includes: If there are multiple candidate regions that meet the local uniqueness condition, the candidate region with the largest number of positive gradients among the candidate regions that meet the local uniqueness condition is identified as the alignment region of the sample image.

10. An apparatus for determining an alignment region, characterized in that, include: The determining unit is used to determine multiple first regions in the sample image of the sample to be tested; A processing unit is configured to process each pixel in the first region to obtain gradient distribution information for each first region; wherein the gradient distribution information includes the gradient directions of multiple pixels in the first region. A filtering unit is configured to filter out multiple candidate regions from multiple first regions based on the gradient distribution information corresponding to the first region; wherein, the first region includes multiple candidate regions and multiple non-candidate regions, the number of positive gradients in each candidate region is greater than the number of positive gradients in each non-candidate region, and the number of negative gradients in each candidate region is greater than or equal to a preset 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 with the largest number of corresponding pixels in the first region, and the negative gradient direction includes gradient directions orthogonal to the positive gradient direction; The identification unit is used to identify, among the multiple candidate regions, the candidate region that meets the local uniqueness condition as the corresponding region of the sample image; wherein, the local uniqueness condition is that the matching degree between the candidate region and the search region corresponding to the candidate region is less than or equal to a preset matching threshold, the search region contains the corresponding candidate region, and the size of the search region is greater than the size of the candidate region.

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 the alignment region 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 region as described in 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