Image detection method, detection device and storage medium

CN117392046BActive Publication Date: 2026-09-08SKYVERSE TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202210772634.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-30
Publication Date
2026-09-08
Estimated Expiration
2042-06-30

AI Technical Summary

Technical Problem

[0004]这种检测方式虽然可以满足一些场景的检测需求,但是存在一些晶圆体图像不同的区域灰度值变化幅度很大的情况,这就容易出现不良特征的漏检和误检情形发生

Benefits of technology

[0034] According to the above embodiments, an image detection method, detection device, and storage medium are disclosed. The image detection method includes a process of acquiring a test image and a target reference image of the object under test, and a process of comparing the test image and the target reference image to obtain a comparison result of whether suspicious image features exist. The technical solution has improved the acquisition of the test image, the acquisition of the target reference image, and the image feature comparison, which can reduce the influence of grayscale differences between the test image and the target reference image, and also achieve pixel-level detection requirements between the test image and the target reference image.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117392046B_ABST
    Figure CN117392046B_ABST
Patent Text Reader

Abstract

The application relates to an image detection method and a detection device and a storage medium, wherein the image detection method comprises an acquisition process of a to-be-detected image of a detected object and a target reference image, and a comparison process of the to-be-detected image and the target reference image to obtain a comparison result of whether there is a suspicious image feature. The technical scheme is improved in the acquisition of the to-be-detected image, the acquisition of the target reference image and the comparison of the image features, can reduce the influence of the gray difference between the to-be-detected image and the target reference image, can realize the pixel-level detection requirement between the to-be-detected image and the target reference image, and can avoid the missed detection or false detection caused by the gray scale difference, so that the accuracy of the image detection of the wafer and the like products is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing technology, specifically to an image detection method, detection device, and storage medium. Background Technology

[0002] In chip manufacturing, advanced manufacturing processes mean processing more complex integrated circuit layouts, and complex integrated circuit layouts also require more sophisticated testing technologies to determine whether the layout products are qualified. Integrated circuit testing technology has been driving the improvement of semiconductor process technology, thereby continuously improving the product yield.

[0003] In industrial inspection, to detect defects on the die surface of wafers, such as foreign objects and scratches, the common method is to first select a qualified wafer image, then select a portion of the qualified wafer images from the selected wafer image, and finally generate a standard reference wafer image using the selected wafer images. During inspection, each wafer image to be tested is compared with the reference wafer image. If the grayscale difference between the wafer image to be tested and the reference wafer image exceeds a preset threshold, the area is considered defective and is marked for further processing.

[0004] While this detection method can meet the needs of some scenarios, there are instances where the grayscale values ​​vary significantly across different regions of the wafer image. This can easily lead to missed or false detections of defective features. This is because, due to limitations in the manufacturing process, it's impossible to achieve completely uniform optical properties across all wafer surfaces. Therefore, wafer images taken from different wafers will exhibit some grayscale differences, resulting in threshold deviations and inevitably causing missed or false detections. Summary of the Invention

[0005] The main technical problem addressed in this application is how to improve the accuracy of wafer image inspection. To solve the above technical problem, this application proposes an image inspection method, an inspection device, and a storage medium.

[0006] According to a first aspect, an image detection method is provided, comprising: acquiring a test image of a target object and a target reference image; comparing the test image and the target reference image to obtain a comparison result of whether there are suspicious image features, wherein the suspicious image features are image features that differ between the target reference image and the test image.

[0007] In one embodiment, acquiring the target reference image of the object under test includes: acquiring multiple reference images; selecting one reference image from the multiple reference images as the target reference image, wherein the difference between the average gray level of the target reference image and the average gray level of the image under test is less than that of the other reference images.

[0008] In one embodiment, the plurality of reference images includes a first reference image and a third reference image; the proximity of the average gray value of the image to be tested to the average gray value of the first reference image and the third reference image is determined, and the reference image with the highest proximity is selected as the target reference image; the image to be tested is compared with the target reference image to obtain a comparison result of whether there are suspicious image features; wherein, the average gray value of the first reference image is greater than the average gray value of the third reference image.

[0009] In one embodiment, the process of acquiring the image to be tested includes: acquiring multiple first initial images of the object to be tested; selecting one of the first initial images as a reference, and aligning the remaining first initial images with the first initial image used as the reference, so that the pixels of each first initial image have a one-to-one correspondence; selecting a group of pixels with the same correspondence in each first initial image as a first pixel group, and sorting the gray values ​​of each pixel in the first pixel group from smallest to largest to obtain a first pixel sorting result; in the first pixel sorting result, weighting a first proportion of gray values ​​to obtain a gray weighting value, and setting the gray weighting value as the gray value to be tested for the pixels with the same correspondence in the image to be tested; and obtaining the gray value to be tested for each pixel in the image to be tested to obtain the image to be tested of the object to be tested.

[0010] In one embodiment, the process of acquiring each reference image includes: acquiring multiple second initial images of the object under test; selecting one of the second initial images as a reference, and aligning the remaining second initial images with the reference second initial image to ensure a one-to-one correspondence between the pixels in each second initial image; selecting a group of pixels with the same correspondence in each second initial image as a second pixel group, and sorting the gray values ​​of each pixel in the second pixel group from smallest to largest to obtain a second pixel sorting result; in the second pixel sorting result, weighting the gray values ​​of a second proportion to obtain a gray weighting value, and setting the gray weighting value as the reference gray value of a pixel with the same correspondence in a reference image, and acquiring a reference gray value for each pixel in the reference image; selecting a reference image as the target reference image from multiple reference images includes: acquiring a second proportion of reference images that is the same as a first proportion of reference images as the target reference image.

[0011] In one embodiment, the process of acquiring each reference image includes: acquiring multiple second initial images of the object under test; sorting the multiple second initial images by average gray level to obtain an image sorting result; selecting a second initial image in a preset order from the image sorting result as a corresponding reference image; or, selecting a preset proportion of second initial images from the image sorting result, and performing image gray level averaging on the preset proportion of second initial images to obtain a corresponding reference image.

[0012] In one embodiment, acquiring the target reference image includes: acquiring multiple reference images, wherein the target reference image is one of the multiple reference images; the step of comparing the image to be tested with the target reference image to obtain a comparison result of whether there are suspicious image features includes: acquiring the difference between corresponding pixels in the two reference images to obtain a set of reference differences corresponding to each pixel; setting an upper limit change amount for each pixel in the image to be tested based on at least one set of reference differences; setting a lower limit change amount for each pixel in the image to be tested based on at least one set of reference differences; determining the grayscale threshold range of corresponding pixels in the image to be tested based on the target reference image, the upper limit change amount, and the lower limit change amount; and traversing all pixels in the image to be tested to determine whether there are suspicious image features based on whether each pixel exceeds the corresponding grayscale threshold range.

[0013] In one embodiment, the step of traversing all pixels of the image to be tested and determining whether there are suspicious image features based on whether each pixel exceeds the corresponding grayscale threshold range includes: traversing all pixels of the image to be tested and determining whether each pixel exceeds the corresponding grayscale threshold range; if so, then: taking the pixels that exceed the grayscale threshold range as suspicious pixels, and determining the suspicious image features in the image to be tested based on some or all of the suspicious pixels.

[0014] In one embodiment, the image detection method further includes: aligning the target reference image and the image to be tested with pixel positions, such that a one-to-one correspondence is formed between the target reference image and the image to be tested at the pixel alignment positions; wherein, determining the grayscale threshold range of the corresponding pixel in the image to be tested based on the target reference image and the upper limit change amount and the lower limit change amount includes: obtaining the lower threshold of the grayscale threshold range based on a linear combination of the target reference image and the lower limit change amount, and obtaining the upper threshold of the grayscale threshold range based on a linear combination of the target reference image and the upper limit change amount; wherein, traversing all pixels in the image to be tested and determining whether each pixel exceeds the corresponding grayscale threshold range includes: comparing the grayscale value of each pixel in the image to be tested with the grayscale threshold range, and determining the pixel as a suspicious pixel if the grayscale value of the pixel is less than the lower threshold or greater than the upper threshold.

[0015] In one embodiment, determining suspicious image features in the image under test based on some or all of the suspicious pixels includes: constructing a suspicious pixel marker map with the same pixel size as the image under test based on some or all of the suspicious pixels in the image under test; searching for pixel connected regions in the suspicious pixel marker map and calculating the geometric size of the pixel connected regions; comparing the geometric size with a region threshold, and if the geometric size is greater than or equal to the region threshold, determining the pixel connected region as a suspicious image feature.

[0016] In one embodiment, the plurality of reference images includes a first reference image, a second reference image, and a third reference image; the average gray value of the first reference image is greater than the average gray value of the second reference image, and the average gray value of the second reference image is greater than the average gray value of the third reference image; wherein, the step of setting a lower limit change amount for each pixel of the image to be tested based on at least one set of the reference differences includes: linearly changing the reference differences of corresponding pixels in the second reference image and the first reference image to obtain the lower limit change amount; wherein, the step of setting a lower limit change amount for each pixel of the image to be tested based on at least one set of the reference differences includes: linearly changing the reference differences of corresponding pixels in the second reference image and the first reference image to obtain the lower limit change amount; Setting upper limit change amounts includes: linearly changing the difference between corresponding pixels in the third reference image and the second reference image to obtain the upper limit change amount; wherein, determining the grayscale threshold range of corresponding pixels in the image to be tested based on the target reference image, the upper limit change amount, and the lower limit change amount includes: obtaining the lower threshold based on the reference difference between the grayscale of the corresponding pixel in the target reference image and the lower limit change amount; obtaining the upper threshold based on the sum of the grayscale of the corresponding pixel in the target reference image and the upper limit change amount, wherein the upper threshold and the lower threshold constitute the threshold range.

[0017] In one embodiment, obtaining the lower threshold of the grayscale threshold range based on a linear combination of the target reference image and the lower limit change includes: calculating the grayscale difference between each pixel in the second reference image and the corresponding pixel in the first reference image, denoted as a1; calculating the lower limit change based on a1 and expressing it as a1*k+B; calculating the lower threshold of the first grayscale threshold range based on the lower limit change, expressed by the formula y1=x3-a1*kB; obtaining the upper threshold of the grayscale threshold range based on a linear combination of the target reference image and the upper limit change includes: calculating the upper threshold of the grayscale threshold range for each pixel in the third reference image. The grayscale difference between the corresponding pixel in the second reference image and the grayscale value in the third reference image is denoted as a2. The upper limit change is calculated based on a2 and expressed as a2*k+B′. The upper limit of the first grayscale threshold range is calculated based on the upper limit change, expressed by the formula y2=x3+a2*k+B′. Here, x3 is the grayscale value of the pixel in the third reference image corresponding to each pixel in the second reference image, and k, B, k′, and B are all process parameters. The first grayscale threshold range is the grayscale threshold range corresponding to the third reference image. If the target reference image is the third reference image, the first grayscale threshold range is used for calculation.

[0018] In one embodiment, obtaining the lower threshold of the grayscale threshold range based on a linear combination of the target reference image and the lower limit change includes: calculating the grayscale difference between each pixel in the second reference image and the corresponding pixel in the first reference image, denoted as a1; calculating the lower limit change based on a1 and expressing it as a1*k+B; calculating the lower threshold of the second grayscale threshold range based on the lower limit change, expressed by the formula z1=x1-a1*kB; obtaining the upper threshold of the grayscale threshold range based on a linear combination of the target reference image and the upper limit change includes: calculating the upper threshold of the grayscale threshold range for each pixel in the third reference image. The grayscale difference between the corresponding pixel in the first reference image and the second reference image is denoted as a2; the upper limit change is calculated based on a2 and expressed as a2*k+B′; the upper limit of the second grayscale threshold range is calculated based on the upper limit change, expressed by the formula z2=x1+a2*k+B′; where x1 is the grayscale value of the pixel corresponding to each pixel in the first reference image and the second reference image, and k, B, k′, and B′ are all process parameters; where the second grayscale threshold range is the grayscale threshold range corresponding to the first reference image; if the target reference image is the first reference image, the second grayscale threshold range is used for calculation.

[0019] In one embodiment, the process of acquiring the first reference image, the second reference image, and the third reference image includes: acquiring multiple second initial images of the object under test; selecting one of the second initial images as a reference, and aligning the remaining second initial images with the reference second initial image pixel by pixel, so that the pixels of each second initial image have a one-to-one correspondence; selecting a group of pixels with the same correspondence in each second initial image as a second pixel group, and sorting the gray values ​​of each pixel in the second pixel group from smallest to largest to obtain a second pixel sorting result; calculating a first gray-level weighted value based on a first preset number of gray values ​​in the second pixel sorting result, and setting the first gray-level weighted value as the pixel with the same correspondence in the first reference image. The first reference image is obtained by acquiring the corresponding reference gray values ​​for each pixel in the first reference image; a second gray-level weighted value is calculated based on a second preset number of gray values ​​in the second pixel sorting result, and the second gray-level weighted value is set as the reference gray value for pixels with the same correspondence in the second reference image; the second reference image is obtained by acquiring the corresponding reference gray values ​​for each pixel in the second reference image; a third gray-level weighted value is calculated based on a third preset number of gray values ​​in the pixel sorting result, and the third gray-level weighted value is set as the reference gray value for pixels with the same correspondence in the third reference image; the third reference image is obtained by acquiring the corresponding reference gray values ​​for each pixel in the third reference image.

[0020] In one embodiment, the first preset quantity, the second preset quantity, and the third preset quantity all include the corresponding number of gray values ​​that are ranked first in the pixel sorting result, and satisfy the condition that the first preset quantity is less than the second preset quantity, and the second preset quantity is less than the third preset quantity; or, the first preset quantity, the second preset quantity, and the third preset quantity all include the corresponding number of gray values ​​that are ranked last in the pixel sorting result, and satisfy the condition that the first preset quantity is greater than the second preset quantity, and the second preset quantity is greater than the third preset quantity.

[0021] In one embodiment, before comparing the image to be tested and the target reference image, the detection method further includes: searching for difference pixels with grayscale differences between the image to be tested and the target reference image; dividing the difference pixels into regions to obtain at least one grayscale difference region, wherein the grayscale of each pixel in any grayscale difference region is greater than or less than the grayscale of each pixel in another grayscale difference region; obtaining a second difference value for the grayscale difference region based on the grayscale difference between the image to be tested and the target reference image in the grayscale difference region; and performing second grayscale compensation on the grayscale difference region in the image to be tested and / or the target reference image corresponding to the second difference value based on the second difference value, so that the grayscale of the grayscale difference region in the image to be tested and the target reference image is the same.

