Image registration method and image detection method
By calculating the histogram measurement value of the image difference graph, selecting the offset corresponding to the minimum value for resampling, the problems of local inaccuracy of image registration and large sampling error in the prior art are solved, and higher registration accuracy and detection sensitivity are achieved.
Patent Information
- Application Number
- CN202311775217.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-21
- Publication Date
- 2025-06-24
AI Technical Summary
When existing image registration methods process images with different local features, it is difficult to accurately perceive the offset, resulting in poor registration results and are greatly affected by sampling errors.
By setting multiple discrete offsets, the histogram of the difference graph is calculated, and the measurement value is calculated based on the cutoff point of the histogram, the offset corresponding to the minimum measurement value is selected as the predicted offset, and resampling is performed to improve the registration accuracy.
The local accuracy of image registration is improved, registration errors caused by sampling differences are reduced, and registration accuracy and detection sensitivity are achieved.
Smart Images

Figure CN120198472A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image registration, and in particular to an image registration method and an image detection method. Background Art
[0002] In the semiconductor manufacturing process, various inspection devices are used to detect various process indicators to improve the yield at each stage, and ultimately improve the overall yield, which is closely related to the profit return rate. In particular, defect detection devices are an important part of various inspection devices. With the progress of semiconductor technology, smaller defects are more likely to cause device failures, and as the feature size of devices gradually becomes smaller than the wavelength range of visible light and even ultraviolet light, it becomes more and more difficult to detect smaller defects.
[0003] In common defect detection, multiple chips with the same design on a wafer are utilized, and it is considered that the imaging results in the same design area must be the same. By taking the difference between the image pixels of the corresponding two areas, a defect is considered to exist where there is an obvious difference. Before defect detection, image registration between images must be performed to obtain a correct difference image.
[0004] The accuracy of the registration process is related to the following factors: 1. The performance of the moving stage: The non-uniformity / vibration of the moving stage speed will cause the deviation between corresponding frames in the scanning direction to not be described by the same deviation, and it is necessary to divide it into intervals for registration; even so, the performance of the moving stage will still seriously affect the upper limit of the registration effect; 2. The performance of the registration algorithm: Various measures for registration based on the spatial domain, frequency domain, or features; representative measures are the normalized cross-correlation NCC based on gray values or the sum of squared pixel differences SSD, and the phase cross-correlation POC based on frequency domain transformation; 3. The design pattern: Whether the features in the pattern are clear and unique is often the key factor restricting whether accurate registration can be achieved theoretically; in fact, the nodes, products, and design patterns of different semiconductor manufacturers vary greatly, and it is difficult to solve all problems with the same measure; 4. Process errors: The noise caused by process errors in the silicon wafer preparation process will also affect the registration accuracy to a certain extent.
[0005] In view of the above prior art, the applicant believes that there are at least the following deficiencies in the existing registration methods: 1. The metrics used in registration consider the overall average effect while ignoring the local parts; currently used metrics such as SSD, NCC, and POC imply the assumption that "the influence of each part of the image on registration is equal", that is, the average effect of the entire region is adopted during registration; in fact, patterns with different features have different sensitivities to the offset; when most of the region is insensitive to the offset in a certain direction and only a small part is sensitive, the existing metrics cannot perceive it, resulting in a poor registration effect; 2. The registration is overly affected by the noise brought by different sampling situations. During registration, in order to achieve sub-pixel accuracy, interpolation is performed on the image, but interpolation will introduce sampling errors and thus affect the registration accuracy; in particular, when the gradient in the image is large, the influence of sampling errors will be particularly obvious. Summary of the Invention
[0006] Aiming at the defects in the prior art, the object of the present invention is to provide an image registration method and an image detection method.
[0007] To achieve the above object, in the first aspect, the present invention provides an image registration method, including the following steps:
[0008] Step S11: Obtain the image to be registered and the reference image;
[0009] Step S21: Set the first registration search range of the image to be registered and the reference image, and determine a number of first discrete offsets within the first registration search range according to a first preset offset step size. Move the image to be registered and / or the reference image respectively based on each first discrete offset, calculate the first difference map between the image to be registered and the reference image after each movement, and generate the first histogram of each first difference map. Each first difference map corresponds to a first discrete offset;
[0010] Calculate the truncation point of the first histogram of each first difference map, and calculate the first measure value of the corresponding first difference map according to the truncation point in each first histogram. The first measure value is used to evaluate the preset accuracy of the first discrete offset corresponding to each first difference map;
[0011] Take the first discrete offset corresponding to the minimum value among the multiple first measure values as the first predicted offset;
[0012] Step S31: Obtain the actual offset between the image to be registered and the reference image based on the first predicted offset;
[0013] Step S41: Resample the image to be registered and the reference image according to the actual offset.
[0014] Preferably, step S31: Obtaining the actual offset between the image to be registered and the reference image based on the first predicted offset includes:
[0015] Taking the first predicted offset as the actual offset between the image to be registered and the reference image.
[0016] Preferably, after taking the first discrete offset corresponding to the minimum value among the multiple first measure values as the first predicted offset in step S21, it further includes:
[0017] Step S22: Centering on the first predicted offset, set the second registration search range according to the first preset offset step size. Determine a number of second discrete offsets within the second registration search range according to the second preset offset step size. Move the image to be registered and / or the reference image respectively according to each second discrete offset, calculate the second difference map between the image to be registered and the reference image after each movement, and generate the second histogram of each second difference map. Each second difference map corresponds to one second discrete offset, where the second preset offset step size is smaller than the first preset offset step size;
[0018] Calculate the truncation point of the second histogram of each second difference map, and calculate the second measure value of the corresponding second difference map according to the truncation point in each second histogram. The second measure value is used to evaluate the preset accuracy of the second discrete offset corresponding to each second difference map;
[0019] Taking the second discrete offset corresponding to the minimum value among the multiple second measure values as the second predicted offset;
[0020] The step S31 of obtaining the actual offset between the image to be registered and the reference image based on the first predicted offset includes:
[0021] Calculate the sum of the first predicted offset and the second predicted offset to obtain the actual offset between the image to be registered and the reference image.
[0022] Preferably, in step S22, after taking the second discrete offset corresponding to the minimum value among the multiple second measure values as the second predicted offset, it further includes judging whether the second predicted offset is less than a preset threshold;
[0023] If so, enter step S31;
[0024] If not, then use the sum of the first prediction offset and the second prediction offset as the updated first prediction offset, and centered on the updated first prediction offset, re - execute step S22.
[0025] Preferably, the first preset offset step in step S21 includes any one or more of 0.1 pixels to 3 pixels in the to - be - registered image or the reference image.
[0026] Preferably, in step S21, calculating the truncation point of the first histogram of each first difference map and calculating the first measure value of the corresponding first difference map according to the truncation point in each first histogram includes:
[0027] Set a first percentage of points;
[0028] Obtain the total number of pixels in the first histogram, and calculate the truncation number of points according to the total number of pixels and the first percentage of points;
[0029] Calculate the first cumulative sum of the number of pixels from one end of the first histogram, and use the gray level corresponding to when the first cumulative sum first exceeds the truncation number of points as the left truncation point P1;
[0030] Calculate the second cumulative sum of the number of pixels from the other end of the first histogram, and use the gray level corresponding to when the second cumulative sum first exceeds the truncation number of points as the right truncation point P2;
[0031] Calculate the first measure value through the left truncation point P1 and the right truncation point P2.
[0032] Preferably, calculating the first measure value through the left truncation point P1 and the right truncation point P2 includes: the first measure value is obtained by subtracting P1 from P2; or the first measure value is obtained by max(|P1|, |P2|).
[0033] In a second aspect, the present invention provides an image detection method, which is characterized by including the following steps:
[0034] Step T1: Obtain a test image and at least one reference image;
[0035] Step T2: Segment the test image and at least one reference image according to a preset size and overlapping area respectively, to obtain multiple blocks of the test image and multiple blocks of each reference image;
[0036] Take multiple blocks in the test image as multiple images to be registered, and take multiple blocks in each control image as multiple reference images. Moreover, the multiple images to be registered correspond one by one to the multiple reference images in each control image. Use an image registration method to obtain the actual offset between each image to be registered and the corresponding reference image, and perform resampling;
[0037] Step T3: Calculate the difference map between each image to be registered after resampling and the corresponding reference image. Obtain the defect detection result of each block according to the difference map, and obtain the defect detection result of the test image relative to the control image according to the defect detection results of all blocks.
[0038] Preferably, in step T2, after obtaining the actual offset in the registration using the image registration method, it further includes: judging each actual offset. If it is found that there is an offset exceeding the index among the actual offsets, an abnormal result is output and the detection is aborted.
[0039] Preferably, the detection method further includes step T4: Obtain multiple control images, loop through step T2 and step T3, traverse each control image, and obtain the defect detection result of the test image relative to each control image;
[0040] Step T5: Compare the detection results of the test image relative to each control image. When a defect appears in the detection results of the test image relative to more than one control image, the defect is regarded as a real defect.
[0041] Preferably, the detection method further includes step T6: Take the test image and multiple control images as a group of images, obtain multiple groups of images, loop through step T1 to step T5, traverse each group of images, and obtain the defect detection result of the test image relative to each control image in each group of images.
[0042] Compared with the prior art, the present invention has the following beneficial effects:
[0043] The present invention can avoid the situation where the overall registration result is good but the local registration is poor. At the same time, it also avoids being affected by sampling errors due to image interpolation, and avoids registration errors caused by sampling differences. Moreover, it is not necessary to use the offsets during the registration of each segment to interpolate each row to obtain their respective offsets after the image is segmented. Therefore, it can avoid the offset of a certain row being affected by the offsets during the registration of adjacent segments. Therefore, a higher-precision registration result can be obtained, and thus the detection sensitivity can be improved. Description of the Drawings
[0044] Figure 1Flow chart of image registration according to an embodiment of the present invention;
[0045] Figure 2 Flow chart of one-way movement in image registration according to an embodiment of the present invention;
[0046] Figure 3 Flow chart of two-way movement in image registration according to an embodiment of the present invention;
[0047] Figure 4 Flow chart of image registration according to another embodiment of the present invention;
[0048] Figure 5 Flow chart of one-way movement in image registration according to another embodiment of the present invention;
[0049] Figure 6 Flow chart of two-way movement in image registration according to another embodiment of the present invention;
[0050] Figure 7 Schematic diagram of calculating the cut-off point according to the difference map according to an embodiment of the present invention;
[0051] Figure 8 Influence diagram of one-way movement and two-way movement on the registration process according to one-dimensional data according to an embodiment of the present invention;
[0052] Figure 9 Example diagram of the image to be registered and the reference image according to an embodiment of the present invention;
[0053] Figure 10 Example diagram of the first measure matrix S1 and the second measure matrix S2 according to an embodiment of the present invention;
[0054] Figure 11 Flow chart of the image detection method according to an embodiment of the present invention;
[0055] Figure 12 Flow chart of defect detection based on registration according to an embodiment of the present invention;
[0056] Figure 13 Schematic diagram of wafer defect detection according to an embodiment of the present invention. Detailed implementation manners
[0057] To make the objectives, technical solutions, and advantages of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention. Unless otherwise defined, the technical terms or scientific terms used herein shall have the ordinary meanings understood by those of ordinary skill in the art in the field to which the present invention belongs. The words such as "including" used herein are intended to mean that the elements or items appearing before the word cover the elements or items listed after the word and their equivalents, without excluding other elements or items.
[0058] An embodiment of the present invention discloses an image registration method, as Figure 1 shown, including the following steps:
[0059] Step S11: Obtain the image to be registered and the reference image.
[0060] Step S21: Set the first registration search range for the image to be registered and the reference image, and determine a number of first discrete offset amounts within the first registration search range according to the first preset offset step. Move the image to be registered and / or the reference image respectively based on each first discrete offset amount, calculate the first difference map between the image to be registered and the reference image after each movement, and generate the first histogram of each first difference map. Each first difference map corresponds to a first discrete offset amount. Calculate the truncation point of the first histogram of each first difference map, and calculate the first measure value of the corresponding first difference map according to the truncation point in each first histogram. Take the first discrete offset amount corresponding to the minimum value among the multiple first measure values as the first predicted offset amount.
[0061] Among them, setting a number of first discrete offset amounts means setting multiple estimated values of the actual offset amount, and then calculating the accuracy evaluation index of each estimated value, denoted as the first measure value. And the smaller the first measure value is, the closer the corresponding estimated value is to the actual offset amount, that is, the higher the estimation accuracy. That is to say, the first measure value is used to evaluate the preset accuracy of the first discrete offset amount corresponding to each first difference map.
[0062] Step S31: Obtain the actual offset amount between the image to be registered and the reference image based on the first predicted offset amount.
[0063] Step S41: Resample the image to be registered and the reference image according to the actual offset amount.
[0064] Specifically, in a semiconductor metrology device, due to high requirements for both the quality and efficiency of metrology, the system is generally required to provide a stable stage and optical system. It is necessary to set the registration search range for the registration process. In principle, images that are designed to be exactly the same should be distributed to a group for registration. Considering the velocity non-uniformity and control accuracy of the stage, it is generally considered that there will be a difference of several pixels between images in the same group, which determines the registration search range used during registration. The first registration search range in step S21 refers to the range of the first preset offset between the image to be registered and the reference image. The range of the first preset offset can indicate the maximum value of the preset offset between the two, which can be denoted as -Range to Range. Among them, the plus and minus signs can represent the direction of the offset. For example, any offset from a maximum of 1 pixel to a maximum of 5 pixels can be preset between the image to be registered and the reference image. It should be noted that usually the first preset offset includes a row offset and a column offset. In this case, both the row offset and the column offset are within the set first registration search range. When the first registration search range is denoted as -Range to Range, that is, the row offset is within the range of -Range to Range, and the column offset is also within the range of -Range to Range. For example, if the maximum offset between the image to be registered and the reference image is considered to be 3 pixels, the first registration search range can be set to -3 to 3. At this time, the row offset and the column offset are respectively within the range of -3 to 3. The first preset offset step refers to the number of pixels to be moved when obtaining each first discrete offset. In one embodiment, the first preset offset step includes any one or more values from 0.1 pixel to 3 pixels. It should be noted that the first preset offset step is set according to a preset number of pixels. For example, in the calculation of the first discrete offset, the first preset offset step used each time can be the same step, always being 1 pixel, or the first preset offset step used each time can also be different steps, using 0.5 pixels, 1 pixel, 2 pixels, etc. according to needs. The first discrete offset is a plurality of preset offsets selected within the first registration search range according to the first preset offset step. The preset offset can be used as an estimated value of the offset between the image to be registered and the reference image. If the first preset offset step is the same, the first discrete offsets selected are preset offsets with the same pixel interval. If the first preset offset steps are different, the first discrete offsets selected may include preset offsets with different pixel intervals.Here, an example with the same first preset offset step is used for illustration. For example, the first preset offset step is 1 pixel, and the first registration search range is -3 to 3. At this time, the first discrete offset is determined within the first registration search range of -3 to 3 according to the preset offset step of 1 pixel. That is, the row offset and column offset of the first discrete offset are combined at intervals of 1 pixel within the range of -3 to 3 respectively. For example, the first discrete offset can be (-3, -3), (-3, -2), (-3, -1) …… (3, 3), a total of 49 offsets are selected. Among them, the plus and minus signs represent the offset directions. It should be noted that in the same image, there are often certain repeated patterns. If the size of the search range exceeds the period of the repeated pattern, it is possible to register to an adjacent period under the influence of noise. Therefore, the search range should not exceed the period of the repeated pattern. For example, if the period of the repeated pattern is 2Range, the upper limit of the first registration search range should be less than Range, and the lower limit of the first registration search range should be less than -Range. For example, the first registration search range is -Range to Range.
[0065] In a possible embodiment, moving the image to be registered and / or the reference image based on each first discrete offset in step S21 includes: moving the image to be registered or the reference image alone according to the first discrete offset, or moving the image to be registered and the reference image simultaneously and the relative movement amount between the two is equal to the first discrete offset.
[0066] Specifically, the first discrete offset can be defined as (r1, c1), where r1 represents the row offset of the first discrete offset, and c1 represents the column offset of the first discrete offset. For example, r1 represents a row offset of r1 pixels, and c1 represents a column offset of c1 pixels. And the row offset and column offset in the first discrete offset respectively do not exceed the above first registration search range of -Range to Range. In a possible implementation manner, the method flow of moving the image to be registered or the reference image alone includes: the image to be registered or the reference image moves unidirectionally, as Figure 2 shown, move the image to be registered by (-r1, -c1). It should be noted that it should be understood that the reference image can also be moved by (r1, c1). In another possible implementation manner, moving the image to be registered and the reference image simultaneously includes: the image to be registered and the reference image move bidirectionally. The bidirectional movement can be a face-to-face movement. Preferably, the image to be registered moves half of the offset in the first discrete offset, and the reference image moves the other half of the offset in the first discrete offset. For example, as Figure 3As shown, the image to be registered is moved by (-r1 / 2, -c1 / 2), and the reference image is moved by (r1 / 2, c1 / 2). It should be noted that if the image to be registered and the reference image are moved simultaneously, it is only necessary to ensure that the sum of the offset values of the two is equal to the first discrete offset.
[0067] In one embodiment, calculating the truncation point of the first histogram of each first difference map in step S21 and calculating the first measure value of the corresponding first difference map according to the truncation point in each first histogram may be, for the first histogram of each first difference map, selecting two gray-scale values separated by a preset number of pixels from both ends of the first histogram of the first difference map as the truncation points, and calculating the first measure value according to the truncation points. Specifically, it may include: setting a first percentage of points; obtaining the total number of pixels in the first histogram, and calculating the number of truncation points according to the total number of pixels and the first percentage of points. Then, calculate the first cumulative sum of the number of pixels from one end of the first histogram, and use the gray-scale corresponding to when the first cumulative sum first exceeds the number of truncation points as the left truncation point P1. Calculate the second cumulative sum of the number of pixels from the other end of the first histogram, and use the gray-scale corresponding to when the second cumulative sum first exceeds the number of truncation points as the right truncation point P2. Calculate the first measure value through the left truncation point P1 and the right truncation point P2. It should be noted that the number of points is the number of pixels. The first percentage of points is set according to the noise level of the image, and generally can be set to 0.001 or 0.0015. For example, when the first percentage of points is set to 0.0015, it corresponds to 3sigma = 99.7% in the Gaussian distribution, that is, the total first percentage of points on both sides of the first histogram is 0.003. Then, the number of truncation points at this time can be the total number of gray-scale pixels in the first histogram multiplied by 0.0015; the first measure value is used to evaluate the preset accuracy of the first discrete offset corresponding to each first difference map. Setting several first discrete offsets is to set several estimated values of the actual offsets, and then calculate the accuracy evaluation index of each estimated value. This index can indicate the difference from the first actual offset between the current image to be registered and the reference image. The first actual offset may be the pixel-level offset in the actual offset, denoted as the first measure value. And the smaller the first measure value, the closer the estimated value is to the actual offset, that is, the smaller the difference between the first discrete offset and the first actual offset.
[0068] In one embodiment, one way to calculate the first measure value through the left truncation point P1 and the right truncation point P2 may be: the first measure value is obtained by subtracting P1 from P2; or another way may be: the first measure value is obtained by max(|P1|, |P2|). For the above calculation methods, the calculation method of subtracting P1 from P2 prevents the difference map from being asymmetric, resulting in the generated histogram being asymmetric, so that the deviation of the obtained truncation point is too large and the deviation of the obtained measure value is relatively large; the calculation method of max(|P1|, |P2|) can be applied to the case where the difference between the truncation points is small, that is, the difference map is relatively symmetric and the histogram is relatively symmetric. At this time, only the maximum or minimum value needs to be taken.
[0069] It should be noted that in step S21, the first measure matrix S1 may be defined first according to the first registration search range. The first measure matrix contains multiple first measure values. Specifically, it may include moving the image to be registered and / or the reference image multiple times according to the first discrete offset, and then calculating the corresponding first measure values through the first histograms generated by the first difference maps of the two images after each movement. The first measure value obtained each time is used as an element in the first measure matrix S1. For example, if the first registration search range is -Range to Range and the first preset offset step is 1 pixel, the size of the first measure matrix S1 can be defined as (2*Range + 1)*(2*Range + 1), and the obtained first measure value is the element S1(r1, c1) in the first measure matrix. As Figure 2 and Figure 3 shown, before obtaining the first predicted offset, it is determined whether the first registration search range is traversed, that is, whether all the first discrete offsets are traversed. If so, the first discrete offset corresponding to the minimum value among the multiple first measure values is used as the first predicted offset. If not, the image to be registered and / or the reference image is moved according to the un-traversed first discrete offset until all the first discrete offsets are traversed, and finally the first predicted offset is determined.
[0070] In one embodiment, in step S31, obtaining the actual offset between the image to be registered and the reference image based on the first predicted offset includes: using the first predicted offset as the actual offset between the image to be registered and the reference image. It should be noted that when the sufficient number of first discrete offsets determined according to any of the above embodiments are obtained, the image to be registered and / or the reference image are respectively moved according to the sufficient number of first discrete offsets, so as to obtain a sufficient number of first difference maps and first histograms, and then a sufficient number of first measure values can be calculated. The first discrete offset corresponding to the minimum value selected from the first measure values is used as the first predicted offset. At this time, the first predicted offset can directly represent the true offset between the image to be registered and the reference image, so the first predicted offset can be directly used as the actual offset. Or, when the registration accuracy required for image registration is only pixel-level offset, the first predicted offset selected according to any of the above embodiments can be directly used as the true offset, that is, the first predicted offset is directly used as the actual offset. That is Figure 2 and Figure 3 the pixel-level offset (R0, C0) shown as the actual offset, where R0 represents the row offset of the pixel-level offset and C0 represents the column offset of the pixel-level offset. It should be noted that the first predicted offset is the first discrete offset corresponding to the minimum value in the first measure values. After that, as Figure 2 and Figure 3 shown, the pixel-level offset (R0, C0) is directly used as the actual offset (R, C) between the image to be registered and the reference image. R represents the row offset of the actual offset and C represents the column offset of the actual offset.
[0071] In step S41, resampling refers to the process of interpolating the information of one type of pixel into the information of another type of pixel. Specifically, the image to be registered can be moved and cropped according to the actual offset. It should be noted that during the resampling process, interpolation will be performed according to the actual situation during the translation according to the actual offset.
[0072] The method for calculating the actual offset in the above embodiment can improve the problem of good overall registration results but poor local registration, and at the same time avoid the sampling error caused by interpolating the image, and then avoid the registration error caused by sampling differences.
[0073] Another embodiment of the present invention also discloses another image registration method. As Figure 4 shown, the difference from the above embodiment is that after using the first discrete offset corresponding to the minimum value among the multiple first measure values as the first predicted offset in step S21, it further includes:
[0074] Step S22: Centering on the first predicted offset, set a second registration search range according to the first preset offset step size. Determine a number of second discrete offsets within the second registration search range according to the second preset offset step size. Move the image to be registered and / or the reference image respectively according to each second discrete offset, calculate the second difference map between the image to be registered and the reference image after each movement, and generate the second histogram of each second difference map. Each second difference map corresponds to a second discrete offset. Wherein, the second preset offset step size is smaller than the first preset offset step size. Calculate the truncation point of the second histogram of each second difference map, and calculate the second measure value of the corresponding second difference map according to the truncation point in each second histogram. The second measure value is used to evaluate the preset accuracy of the second discrete offset corresponding to each second difference map. Take the second discrete offset corresponding to the minimum value among the multiple second measure values as the second predicted offset.
[0075] The above step S31 obtains the actual offset between the image to be registered and the reference image based on the first predicted offset, which may specifically include: calculating the sum of the first predicted offset and the second predicted offset to obtain the actual offset between the image to be registered and the reference image.
[0076] Specifically, the second registration search range refers to the range of the second preset offset between the image to be registered and the reference image centered on the first predicted offset. The range of the second preset offset can be denoted as -Z to Z, where the plus and minus signs can represent the direction of the offset. It can be that the second registration search range is set centered on the first predicted offset according to M times of the first preset offset step, where M ≥ 1. It should be noted that the second preset offset also includes a row offset and a column offset. At this time, both the row offset and the column offset are within the range of the second predicted offset and are respectively set according to M times of the first preset offset step. Specifically, it can be that the row offset and the column offset are respectively set by adding and subtracting M times of the first preset offset step. Exemplarily, when the pixel-level offset (R0, C0) is used as the first predicted offset and the first preset offset step is 1 pixel, the second registration search range can be set centered on the pixel-level offset (R0, C0) according to 1 times of the first preset offset step. That is to say, the row offset is obtained by adding and subtracting 1 pixel to get R0 - 1 to R0 + 1, and the column offset is obtained by adding and subtracting 1 pixel to get C0 - 1 to C0 + 1. Therefore, at this time, the second registration search range is that the row offset is within the range of R0 - 1 to R0 + 1, and the column offset is within the range of C0 - 1 to C0 + 1. For example, the first preset offset step is 1 pixel, and the first predicted offset obtained through the above implementation is (1, 1). Generally, the second registration search range is set according to 1 times of the first preset offset step. Therefore, the row offset is set by adding and subtracting 1 pixel to be 0 to 2, and the column offset is set by adding and subtracting 1 pixel to be 0 to 2. Therefore, the second registration search range can be set to be 0 to 2 in the row direction and 0 to 2 in the column direction. At this time, the row direction offset and the column direction offset are respectively within 0 to 2.
[0077] In this embodiment, the second preset offset step refers to the number of pixels to be moved when obtaining each second discrete offset. Since higher-precision image registration is required, the second preset offset step is smaller than the first preset offset step. It should be noted that the area of the second registration search range is upsampled by N times, where N is greater than or equal to 2 and can be up to 100 at most. The second preset offset step can be L / N or a multiple of L / N. L represents the value of the second registration search range, and L is less than N. That is, the second preset offset step can also move by a preset L / N pixels each time. For example, in the calculation of the second discrete offset, the second preset offset step used each time can be the same step. For example, when L is equal to 1, the second preset offset step can be 1 / N pixels. The second preset offset step used each time can also be different steps, such as 1 / N pixels, 2 / N pixels, and 3 / N pixels, etc. The second discrete offset is a plurality of preset offsets selected within the second registration search range according to the second preset offset step. This preset offset can be used as an estimated value of the offset between the second image to be registered and the reference image. If the second preset offset steps are the same, the selected second discrete offset steps are preset offsets with the same pixel interval. If the second preset offset steps are different, the selected second discrete offsets can include preset offsets with different pixel intervals. Here, an example is given with the first preset offset step being 1 pixel for each. For example, the second registration search range -Z to Z obtained by selection can be understood as the row offset being within the range of -Z to Z, and the column offset is also within the range of -Z to Z.When performing 4-fold upsampling on the region in the range of -Z to Z, the set second preset offset step is 1 / 4 pixel. At this time, the second discrete offset is determined according to the second preset offset step of 1 / 4 pixel within the row offset range of -Z to Z and the column offset range of -Z to Z. That is, the row offset and column offset of the second discrete offset are respectively combined at intervals of 1 / 4 pixel within the range of -Z to Z to determine. For example, the second discrete offset can be (-Z, -Z), (-Z, -Z + 1 / 4), (-Z, -Z + 1 / 2), …… (Z, Z), and a total of 81 offsets are selected; for example, when the pixel-level offset (R0, C0) is used as the first predicted offset and the first preset offset step is 1 pixel, the second registration search range can be centered on the pixel-level offset (R0, C0) and set according to 1 times the first preset offset step; that is, the row offset is added and subtracted by 1 pixel to get R0 - 1 to R0 + 1, and the column offset is added and subtracted by 1 pixel to get C0 - 1 to C0 + 1. Therefore, at this time, the second registration search range is that the row offset is within the range of R0 - 1 to R0 + 1, and the column offset is within the range of C0 - 1 to C0 + 1. At this time, 4-fold upsampling is performed on the row offset within the range of R0 - 1 to R0 + 1, and 4-fold upsampling is performed on the column offset within the range of C0 - 1 to C0 + 1. The set second preset offset step is 1 / 4 pixel. At this time, the second discrete offset is determined according to the second preset offset step of 1 / 4 pixel for the row offset in the range of R0 - 1 to R0 + 1 and the column offset in the range of C0 - 1 to C0 + 1 respectively. That is, the row offset and column offset of the second discrete offset are respectively combined at intervals of 1 / 4 pixel within the ranges of R0 - 1 to R0 + 1 and C0 - 1 to C0 + 1 to determine. For example, the second discrete offset can be (R0 - 1, C0 - 1), (R0 - 1, C0 - 3 / 4), (R0 - 1, C0 - 1 / 2), …… (R0 + 1, C0 + 1), and a total of 81 offsets are selected, where the plus and minus signs indicate the offset direction.
[0078] In a possible implementation manner, moving the image to be registered and / or the reference image based on each second discrete offset in step S22 includes: moving the image to be registered or the reference image alone according to the second discrete offset, or moving the image to be registered and the reference image simultaneously, and the relative movement amount between the two is equal to the second discrete offset.
[0079] It can be that, according to any of the above embodiments, the second discrete offset can be defined as (r2, c2), where r2 represents the row offset of the second discrete offset, and c2 represents the column offset of the second discrete offset. For example, r2 represents a row offset of r2 pixels, and c2 represents a column offset of c2 pixels, and both the row offset and the column offset in the second discrete offset do not exceed the above-mentioned second registration search range. Moving the image to be registered or the reference image alone includes: the image to be registered or the reference image moves unidirectionally, and the image to be registered moves (-r2, -c2) or the reference image moves (r2, c2). Moving the image to be registered and the reference image simultaneously includes: the image to be registered and the reference image move bidirectionally, and the bidirectional movement can be a facing movement. Preferably, the image to be registered moves half of the offset in the second discrete offset, and the reference image moves the other half of the offset in the second discrete offset. For example, the image to be registered moves (-r2 / 2, -c2 / 2), and the reference image moves (r2 / 2, c2 / 2), which can ensure simple operation.
[0080] It should be noted that when moving the image to be registered and / or the reference image based on each first discrete offset, or moving the image to be registered and / or the reference image based on each second discrete offset, if it is a bidirectional movement, the influence of sampling differences on registration and resampling can be reduced. Since the images collected by the camera are the discretization of the spatial image of the object after passing through the optical system, the sampling difference refers to the discretization difference when there is a non-integer pixel offset of the object in different imaging processes; in the field of semiconductor detection, especially when detecting defects on a wafer, when scanning the same position multiple times, due to factors such as the control accuracy and speed non-uniformity of the moving stage, there must be slight differences, which lead to the above-mentioned sampling differences. When detecting defects on a wafer, when scanning adjacent chips arranged on the wafer, although the designs of adjacent chips are the same, there must be differences caused by process reasons during manufacturing; on this basis, sampling differences will be superimposed.
[0081] Such as Figure 7As shown in the figure, taking one-dimensional data as an example, the effects of one-way movement and two-way movement on the registration process are given: The left figure shows two sets of data sampled at different positions based on different sine curves, denoted as Curve 1 and Curve 2; The right figure shows the comparison of the sampling errors in two cases. Curve 1 in the right figure is the sampling error when Sine Curve 2 is registered to Sine Curve 1 alone and then one-way resampling is performed. Curve 2 in the right figure is the sampling error when Sine Curve 1 and Sine Curve 2 are registered and then two-way resampling is performed on both; That is, Curve 1 is the error in the positions of the two images after image movement in only one direction under the sine curve, and Curve 2 is the error in the positions of the two images after the two images move towards each other under the sine curve. It can be seen that when moving in two directions, the positions of the two images are more consistent, thereby reducing the sampling difference and the impact on resampling.
[0082] In one embodiment, calculating the truncation points of the second histograms of each second difference map in step S22 and calculating the second measure values of the corresponding second difference maps according to the truncation points in each second histogram may be that, for the second histogram of each second difference map, two gray levels separated by a preset number of pixels are selected from both ends of the second histogram of the second difference map as the truncation points, and the second measure values are calculated according to the truncation points. Specifically, it may include: setting a second point percentage; obtaining the total number of pixels in the second histogram, and calculating the truncation point number according to the total number of pixels and the second point percentage. Calculate the first cumulative sum of the number of pixels from one end of the second histogram, and use the gray level corresponding to when the first cumulative sum first exceeds the truncation point number as the left truncation point. Calculate the second cumulative sum of the number of pixels from the other end of the first histogram, and use the gray level corresponding to when the second cumulative sum first exceeds the truncation point number as the right truncation point. The second measure value is calculated through the left truncation point and the right truncation point. It should be noted that the number of points is the number of pixels. The second point percentage is also set according to the noise level of the image, and generally can also be set to 0.001 or 0.0015. For example, when the second point percentage is set to 0.0015, it corresponds to 3sigma = 99.7% in the Gaussian distribution, that is, a total of 0.003 on both sides of the first point percentage on both sides of the first histogram. At this time, the truncation point number can be the total number of gray-level pixels in the second histogram multiplied by 0.0015. The calculation of the truncation points of the second histogram is similar to the calculation of the truncation points of the first histogram, and the calculation process of the second measure value is similar to the calculation of the first measure value. The second measure value is used to evaluate the preset accuracy of the second discrete offset corresponding to each second difference map. Setting a plurality of second discrete offsets is to set a plurality of estimated values of the actual offsets, and then calculate the accuracy evaluation index of each estimated value. This index can indicate the difference from the second actual offset between the current image to be registered and the reference image. The second actual offset can be the sub-pixel level offset in the actual offset, denoted as the second measure value, and the smaller the second measure value, the closer the corresponding estimated value is to the sub-pixel level offset in the actual offset.
[0083] It should be noted that reference can be made to Figure 8 , where Figure 8 (a) in represents the histogram distribution of the generated difference map. The abscissa represents the gray level value, that is, the brightness level of the pixel, and the ordinate represents the number of pixels, that is, it represents the frequency of each brightness level appearing in the image. Therefore, Figure 7 (a) in can reflect the gray level distribution of the pixels; Figure 8 (b) in represents the histogram distribution of the cumulative value. The abscissa represents the gray level value number, and the ordinate represents the cumulative value of the number of pixels, Figure 8 (b) in reflects the cumulative number of pixels where different gray level values appear in the image. Figure 8 (c) in represents Figure 8In (a) thereof, the histogram distribution of the generated difference map is analyzed to determine the left truncation point P1 and the right truncation point P2. It should be understood that Figure 8 The calculation of the histogram shown is obtained by subtracting the image to be registered and the reference image after each movement. Filtering can be performed during subtraction, and the filtering methods include Gaussian filtering and / or mean filtering. The granularity of the histogram is controlled within 0.5 gray levels or below, and generally may reach 0.1 gray level; the percentage of points is set according to the noise level of the image, and generally can be set to 0.001 or 0.0015, corresponding to 3sigma = 99.7% in the Gaussian distribution, with a total of 0.003 on both sides. The percentage of points can be set with reference to the Gaussian distribution value. The measurement value comprehensively utilizes the left truncation point and the right truncation point, avoiding the situation where the overall registration result is good but the local registration is poor. It should be noted that the difference map is, for example, the first difference map and the second difference map. The histogram is, for example, the first histogram or the second histogram, and the percentage of points is, for example, the first percentage of points or the second percentage of points. The measurement value is, for example, the first measurement value and the second measurement value.
[0084] In step S22, the second measurement matrix S2 can be defined first according to the second registration search range. The second measurement matrix contains multiple second measurement values. It can include moving the image to be registered and / or the reference image multiple times according to the second discrete offset, and then calculating the corresponding second measurement values through the second histogram generated corresponding to the second difference map of the two images after each movement. The second measurement value obtained each time is used as an element in the second measurement matrix S2. For example, when the second registration search range is set from -Z to Z and N times upsampling is performed to define the second measurement matrix S2, the size of the second measurement matrix S2 is (2*N + 1)*(2*N + 1). The obtained second measurement value is the element S2(r2, c2) in the second measurement matrix S2. Before obtaining the second predicted offset, each element in the second measurement matrix S2 is calculated, and the second discrete offset corresponding to the minimum value among the multiple second measurement values is used as the second predicted offset, and the second predicted offset is used as the actual offset between the image to be registered and the reference image. The smaller the second measurement value, the closer the corresponding second discrete deviation is to the actual offset, which can improve the accuracy of image registration. For example, in the case of high-precision requirements, after finding the first predicted offset, the second predicted offset is searched, that is, after finding the pixel-level offset, the sub-pixel-level offset is also searched.
[0085] Furthermore, in step S31 of the embodiment, the sum of the first predicted offset and the second predicted offset is calculated to obtain the actual offset between the image to be registered and the reference image. For example, as Figure 5 and Figure 6 shown, when the sub-pixel-level offset (R s , C s)As the second predicted offset, R s represents the row offset of the sub-pixel level offset, C s represents the column offset of the sub-pixel level offset. Then, based on the pixel level offset (R0, C0) calculated in any of the above embodiments as the first predicted offset, calculate the sum of the first predicted offset and the second predicted offset, that is, calculate the sum of the pixel level offset (R0, C0) and the sub-pixel level offset (R s , C s ) to obtain the actual offset between the image to be registered and the reference image.
[0086] In one embodiment, after using the second discrete offset corresponding to the minimum value among the multiple second measure values as the second predicted offset in step S22, it further includes determining whether the second predicted offset is less than a preset threshold; if so, proceed to step S31; if not, use the sum of the first predicted offset and the second predicted offset as the updated first predicted offset, and with the updated first predicted offset as the center, re-execute step S22. The preset threshold is, for example, 0.01 pixel.
[0087] Among them, the actual offset (R, C) in step S31 = (R0, C0) + (R s , C s ).
[0088] As Figure 9 shown, it is an example of the image to be registered and a reference image, and there is a sub-pixel offset between them. Most of the image is vertical line pairs, with only a horizontal gradient, and the vertical gradient is close to zero. The vertical gradient can be understood as being caused only by process errors or noise, so it is not conducive to vertical registration; while the area with both horizontal and vertical gradients accounts for a relatively small proportion, which is beneficial to registration. This part can be Figure 9 the inclined part, and the method involved in the present invention can avoid poor registration effects caused by the insensitivity of most of the image area to the offset, such as the insensitivity in the longitudinal extension direction in this example.
[0089] As Figure 10 shown, it is the first measure matrix S1 and the second measure matrix S2 of the image to be registered and the reference image selected according to the present invention Figure 9 shown. The “+” marks the minimum position in the measure matrix. The offsets corresponding to the minimum positions in S1 and S2 are the pixel level offset and the sub-pixel level offset respectively. That is, in the method of the present application, in an image where it is not easy to find the offset, the pixel level offset and the sub-pixel level offset can also be found.
[0090] The present invention avoids the situation where the overall registration result is good but the local registration is poor, and also avoids the registration error caused by sampling differences. Therefore, a registration result with higher accuracy can be obtained, and the detection sensitivity can be further improved.
[0091] An embodiment of the present invention also discloses an image detection method, which is characterized in that, as Figure 11 shown, it includes the following steps:
[0092] Step T1: Obtain a test image and at least one reference image.
[0093] Step T2: Segment the test image and at least one reference image according to a preset size and overlapping area respectively, to obtain multiple blocks of the test image and multiple blocks of each reference image. Take the multiple blocks in the test image as multiple images to be registered, take the multiple blocks in each reference image as multiple reference images, and the multiple images to be registered correspond to the multiple reference images one by one. Use the image registration method of the above embodiment to obtain the actual offset between each image to be registered and the reference image corresponding to each image to be registered and perform resampling. Among them, the moving modes of the resampled images to be registered and the reference images are similar to the moving modes in the registration process.
[0094] Step T3: Calculate the difference map between each resampled image to be registered and the corresponding reference image, obtain the defect detection result of each block according to the difference map, and obtain the defect detection result of the test image relative to the reference image according to the defect detection results of all blocks.
[0095] In one embodiment, when the device is running and the system performance fails to meet the detection requirements, relevant signals need to be obtained in a timely manner and the current detection needs to be stopped. In step T2, after obtaining the actual offset in the registration using the image registration method of the above embodiment, it further includes: determining each actual offset, and if it is found that any of the actual offsets exceeds the index, an abnormal result is output and the detection is aborted. For example, detection is performed in a polling manner at a preset time interval. In real-time detection, when the performance of the moving stage deteriorates from a certain moment, resulting in the actual mutual offset in a certain group of images exceeding the search range, the registration result at this time is incorrect, which will lead to a large number of false detections; and it is very likely that the performance of the moving stage will be difficult to recover to the normal state thereafter, and the subsequent detection results should not reflect the normal situation of the sample to be tested. Therefore, it is necessary to remind the system to make corresponding processing, such as aborting or alarming, etc.; the system will check its own performance and status at a certain frequency and will abort the task in a timely manner when there are problems with the performance or status. In addition, in the above method flow, when the registration result exceeds the expectation, for example, it is found that the minimum value of the first measurement matrix S1 or the second measurement matrix S2 falls on the outermost edge, it means that the first measurement matrix S1 or the second measurement matrix S2 is no longer sufficient to include the position of the actual minimum value, and a reliable detection result cannot be obtained. At this time, the detection task needs to be aborted in a timely manner; another possibility for the registration result to exceed the expectation is that the detection task is distributed incorrectly. For example, different images are distributed to a group for registration, but this reason will also lead to an inability to obtain a reliable detection result, and the detection task also needs to be aborted in a timely manner.
[0096] The detection method further includes step T4: obtaining multiple reference images, and repeatedly executing step T2 and step T3 to traverse each reference image to obtain the defect detection results of the test image relative to each reference image.
[0097] Step T5: Comparing the detection results of the test image relative to each reference image, and when the defect appears in the detection results of the test image relative to more than one reference image, the defect is regarded as a real defect.
[0098] The detection method further includes step T6: taking the test image and multiple reference images as a group of images, obtaining multiple groups of images, and repeatedly executing steps T1 to T5 to traverse each group of images to obtain the defect detection results of the test image relative to each reference image in each group of images.
[0099] In specific applications, in order to determine which area has a defect, differential comparison can be performed with three or more areas as a group. Exemplarily, such as Figure 12As shown, obtain Image 0, Image 1, Image 2, and Image 3. Register Image 0 and Image 1, and calculate the actual offset as (dr1, dc1) according to the above method; register Image 0 and Image 2, and calculate the actual offset as (dr2, dc2) according to the above method; register Image 0 and Image 3, and calculate the actual offset as (dr3, dc3) according to the above method. For a set of images consisting of Image 0 and Image 1, resample Image 0 according to (-dr1 / 2, -dc1 / 2), resample Image 1 according to (dr1 / 2, dc1 / 2), and obtain the difference Figure 1 , then complete the filtering to obtain the filtered difference Figure 1 , and then perform defect detection to obtain Defect List 1. For a set of images consisting of Image 0 and Image 2, resample Image 0 according to (-dr2 / 2, -dc2 / 2), resample Image 2 according to (dr2 / 2, dc2 / 2), and obtain the difference Figure 2 , then complete the filtering to obtain the filtered difference Figure 2 , and then perform defect detection to obtain Defect List 2. For a set of images consisting of Image 0 and Image 3, resample Image 0 according to (-dr3 / 2, -dc3 / 2), resample Image 2 according to (dr3 / 2, dc3 / 2), and obtain the difference Figure 3 , then complete the filtering to obtain the filtered difference Figure 3 , and then perform defect detection to obtain Defect List 3. Finally, compare the defects in Defect List 1, Defect List 2, and Defect List 3, take the defects that appear commonly as the target defects, and then generate the final defect list including the target defects. It should be understood that before resampling each set of images, each set of images can also be segmented according to the preset size and overlapping area according to the above step T2 to obtain the blocks of each image. Then, each block in Image 1, Image 2, and Image 3 is used as the image to be registered, each block in Image 0 is used as the reference image, and then the actual offset between each image to be registered and the corresponding reference image is obtained by using the image registration method of the above embodiment and resampled.
[0100] As Figure 13 shown, the sample to be tested placed on the moving stage can be a wafer. In the wafer 100( Figure 12(only a part is schematically shown), the scanning area 102 is the area of one row when scanning with a TDI camera. The first chip 104, the second chip 106, the third chip 108, and the fourth chip 110 are adjacent chips formed on the wafer, and these four chips are chips with the same design. The first scanning area 105, the second scanning area 107, the third scanning area 109, and the fourth scanning area 111 are the areas within the scanning row of the scanning area 102 in the first chip 104, the second chip 106, the third chip 108, and the fourth chip 110 respectively. When it is necessary to detect the image of the second scanning area 107, the image of the second scanning area 107 is the test image, and the three area images of the first scanning area 105, the third scanning area 109, and the fourth scanning area 111 are used as the reference images. The final defect detection result is obtained by performing image detection according to the above image detection steps. For example, when there are obvious differences in a certain place between the area image of the second scanning area 107 and the area images of the first scanning area 105, the third scanning area 109, and the fourth scanning area 111, it is considered that there is a defect in that place in the area image of the second scanning area 107.
[0101] The present invention no longer interpolates the offset of each row by using the offsets obtained by segmented calculations, but directly uses the difference map for detection. Therefore, it can avoid the influence of the offset of a certain row by the offsets during adjacent segment registration. Therefore, a higher-precision registration result can be obtained, and then the detection sensitivity can be improved. Moreover, the processing method for the images in the same group is double-checking. A defect at a certain position is considered a real defect only when all the defects at that position appear or appear at least twice. The present invention provides a means for judging whether the system performance is abnormal, which can effectively avoid the time loss caused by continuing detection when the system is abnormal. When performing registration, if it is found that the extreme value of the relevant measure appears at the outermost periphery calculated, it not only indicates the risk of error in this registration, but also indicates the abnormal system state at this moment.
[0102] Although the embodiments of the present invention have been described in detail above, it is obvious to those skilled in the art that various modifications and changes can be made to these embodiments. However, it should be understood that such modifications and changes are all within the scope and spirit of the present invention described in the claims. Moreover, the present invention described herein may have other embodiments and can be implemented or realized in various ways.
Claims
1. An image registration method, characterized in that, It includes the following steps: Step S11: Obtain the image to be registered and the reference image; Step S21: Set the first registration search range between the image to be registered and the reference image, and determine a number of first discrete offsets within the first registration search range according to a first preset offset step size. Move the image to be registered and / or the reference image respectively based on each of the first discrete offsets, calculate the first difference map between the image to be registered and the reference image after each movement, and generate a first histogram for each of the first difference maps. Each of the first difference maps corresponds to one of the first discrete offsets; Calculate the truncation point of the first histogram of each of the first difference maps, and calculate the first measure value of the corresponding first difference map according to the truncation point in each of the first histograms. The first measure value is used to evaluate the preset accuracy of the first discrete offset corresponding to each of the first difference maps; Take the first discrete offset corresponding to the minimum value among the multiple first measure values as the first predicted offset; Step S31: Obtain the actual offset between the image to be registered and the reference image based on the first predicted offset; Step S41: Resample the image to be registered and the reference image according to the actual offset.
2. The image registration method according to claim 1, wherein Step S31: Obtain the actual offset between the image to be registered and the reference image based on the first predicted offset, including: Take the first predicted offset as the actual offset between the image to be registered and the reference image.
3. The image registration method according to claim 1, characterized in that After taking the first discrete offset corresponding to the minimum value among the multiple first measure values as the first predicted offset in the step S21, it further includes: Step S22: Set the second registration search range centered on the first predicted offset according to the first preset offset step size. Determine a number of second discrete offsets within the second registration search range according to a second preset offset step size. Move the image to be registered and / or the reference image respectively according to each of the second discrete offsets, calculate the second difference map between the image to be registered and the reference image after each movement, and generate a second histogram for each of the second difference maps. Each of the second difference maps corresponds to one of the second discrete offsets, where the second preset offset step size is smaller than the first preset offset step size; Calculate the truncation point of the second histogram of each of the second difference maps, and calculate the second measure value of the corresponding second difference map according to the truncation point in each of the second histograms. The second measure value is used to evaluate the preset accuracy of the second discrete offset corresponding to each of the second difference maps; Take the second discrete offset corresponding to the minimum value among the multiple second measure values as the second predicted offset; The step S31 obtains the actual offset between the image to be registered and the reference image based on the first predicted offset, including: Calculate the sum of the first predicted offset and the second predicted offset to obtain the actual offset between the image to be registered and the reference image.
4. The image registration method according to claim 3, wherein After taking the second discrete offset corresponding to the minimum value among the multiple second measurement values as the second predicted offset in the step S22, it further includes determining whether the second predicted offset is less than a preset threshold; If so, enter the step S31; If not, take the sum of the first predicted offset and the second predicted offset as the updated first predicted offset, and re - execute the step S22 with the updated first predicted offset as the center.
5. The image registration method according to claim 1, wherein The first preset offset step in the step S21 includes any one or more of 0.1 pixel to 3 pixels.
6. The image registration method according to claim 1, wherein In the step S21, calculating the truncation point of the first histogram of each first difference map and calculating the first measurement value of the corresponding first difference map according to the truncation point in each first histogram includes: Set a first percentage of points; Obtain the total number of pixels in the first histogram, and calculate the number of truncation points according to the total number of pixels and the first percentage of points; Calculate the first cumulative sum of the number of pixels from one end of the first histogram, and take the gray level corresponding to when the first cumulative sum first exceeds the number of truncation points as the left truncation point P1; Calculate the second cumulative sum of the number of pixels from the other end of the first histogram, and take the gray level corresponding to when the second cumulative sum first exceeds the number of truncation points as the right truncation point P2; Calculate the first measurement value through the left truncation point P1 and the right truncation point P2.
7. The image registration method according to claim 6, wherein The calculating the first measurement value through the left truncation point P1 and the right truncation point P2 includes that the first measurement value is obtained by subtracting P1 from P2; or the first measurement value is obtained by max(|P1|, |P2|).
8. An image detection method, characterized in that, It includes the following steps: Step T1: Obtain a test image and at least one reference image; Step T2: Segment the test image and at least one reference image according to a preset size and overlapping area respectively, to obtain multiple blocks of the test image and multiple blocks of each reference image. Take the multiple blocks in the test image as multiple images to be registered, take the multiple blocks in each reference image as multiple reference images, and the multiple images to be registered correspond to the multiple reference images in each reference image one by one. Use the image registration method according to any one of claims 1 - 7 to obtain the actual offset between each image to be registered and the corresponding reference image and perform resampling; Step T3: Calculate the difference map between each image to be registered after resampling and the corresponding reference image, obtain the defect detection result of each block according to the difference map, and obtain the defect detection result of the test image relative to the reference image according to the defect detection results of all blocks.
9. The image detection method according to claim 8, wherein In the step T2, after obtaining the actual offset in the registration using the image registration method according to any one of claims 1 - 7, it further includes: determining each actual offset, and if it is found that there is an offset exceeding the index among the actual offsets, output an abnormal result and abort the detection.
10. The image detection method according to claim 8, wherein The detection method further includes step T4: obtaining a plurality of the reference images, looping step T2 and step T3, traversing each of the reference images, and obtaining the defect detection results of the test image relative to each of the reference images; Step T5: comparing the detection results of the test image relative to each of the reference images, and when a defect appears in the detection results of the test image relative to more than one of the reference images, the defect is regarded as a real defect.
11. The image detection method according to claim 10, wherein, The detection method further includes step T6: taking the test image and a plurality of the reference images as a group of images, obtaining multiple groups of images, looping step T1 to step T5, traversing each group of images, and obtaining the defect detection results of the test image relative to each reference image in each group of images.