[0022] In one embodiment, searching for difference pixels with grayscale differences between the image to be tested and the target reference image includes: aligning the pixel positions of the image to be tested and the target reference image to establish a one-to-one correspondence between the pixels at the aligned positions; comparing the grayscale values ​​of the corresponding pixels in the image to be tested and the target reference image; if the grayscale value of any pixel in the image to be tested is greater than the grayscale value of a corresponding pixel in the target reference image, counting the corresponding pixels in the image to be tested and / or counting the corresponding pixels in the target reference image; and defining the grayscale difference region formed by the counted one or more pixels as the grayscale difference region between the image to be tested and / or the target reference image. A first grayscale difference region of the image; in the first grayscale difference region, the grayscale difference of each pixel is counted and a first weighted value is calculated, and the first weighted value is used as the second difference value corresponding to the first grayscale difference region; and / or, if the grayscale value of any pixel in the image to be tested is less than the grayscale value of a corresponding pixel in the target reference image, the pixels in the image to be tested and / or the corresponding pixels in the target reference image are counted; the grayscale difference region formed by the counted one or more pixels is recorded as the second grayscale difference region of the image to be tested and / or the target reference image; in the second grayscale difference region, the grayscale difference of each pixel is counted and a second weighted value is calculated, and the second weighted value is used as the second difference value corresponding to the second grayscale difference region.

[0023] In one embodiment, the step of performing second gray-level compensation on the gray-level difference region corresponding to the second difference in the image under test and / or the target reference image based on the second difference includes: for a first gray-level difference region in the image under test and / or the target reference image, subtracting the first weighting value from each pixel in the first gray-level difference region to obtain a first form of gray-level compensation for the image under test and / or the target reference image; for a second gray-level difference region in the image under test and / or the target reference image, adding the second weighting value to each pixel in the second gray-level difference region to obtain a second form of gray-level compensation for the image under test and / or the target reference image; and achieving the second gray-level compensation of the image under test and / or the target reference image through the first form of gray-level compensation and / or the second form of gray-level compensation.

[0024] In one embodiment, before performing the second grayscale compensation, the method further includes: obtaining a first difference based on the grayscale values ​​of each pixel in the target reference image and the image to be tested, wherein the first difference is equal to the difference between the median grayscale value of each pixel in the target reference image and the median grayscale value of each pixel in the image to be tested, wherein the median is a weighted value or median; and performing a first grayscale compensation on the image to be tested and / or the target reference image based on the first difference, so that the median grayscale values ​​of the image to be tested and the target reference image are the same.

[0025] In one embodiment, the grayscale compensation of the image to be tested and / or the target reference image based on the first difference includes: adding or subtracting the first difference to the grayscale value of each pixel in the image to be tested and / or the target reference image, and obtaining a first compensated image by updating the grayscale value of each pixel in the image to be tested and / or the target reference image.

[0026] In one embodiment, the comparison processing of the image to be tested and the target reference image further includes: if the comparison result indicates the existence of the suspicious image features, then replacing the target reference image with the image to be tested; the image detection method further includes: acquiring the target image to be tested of the object to be tested; after comparing the image to be tested and the target reference image, the method further includes: comparing the target image to be tested with the target reference image to determine whether there is defect information in the target image to be tested, and if so, acquiring the defect information in the target image to be tested.

[0027] In one embodiment, the number of target reference images is multiple; comparing the target image to be tested with the target reference images includes: obtaining the target reference image with the smallest difference in grayscale mean with the target image to be tested as a comparison image; performing threshold comparison on the grayscale of corresponding pixels in the comparison image and the target image to be tested respectively, and identifying pixels whose grayscale difference is greater than a preset threshold as defect points.

[0028] According to a second aspect, a detection device is provided, comprising: a memory for storing a test image and a reference image of a test object; and a processor connected to the memory for detecting the test image using the image detection method described in the first aspect, obtaining a comparison result of whether suspicious image features exist, and outputting the comparison result.

[0029] In one embodiment, the processor includes: a first acquisition module for acquiring a plurality of reference images; a selection module for selecting one reference image from the plurality of reference images as the target reference image; and a comparison module for comparing the image to be tested with the target reference image to obtain a comparison result of whether there are suspicious image features; wherein the difference between the average gray level of the target reference image and the average gray level of the image to be tested is smaller than that of the other reference images.

[0030] In one embodiment, the detection device further includes an imaging module for acquiring multiple first initial images of the object under test; the processor is further configured to generate the image to be tested, the processor comprising: a second acquisition module for acquiring multiple first initial images of the object under test; a first alignment module for selecting one of the first initial images as a reference, and aligning the remaining first initial images pixel-wise with the reference first initial image, so that the pixels of each first initial image have a one-to-one correspondence; a first sorting module for selecting a group of pixels with the same correspondence in each first initial image as a first pixel group, and sorting the gray values ​​of each pixel in the first pixel group from smallest to largest to obtain a first pixel sorting result; and a first generation module for calculating a gray-scale weighted value based on a first proportion of gray values ​​in the first pixel sorting result, and setting the gray-scale weighted value as the gray-scale value to be tested for the pixels with the same correspondence in the image to be tested; and obtaining the gray-scale value to be tested for each pixel in the image to be tested to obtain the image to be tested of the object under test.

[0031] In one embodiment, the detection device further includes an imaging module for acquiring multiple second initial images of the object under test; the processor is further configured to generate the target reference image, the processor comprising: a third acquisition module for acquiring multiple second initial images from the imaging module; a second alignment module for selecting one of the second initial images as a reference, and aligning the remaining second initial images pixel-wise with the reference second initial image, such that there is a one-to-one correspondence between the pixels of each second initial image; and a second sorting module for selecting pixels with the same corresponding relationship from each of the second initial images. A second pixel group is formed by taking a set of pixels as the second pixel group and sorting the gray values ​​of each pixel in the second pixel group from smallest to largest to obtain a second pixel sorting result; a second generation module is used to calculate a gray weight value based on a second proportion of gray values ​​in the second pixel sorting result, and set the gray weight value as the reference gray value of a pixel with the same correspondence in the reference image, and obtain a reference gray value for each pixel in the reference image; and when selecting a reference image as the target reference image from multiple reference images, obtaining a reference image with the same second proportion as the first proportion as the target reference image.

[0032] According to a third aspect, a computer-readable storage medium is provided, the medium storing a program that can be executed by a processor to implement the image detection method described in the first aspect above.

[0033] The beneficial effects of this application are:

[0034] According to the above embodiments, an image detection method, detection device, and storage medium are disclosed. The image detection method includes a process of acquiring a test image and a target reference image of the object under test, and a process of comparing the test image and the target reference image to obtain a comparison result of whether suspicious image features exist. The technical solution has improved the acquisition of the test image, the acquisition of the target reference image, and the image feature comparison, which can reduce the influence of grayscale differences between the test image and the target reference image, and also achieve pixel-level detection requirements between the test image and the target reference image.

[0035] The technical solution ensures that the difference between the average grayscale of the target reference image and the average grayscale of the image under test is smaller than that of other reference images when acquiring the target reference image. This improves the comparison accuracy between the target reference image and the image under test. Furthermore, the acquisition of both the image under test and the target reference image comprehensively considers the pixel grayscale of multiple initial images, reducing grayscale interference caused by a single initial image. This enhances the image representation of the object under test by both the reference image and the image under test, thereby improving the reliability of subsequent image comparison processing.

[0036] In the comparison process between the image under test and the target reference image, the technical solution sets a grayscale threshold range for the corresponding pixels in the image under test. This allows for pixel-by-pixel judgment of whether each pixel exceeds the corresponding grayscale threshold range, enhancing the accuracy of suspicious image feature judgment. This facilitates the achievement of pixel-level detection requirements between the image under test and the target reference image, while avoiding missed or false detections caused by grayscale differences. This also helps improve the image detection accuracy of products such as wafers.

[0037] The technical solution performs grayscale compensation processing on the image under test and / or the target reference image, which can further increase the grayscale similarity between the image under test and the target reference image. This facilitates image comparison processing at similar grayscale levels, thereby improving the accuracy of the comparison results during the comparison processing stage between the image under test and the target reference image. Attached Figure Description

[0038] Figure 1 This is a flowchart of an image detection method in one embodiment of this application;

[0039] Figure 2 This is a flowchart illustrating the process of obtaining the image to be tested in one embodiment of this application;

[0040] Figure 3 This is a flowchart illustrating the process of obtaining each reference image in one embodiment of this application;

[0041] Figure 4 This is a flowchart illustrating the acquisition of each reference image in another embodiment of this application;

[0042] Figure 5 This is a flowchart illustrating the comparison between the image to be tested and the target reference image in one embodiment of this application;

[0043] Figure 6 This is a flowchart of grayscale compensation for the image under test and / or the target reference image in one embodiment of this application;

[0044] Figure 7 This is a flowchart illustrating the replacement of a target reference image with a test image in one embodiment of this application;

[0045] Figure 8 This is a flowchart illustrating the process of obtaining defect information in a target image to be tested, as described in one embodiment of this application.

[0046] Figure 9 This is a schematic diagram of the distribution of wafers on a wafer in one embodiment of this application;

[0047] Figure 10 This is a schematic diagram showing the sorting of grayscale values ​​of pixels with the same correspondence in each initial image in one embodiment of this application;

[0048] Figure 11 This is a schematic diagram of multiple images to be tested and multiple reference images in one embodiment of this application;

[0049] Figure 12 This is a schematic diagram illustrating the acquisition of suspicious image features based on the image to be tested and the target reference image in one embodiment of this application;

[0050] Figure 13 This is a structural diagram of the detection device in one embodiment of this application;

[0051] Figure 14 This is a structural diagram of a processor in one embodiment of this application;

[0052] Figure 15 This is a structural diagram of the processor in another embodiment of this application;

[0053] Figure 16 This is a structural diagram of the processor in yet another embodiment of this application;

[0054] Figure 17 This is a structural diagram of an optical detection device in one embodiment of this application. Detailed Implementation

[0055] The present application will now be described in further detail with reference to the accompanying drawings and specific embodiments. Similar elements in different embodiments are referred to by related similar element reference numerals. In the following embodiments, many details are described to facilitate a better understanding of the present application. However, those skilled in the art will readily recognize that some features may be omitted in different situations, or may be replaced by other elements, materials, or methods. In some cases, certain operations related to the present application are not shown or described in the specification. This is to avoid obscuring the core parts of the present application with excessive description. For those skilled in the art, detailed description of these related operations is not necessary; they can fully understand the related operations based on the description in the specification and general technical knowledge in the art.

[0056] Furthermore, the features, operations, or characteristics described in the specification can be combined in any suitable manner to form various embodiments. At the same time, the steps or actions in the method description can be rearranged or adjusted in a manner obvious to those skilled in the art. Therefore, the various orders in the specification and drawings are only for the clear description of a particular embodiment and do not imply a necessary order, unless otherwise stated that a particular order must be followed.

[0057] The serial numbers assigned to components in this document, such as "first" and "second," are used only to distinguish the described objects and have no sequential or technical meaning. The terms "connection" and "linkage" used in this application, unless otherwise specified, include both direct and indirect connections (linkages).

[0058] Example 1

[0059] Please refer to Figure 1 This embodiment discloses an image detection method, which mainly includes steps 1100 to 1200, which are described below.

[0060] Step 1100: Obtain the image to be tested and the target reference image of the object under test.

[0061] The object being tested here can be a product on an industrial production line, a test object on a testing instrument, or even a wafer on a wafer. Such objects may have abnormal textures, surface damage, or disordered integrated circuits during the manufacturing process, which can make it difficult to detect the surface characteristics of the object being tested.

[0062] It should be noted that a camera or video camera can be used to image the object under test, thereby obtaining one or more initial images of the object. The image to be tested and a target reference image are obtained by sorting and weighting the pixels of some initial images. The target reference image of the object under test can be the result of processing the image of the corresponding standard part of the object under test, or it can be one of the images from the initial imaging sequence of the object under test. The target reference image can be used as a reference and stored in memory for later retrieval.

[0063] See Figure 9 This illustrates the overall image of wafer 20 (which can be called a wafer), where each square represents a die, such as wafer 201. This is achieved through scanning... Figure 9 The entire wafer, as illustrated in the diagram, can be scanned to obtain the corresponding wafer image. During the scanning of wafer 20, images of each wafer can be acquired. If the object under test is a wafer, images of one or more wafers can be acquired to form initial images. These initial images are then further processed to obtain the image to be tested and the target reference image. For example, the target reference image can be an image processed from the initial image of a wafer on a wafer within a cassette, and the image to be tested can be an image processed from the initial images of one or more wafers on wafers within the same or different cassettes.

[0064] Step 1200: Compare the image to be tested and the target reference image to obtain a comparison result indicating whether there are suspicious image features. Suspicious image features are those that differ between the target reference image and the image to be tested. Since the target reference image is used as the benchmark for image feature comparison, it is easy to identify one or more potentially different regions when comparing the image features of the image to be tested and the target reference image. These different regions are then used as the comparison result for suspicious image features.

[0065] In one embodiment, to facilitate technicians in viewing and understanding the comparison results regarding the presence of suspicious image features in the image under test, the comparison result can be output after obtaining it. If the comparison result indicates the presence of suspicious image features, these features are output for marking and display. Conversely, if the comparison result indicates the absence of suspicious image features, there is no need to mark the image under test; the image under test or the corresponding prompt information can be directly output. Alternatively, in some cases, the comparison result may not be output but stored for later processing by the processor.

[0066] It should be noted that since suspicious image features reflect the pixel grayscale differences between the image under test and the target reference image, the comparison results of whether suspicious image features exist can be used as a criterion for determining whether the current target reference image can continue to be used. Furthermore, the comparison results can be used to identify potential defect features in the image under test. The subsequent processing based on the comparison results will be described in detail in Example 4 below.

[0067] Both the image under test and the target reference image reflect the imaging state of the object under test (such as a die on a wafer in the same or different cassettes) at a certain stage. To ensure the stability of the imaging state, the image under test and the target reference image need to have the overall grayscale representation capability over a certain period of time. To achieve this goal, the following will explain in detail how to obtain the target reference image and how to obtain the image under test.

[0068] In one embodiment, a specific scheme is provided to obtain the target reference image of the object under test involved in step 1100 above, mainly by selecting one reference image from multiple reference images as the target reference image. Obtaining the target reference image of the object under test includes: (1) obtaining multiple reference images. Each reference image can be the result of processing the imaging image of the standard part corresponding to the object under test, or it can be one of the imaging images in the initial imaging sequence of the object under test; (2) selecting one reference image from the multiple reference images as the target reference image, and ensuring that the difference between the average gray level of the target reference image and the average gray level of the image under test is less than that of the other reference images. This allows the average gray levels of the target reference image and the image under test to be as close as possible, improving the accuracy of subsequent image comparison processing.

[0069] In one specific embodiment, the plurality of reference images mentioned may include a first reference image and a third reference image. One of the first and third reference images can then be selected as the target reference image. The specific process is described as follows: The proximity of the average gray value of the image to be tested to the average gray value of the first and third reference images is determined, and the reference image with the highest proximity is selected as the target reference image. The average gray value of the first reference image is greater than the average gray value of the third reference image. It can be understood that after obtaining the target reference image, the image to be tested can be compared with the target reference image to obtain a comparison result indicating whether suspicious image features exist.

[0070] It's important to note that the average grayscale value represents the overall grayscale level of an image. A smaller average grayscale value indicates a darker image, while a larger average grayscale value indicates a lighter image. Typically, for each pixel in an image, the grayscale value is calculated by dividing the white and black areas into several levels based on a logarithmic relationship. These levels generally range from 0 to 255, with 255 for white and 0 for black. Since the average grayscale value of the first reference image is greater than that of the third reference image, the first reference image will appear darker overall.

[0071] It's understandable that there are differences in the average gray levels between different reference images. If we want the target reference image and the image under test to be compared on the same gray level, it's necessary to select the reference image from multiple reference images that has the highest similarity to the image under test as the target reference image. This improves the comparison accuracy between the target reference image and the image under test. Of course, if we ignore the influence of the average gray level, then it's not necessary to select a reference image from multiple reference images as the target reference image; we can directly compare any gray level reference image with the image under test.

[0072] In one embodiment, a specific method is provided to obtain the image of the object under test involved in step 1100 above. The process of obtaining the image under test may include steps 1110-11140, see details below. Figure 2 .

[0073] Step 1110: Acquire multiple initial images of the object under test. These initial images can be images obtained by scanning the object using a camera or video camera, such as scanned images of one or more wafers on a wafer within a hopper. If the object under test is... Figure 9 For any wafer on the wafer, each small square represented by grayscale can be used as a first initial image of the wafer, preferably with the number of first initial images n>=3.

[0074] Step 1120: Select one of the first initial images as a reference, and align the pixels of the remaining first initial images with the reference first initial image to ensure a one-to-one correspondence between the pixels of each first initial image. Furthermore, select a group of pixels with the same correspondence from each first initial image as the first pixel group, and sort the grayscale values ​​of the pixels in the first pixel group from smallest to largest to obtain the first pixel sorting result.

[0075] For example, choose Figure 9 The first initial image corresponding to any one wafer is used as a reference, and the first initial images corresponding to the other wafers are pixel-aligned with this reference image. For example... Figure 10 Each initial image is represented by C0, C1, C2, ..., Cn, where n is the number of initial images. For any pixel p0 in the initial image C0, the corresponding pixels in the other initial images are p1, p2, ..., pn, forming the first pixel group. Then, the pixels p0, p1, p2, ..., pn need to be sorted by gray value from smallest to largest to obtain the first pixel sorting result, for example, the gray values ​​are g0≤g1≤g2≤...≤gn.

[0076] Step 1130: In the first pixel sorting result, the gray values ​​of a first proportion are weighted to obtain a gray weight value, and this gray weight value is set as the gray value to be tested for pixels with the same correspondence in the image to be tested. Here, the first proportion refers to the amount of data contained in the first pixel sorting result under a certain proportion constraint.

[0077] for example Figure 10For the first pixel sorting result g0≤g1≤g2≤…≤gn, the gray values ​​contained in the first 20%*n can be weighted and assigned to the pixels in the image to be tested that correspond to pixel p0, and this weighted value is used as the gray value to be tested for that pixel. The smaller the gray value to be tested, the larger the gray level of the pixel, i.e., the darker it is; the larger the gray value to be tested, the smaller the gray level of the pixel, i.e., the whiter it is.

[0078] Step 1140: Obtain the test image of the object by acquiring the grayscale value of each pixel in the test image.

[0079] For example, if the first proportion is the number of gray values ​​contained in the first 20%*n of the sorted results of the first pixel, then the final image to be tested can be referenced. Figure 11 In D1, the overall image has a large grayscale level and is generally dark. If the first proportion is the number of grayscale values ​​contained in the first 50%*n of the sorted results of the first pixel, then the final image to be tested can be used as a reference. Figure 11 In D2, the overall grayscale of the image is relatively moderate. If the first proportion is the number of grayscale values ​​contained in the first 80%*n of the sorted results of the first pixel, then the final image to be tested can be used as a reference. Figure 11 In D3, the overall grayscale of the image is relatively small, and the overall image appears whiter.

[0080] Understandable. Figure 2 The proposed method for acquiring the test image comprehensively considers the pixel grayscale of multiple initial images, reducing the grayscale interference caused by a single initial image and enhancing the image representation of the object under test. In particular, the pixel sorting method accurately reveals the continuous grayscale changes of corresponding pixels across multiple initial images. Grayscale weighting calculations reflect the grayscale value of each pixel under stable imaging conditions, avoiding abrupt changes in pixel grayscale under abnormal imaging conditions. Alternatively, if the grayscale interference caused by a single initial image is ignored, an initial image with a certain grayscale level (e.g., similar average grayscale) can be directly used as the test image.

[0081] In one embodiment, a specific scheme is provided to obtain the target reference image of the object under test involved in step 1100 above, such as selecting one reference image from multiple reference images as the target reference image, as detailed in the relevant embodiments provided above. Furthermore, a scheme for obtaining each reference image is also provided. The process for obtaining each reference image can be found in [reference needed]. Figure 3 Specifically, this includes steps 1150-1180.

[0082] Step 1150: Acquire multiple second initial images of the object under test. These second initial images can be images obtained by scanning the object under test using a camera or video camera, such as scanned images of one or more wafers on a wafer within a cassette. Of course, the object under test corresponding to the second initial image and the object under test corresponding to the first initial image can be wafers on the same wafer within a cassette (e.g., dies), or wafers on wafers in different cassettes.

[0083] Step 1160: Select one of the second initial images as a reference. Align the remaining second initial images pixel-wise with the reference image to ensure a one-to-one correspondence between pixels in each second initial image. Furthermore, select a group of pixels with the same correspondence from each second initial image as a second pixel group, and sort the grayscale values ​​of the pixels in the second pixel group from smallest to largest to obtain the second pixel sorting result. The method for obtaining the second pixel sorting result can also be found in [reference needed]. Figure 10 The process of sorting pixel grayscale values ​​is illustrated here, but will not be explained in detail.

[0084] Step 1170: In the second pixel sorting result, the grayscale values ​​of the second proportion are weighted to obtain a grayscale weighted value. This grayscale weighted value is then set as the reference grayscale value for pixels with the same correspondence in a reference image. Reference grayscale values ​​are then obtained for each pixel in the reference image. The smaller the reference grayscale value, the larger the grayscale of the pixel, i.e., the darker it is; the larger the reference grayscale value, the smaller the grayscale of the pixel, i.e., the whiter it is.

[0085] For example, if the second proportion is the number of gray values ​​contained in the first 20%*n of the second pixel sorting result, then the final reference image can be used as a reference. Figure 11 In C1, the overall image has a large grayscale level and is generally dark. If the second proportion is the number of grayscale values ​​contained in the first 50%*n of the second pixel sorting result, then the final reference image can be used as a reference. Figure 11 In C2, the overall grayscale of the image is relatively moderate. If the second proportion is the number of grayscale values ​​contained in the first 80%*n of the second pixel sorting result, then the final image to be tested can be used as a reference. Figure 11 In C3, the overall grayscale of the image is relatively small, and the overall image appears whiter.

[0086] Step 1180, selecting a reference image as the target reference image from multiple reference images, may include: obtaining a second proportion of reference images whose proportion is the same as the first proportion of reference images as the target reference image. For example, if the first proportion is the number of grayscale values ​​contained in the first 50%*n of the first pixel sorting result, the final image to be tested is... Figure 11In the case of D2, when selecting a reference image, the second proportion should also be the number of grayscale values ​​contained in the first 50% * n of the second pixel sorting result. The final reference image is... Figure 11 C2 is used as the reference image, and C2 is used as the final reference image. It has the highest grayscale similarity with the image to be tested, which is beneficial for pixel comparison between the two.

[0087] Understandable. Figure 3 The proposed method for obtaining the target reference image comprehensively considers the pixel grayscale of multiple second initial images, reducing the grayscale interference caused by a single second initial image, enhancing the image representation effect of the reference image on the measured object, and ensuring that the finally selected target reference image can accurately represent the surface features of the measured object, thereby improving the reliability of subsequent image comparisons. Of course, if the grayscale interference caused by a single second initial image is ignored, then a second initial image with a certain grayscale level (such as similar average grayscale) can be directly used as the reference image.

[0088] In another embodiment, a specific method is provided to obtain the target reference image of the object under test involved in step 1100 above, such as selecting one from multiple reference images as the target reference image, as detailed in the relevant embodiments provided above; furthermore, another method for obtaining each reference image is also provided. This alternative method for obtaining each reference image is compared to... Figure 3 For the acquisition scheme of each reference image, no complex pixel sorting is required, which has the advantage of simple computation. Therefore, another acquisition scheme for each reference image can be referred to... Figure 4 Specifically, this includes steps 0150-0170.

[0089] Step 0150: Acquire multiple second initial images of the object under test. These second initial images can be images obtained by scanning the object under test using a camera or video camera, such as scanned images of one or more wafers on a wafer within a cassette. Of course, the object under test corresponding to the second initial image and the object under test corresponding to the first initial image can be wafers on the same wafer within a cassette (e.g., dies), or wafers on wafers in different cassettes.

[0090] Step 0160: Sort the multiple second initial images by average gray level to obtain the image sorting result. For example, calculate the average gray level of all pixels in each second initial image to obtain the average gray level of each second initial image. The second initial image with the smaller average gray level is sorted first, and the second initial image with the larger average gray level is sorted last. This is how the image sorting result of each second initial image is obtained.

[0091] Step 0170: In one optional method, a second initial image of a preset order is selected from the image sorting results as a corresponding reference image. Naturally, the lower the order of the selected second initial image, the lower the overall grayscale of the corresponding reference image; conversely, the higher the order of the selected second initial image, the higher the overall grayscale of the corresponding reference image. In another optional method, a preset proportion of second initial images is selected from the image sorting results, and these images are then subjected to grayscale averaging to obtain a corresponding reference image. For example, the top 20% of the second initial images in the image sorting results are selected for grayscale averaging, and the resulting image is used as the reference image with a lower overall grayscale.

[0092] Understandable. Figure 4 The method for obtaining each reference image takes into account the influence of the average gray level of multiple second initial images. It selects an appropriate reference image based on the ranking of the average gray levels of the images. Compared to... Figure 3 The Chinese approach can reduce the complexity of data processing and, to some extent, enhance the image representation of the object being measured by the reference image.

[0093] It should be noted that the specific schemes for obtaining the target reference image, the image to be tested, and each reference image provided above can all or partly be applied to the image detection method in this embodiment, or even a combination of certain schemes can be used. Figure 1 The image detection method shown is provided. It should be noted that each specific solution provided represents only what a person skilled in the art considers feasible, and does not imply that other feasible solutions cannot be used outside of this situation. Therefore, whether or not each specific solution is applied to the image detection method of this application does not constitute a strict limitation on the image detection method.

[0094] Example 2

[0095] This embodiment discloses an image detection method, which can be found in the following reference: Figure 1 Steps 1100 to 1200 in the process.

[0096] Step 1100: Obtain the image to be tested and the target reference image of the object under test.

[0097] In an optional scheme, the method for acquiring the image to be tested and the target reference image can be referred to the description in Embodiment 1, and will not be repeated here.

[0098] In another alternative approach, the acquisition of the test image and the target reference image of the object under test can be achieved in other ways, such as ignoring the influence of image grayscale and directly using the first initial image of any grayscale level as the test image, and directly using the second initial image of a similar grayscale level as the target reference image.

[0099] Step 1200: Compare the image to be tested and the target reference image to obtain the comparison result of whether there are suspicious image features.

[0100] It should be noted that suspicious image features are image features that differ between the target reference image and the image to be tested. Since the target reference image is used as the benchmark for image feature comparison, when comparing the image features of the image to be tested and the target reference image, it is easy to find one or more possible difference regions between the two, and these difference regions are used as the comparison results of suspicious image features.

[0101] In one embodiment, obtaining a target reference image includes obtaining multiple reference images and setting the target reference image as one of the multiple reference images. For details, please refer to the relevant embodiments in Embodiment 1 regarding obtaining the target reference image; these will not be repeated here. Therefore, for... Figure 1 Step 1200, which compares the image to be tested with the target reference image to obtain a comparison result indicating whether suspicious image features exist, may include steps 1210-1240, as detailed in [link to relevant documentation]. Figure 5 .

[0102] Step 1210: Obtain the difference between corresponding pixels in the two reference images to obtain a set of reference difference values ​​corresponding to each pixel. Since multiple reference images are obtained, the target reference image is one of these multiple reference images. During the comparison process between the image to be tested and the target reference image, the difference between corresponding pixels in each pair of reference images can be obtained first to obtain a set of reference difference values ​​corresponding to each pixel. Then, based on the set of reference difference values ​​corresponding to each pixel, the grayscale threshold range corresponding to each pixel can be further determined. The difference between corresponding pixels mentioned here refers to the grayscale difference between two corresponding pixels in the two reference images.

[0103] To facilitate finding corresponding pixels in any two reference images, the two reference images can be aligned before obtaining the differences between corresponding pixels. Specifically, this involves aligning the target reference image and the image under test at their pixel positions, thus establishing a one-to-one correspondence between the pixels at the aligned positions. This can be understood as calculating the grayscale difference between two corresponding pixels to obtain the difference between those pixels; similarly, the differences between all corresponding pixels in the two reference images can be calculated, and these calculated differences form a set of reference differences for each pixel.

[0104] Step 1220: Set an upper limit change amount for each pixel of the image under test based on at least one set of reference differences; and set a lower limit change amount for each pixel of the image under test based on at least one set of reference differences.

[0105] It should be noted that the upper limit change (or lower limit change) can be based on a set of reference differences, or multiple sets of reference differences. In this case, it is only necessary to perform a weighted calculation on the multiple sets of reference differences.

[0106] Step 1230: Determine the grayscale threshold range of the corresponding pixels in the image to be tested based on the target reference image and the upper and lower limit changes. Since the upper and lower limit changes set for each pixel in the image to be tested are key to setting the grayscale threshold range, the grayscale threshold range of the corresponding pixels in the image to be tested can be determined based on the target reference image and the upper and lower limit changes.

[0107] In one specific embodiment, determining the grayscale threshold range of corresponding pixels in the image to be tested based on the target reference image and the upper and lower limit changes includes: obtaining the lower threshold of the grayscale threshold range based on a linear combination of the target reference image and the lower limit change; and obtaining the upper threshold of the grayscale threshold range based on a linear combination of the target reference image and the upper limit change. Here, "linear combination" is a common concept in linear algebra, representing the sum of several parameters multiplied by a scalar, and will not be specifically explained further. Step 1240 involves traversing all pixels in the image to be tested and determining whether there are any suspicious image features based on whether each pixel exceeds its corresponding grayscale threshold range.

[0108] In one specific embodiment, step 1240 may specifically include: traversing all pixels of the image to be tested and determining whether each pixel exceeds the corresponding grayscale threshold range. If so, the pixels exceeding the grayscale threshold range are designated as suspicious pixels, and suspicious image features in the image to be tested are determined based on some or all of the suspicious pixels. It can be understood that during the process of traversing all pixels of the image to be tested, if it is determined that some pixels exceed the corresponding grayscale threshold range, then the pixels exceeding the grayscale threshold range are designated as suspicious pixels, and suspicious image features in the image to be tested are determined based on some or all of the suspicious pixels.

[0109] The process involves iterating through all pixels in the image to be tested and determining whether each pixel exceeds the corresponding grayscale threshold range. This includes the following specific operations: comparing the grayscale value of each pixel in the image to be tested with the grayscale threshold range corresponding to that pixel; if the grayscale value of the pixel is less than the lower threshold or greater than the upper threshold, the pixel is determined to be a suspicious pixel.

[0110] In one specific embodiment, after obtaining all suspicious pixels in the image to be tested, the presence of suspicious image features in the image to be tested can be determined based on some or all of the suspicious pixels. Determining the presence of suspicious image features in the image to be tested based on some or all of the suspicious pixels includes the following steps:

[0111] (1) Based on some or all of the suspicious pixels in the image to be tested, construct a suspicious pixel marker map (also called a mask map) with the same pixel size as the image to be tested.

[0112] The more suspicious pixels involved in constructing the suspicious pixel marker map, the more accurate the final suspicious image features will be. Therefore, it is preferable to use all the suspicious pixels found in the image to be tested.

[0113] (2) Search for pixel connected regions in the suspicious pixel marker map and calculate the geometric dimensions of the pixel connected regions.

[0114] For example, geometric dimensions can include one or more of the following: dimension along any direction, area, and perimeter. Specifically, a dimension along any direction can be length, width, or radius, etc.

[0115] (3) Compare the geometric size with the preset region threshold, and determine the pixel connected region as a suspicious image feature when the geometric size is greater than or equal to the region threshold.

[0116] For example, by traversing all pixels in the image under test, the grayscale value of each pixel is compared with its corresponding grayscale threshold range. Pixels with values ​​greater than the upper threshold or less than the lower threshold are marked as suspicious pixels. This generates a suspicious pixel marker map (mask map) with the same pixel size as the image under test. In the suspicious pixel marker map, the coordinates of suspicious pixels are marked as 1, and the coordinates of other pixels are marked as 0. This makes it easy to identify which pixels are suspicious. Connected components are calculated from the suspicious pixel marker map to obtain the length, width, and area of ​​each connected component. These dimensions are compared with the length and width thresholds and the area thresholds, respectively. Components exceeding these thresholds are considered suspicious image features. Specific markers can also be used to indicate suspicious image features. This process is repeated for all regions in the second compensation image.

[0117] In one embodiment, obtaining a target reference image includes obtaining multiple reference images and setting the target reference image as one of the multiple reference images. Since multiple reference images are obtained, the grayscale threshold range corresponding to each pixel in the image under test can be set based on these reference images, as explained in detail below.

[0118] In one specific embodiment, the acquired multiple reference images include a first reference image, a second reference image, and a third reference image. For example, Min_golden, Med_golden, and Max_golden are used to represent the first reference image, the second reference image, and the third reference image, respectively. Here, the pixel dimensions of the first reference image, the second reference image, and the third reference image are all the same as those of the image to be tested, and there is a one-to-one correspondence between the pixels of the images, so as to achieve pixel alignment between the image to be tested and the reference images; in addition, the average gray value of the first reference image is greater than the average gray value of the second reference image, and the average gray value of the second reference image is greater than the average gray value of the third reference image.

[0119] In one specific embodiment, step 1220, setting a lower limit change amount for each pixel in the image to be tested based on at least one set of reference differences, includes: linearly changing the reference differences between corresponding pixels in the second reference image and the first reference image to obtain the lower limit change amount. For example, comparing the grayscale values ​​of corresponding pixels in the second reference image and the first reference image, and calculating the lower limit of the grayscale threshold range based on the comparison results.

[0120] In one specific embodiment, for the aforementioned step 1220, setting the upper limit change amount for each pixel of the image to be tested based on at least one set of reference differences includes: linearly changing the difference between corresponding pixels in the third reference image and the second reference image to obtain the upper limit change amount. For example, comparing the grayscale values ​​of corresponding pixels in the third reference image and the second reference image, and calculating the upper limit of the grayscale threshold range based on the comparison result of the grayscale values.

[0121] In a specific embodiment, for the aforementioned step 1230, determining the grayscale threshold range of the corresponding pixel in the image to be tested based on the target reference image and the upper limit change and lower limit change includes: obtaining the lower threshold based on the reference difference between the grayscale of the corresponding pixel in the target reference image and the lower limit change; obtaining the upper threshold based on the sum of the grayscale of the corresponding pixel in the target reference image and the upper limit change; then, the grayscale threshold range can finally be constructed based on the upper threshold and the lower threshold.

[0122] In one embodiment, the acquired multiple reference images may include a first reference image and a third reference image. The reference image with the highest similarity to the average grayscale values ​​of the image under test and the first and third reference images is selected as the target reference image. Then, the image under test is compared with the target reference image to obtain a comparison result indicating whether suspicious image features exist. Therefore, there are two possibilities in this scheme: the target reference image may be either the third reference image or the first reference image. These two possibilities will be described in detail below.

[0123] In one specific embodiment, if the target reference image is a third reference image, then the grayscale threshold range corresponding to the third reference image needs to be used for calculation. In this case, the first grayscale threshold range can be set as the grayscale threshold range corresponding to the third reference image, and the calculation can be performed using the first grayscale threshold range.

[0124] For example, to obtain the lower threshold of the first grayscale threshold range, the lower threshold of this grayscale threshold range can be obtained based on a linear combination of the target reference image and the change in the lower threshold. Specifically, the processing steps include the following:

[0125] (1) Calculate the grayscale difference between each pixel in the second reference image and the corresponding pixel in the first reference image, and denote it as a1.

[0126] (2) Calculate the lower limit change based on a1 and express it as a1*k+B. Then, calculate the lower limit of the first gray threshold range based on the lower limit change. The lower limit of the threshold is expressed by the formula y1=x3-a1*kB. Where x3 is the gray value of the pixel corresponding to each pixel in the second reference image in the third reference image, and k and B are process parameters.

[0127] For example, to obtain the upper threshold of the first grayscale threshold range, the upper threshold of this grayscale threshold range can be obtained by a linear combination of the target reference image and the change in the upper threshold. Specifically, the following processing is performed:

[0128] (1) Calculate the grayscale difference between each pixel in the third reference image and the corresponding pixel in the second reference image, and denote it as a2.

[0129] (2) Calculate the upper limit change based on a2 and express it as a2*k′+B′. Then, calculate the upper limit of the first grayscale threshold range based on the upper limit change. The upper limit of the threshold is expressed by the formula y2=x3+a2*k′+B′. Where x3 is the grayscale value of the pixel corresponding to each pixel in the second reference image in the third reference image, and k′ and B′ are process parameters.

[0130] It can be understood that the lower limit y1 of the first grayscale threshold range and the upper limit y2 of the first grayscale threshold range can be obtained through the above processing, thus obtaining the first grayscale threshold range [y1, y2].

[0131] Here's an example: set the grayscale values ​​of some pixels in the first reference image (i.e., Min_golden) to 100, 100, and 100 respectively; set the grayscale values ​​of corresponding pixels in the second reference image (i.e., Med_golden) to 130, 110, and 120 respectively; and set the grayscale values ​​of corresponding pixels in the third reference image (i.e., Max_golden) to 150, 140, and 170 respectively.

[0132] Therefore, the lower limits of the first grayscale threshold range corresponding to the corresponding pixels in the image under test are respectively

[0133] 150-(130-100)*kB;

[0134] 140-(110-100)*kB;

[0135] 170-(120-100)*kB;

[0136] Here, k can take the value 1, and B can take the value -40.

[0137] Therefore, the upper threshold values ​​of the first grayscale threshold range corresponding to the corresponding pixels in the image under test are respectively:

[0138] 150+(150-130)*k′+B′;

[0139] 140+(140-110)*k′+B′;

[0140] 170+(170-120)*k′+B′;

[0141] Here, k′ can take the value 1, and B′ can take the value 40. Of course, the values ​​of k′ and k can be different, and the absolute values ​​of B′ and B can also be different.

[0142] In one specific embodiment, if the target reference image is a first reference image, then the grayscale threshold range corresponding to the first reference image needs to be used for calculation. In this case, the second grayscale threshold range can be set as the grayscale threshold range corresponding to the first reference image, and the second grayscale threshold range can be used for calculation.

[0143] For example, to obtain the lower threshold of the second grayscale threshold range, the lower threshold of this grayscale threshold range can be obtained based on a linear combination of the target reference image and the change in the lower threshold. Specifically, this includes the following processing steps:

[0144] (1) Calculate the grayscale difference between each pixel in the second reference image and the corresponding pixel in the first reference image, and denote it as a1.

[0145] (2) Calculate the lower limit change based on a1 and express it as a1*k+B; calculate the lower limit of the second grayscale threshold range based on the lower limit change, and express the lower limit of the threshold as a formula.

[0146] z1 = x1 - a1 * kB;

[0147] Where x1 is the gray value of the pixel corresponding to each pixel in the first reference image and the second reference image, and k and B are process parameters.

[0148] For example, to obtain the upper threshold of the second grayscale threshold range, the upper threshold of the grayscale threshold range can be obtained based on a linear combination of the target reference image and the change in the upper threshold, including:

[0149] (1) Calculate the grayscale difference between each pixel in the third reference image and the corresponding pixel in the second reference image, and denote it as a2.

[0150] (2) Calculate the upper limit change based on a2 and express it as a2*k′+B′; calculate the upper limit of the second grayscale threshold range based on the upper limit change, and express the upper limit of the threshold as follows:

[0151] z2 = x1 + a2*k′ + B′;

[0152] Where x1 is the gray value of the pixel corresponding to each pixel in the first reference image and the second reference image, and k′ and B′ are process parameters.

[0153] It can be understood that the lower threshold z1 of the second grayscale threshold range and the upper threshold z2 of the second grayscale threshold range can be obtained through the above processing, thus obtaining the second grayscale threshold range [z1, z2].

[0154] Here's an example: set the grayscale values ​​of some pixels in the first reference image (i.e., Min_golden) to 100, 100, and 100 respectively; set the grayscale values ​​of corresponding pixels in the second reference image (i.e., Med_golden) to 130, 110, and 120 respectively; and set the grayscale values ​​of corresponding pixels in the third reference image (i.e., Max_golden) to 150, 140, and 170 respectively.

[0155] Therefore, the lower limits of the second grayscale threshold range corresponding to the corresponding pixels in the image under test are respectively

[0156] 100-(130-100)*kB;

[0157] 100-(110-100)*kB;

[0158] 100-(120-100)*kB;

[0159] Here, k can take the value 1, and B can take the value -40.

[0160] Therefore, the upper threshold values ​​of the second grayscale threshold range corresponding to the corresponding pixels in the image under test are respectively:

[0161] 100+(150-130)*k′+B′;

[0162] 100+(140-110)*k′+B′;

[0163] 100+(170-120)*k′+B′;

[0164] Here, k′ can take the value 1, and B′ can take the value 40. Of course, the values ​​of k′ and k can be different, and the absolute values ​​of B′ and B can also be different.

[0165] In one embodiment, multiple reference images are acquired, including a first reference image, a second reference image, and a third reference image. A lower limit change is obtained by linearly transforming the reference differences between corresponding pixels in the second and first reference images. An upper limit change is obtained by linearly transforming the differences between corresponding pixels in the third and second reference images. Then, the grayscale threshold range of corresponding pixels in the image to be tested is determined based on the target reference image, the upper limit change, and the lower limit change. The process for determining the grayscale threshold range of corresponding pixels can be referred to the relevant embodiments above, and will not be repeated here. Specifically, the acquisition process of the first, second, and third reference images is provided here, including:

[0166] (1) Obtain multiple second initial images of the object under test.

[0167] (2) Select one of the second initial images as a reference, and align the pixels of the remaining second initial images with the second initial image used as the reference, so that the pixels of each second initial image have a one-to-one correspondence.

[0168] (3) Select a group of pixels with the same correspondence in each of the second initial images as the second pixel group, and sort the gray values ​​of each pixel in the second pixel group from small to large to obtain the second pixel sorting result.

[0169] It should be noted that at this point, three black images of the same size and type as the initial image can be created, denoted as MatLow, MatMid, and MatHigh respectively. These images need to have their pixel grayscale set before the first reference image, second reference image, and third reference image can be obtained respectively.

[0170] (3) Calculate the first gray-level weighted value based on the gray-level values ​​of the first preset number (e.g., m1 gray-level values) in the second pixel sorting result, and set the first gray-level weighted value as the reference gray-level value for pixels with the same corresponding relationship in the first reference image; and so on, obtain the first reference image by obtaining the corresponding reference gray-level value for each pixel in the first reference image. For example, the generated first reference image could be... Figure 11 C1 in the image represents a dark gray wafer image, where the lines are laser-etched integrated circuits on the wafer.

[0171] (4) Calculate the second gray-level weighted value based on the gray-level values ​​of the second preset number (e.g., 2*m1 gray-level values) in the second pixel sorting result, and set the second gray-level weighted value as the reference gray-level value for pixels with the same corresponding relationship in the second reference image; and so on, obtain the second reference image by acquiring the corresponding reference gray-level value for each pixel in the second reference image. For example, the generated second reference image could be... Figure 11 C2 in the image represents a wafer image with moderate grayscale, and the lines within it are integrated circuits laser-etched on the wafer.

[0172] (5) Calculate the third gray-level weighted value based on the gray-level values ​​of the third preset number (e.g., 3*m1 gray-level values) in the pixel sorting result, and set the third gray-level weighted value as the reference gray-level value for pixels with the same correspondence in the third reference image; obtain the third reference image by acquiring the corresponding reference gray-level value for each pixel in the third reference image. For example, the generated third reference image could be... Figure 11 C3 in the image represents a grayscale image of a wafer, and the lines within it are integrated circuits laser-etched on the wafer.

[0173] The first, second, and third preset quantities all include a corresponding number of grayscale values ​​that appear first in the pixel sorting result, and satisfy the condition that the first preset quantity is less than the second preset quantity, and the second preset quantity is less than the third preset quantity. For example, the first preset quantity is the first m1 grayscale values ​​in the pixel sorting result, the second preset quantity is the first 2*m1 grayscale values ​​in the pixel sorting result, and the third preset quantity is the first 3*m1 grayscale values ​​in the pixel sorting result, where m1 is any value set by the user. Alternatively, the first, second, and third preset quantities all include a corresponding number of grayscale values ​​that appear last in the pixel sorting result, and satisfy the condition that the first preset quantity is greater than the second preset quantity, and the second preset quantity is greater than the third preset quantity. For example, the first preset quantity is the last 3*m2 grayscale values ​​in the pixel sorting result, the second preset quantity is the last 2*m2 grayscale values ​​in the pixel sorting result, and the third preset quantity is the last m2 grayscale values ​​in the pixel sorting result, where m2 is any value set by the user.

[0174] As can be understood, this embodiment provides a detailed description of the comparison process between the image under test and the target reference image. The technical solution sets grayscale threshold ranges for corresponding pixels in the image under test during this process. This allows for pixel-by-pixel judgment of whether each pixel exceeds its corresponding grayscale threshold range, enhancing the accuracy of suspicious image feature judgment and facilitating pixel-level detection between the image under test and the target reference image. Furthermore, the comparison processing scheme provided in this embodiment minimizes the impact of grayscale differences between the image under test and the target reference image, avoiding false negatives or missed detections caused by grayscale differences, thus providing favorable conditions for improving the image detection accuracy of products such as wafers.

[0175] Example 3

[0176] This embodiment discloses an image detection method, which can be found in the following reference: Figure 1 Steps 1100 to 1200 in the process.

[0177] Step 1100: Obtain the image to be tested and the target reference image of the object under test.

[0178] In an optional scheme, the method for acquiring the image to be tested and the target reference image can be referred to the description in Embodiment 1, and will not be repeated here.

[0179] In another alternative approach, the acquisition of the test image and the target reference image of the object under test can be achieved in other ways, such as ignoring the influence of image grayscale and directly using the first initial image of any grayscale level as the test image, and directly using the second initial image of a similar grayscale level as the target reference image.

[0180] Step 1200: Compare the image to be tested and the target reference image to obtain the comparison result of whether there are suspicious image features.

[0181] In an optional scheme, the comparison processing scheme between the image to be tested and the target reference image can be referred to the description in Embodiment 2, and will not be repeated here.

[0182] In another alternative approach, the comparison between the image to be tested and the target reference image can be performed in other ways, such as directly comparing the size of pixel-by-pixel gray values, or directly comparing the difference of pixel-by-pixel gray values ​​with a fixed threshold range, or even using conventional neural network algorithms to compare the features between the images.

[0183] In one embodiment, to improve the grayscale similarity between the image under test and the target reference image, grayscale compensation processing can be performed on the image under test and / or the target reference image after acquiring the image under test and the target reference image, and before the comparison processing between the image under test and the target reference image; that is, there is a step of performing grayscale compensation processing on the image under test and / or the target reference image between step 1100 and step 1200. See also Figure 6 The process of performing grayscale compensation processing on the image to be tested and / or the target reference image may specifically include steps 1310-1340, which are described below.

[0184] Step 1310: Obtain the first difference based on the grayscale values ​​of each pixel in the target reference image and the image to be tested. This first difference is equal to the difference between the median grayscale value of each pixel in the target reference image and the median grayscale value of each pixel in the image to be tested. Here, the median is the weighted value or median.

[0185] In one specific embodiment, the mean gray values ​​corresponding to the target reference image and the image to be tested can be calculated respectively, and the first difference value can be obtained by comparing the two mean gray values.

[0186] It should be noted that the color and brightness of the light reflected from different points on the surface of the object being measured are different, so each point in the initial black and white image will appear to be gray to different degrees. If the relationship between white and black is divided into several levels (i.e., gray levels) according to the logarithmic relationship, then the gray value is the embodiment of the gray level of the pixel.

[0187] The mean grayscale value of the target reference image refers to the average calculated value of the grayscale values ​​of all pixels in the target reference image, reflecting the overall grayscale performance of the target reference image. The mean grayscale value of the test image refers to the average calculated value of the grayscale values ​​of all pixels in the test image, reflecting the overall grayscale performance of the test image. If we denote the mean grayscale values ​​of the target reference image and the test image as meanA and meanB respectively, then calculating meanA-meanB yields the first difference between the two mean grayscale values, which can be denoted as diffMean. This first difference reflects the overall grayscale color difference between the target reference image and the test image, serving as a reference for subsequent grayscale compensation.

[0188] Step 1320: Perform first grayscale compensation on the image to be tested and / or the target reference image based on the first difference, so that the median grayscale values ​​of the image to be tested and the target reference image are the same.

[0189] It should be noted that since the first difference reflects the overall grayscale difference between the target reference image and the image under test, using the first difference to perform grayscale compensation on the image under test and / or the target reference image reduces the overall color difference between them. This achieves the effect of overall color difference correction for both the image under test and the target reference image. In other words, the first difference can be used to perform overall grayscale compensation on either the image under test or the target reference image, or it can be used on both simultaneously to achieve a better grayscale compensation effect.

[0190] For example, by adding or subtracting a first difference to the grayscale values ​​of each pixel in the image under test and / or the target reference image, the first compensated image can be obtained by updating the grayscale values ​​of each pixel in the image under test and / or the target reference image. It can be understood that if the first difference is the mean grayscale value of the target reference image minus the mean grayscale value of the image under test, then the grayscale value of each pixel in the image under test should be added to the first difference, thus achieving overall color difference correction of the image under test; if the first difference is the mean grayscale value of the image under test minus the mean grayscale value of the target reference image, then the grayscale value of each pixel in the image under test should be subtracted from the first difference, thus achieving overall color difference correction of the image under test. It can be understood that, in order to achieve overall grayscale compensation of the image, the calculation result of adding or subtracting the first difference to the grayscale value of each pixel needs to be assigned to that pixel, so that the pixel obtains a new grayscale value, thus completing the grayscale value update of a single pixel, i.e., grayscale compensation of a single pixel. Therefore, by updating the grayscale values ​​of each pixel in the image under test and / or the target reference, a new image can be obtained, namely the corresponding first compensation image.

[0191] Of course, in another embodiment, there is no need to perform overall grayscale compensation for the image under test and / or the target reference image, that is, to omit the aforementioned steps 1310 and 1320, and directly use the image under test as the corresponding first compensation image, and / or directly use the target reference image as the corresponding first compensation image.

[0192] Step 1330: Search for grayscale difference regions between the image to be tested and the target reference image, and obtain a second difference value based on the grayscale difference value of the grayscale difference regions. Specifically, search for difference pixels with grayscale differences between the image to be tested and the target reference image, divide the difference pixels into regions to obtain at least one grayscale difference region, where the grayscale of each pixel in any grayscale difference region is greater than or less than the grayscale of each pixel in another grayscale difference region; thus, obtain the second difference value of the grayscale difference region based on the grayscale difference value between the image to be tested and the target reference image in the grayscale difference region.

[0193] Since there are still many pixel differences in grayscale values ​​between the image under test and the target reference image, the grayscale difference region can be obtained by comparing the grayscale values ​​of corresponding pixels in the two images. The grayscale difference region is the area where local grayscale color differences exist. The second difference value of the grayscale difference region can be obtained by calculating the average grayscale value of each pixel in the grayscale difference region. Of course, the grayscale difference region between the image under test and the target reference image is not necessarily distributed in the same area; it can be considered as a collective term for all difference regions.

[0194] It should be noted that the second difference can be a weighted sum of the differences between corresponding pixels in the gray-level difference region and the target reference image, or a weighted sum of the differences in the mean gray levels of all pixels in the gray-level difference region. Alternatively, the second difference can be the median of the gray-level differences among all pixels in the gray-level difference region, or the difference in the median gray levels among all pixels in the gray-level difference region. The specific calculation process for the second difference is not limited.

[0195] It should be noted that if the image under test and / or the target reference image have undergone the overall grayscale compensation processing of steps 1310 and 1320, then the image under test in steps 1330 and 1340 should be the first compensated image obtained after the overall grayscale compensation of the image under test, and the target reference image should be the first compensated image obtained after the overall grayscale compensation of the target reference image.

[0196] Step 1340: Perform second gray-level compensation on the gray-level difference region in the test image and / or target reference image corresponding to the second difference based on the second difference, so that the gray levels of the gray-level difference region in the test image and the target reference image are the same, and obtain the corresponding second compensated images respectively.

[0197] It should be noted that since the second difference reflects the local grayscale difference between the test image and the target reference image (such as the pixel grayscale difference within the grayscale difference region), using the second difference to perform local grayscale compensation on the test image and / or the target reference image reduces the local color difference between the target reference image and the test image, thus achieving a local color difference correction effect. Furthermore, the second difference can be used to perform local grayscale compensation on either the test image or the target reference image, or simultaneously on both, thereby achieving a better local grayscale compensation effect.

[0198] It is understandable that after grayscale compensation is applied to the image under test and / or the target reference image, the grayscale-compensated image under test can be compared row-by-row pixel-by-pixel with the grayscale-compensated target reference image to obtain suspicious image features. Compared to the original image, the second compensated image has already achieved overall color difference correction and local color difference correction, which can eliminate the influence of grayscale differences between images. Next, it is only necessary to compare the grayscale differences with the target reference image at the pixel level to determine the suspicious pixels and obtain the suspicious image features composed of the suspicious pixels.

[0199] It should be noted that, Figure 6 The first grayscale compensation used in steps 1310 and 1320 serves as overall grayscale compensation, while the second grayscale compensation used in steps 1330 and 1340 serves as local grayscale compensation. Therefore, the first and second grayscale compensation methods can be used sequentially, or only the first or second grayscale compensation method can be used. Of course, to achieve better grayscale compensation for the image under test and / or the target reference image, it is preferable to use the first grayscale compensation method first, followed by the second grayscale compensation method.

[0200] In this embodiment, during the grayscale compensation process, the technical solution first uses a first difference to perform grayscale compensation on the image under test and / or the target reference image. The resulting first compensated image makes the grayscale of the image under test and the target reference image similar overall, thereby minimizing detection errors caused by overall grayscale differences during image detection. Furthermore, during the grayscale compensation process, the technical solution also uses a second difference to perform grayscale compensation on the image under test and / or the target reference image. The resulting second compensated image reflects the differences between the image under test and the target reference image in detail, making it easier to further identify suspicious image features. In addition, the technical solution, through two grayscale compensations, can effectively achieve pixel-level detection requirements between the image under test and the target reference image, reducing missed or false detections caused by grayscale differences, thereby improving the image detection accuracy of products such as wafers.

[0201] In one specific embodiment, step 1143 above mainly involves the process of obtaining the second difference, which may specifically include the following processing steps.

[0202] Step S11: Align the pixel positions of the image to be tested and the target reference image to establish a one-to-one correspondence between their pixels. Of course, to meet the pixel alignment requirements between the image to be tested and the target reference image, both images should have the same pixel size.

[0203] Step S12 involves comparing the grayscale values ​​of corresponding pixels in the test image and the target reference image. Three comparison results are typically obtained: first, the grayscale value of a pixel in the test image is greater than the grayscale value of its corresponding pixel in the target reference image; second, the grayscale value of a pixel in the test image is less than the grayscale value of its corresponding pixel in the target reference image; and third, the grayscale value of a pixel in the test image is equal to the grayscale value of its corresponding pixel in the target reference image. Since the third case does not require color difference correction, only the first two cases are considered, and steps S13 and S15 are performed accordingly.

[0204] Step S13: If the gray value of any pixel in the image to be tested is greater than the gray value of a corresponding pixel in the target reference image, count the gray values ​​of any pixel in the image to be tested and / or the corresponding pixels in the target reference image (e.g., record the coordinates of the pixels); after traversing all corresponding pixels, if the pixels counted are in the image to be tested, then the gray value difference region formed by the counted pixels is recorded as the first gray value difference region of the image to be tested; if the pixels counted are in the target reference image, then the gray value difference region formed by the counted pixels is recorded as the first gray value difference region of the target reference image.

[0205] Step S14 follows step S13. In the first gray-level difference region, the gray-level difference of each pixel is statistically analyzed and a first weighted value is calculated. This first weighted value is then used as the second difference value corresponding to the first gray-level difference region. When the weight of the first weighted value is 0.5, it is the average of the gray-level differences of each pixel. Of course, the weight of the gray-level difference of each pixel can also be set to other values, or even to some or all different weight values.

[0206] Step S15: If the gray value of any pixel in the image to be tested is less than the gray value of a corresponding pixel in the target reference image, count the pixels in the image to be tested and / or count the corresponding pixels in the target reference image (e.g., record the coordinates of the pixels); after traversing all corresponding pixels, if the counted pixels are in the image to be tested, then the gray-level difference region formed by the counted pixels is recorded as the second gray-level difference region of the image to be tested; if the counted pixels are in the target reference image, then the gray-level difference region formed by the counted pixels is recorded as the second gray-level difference region of the target reference image.

[0207] Step S16 follows step S15. In the second grayscale difference region, the grayscale difference of each pixel is statistically analyzed and a second weighted value is calculated. This second weighted value is used as the second difference value corresponding to the second grayscale difference region. When the weight of this second weighted value is 0.5, the second weighted value is the average of the grayscale differences of each pixel. Of course, the weight of the grayscale difference of each pixel can also be set to other values, or even to some or all different weight values.

[0208] It should be noted that the first weighted value and the second weighted value here can be the mean or the weighted calculation result of different weight coefficients.

[0209] It can be understood that after steps S11-S16, the first gray-level difference region and the second gray-level difference region corresponding to the image under test and / or the target reference image can be obtained respectively, and the second difference value corresponding to these two difference regions can be obtained respectively. Then, local gray-level compensation can be performed on the image under test and / or the target reference image according to the second difference value.

[0210] In one specific embodiment, a second grayscale compensation is performed on the grayscale difference region in the test image and / or the target reference image corresponding to the second difference based on the second difference, including steps S21, S22, and S23.

[0211] Step S21: For the first gray-level difference region in the image to be tested and / or the target reference image, subtract the first weighting value from each pixel in the first gray-level difference region to obtain the first form of gray-level compensation for the image to be tested and / or the target reference image.

[0212] For example, the gray values ​​of some pixels in the image under test are 100, 100, 100, 100, 100, 100, 100, respectively; the gray values ​​of corresponding pixels in the target reference image are 100, 60, 70, 100, 110, 120, respectively. In comparison, the gray values ​​of the 2nd and 3rd pixels in the image under test are larger (i.e., pixels with a difference greater than 0), and the differences are 40 and 30, respectively. These two pixels can constitute the first gray-level difference region, and the corresponding first weighting value is 35. If the first weighting value is subtracted from each pixel in the first gray-level difference region, the pixel gray-level distribution after the first form of gray-level compensation in the image under test can be obtained, which is 100, 65, 65, 100, 100, 100.

[0213] Step S22: For the second gray-level difference region in the image to be tested and / or the target reference image, add a second weighting value to each pixel in the second gray-level difference region so that the image to be tested and / or the target reference image obtains a second form of gray-level compensation.

[0214] For example, the gray values ​​of some pixels in the image under test are 100, 100, 100, 100, 100, 100, and 100, respectively. The gray values ​​of corresponding pixels in the target reference image are 100, 60, 70, 100, 110, and 120, respectively. In contrast, the gray values ​​of the 5th and 6th pixels in the image under test are smaller (i.e., pixels with a difference less than 0), and the differences are 10 and 20, respectively. These two pixels can constitute the second gray-level difference region, with a corresponding second weighting value of 15. If the second weighting value is added to each pixel in the second gray-level difference region, the pixel gray-level distribution after the second form of gray-level compensation in the image under test can be obtained, which is 100, 100, 100, 100, 115, and 115.

[0215] Step S23: After obtaining the first form of grayscale compensation and / or the second form of grayscale compensation in the image to be tested and / or the target reference image, the corresponding second compensated image can be obtained respectively.

[0216] It is understandable that if both a first gray-level difference region and a second gray-level difference region exist in the image to be tested (or the target reference image), then gray-level compensation needs to be performed separately to obtain the second compensated image. Of course, if only a first gray-level difference region or a second gray-level difference region exists in the image to be tested (or the target reference image), then the second compensated image can be obtained simply by performing gray-level compensation in either the first or second form.

[0217] For example, if the pixel grayscale distribution of the image under test after the first form of grayscale compensation is 100, 65, 65, 100, 100, 100, and the pixel grayscale distribution of the image under test after the second form of grayscale compensation is 100, 100, 100, 100, 115, 115, then the pixel grayscale distribution of the corresponding second-compensated image is 100, 65, 65, 100, 115, 115, which is close to the grayscale values ​​of the pixels in the target reference image (such as grayscale distribution of 100, 60, 70, 100, 110, 120). In this case, the possibility of missing or falsely detecting defects is relatively small.

[0218] It should be noted that in this embodiment, grayscale compensation processing is performed on the image to be tested and / or the target reference image. Therefore, the object of grayscale compensation processing can be the image to be tested, the target reference image, or both the image to be tested and the target reference image. In other words, the object to be compensated can be reasonably set according to actual needs, and no specific limitation is made here.

[0219] It is understood that in this embodiment, before comparing the image to be tested and the target reference image, grayscale compensation processing is performed on the image to be tested and / or the target reference image. This allows the image to be tested and the target reference image to have better grayscale similarity, which is beneficial to improving the accuracy of the comparison results in the comparison processing stage between the image to be tested and the target reference image.

[0220] Example 4

[0221] This embodiment discloses an image detection method, which includes not only the processing steps provided in any of Embodiments 1, 2, and 3, but also one or more subsequent processing steps. The subsequent processing steps will be described in detail below.

[0222] In one embodiment, since suspicious image features can be used as a criterion for determining whether the current target reference image can continue to be used, the process after obtaining the suspicious image features may further include a judgment process based on the suspicious image features. Therefore, after comparing the image to be tested and the target reference image, an image replacement step is also included, which may refer to... Figure 7 Steps 2100-2200 in the process.

[0223] Step 2100: Based on the comparison results of whether suspicious image features exist, determine whether suspicious image features exist. For example, judge the number, size, type, etc. of suspicious image features, and determine whether one or more parameters reach the threshold condition.

[0224] Step 2200: If yes, replace the target reference image with the image to be tested. This indicates a significant grayscale difference between the image to be tested and the target reference image, and the target reference image is no longer suitable as the benchmark for current wafer defect detection. Therefore, the image to be tested needs to replace the reference image, and this image will be used as the benchmark for current wafer defect detection. Furthermore, the target reference image here is used for defect detection.

[0225] Of course, if not, it indicates that the grayscale difference between the image under test and the target reference image is not significant, and the target reference image can continue to be used as the benchmark for the current wafer defect detection.

[0226] It is understandable that the image replacement step provided here is to replace the target reference image with the image to be tested when there are suspicious image features in the comparison results. This is because the presence of suspicious image features in the comparison results indicates that the target reference image can no longer accurately represent the surface detail features of the object being tested, and a new reference benchmark needs to be selected. Since the image to be tested contains richer features on the object being tested, it can be used as a new reference benchmark.

[0227] It should be noted that suspicious image features reflect the pixel grayscale differences between the image under test and the target reference image, and can be used as a basis for determining whether the current target reference image can still be used. For example, the target reference image is a reference image used for defect detection of all wafers in the previous hopper, while the image under test is an image of one wafer in the current hopper. To determine whether the target reference image is applicable to defect detection of all wafers in the current hopper, the image under test and the target reference image need to be compared. If there are many suspicious image features in the comparison result, it means that the target reference image is no longer applicable to defect detection of all wafers in the current hopper. In this case, it is necessary to select a new target reference image to participate in the defect detection of all wafers in the current hopper.

[0228] It should be noted that after obtaining the target reference image, defects in the object under test (such as wafers on a wafer) can be detected based on the target reference image.

[0229] In one embodiment, after comparing the image to be tested and the target reference image, a defect detection step is further included, which specifically includes... Figure 8 Steps 3100-3300 in the process.

[0230] Step 3100: Obtain the target image of the object under test. Since the target reference image is obtained based on the initial image of a certain wafer (e.g., Die) on a single wafer, defect detection is also required on other wafers. Therefore, target images obtained based on the initial images of other wafers can participate in defect detection. It can be understood that the object under test here can be different wafers on the same wafer or different wafers on different wafers; no specific limitation is made here.

[0231] Of course, in step 3100, the acquisition of the target image of the object under test can be carried out at any stage of the image detection method, not limited to the stage after the comparison and processing of the image under test and the target reference image. As long as the target image under test is saved in advance, it can be called at any time during the defect detection stage.

[0232] Step 3200: Based on the target reference image, perform image feature comparison detection on the target image of the object under test to determine whether there is defect information in the target image of the object under test.

[0233] For example, by binarizing the target image of another object and then performing a difference operation with the target reference image, the image regions in the target image of other objects that differ from the target reference image can be found. These differing image regions are the defect information. Since image comparison detection is a common technique in the field of image processing, it will not be explained in detail here.

[0234] For example, if there are multiple target reference images, one of the first reference image and the third reference image can be used as the target reference image. Then, comparing the target image to be tested with the target reference image includes: obtaining the target reference image with the smallest difference in grayscale mean between it and the target image to be tested as the comparison image; and performing threshold comparisons on the grayscale values ​​of corresponding pixels in the comparison image and the target image to be tested, identifying pixels whose grayscale difference is greater than a preset threshold as defect points.

[0235] Step 3300: If yes, it indicates that there is a defect feature in the target image of the object being tested. In this case, the defect feature can be output, specifically the image of the area where the defect feature is located, as well as parameters such as the area coordinates and the defect type. Of course, if no, it means that there is no defect information in the target image being tested, and in this case, there is no need to output the defect information.

[0236] It is understandable that the defect detection steps provided here involve comparing the target image to be tested with the target reference image to find the defect information in the target image to be tested. Since the target reference image can accurately reflect the surface features of the object being tested, it helps to improve the accuracy of defect information detection and enhance the defect detection performance of the system during the defect detection process.

[0237] In another embodiment, after comparing the image to be tested and the target reference image, a defect discrimination step is further included. The defect discrimination step specifically includes: taking the image to be tested as the target image to be tested, the comparison result of whether there are suspicious image features obtained from the comparison process is the defect detection result between the target image to be tested and the target reference image; if there are suspicious image features in the comparison result, the existing suspicious image features are identified as defect information in the target image to be tested.

[0238] It is understandable that the scheme of identifying existing suspicious image features as defect information in the target image does not require frequent replacement of the target reference image, which simplifies the algorithm complexity of the entire defect detection process and improves the efficiency of defect detection to a certain extent.

[0239] It should be noted that the image detection method provided in this embodiment may include any one of the image replacement step, the defect detection step, and the defect identification step, or may include both the image replacement step and the defect detection step. No specific limitation is made here.

[0240] Example 5

[0241] Please refer to Figure 13 This embodiment discloses a detection device.

[0242] In this embodiment, the disclosed detection device 3 mainly includes a memory 32 and a processor 33. The memory 32 stores the image of the object to be tested and a target reference image. The processor 33 is connected to the memory, and its function is to detect the image of the object to be tested using any of the image detection methods disclosed in Embodiments 1, 2, and 3, thereby outputting any suspicious image features that may exist in the image of the object to be tested. It is understood that since the reference image is the benchmark for image detection, it should be generated in advance and stored in the memory 32 so that the processor 33 can access it at any time.

[0243] Further, see Figure 13 The disclosed testing device 3 includes not only a memory 32 and a processor 33, but may also include an imaging module 31 and a display module 34. The imaging module 31 can be a camera or video camera, which acquires one or more initial images of the object under test. The processor 33 then processes these initial images to obtain the image to be tested and a target reference image of the object under test. The object under test can be a product on an industrial production line, a test object on a testing instrument, or even a wafer on a wafer. Such objects may exhibit texture abnormalities, surface damage, or disordered integrated circuits during the manufacturing process. The display module 34 is connected to the processor 33 and its function is to display suspicious image features in the image to be tested.

[0244] for example Figure 12 The image of the object to be tested stored in memory 32 is A1, and the target reference image of the object to be tested is A0. After the processor 33 performs image detection processing on the image to be tested A1 based on the reference image A0, it can obtain the suspicious image features in the image to be tested A1, which are marked as a1, a2 and a3 respectively.

[0245] In one specific embodiment, the processor 33 can implement the function of detecting suspicious image features, as shown below. Figure 14 The processor 33 may specifically include a first acquisition module 331, a selection module 332, and a comparison module 333, which are described below.

[0246] The function of the first acquisition module 331 is to acquire multiple reference images from the memory 32, such as acquiring a first reference image, a second reference image, and a third reference image respectively. Specifically, the average grayscale value of the first reference image acquired by the first acquisition module 331 is greater than the average grayscale value of the second reference image, and the average grayscale value of the second reference image is greater than the average grayscale value of the third reference image.

[0247] The selection module 332 selects one reference image from multiple reference images as the target reference image. The target reference image has an average gray level that is less than the average gray level of the image under test compared to the other reference images. For example, it determines the similarity between the average gray level of the image under test and the average gray levels of the first and third reference images, and selects the reference image with the highest similarity as the target reference image. In other words, if the average gray level of the image under test is closest to the average gray level of the first reference image, then the first reference image is selected as the target reference image.

[0248] The comparison module 333 compares the image to be tested with the target reference image to obtain a comparison result indicating whether there are any suspicious image features. For example, the comparison module 333 finds pixels where the grayscale difference between the image to be tested and the target reference image exceeds a preset grayscale threshold range, thus obtaining all suspicious pixels in the image to be tested, and then determines the suspicious image features present in the image to be tested based on the suspicious pixels. Specifically, the comparison module 333 aligns the first reference image, the second reference image, and the third reference image with the image to be tested, respectively, so that the first reference image, the second reference image, and the third reference image and the image to be tested form a one-to-one correspondence of pixels at the pixel alignment positions. Then, the comparison module 333 obtains the gray value of each pixel in the image to be tested, the gray value of the corresponding pixel in the target reference image, and the lower threshold and upper threshold of the gray value threshold range. Next, the comparison module 333 calculates the gray value difference between the gray value of each pixel in the image to be tested and the gray value of the corresponding pixel in the target reference image. If the gray value difference is less than the lower threshold or greater than the upper threshold, the pixel is determined to be a suspicious pixel. In this way, by traversing each pixel in the image to be tested, all suspicious pixels in the image to be tested are obtained. Then, the comparison module 333 constructs a suspicious pixel marker map with the same pixel size as the image under test based on all the suspicious pixels in the image under test. It searches for pixel connected regions in the suspicious pixel marker map, calculates the region size of the pixel connected region, and compares the region size with a preset region threshold. When the region size is greater than or equal to the region threshold, the pixel connected region is determined to be a suspicious image feature.

[0249] In one specific embodiment, the imaging module 31 can image at least one initial image of the object under test, and the processor 33 can acquire the image under test and store it in the memory 32. See also... Figure 15 The processor 33 may specifically include a second acquisition module 334, a first alignment module 335, a first sorting module 336, and a first generation module 337.

[0250] The second acquisition module 334 is used to acquire multiple first initial images from the imaging module 31. The first initial images here can be images obtained by scanning the object under test using a camera or video camera, such as scan images of one or more wafers on a wafer in a certain hopper.

[0251] The first alignment module 335 is used to select one of the first initial images as a reference, and the remaining first initial images are pixel-aligned with the first initial image used as the reference, so that the pixels of each first initial image have a one-to-one correspondence.

[0252] The first sorting module 336 is used to select a group of pixels with the same correspondence in each first initial image as the first pixel group, and sort the gray values ​​of each pixel in the first pixel group from smallest to largest to obtain the first pixel sorting result.

[0253] The first generation module 337 is used to calculate a gray-scale weighted value based on a first proportion of gray-scale values ​​in the first pixel sorting result, and set the gray-scale weighted value as the gray-scale value to be measured for the corresponding pixels in the image to be measured; thus, the image to be measured of the object is obtained by acquiring the gray-scale value to be measured for each pixel in the image to be measured.

[0254] For example, the sorting process for grayscale values ​​in the first pixel group can be referenced. Figure 10 The first pixel sorting result is g0≤g1≤g2≤…≤gn. Then, the grayscale values ​​within the first 20%*n can be weighted and assigned to the corresponding pixels in the image to be tested, serving as the grayscale value to be measured for those pixels. It can be understood that the smaller the grayscale value to be measured, the larger the grayscale value of the pixel, i.e., the darker it is; conversely, the larger the grayscale value to be measured, the smaller the grayscale value of the pixel, i.e., the whiter it is. It can be understood that if the first proportion is the number of grayscale values ​​within the first 20%*n of the first pixel sorting result, then the final image to be tested can be referenced. Figure 11 In D1, the overall image has a large grayscale level and is generally dark. If the first proportion is the number of grayscale values ​​contained in the first 50%*n of the sorted results of the first pixel, then the final image to be tested can be used as a reference. Figure 11In D2, the overall grayscale of the image is relatively moderate. If the first proportion is the number of grayscale values ​​contained in the first 80%*n of the sorted results of the first pixel, then the final image to be tested can be used as a reference. Figure 11 In D3, the overall grayscale of the image is relatively small, and the overall image appears whiter.

[0255] It should be noted that the process of processor 33 acquiring the image to be tested can refer to steps 1110 to 1140 in Embodiment 1, and will not be repeated here.

[0256] In one specific embodiment, the imaging module 31 can image multiple second initial images of the object under test, and the processor 33 can acquire a target reference image and store it in the memory 32. See also... Figure 16 The processor 33 may specifically include a third acquisition module 338, a second alignment module 339, a second sorting module 340, and a second generation module 341, which are described below.

[0257] The third acquisition module 338 is used to acquire multiple second initial images from the imaging module 31. The second initial images here can be images obtained by scanning the object under test using a camera or video camera, such as scan images of one or more wafers on a wafer in a certain cassette; of course, the object under test corresponding to the second initial image and the object under test corresponding to the first initial image can be wafers on the same wafer in the same cassette (e.g., dies), or wafers on wafers in different cassettes.

[0258] The second alignment module 339 is used to select one of the second initial images as a reference, and the remaining second initial images are pixel-aligned with the second initial image used as the reference, so that the pixels of each second initial image have a one-to-one correspondence.

[0259] The second sorting module 340 is used to sort the gray values ​​of pixels with the same correspondence in each second initial image from smallest to largest to obtain the second pixel sorting result; and to sort the gray values ​​of each pixel in the second pixel group from smallest to largest to obtain the second pixel sorting result.

[0260] The second generation module 341 is used to calculate a grayscale weighted value based on a second proportion of grayscale values ​​in the second pixel sorting result, and set the grayscale weighted value as the reference grayscale value of the corresponding pixel in a reference image, and obtain a reference grayscale value for each pixel in the reference image; and when selecting a reference image as a target reference image from multiple reference images, obtain a reference image with the same second proportion as the first proportion as the target reference image.

[0261] For example, if the second proportion is the number of gray values ​​contained in the first 20%*n of the second pixel sorting result, then the final reference image can be used as a reference. Figure 11 In C1, the overall image has a large grayscale level and is generally dark. If the second proportion is the number of grayscale values ​​contained in the first 50%*n of the second pixel sorting result, then the final reference image can be used as a reference. Figure 11 In C2, the overall grayscale of the image is relatively moderate. If the second proportion is the number of grayscale values ​​contained in the first 80%*n of the second pixel sorting result, then the final image to be tested can be used as a reference. Figure 11 In C3, the overall image has a low grayscale level and appears whitish. This can be understood as follows: if the first proportion is the number of grayscale values ​​contained in the first 50% * n of the sorted pixel results, then the final image obtained is... Figure 11 In the case of D2, when selecting a reference image, the second proportion should also be the number of grayscale values ​​contained in the first 50% * n of the second pixel sorting result. The final reference image is... Figure 11 C2 is used as the reference image, and C2 is used as the final reference image. It has the highest grayscale similarity with the image to be tested, which is beneficial for pixel comparison between the two.

[0262] It should be noted that the process of processor 33 acquiring the target image can refer to steps 1150 to 1180 in Embodiment 1, and will not be repeated here.

[0263] In this embodiment, to achieve better grayscale similarity between the image to be tested and the target reference image, the processor 33 may perform grayscale compensation processing on the image to be tested and / or the target reference image before comparing the two images. For example, the processor 33 may include a grayscale compensation module to perform grayscale compensation processing. Figure 14-16 (No illustration is provided).

[0264] The processor 33 obtains a first difference based on the grayscale values ​​of each pixel in the target reference image and the image under test. This first difference is equal to the difference between the median grayscale value of each pixel in the target reference image and the median grayscale value of each pixel in the image under test, where the median is a weighted value or median. Then, the processor 33 performs a first grayscale compensation on the image under test and / or the target reference image based on the first difference, making the median grayscale values ​​of the image under test and the target reference image the same. Furthermore, the processor 33 can also search for grayscale difference regions between the image under test and the target reference image, and obtain a second difference based on the grayscale difference values ​​of these regions. Then, based on the second difference, the processor performs a second grayscale compensation on the grayscale difference regions in the image under test and / or the target reference image corresponding to the second difference, making the grayscale values ​​of the grayscale difference regions in the image under test and the target reference image the same, thus obtaining corresponding second compensated images.

[0265] It should be noted that the first gray-level compensation method provides overall gray-level compensation, while the second gray-level compensation method provides local gray-level compensation. Therefore, the first and second gray-level compensation methods can be used sequentially, or only the first or second gray-level compensation method can be used. Of course, to achieve better gray-level compensation results for the image under test and / or the target reference image, it is preferable to use the first gray-level compensation method first, followed by the second gray-level compensation method.

[0266] It should be noted that after grayscale compensation is applied to the image under test and / or the target reference image, the grayscale-compensated image under test can be compared row-by-row, pixel-by-pixel, with the grayscale-compensated target reference image to obtain suspicious image features. Compared to the original image, the second compensated image has already achieved overall and local color difference correction, eliminating the influence of grayscale differences between images. Next, only pixel-level comparison of the grayscale differences with the target reference image is needed to identify suspicious pixels and obtain the suspicious image features composed of these suspicious pixels.

[0267] Suspicious image features reflect the pixel grayscale differences between the image under test and the target reference image, and can be used as a basis for determining whether the current target reference image can still be used. For example, the target reference image is an image with reference properties used for defect detection of all wafers in the previous bin, while the image under test is an image of one wafer in the current bin. In order to determine whether the target reference image is applicable to defect detection of all wafers in the current bin, it is necessary to compare the image under test and the target reference image. If there are many suspicious image features in the comparison result, it means that the target reference image is no longer applicable to defect detection of all wafers in the current bin. At this time, it is necessary to select a new target reference image to participate in the defect detection of all wafers in the current bin.

[0268] It should be noted that, in this embodiment, the processor 33 may include... Figure 14 , Figure 15 , Figure 16 One or more structures in, if including Figure 14 The processor 33 is used to implement the comparison processing function between the image to be tested and the target reference image. If it includes... Figure 15 The processor 33 is used to acquire the image to be tested. If it includes... Figure 16 The processor 33 is used to acquire the image to be tested. Of course, the processor 33 can also include other structures, such as a module for image grayscale compensation. It can be understood that the specific structures included in the processor 33 can be freely configured according to actual needs, and no strict limitations are imposed here.

[0269] The structure and function of the detection device 3 have been described above. The detection device 3 can be used to detect wafers and wafer bodies thereon.

[0270] For example, first create three reference images of the wafer: drive a scan of the entire wafer to obtain... Figure 7 From the image of wafer 20, select multiple initial images of n wafers, such as initial images of wafers represented by at least 11 grayscale portions on wafer 20. Select one of these initial images as a reference, and use the remaining n-1 images as a reference for pixel alignment. Create three black template images with the same size and type as the reference image: MatLow, MatMid, and MatHigh. In the sorting results, the gray values ​​of a first proportion (e.g., the gray values ​​of the first 20% of pixels in the sorting results) are counted, and a first gray-level weighted value is calculated. This first gray-level weighted value is set as the gray value of the corresponding pixels in the first reference image. Similarly, the gray values ​​of a second proportion (e.g., the gray values ​​of the first 50% of pixels in the sorting results) are counted, and a second gray-level weighted value is calculated. This second gray-level weighted value is set as the gray value of the corresponding pixels in the second reference image. Likewise, the gray values ​​of a third proportion (e.g., the gray values ​​of the first 20% of pixels in the sorting results) are counted, and a third gray-level weighted value is calculated. This third gray-level weighted value is set as the gray value of the corresponding pixels in the third reference image. In this way, three reference images (i.e., golden images) are obtained and stored in memory 32.

[0271] Then, the reference image and parameter file of the previous batch are read, and a golden image is created for the first wafer in the current hopper based on the configuration file information (such as the size, coordinates, and alignment area of ​​the die). It is necessary to compare whether the currently generated golden images belong to the same type. For example, a detection threshold map is generated for Max_golden_tmp (i.e., the image to be tested of the wafer in the current hopper) using three local golden images (such as Min_golden, Med_golden, and Max_golden). Specifically, two threshold maps are generated for the current Max_golden_tmp using the original three golden images. These two threshold maps are Max_low and Max_high (Max golden tmp ± threshold). Pixels with grayscale values ​​between Max_low and Max_high in Max_golden_tmp are considered the same; otherwise, they are considered different. Filtering all points yields the different regions of the preceding and following golden images.

[0272] Next, process Min_golden_tmp in the same way to obtain Min_golden_tmp ± threshold. It is important to note that an alarm will be triggered if a different region is detected in either Max_golden_tmp or Min_golden_tmp, prompting the user to pay attention to the different region; otherwise, the detection of all wafers in the current hopper will begin.

[0273] It should be noted that there may be color differences between the test image and the reference image (e.g., the original golden image and the new golden image) of wafers from different batches of wafers, and the occurrence of these color differences may vary. In bright areas of the original golden image, the corresponding area in the new golden image may be either darker or brighter; similarly, in dark areas of the original golden image, the corresponding area in the new golden image may be either darker or brighter.

[0274] It is understandable that the above method can be used to complete the image inspection of the wafers in the cassette.

[0275] As described above, suspicious image features can be used as a basis for determining whether the current target reference image can continue to be used. Therefore, after obtaining suspicious image features, the process can also include judgment processing for suspicious image features. For example, the processor 33 determines whether suspicious image features exist based on the comparison results. If so, it indicates that there is a significant grayscale difference between the image to be tested and the target reference image, and the target reference image is no longer suitable as the benchmark for the current wafer defect detection. The reference image needs to be replaced with the image to be tested, and the image to be tested will be used as the benchmark for the current wafer defect detection.

[0276] Based on the above description, after obtaining the reference image, defect detection of the object under test (such as a wafer on a wafer) can be performed based on the target reference image. For example, the processor 33 acquires the target image of the object under test; then, based on the target reference image, it performs image feature comparison detection on the target image of the object under test to determine whether there is defect information in the target image of the object under test; if so, it indicates that there is a defect feature in the target image of the object under test, and then the defect feature can be output. Specifically, the image of the area where the defect feature is located, as well as parameters such as the area coordinates and defect type, can be output.

[0277] Example 6

[0278] Please refer to Figure 17 This embodiment discloses an optical inspection device 4, which includes a memory 41 and a processor 42.

[0279] In this embodiment, the memory 41 and the processor 42 are the main components of the optical inspection device 4. Of course, the optical inspection device 4 may also include some detection components and execution components connected to the processor 42. For details, please refer to Embodiment 5 above, which will not be described in detail here.

[0280] The memory 41 can be used as a computer-readable storage medium to store a program, which may be the program code corresponding to the image detection method in Embodiment 1.

[0281] The processor 42 is connected to the memory 41 and is used to execute the program stored in the memory 41 to implement the image detection method disclosed in any of the embodiments 1, 2, 3, and 4 above. It should be noted that the function implemented by the processor 42 can be referred to the processor 33 in embodiment 5, and will not be described in detail here.

[0282] Those skilled in the art will understand that all or part of the functions of the various methods in the above embodiments can be implemented by hardware or by computer programs. When all or part of the functions in the above embodiments are implemented by computer programs, the program can be stored in a computer-readable storage medium, which may include: read-only memory, random access memory, disk, optical disk, hard disk, etc., and the program is executed by a computer to achieve the above functions. For example, the program can be stored in the memory of a device, and when the program in the memory is executed by the processor, all or part of the above functions can be achieved. In addition, when all or part of the functions in the above embodiments are implemented by computer programs, the program can also be stored in a server, another computer, disk, optical disk, flash drive, or external hard drive, etc., and can be downloaded or copied to the memory of a local device, or the system of the local device can be updated. When the program in the memory is executed by the processor, all or part of the functions in the above embodiments can be achieved.

[0283] The above examples illustrate this application only to aid in understanding its technical solution and are not intended to limit its scope. Those skilled in the art can make various simple deductions, modifications, or substitutions based on the ideas presented in this application.

Claims

1. An image detection method, characterized in that, include: Acquire the test image and target reference image of the object under test; Before comparing the image to be tested and the target reference image, the method further includes: searching for difference pixels with grayscale differences between the image to be tested and the target reference image; dividing the difference pixels into regions to obtain at least one grayscale difference region, wherein the grayscale of each pixel in any grayscale difference region is greater than or less than the grayscale of each pixel in another grayscale difference region; obtaining a second difference value for the grayscale difference region based on the grayscale difference between the image to be tested and the target reference image in the grayscale difference region; and performing second grayscale compensation on the grayscale difference region in the image to be tested and / or the target reference image corresponding to the second difference value based on the second difference value. The image to be tested and the target reference image are compared to obtain a comparison result of whether there are suspicious image features. The suspicious image features are image features that differ between the target reference image and the image to be tested.

2. The image detection method as described in claim 1, characterized in that, The acquisition of the target reference image of the object under test includes: Acquire multiple reference images; One reference image is selected from the plurality of reference images as the target reference image, wherein the difference between the average gray level of the target reference image and the average gray level of the image to be tested is smaller than that of the other reference images.

3. The image detection method as described in claim 2, characterized in that, The plurality of reference images includes a first reference image and a third reference image; The proximity of the average gray value of the image under test to the average gray value of the first reference image and the third reference image is determined, and the reference image with the highest proximity is selected as the target reference image. The image to be tested is compared with the target reference image to obtain a comparison result showing whether there are any suspicious image features. The average gray value of the first reference image is greater than the average gray value of the third reference image.

4. The image detection method as described in claim 2, characterized in that, The process of acquiring the image to be tested includes: Acquire multiple initial images of the object under test; One of the first initial images is selected as a reference, and the remaining first initial images are pixel-aligned with the first initial image used as the reference, so that the pixels of each first initial image have a one-to-one correspondence. Select a group of pixels with the same correspondence in each of the first initial images as the first pixel group, and sort the gray values ​​of each pixel in the first pixel group from small to large to obtain the first pixel sorting result; In the first pixel sorting result, the gray values ​​of a first proportion are weighted to obtain a gray weight value, and this gray weight value is set as the gray value to be tested for pixels with the same correspondence in the image to be tested. The test image of the object is obtained by acquiring the grayscale value of each pixel in the test image.

5. The image detection method as described in claim 4, characterized in that, The process of acquiring each of the reference images includes: Acquire multiple second initial images of the object under test; One of the second initial images is selected as a reference, and the remaining second initial images are pixel-aligned with the second initial image used as the reference, so that there is a one-to-one correspondence between the pixels of each second initial image. Select a group of pixels with the same correspondence in each of the second initial images as the second pixel group, and sort the gray values ​​of each pixel in the second pixel group from small to large to obtain the second pixel sorting result; In the second pixel sorting result, the gray values ​​of the second proportion are weighted to obtain a gray weight value, and this gray weight value is set as the reference gray value of a pixel with the same corresponding relationship in the reference image, and a reference gray value is obtained for each pixel in the reference image. Selecting a reference image from a plurality of reference images as the target reference image includes: obtaining a second number of reference images with the same second ratio as the first number of reference images as the target reference image.

6. The image detection method as described in claim 2, characterized in that, The process of acquiring each of the reference images includes: Acquire multiple second initial images of the object under test; The average gray level of multiple second initial images is sorted to obtain the image sorting result; Select a second initial image from the image sorting results in a preset order as a corresponding reference image; or... A predetermined number of second initial images are selected from the image sorting results, and the predetermined number of second initial images are subjected to image grayscale averaging to obtain a corresponding reference image.

7. The image detection method as described in claim 3, characterized in that, Obtaining the target reference image includes: obtaining multiple reference images, wherein the target reference image is one of the multiple reference images; The step of comparing the image to be tested with the target reference image to obtain a comparison result indicating whether there are suspicious image features includes: Obtain the difference between corresponding pixels in the two reference images to obtain a set of reference differences corresponding to each pixel; Based on at least one set of reference differences, an upper limit change amount is set for each pixel of the image under test; based on at least one set of reference differences, a lower limit change amount is set for each pixel of the image under test. The grayscale threshold range of the corresponding pixel in the image to be tested is determined based on the target reference image, the upper limit change, and the lower limit change. The comparison results of whether there are suspicious image features are determined by traversing all pixels of the image to be tested and determining whether each pixel exceeds the corresponding grayscale threshold range.

8. The image detection method as described in claim 7, characterized in that, The comparison result of traversing all pixels of the image under test and determining whether there are suspicious image features based on whether each pixel exceeds the corresponding grayscale threshold range includes: Traverse all pixels of the image to be tested and determine whether each pixel exceeds the corresponding grayscale threshold range. If so, the pixels that exceed the grayscale threshold range are regarded as suspicious pixels, and the suspicious image features in the image to be tested are determined based on some or all of the suspicious pixels.

9. The image detection method as described in claim 7, characterized in that, Also includes: Align the target reference image with the image under test by pixel positions, so that a one-to-one correspondence of pixels is formed between the target reference image and the image under test at the pixel alignment positions; The step of determining the grayscale threshold range of corresponding pixels in the image to be tested based on the target reference image and the upper limit change and the lower limit change includes: obtaining the lower threshold of the grayscale threshold range based on a linear combination of the target reference image and the lower limit change; and obtaining the upper threshold of the grayscale threshold range based on a linear combination of the target reference image and the upper limit change. The step of traversing all pixels of the image to be tested and determining whether each pixel exceeds the corresponding grayscale threshold range includes: comparing the grayscale value of each pixel in the image to be tested with the grayscale threshold range; if the grayscale value of the pixel is less than the lower threshold limit or greater than the upper threshold limit, the pixel is determined to be a suspicious pixel.

10. The image detection method as described in claim 8, characterized in that, The step of determining suspicious image features in the image under test based on some or all of the suspicious pixels includes: Based on some or all of the suspicious pixels in the image to be tested, construct a suspicious pixel marker map with the same pixel size as the image to be tested; Search for connected pixel regions in the suspected pixel marker map and calculate the geometric dimensions of the connected pixel regions; The geometric dimension is compared with a region threshold. If the geometric dimension is greater than or equal to the region threshold, the pixel connected region is determined to be a suspicious image feature.

11. The image detection method as described in claim 9, characterized in that, The multiple reference images include a first reference image, a second reference image, and a third reference image; the average gray value of the first reference image is greater than the average gray value of the second reference image, and the average gray value of the second reference image is greater than the average gray value of the third reference image; Wherein, setting a lower limit change amount for each pixel of the image to be tested based on at least one set of reference differences includes: linearly changing the reference differences of corresponding pixels in the second reference image and the first reference image to obtain the lower limit change amount; Wherein, the step of setting an upper limit change amount for each pixel of the image to be tested based on at least one set of reference differences includes: linearly changing the difference between corresponding pixels in the third reference image and the second reference image to obtain the upper limit change amount; The step of determining the grayscale threshold range of the corresponding pixel in the image to be tested based on the target reference image and the upper limit change and the lower limit change includes: obtaining the lower threshold based on the reference difference between the grayscale of the corresponding pixel in the target reference image and the lower limit change; obtaining the upper threshold based on the sum of the grayscale of the corresponding pixel in the target reference image and the upper limit change, wherein the upper threshold and the lower threshold constitute the grayscale threshold range.

12. The image detection method as described in claim 11, characterized in that, The step of obtaining the lower limit of the grayscale threshold range based on a linear combination of the target reference image and the lower limit change includes: calculating the grayscale difference between each pixel in the second reference image and the corresponding pixel in the first reference image, and denoting it as a1; calculating the lower limit change based on a1 and expressing it as a1*k+B; and calculating the lower limit of the first grayscale threshold range based on the lower limit change, expressed by the formula: y1 = x3 - a1 * kB; The step of obtaining the upper limit of the grayscale threshold range based on a linear combination of the target reference image and the upper limit change includes: calculating the grayscale difference between each pixel in the third reference image and the corresponding pixel in the second reference image, denoted as a2; calculating the upper limit change based on a2 and expressing it as a2*k´+B´; and calculating the upper limit of the first grayscale threshold range based on the upper limit change, expressed by the formula: y2=x3+a2*k´+B´; Where x3 is the gray value of the pixel in the third reference image corresponding to each pixel in the second reference image, and k, B, k', and B' are all process parameters; Wherein, the first grayscale threshold range is the grayscale threshold range corresponding to the third reference image; if the target reference image is the third reference image, then the first grayscale threshold range is used for calculation.

13. The image detection method as described in claim 11 or 12, characterized in that, The step of obtaining the lower limit of the grayscale threshold range based on a linear combination of the target reference image and the lower limit change includes: calculating the grayscale difference between each pixel in the second reference image and the corresponding pixel in the first reference image, and denoting it as a1; calculating the lower limit change based on a1 and expressing it as a1*k+B; and calculating the lower limit of the second grayscale threshold range based on the lower limit change, expressed by the formula: z1 = x1 - a1 * kB; The step of obtaining the upper limit of the grayscale threshold range based on a linear combination of the target reference image and the upper limit change includes: calculating the grayscale difference between each pixel in the third reference image and the corresponding pixel in the second reference image, denoted as a2; calculating the upper limit change based on a2 and expressing it as a2*k´+B´; and calculating the upper limit of the second grayscale threshold range based on the upper limit change, expressed by the formula: z2 = x1 + a2 * k' + B'; Where x1 is the gray value of the pixel corresponding to each pixel in the first reference image and the second reference image, and k, B, k', and B' are all process parameters; Wherein, the second grayscale threshold range is the grayscale threshold range corresponding to the first reference image; if the target reference image is the first reference image, then the second grayscale threshold range is used for calculation.

14. The image detection method as described in claim 11, characterized in that, The process of acquiring the first reference image, the second reference image, and the third reference image includes: Acquire multiple second initial images of the object under test; One of the second initial images is selected as a reference, and the remaining second initial images are pixel-aligned with the second initial image used as the reference, so that there is a one-to-one correspondence between the pixels of each second initial image. Select a group of pixels with the same correspondence in each of the second initial images as the second pixel group, and sort the gray values ​​of each pixel in the second pixel group from small to large to obtain the second pixel sorting result; A first gray-level weighted value is calculated based on a first preset number of gray-level values ​​in the second pixel sorting result. The first gray-level weighted value is then set as the reference gray-level value for pixels with the same correspondence in the first reference image. The first reference image is obtained by acquiring the corresponding reference gray-level value for each pixel in the first reference image. Based on the second preset number of gray values ​​in the second pixel sorting result, a second gray weighting value is calculated, and the second gray weighting value is set as the reference gray value of the corresponding pixels in the second reference image; the second reference image is obtained by obtaining the corresponding reference gray value for each pixel in the second reference image. Based on the third preset number of gray values ​​in the pixel sorting result, a third gray weighting value is calculated, and the third gray weighting value is set as the reference gray value of the corresponding pixels in the third reference image; the third reference image is obtained by obtaining the corresponding reference gray value for each pixel in the third reference image.

15. The image detection method as described in claim 14, characterized in that, The first preset quantity, the second preset quantity, and the third preset quantity all include the gray values ​​that are ranked first in the pixel sorting result and have a corresponding quantity, and satisfy the condition that the first preset quantity is less than the second preset quantity, and the second preset quantity is less than the third preset quantity; or, The first preset quantity, the second preset quantity, and the third preset quantity all include gray values ​​with a corresponding quantity arranged at the end of the pixel sorting result, and satisfy the condition that the first preset quantity is greater than the second preset quantity, and the second preset quantity is greater than the third preset quantity.

16. The image detection method as described in claim 1, characterized in that, The search for difference pixels with grayscale differences between the image to be tested and the target reference image includes: Align the pixel positions of the image to be tested and the target reference image so that a one-to-one correspondence of pixels is formed between the image to be tested and the target reference image at the pixel alignment position; The grayscale values ​​of corresponding pixels between the image to be tested and the target reference image are compared. If the grayscale value of any pixel in the image under test is greater than the grayscale value of a corresponding pixel in the target reference image, the grayscale values ​​of the pixel in the image under test and / or the corresponding pixels in the target reference image are counted. The grayscale difference region formed by the counted one or more pixels is designated as the first grayscale difference region of the image under test and / or the target reference image. Within the first grayscale difference region, the grayscale difference of each pixel is counted and a first weighted value is calculated. The first weighted value is used as the second difference value corresponding to the first grayscale difference region. And / or, If the gray value of any pixel in the image under test is less than the gray value of a corresponding pixel in the target reference image, the pixels in the image under test and / or the corresponding pixels in the target reference image are counted. The gray-level difference region formed by the counted one or more pixels is recorded as the second gray-level difference region of the image under test and / or the target reference image. In the second gray-level difference region, the gray-level difference of each pixel is counted and a second weighted value is calculated. The second weighted value is used as the second difference value corresponding to the second gray-level difference region.

17. The image detection method as described in claim 16, characterized in that, The step of performing second gray-level compensation on the gray-level difference region corresponding to the second difference in the image under test and / or the target reference image based on the second difference includes: For the first gray-level difference region of the image under test and / or the target reference image, the first weighting value is subtracted from each pixel in the first gray-level difference region, so that the image under test and / or the target reference image obtains a first form of gray-level compensation. For the second gray-level difference region of the image under test and / or the target reference image, the second weighting value is added to each pixel in the second gray-level difference region so that the image under test and / or the target reference image obtains a second form of gray-level compensation. The second grayscale compensation of the image under test and / or the target reference image is achieved through a first form of grayscale compensation and / or a second form of grayscale compensation.

18. The image detection method as described in claim 1, characterized in that, Before performing the second grayscale compensation, the following is also included: A first difference is obtained based on the grayscale values ​​of each pixel in the target reference image and the image under test. The first difference is equal to the difference between the median grayscale value of each pixel in the target reference image and the median grayscale value of each pixel in the image under test. The median is a weighted value or median. A first grayscale compensation is performed on the image under test and / or the target reference image based on the first difference to make the median grayscale values ​​of the image under test and the target reference image the same.

19. The image detection method as described in claim 18, characterized in that, The step of performing grayscale compensation on the image to be tested and / or the target reference image based on the first difference includes: The grayscale values ​​of each pixel in the image under test and / or the target reference image are respectively added to or subtracted from the first difference, and the first compensation image is obtained by updating the grayscale values ​​of each pixel in the image under test and / or the target reference image.

20. The image detection method as described in claim 1, characterized in that, The comparison process between the image to be tested and the target reference image further includes: If the comparison result indicates the presence of the suspicious image features, then the target reference image is replaced with the image to be tested; The image detection method further includes: acquiring the target image of the object to be tested; After comparing the image to be tested and the target reference image, the method further includes: comparing the target image to be tested with the target reference image to determine whether there is defect information in the target image to be tested; if so, obtaining the defect information in the target image to be tested.

21. The image detection method as described in claim 20, characterized in that, The number of target reference images is multiple; comparing the target image to be tested with the target reference images includes: obtaining the target reference image with the smallest difference in grayscale mean with the target image to be tested as the comparison image; performing threshold comparison on the grayscale of corresponding pixels in the comparison image and the target image to be tested respectively, and identifying pixels whose grayscale difference is greater than a preset threshold as defect points.

22. A detection device, characterized in that, include: The memory is used to store the image of the object under test and the reference image. A processor, connected to the memory, is configured to detect the image to be tested using the image detection method according to any one of claims 1-19, obtain a comparison result of whether there are suspicious image features, and output the comparison result.

23. The detection device as described in claim 22, characterized in that, The processor includes: The first acquisition module is used to acquire multiple reference images; A selection module is used to select one reference image from a plurality of reference images as the target reference image; The comparison module is used to compare the image to be tested with the target reference image to obtain a comparison result of whether there are suspicious image features; Wherein, the difference between the average gray level of the target reference image and the average gray level of the image under test is smaller than that of other reference images.

24. The detection device as described in claim 22, characterized in that, It also includes an imaging module, which is used to obtain multiple first initial images of the object under test; The processor is further configured to generate the image to be tested, the processor comprising: The second acquisition module is used to acquire multiple initial images of the object under test. The first alignment module is used to select one of the first initial images as a reference, and the remaining first initial images are respectively aligned with the first initial image used as the reference, so that the pixels of each first initial image have a one-to-one correspondence. The first sorting module is used to select a group of pixels with the same correspondence in each of the first initial images as the first pixel group, and sort the gray values ​​of each pixel in the first pixel group from small to large to obtain the first pixel sorting result. The first generation module is used to calculate a gray-scale weighted value based on a first proportion of gray-scale values ​​in the first pixel sorting result, and set the gray-scale weighted value as the gray-scale value to be tested for pixels with the same corresponding relationship in the image to be tested; and obtain the image to be tested for the object to be tested by acquiring the gray-scale value to be tested for each pixel in the image to be tested.

25. The detection device as described in claim 22, characterized in that, It also includes an imaging module, which is used to image multiple second initial images of the object under test; The processor is further configured to generate the target reference image, the processor comprising: The third acquisition module is used to acquire multiple second initial images from the imaging module; The second alignment module is used to select one of the second initial images as a reference, and the remaining second initial images are respectively aligned with the second initial image used as the reference, so that the pixels of each second initial image have a one-to-one correspondence. The second sorting module is used to select a group of pixels with the same correspondence in each of the second initial images as the second pixel group, and sort the gray values ​​of each pixel in the second pixel group from small to large to obtain the second pixel sorting result. The second generation module is configured to calculate a grayscale weighted value based on a second proportion of grayscale values ​​in the second pixel sorting result, set the grayscale weighted value as a reference grayscale value for a pixel with the same corresponding relationship in the reference image, and obtain a reference grayscale value for each pixel in the reference image; and, when selecting a reference image from a plurality of reference images as the target reference image, obtain a reference image with the same second proportion as the first proportion as the target reference image.

26. A computer-readable storage medium, characterized in that, The medium stores a program that can be executed by a processor to implement the image detection method as described in any one of claims 1-21.

Citation Information

Patent Citations

  • Image processing method and device thereof

    CN108111749A

  • Detection method and detection system

    CN111724335A

  • Defect detection method and device and computer readable storage medium

    CN112767396A

  • Appearance inspection device and appearance inspection method

    JP2004093338A