Image matching method, defect detection method and storage medium
By calculating the similarity and evaluating the concentration degree of the difference map by sliding pixel by pixel on the wafer surface, the problem of false detection in template matching under lighting and product differences is solved, and the accuracy of wafer defect detection is improved.
Patent Information
- Application Number
- CN202510977226.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-15
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2045-07-15
AI Technical Summary
Existing template matching methods are difficult to accurately detect defects on the wafer surface due to the influence of lighting, manufacturing process and differences between different products. In particular, false detections are prone to occur at the junction of periodic and non-periodic areas.
The similarity between the template image and the image to be detected is calculated by sliding pixel by pixel, and several candidate positions are selected. The concentration of the differential pixel values is evaluated through the difference map, and the position with the highest concentration is selected as the matching position to reduce false detection.
The accuracy of template matching is improved, the matching error at the junction of periodic and non-periodic regions is reduced, and the false detection rate is reduced.
Smart Images

Figure CN120765626A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of semiconductor detection technology, and in particular to an image matching method, a defect detection method and a storage medium. Background Art
[0002] Semiconductor devices such as chips are manufactured using wafers as substrates. During the manufacturing process of semiconductor devices, it is necessary to detect defects on the surface of the wafers to ensure product quality.
[0003] Template matching is a commonly used detection method that uses a template image to locate a specific area or shape, thereby detecting defects in the located area. However, due to interference from factors such as lighting, manufacturing process, and differences between different products, template matching may have errors and fail to accurately locate the target to be detected. This is especially true when there are periodic and non-periodic areas in the image (such as Figure 1 In the figure, the repetitive dot-shaped photolithography pattern 1 is distributed in an array, forming a periodic area, while a part of the area 2 on the left is a non-periodic area). If a matching error occurs at the junction of the periodic area and the non-periodic area, it will have a great impact on the detection result and will cause more false detections. Summary of the Invention
[0004] The present invention provides an image matching method, a defect detection method and a storage medium, which are intended to reduce template matching errors caused by differences in lighting, manufacturing process and different products.
[0005] According to the first aspect, an embodiment provides an image matching method, including:
[0006] Acquire a template image and an image to be inspected of a wafer, wherein the image to be inspected has a plurality of periodic characteristic patterns, wherein at least some of the characteristic patterns use the template image as a detection reference;
[0007] Slide the template image as a window on the image to be detected pixel by pixel, and calculate the similarity between the template image and the corresponding window area at each sliding position;
[0008] Selecting a plurality of sliding positions as candidate positions based on similarity;
[0009] For each candidate position, performing a difference operation on the template image and the window area corresponding to the candidate position to obtain a difference map, wherein the pixel values in the difference map are the difference pixel values between the corresponding pixel points of the template image and the window area; counting the number of pixels in each difference pixel value in the difference map, and evaluating the concentration of the difference pixel values in the difference map based on the statistical results;
[0010] The candidate position corresponding to the highest concentration value is selected as the matching position.
[0011] In some embodiments, evaluating the concentration of differential pixel values in the differential image according to statistical results includes:
[0012] Obtaining the number of pixels in the difference image whose differential pixel values are within a preset first differential pixel value interval, and using the number to represent the concentration of the differential pixel values in the difference image, wherein the first differential pixel value interval includes a differential pixel value of 0;
[0013] Alternatively, a second differential pixel value interval is obtained, where the second differential pixel value interval includes a differential pixel value of 0, and the number of pixels whose differential pixel values are within the interval is not less than a first quantity threshold, and the width of the second differential pixel value interval is used to represent the concentration of the differential pixel values in the differential image.
[0014] In some embodiments, the first number threshold is the product of the total number of pixels in the difference image and a first proportionality coefficient α;
[0015] The obtaining of the second differential pixel value interval includes:
[0016] Get the minimum difference pixel value d in the difference image min and the maximum differential pixel value d max ;
[0017] Get the difference pixel value in the difference image in [d min ,0] interval, and obtain the first pixel number;
[0018] Get the difference pixel value in the difference image in [0,d max ] the number of pixels in the interval, and obtain the second number of pixels;
[0019] From the minimum difference pixel value d min Starting from the beginning, the number of pixels of each differential pixel value is accumulated one by one towards the differential pixel value 0 until the accumulated number of pixels is greater than or equal to the second number threshold, and the differential pixel value dLeft1 at the last accumulation is recorded, where the second number threshold is the product of the first number of pixels and (1-α);
[0020] From the maximum difference pixel value d max Starting from the beginning, the number of pixels of each differential pixel value is accumulated one by one toward the differential pixel value 0 until the accumulated number of pixels is greater than or equal to a third number threshold, and the differential pixel value dRight1 at the last accumulation is recorded to obtain a second differential pixel value interval [dLeft1, dRight1], where the third number threshold is the product of the second number of pixels and (1-α);
[0021] Alternatively, obtaining the second differential pixel value interval includes:
[0022] Obtaining the number of pixels in the difference image whose differential pixel values are in the interval [-255, 0] to obtain a third number of pixels;
[0023] Obtaining the number of pixels in the difference image whose differential pixel values are in the interval [0, 255] to obtain a fourth number of pixels;
[0024] Starting from the differential pixel value -255, accumulating the number of pixels of each differential pixel value one by one toward the differential pixel value 0 until the accumulated number of pixels is greater than or equal to a fourth number threshold, and recording the differential pixel value dLeft2 at the last accumulation, where the fourth number threshold is the product of the third number of pixels and (1-α);
[0025] Starting from the differential pixel value 255, the number of pixels of each differential pixel value is accumulated one by one towards the differential pixel value 0 until the accumulated number of pixels is greater than or equal to the fifth quantity threshold, and the differential pixel value dRight2 at the time of the last accumulation is recorded to obtain the second differential pixel value interval [dLeft2, dRight2], where the fifth quantity threshold is the product of the fourth pixel number and (1-α).
[0026] In some embodiments, obtaining the second differential pixel value interval includes:
[0027] Starting from the differential pixel values -255 and 255, the number of pixels of each differential pixel value is accumulated towards the differential pixel value 0, and each time the accumulation is performed, it is determined whether the number of pixels currently accumulated is greater than or equal to the fourth number threshold. If so, the accumulation is stopped, and the current differential pixel values -Dif and Dif are recorded to obtain a second differential pixel value interval [-Dif, Dif];
[0028] Among them, one accumulation includes accumulating the number of pixels of a differential pixel value from the differential pixel value -255 to 0 and accumulating the number of pixels of a differential pixel value from the differential pixel value 255 to 0, and the sum of the fourth quantity threshold and the first quantity threshold is equal to the total number of pixels of the differential image.
[0029] In some embodiments, selecting a plurality of sliding positions as candidate positions based on similarity includes:
[0030] The sliding position corresponding to the maximum similarity is selected as a candidate position, and the selected sliding position is excluded. The sliding position corresponding to the maximum similarity is selected as another candidate position among the remaining sliding positions, and the selected sliding positions are excluded until the maximum similarity is less than the similarity threshold or the number of candidate positions reaches a preset position number threshold.
[0031] In some embodiments, the image detection method further includes: recording each of the sliding positions and its corresponding similarity to form a similarity map, wherein each pixel position of the similarity map corresponds to one of the sliding positions; when excluding the selected sliding position, other sliding positions in the neighborhood of the sliding position in the similarity map are also excluded.
[0032] In some embodiments, the size of the neighborhood is positively correlated with the period size of the periodically distributed characteristic pattern.
[0033] In some embodiments, the similarity threshold is the product of the maximum similarity among the similarities corresponding to all the sliding positions and a second proportional coefficient β.
[0034] According to the second aspect, an embodiment provides a defect detection method, including:
[0035] Acquire a template image and an image of the wafer to be inspected;
[0036] Obtaining a matching position by the image matching method of any one of the embodiments of the first aspect above;
[0037] A window area corresponding to the matching position is obtained as a target area, and defect detection is performed on the target area to obtain a detection result.
[0038] According to the third aspect, an embodiment provides a computer-readable storage medium, on which a computer program is stored, and the computer program can be executed by a processor to implement the image matching method of any embodiment of the first aspect or the defect detection method of any embodiment of the second aspect.
[0039] According to the image matching method, defect detection method and storage medium of the above embodiment, the template image is used as a window to slide pixel by pixel on the image to be detected on the wafer, and the similarity between the template image and the corresponding window area at each sliding position is calculated; based on the similarity, several sliding positions are selected as candidate positions; for each candidate position, the template image and the window area corresponding to the candidate position are differentiated to obtain a differential map; the number of pixels of each differential pixel value in the differential map is counted, and the concentration of the differential pixel values in the differential map is evaluated based on the statistical results; finally, the candidate position corresponding to the highest concentration value is selected as the matching position. Due to the influence of different lighting and manufacturing processes, product differences, etc., the grayscale of the image formed on the wafer surface will change. At this time, selecting the position with the highest similarity as the matching position may not be accurate. In the present invention, several candidate positions are first selected according to the similarity, and then a differential map of the window area corresponding to the template image and each candidate position is obtained. The concentration of the differential pixel values in the differential map is evaluated, and the candidate position corresponding to the highest concentration value is taken as the matching position. Since the pixels in the differential map at the position with large similarity are usually concentrated in the interval with small absolute values of the differential pixel values, the concentration degree represents the proportion of pixels with small differences between the template image and the window area. By selecting the position with the highest concentration as the matching position, the accuracy of template matching is effectively improved, and false detection caused by matching errors at the junction of periodic areas and non-periodic areas is reduced. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 is a partial image of a wafer surface in one embodiment;
[0041] Figure 2 is a flowchart of an image matching method according to an embodiment;
[0042] Figure 3 are a template image and an image to be detected in one embodiment;
[0043] Figure 4 A schematic diagram of an embodiment of sliding a template image as a window on an image to be detected pixel by pixel;
[0044] Figure 5 is a similarity graph in one embodiment;
[0045] Figure 6 An image showing the statistical result of the number of pixels of each differential pixel value in the differential image in one embodiment;
[0046] Figure 7 for Figure 6 Enlarged image of the middle part;
[0047] Figure 8 is a flow chart of obtaining a second differential pixel value interval in one embodiment;
[0048] Figure 9 A flowchart of obtaining a second differential pixel value interval in another embodiment;
[0049] Figure 10 A flowchart of a defect detection method according to an embodiment. DETAILED DESCRIPTION
[0050] The present invention will be further described in detail below by means of specific embodiments in conjunction with the accompanying drawings. Similar elements in different embodiments are numbered with associated similar elements. In the following embodiments, many detailed descriptions are provided to enable the present application to be better understood. However, those skilled in the art will readily appreciate that some of the features may be omitted in different circumstances, or may be replaced by other elements, materials, or methods. In some cases, some operations related to the present application are not shown or described in the specification. This is to avoid the core portion of the present application being overwhelmed by excessive descriptions, and for those skilled in the art, it is not necessary to describe these related operations in detail. They will fully understand the related operations based on the description in the specification and the general technical knowledge in the art.
[0051] In addition, the features, operations, or characteristics described in the specification may be combined in any appropriate manner to form various embodiments. Furthermore, the steps or actions in the method description may be reordered or adjusted in a manner readily apparent to those skilled in the art. Therefore, the various sequences in the specification and drawings are provided solely for the purpose of clearly describing a particular embodiment and are not intended to be mandatory, unless otherwise specified.
[0052] The serial numbers assigned to components herein, such as "first," "second," and so on, are used solely to distinguish the objects being described and do not convey any sequential or technical meaning. "Multiple" means two or more. References to "connected" and "coupled" in this application, unless otherwise specified, include both direct and indirect connections (couplings).
[0053] Please refer to Figure 2 , the image matching method in some embodiments of the present invention includes steps 100 to 500, which are described in detail below.
[0054] Step 100: Acquire a template image and an image of a wafer to be inspected.
[0055] The image to be detected of the wafer can be obtained by imaging the wafer surface through a CCD (Charge Coupled Device) camera or a TDI (Time Delay Integration) camera. There are some periodically distributed structures or patterns on the wafer surface, so the image to be detected has multiple periodic feature patterns. For example, the surface of the wafer has multiple periodically distributed grains (dies), so the image to be detected has multiple periodic grain patterns. For example, the surface of the grain has multiple periodically distributed dot-shaped lithographic structures, so the image to be detected has multiple periodic dot-shaped patterns (such as Figure 1 shown).
[0056] Among them, at least part of the characteristic pattern uses the template image as a detection reference, that is, part or all of the characteristic pattern on the image to be detected can be located by performing template matching on the image to be detected using the template image to detect it.
[0057] Step 200: Slide the template image as a window on the image to be detected pixel by pixel, and calculate the similarity between the template image and the corresponding window area at each sliding position.
[0058] This step can be implemented using any existing technology. In a specific embodiment, Figure 3 As shown in the figure, the length of the template image is h and the width is w (unit: pixel), the length of the image to be detected is H and the width is W, the template image is used as a window to slide pixel by pixel on the image to be detected, and the process of calculating the similarity between the template image and the corresponding window area at each sliding position is as follows:
[0059] ① Align the upper left corners of the two images, determine the window area on the image to be detected that corresponds to the template image, and use the coordinates of the upper left corner of the template image to represent the position of the template image. At this time, the position of the template image (i.e., the sliding position) is (0,0), such as Figure 4 shown.
[0060] ② Subtract the pixel values of the corresponding positions of the template image and the window area, square them, and then divide them by (255 2 ×h×w), and finally normalize it to obtain the calculation result of the pixel point at each position; add the calculation results of the pixel points at all positions to obtain the similarity measurement value at the current sliding position; because the more similar the window area and the template image are, the smaller the difference value between the pixels of the two is, so it can be seen that the closer the calculated similarity measurement value is to 0, the more similar the window area and the template image are.
[0061] ③ Shift the template image right by one pixel and repeat step ② to obtain the similarity measurement value at the second sliding position (1,0). Continue sliding to the next position to perform similarity calculation until the template image slides to the position (W-w+1,0) to complete the similarity calculation of the first row. Then slide the template image to the position (0,1) and start the similarity calculation of the second row until the template image slides to the position (W-w+1,H-h+1), completing the similarity calculation at all positions.
[0062] Arranging the similarities by position, we can obtain a similarity map of size (W-w+1)×(H-h+1). Each pixel position in the similarity map corresponds to a sliding position, and the pixel value is the similarity calculated at the sliding position, such as Figure 5 As shown ( Figure 5 The larger the value, the greater the similarity).
[0063] Step 300: Select several sliding positions as candidate positions based on similarity.
[0064] It is understandable that sliding positions with greater similarity should be selected as candidate positions, for example, N sliding positions with the greatest similarity are selected as candidate positions, where N is an integer not less than 2.
[0065] Step 400: For each candidate position, the template image is differentiated from the window area corresponding to the candidate position to obtain a differential map, where the pixel values in the differential map are the differential pixel values between the template image and the corresponding pixel points in the window area; the number of pixels of each differential pixel value in the differential map is counted, and the concentration of the differential pixel values in the differential map is evaluated based on the statistical results.
[0066] The candidate position can be represented by two-dimensional coordinates (x, y). In a specific embodiment, the offset is obtained by subtracting the alignment radius in the x direction and y direction from the x coordinate and y coordinate of the candidate position, respectively. According to the offset, the window area corresponding to the template image on the image to be detected can be determined, where the alignment radius in the x direction is The alignment radius in the y direction is It can be understood that the obtained alignment radius is the result of rounding down.
[0067] The statistical results can be represented by a 1×511 image, and the difference statistical histogram can be expressed as follows: Figure 6As shown in the figure, from left to right (i.e., x-coordinates from 0 to 510) are the number of pixels with differential pixel values from -255 to 255. The number of pixels in the black part is relatively small, while the number of pixels in the white part is relatively large. It can be understood that the differential statistical histogram counts the number of each differential pixel value between -255 and +255. Usually, the number of pixels in the middle part (i.e., the interval with smaller absolute value of differential pixel value) is large, while the number of pixels on both sides is small, and the overall distribution is Gaussian. Figure 7 for Figure 6 The middle part is the enlarged image, where the number at each position represents the number of pixels, and "1.57E+04" means 1.57×10 4 , “2.62E+04” means 2.62×10 4 , and so on. It can be seen that the difference pixel values in the difference image are basically concentrated in the middle part. The higher the concentration, the higher the proportion of pixels in the middle part, that is, the higher the proportion of pixels with small differences between the template image and the window area, that is, the smaller the difference between the window area and the template image.
[0068] In some embodiments, evaluating the concentration of differential pixel values in a differential image based on statistical results includes: obtaining the number of pixels in the differential image whose differential pixel values are within a preset first differential pixel value interval, and using this number to characterize the concentration of differential pixel values in the differential image, wherein the first differential pixel value interval includes a differential pixel value of 0.
[0069] The first differential pixel value interval can be a symmetrical interval (e.g., [-10, 10]) or an asymmetrical interval (e.g., [-5, 15]), and can be set based on experience. Since the differential pixel values in the differential image are concentrated in an interval with a small absolute value, this embodiment sets the first differential pixel value interval to include a differential pixel value of 0. It can be understood that the greater the number of pixels whose differential pixel values are within the first differential pixel value interval, the higher the concentration of the differential pixel values in the differential image.
[0070] In other embodiments, evaluating the concentration of differential pixel values in the differential image based on statistical results includes: obtaining a second differential pixel value interval, wherein the second differential pixel value interval includes a differential pixel value of 0, and the number of pixels whose differential pixel values are within the interval is not less than a first number threshold, and the width of the second differential pixel value interval is used to represent the concentration of differential pixel values in the differential image.
[0071] The first quantity threshold can be set based on experience and the total number of pixels in the difference image, for example, the total number of pixels in the difference image multiplied by a proportional coefficient. It is understood that the smaller the width of the second differential pixel value interval, the higher the concentration of the differential pixel values in the difference image.
[0072] Step 500: Select the candidate position corresponding to the highest concentration value as the matching position. Subsequently, the window area corresponding to the matching position can be subjected to defect detection and other processing.
[0073] In this application, considering that the image formed on the wafer surface may change in grayscale due to different lighting, product differences, etc., it may not be accurate to select the position with the highest similarity as the matching position. Therefore, several candidate positions are first selected based on the similarity, and then a differential map of the window area corresponding to the template image and each candidate position is obtained. The concentration of the differential pixel values in the differential map is evaluated, and the candidate position corresponding to the highest concentration value is taken as the matching position. Since the pixels in the differential map at the position with large similarity are usually concentrated in the interval with a small absolute value of the differential pixel value, the concentration degree characterizes the proportion of pixels with small differences between the template image and the window area. By selecting the position with the highest concentration as the matching position, the accuracy of template matching is effectively improved, and the false detection caused by matching errors at the junction of the periodic area and the non-periodic area is reduced.
[0074] In some embodiments, obtaining the second differential pixel value interval includes: starting from the differential pixel values -255 and 255, respectively accumulating the number of pixels of each differential pixel value toward the differential pixel value 0, and each time the accumulation is performed, determining whether the number of pixels currently accumulated is greater than or equal to a fourth quantity threshold; if so, stopping the accumulation, recording the current differential pixel values -Dif and Dif, and obtaining the second differential pixel value interval [-Dif, Dif].
[0075] Here, one accumulation includes the number of pixels that accumulate a differential pixel value from the differential pixel value -255 toward 0, and the number of pixels that accumulate a differential pixel value from the differential pixel value 255 toward 0. The sum of the fourth quantity threshold and the first quantity threshold equals the total number of pixels in the differential image. In other words, accumulation is performed simultaneously from both sides toward the differential pixel value 0. When the accumulated number of pixels is greater than or equal to the fourth quantity threshold, the accumulation stops, and the interval not accumulated in the middle is the second differential pixel value interval.
[0076] In some embodiments, the first number threshold is the product of the total number of pixels in the difference image and the first proportional coefficient α. The first proportional coefficient α can be set based on experience, for example, it can be set to 0.997. Figure 8 In one embodiment, obtaining the second differential pixel value interval includes the following steps 411 to 414.
[0077] Step 411: Obtain the number of pixels in the differential image whose differential pixel values are in the interval [-255,0] to obtain the third number of pixels. Figure 6 The number of pixels whose x coordinates range from 0 to 255.
[0078] Step 412: Obtain the number of pixels in the differential image whose differential pixel values are in the interval [0, 255] to obtain the fourth number of pixels. Figure 6 The number of pixels with x coordinates from 255 to 510.
[0079] Step 413: Starting from the differential pixel value -255, accumulate the number of pixels of each differential pixel value one by one toward the differential pixel value 0 until the accumulated number of pixels is greater than or equal to the fourth quantity threshold, and record the differential pixel value dLeft2 at the time of the last accumulation, where the fourth quantity threshold is the product of the third number of pixels and (1-α).
[0080] Taking the first proportional coefficient α as 0.997 as an example, sumLeft represents the third number of pixels, threshLeft represents the fourth number threshold, then threshLeft = sumLeft × 0.003. Figure 6 In the example, the number of pixels is accumulated one by one starting from the x-coordinate 0 toward the x-coordinate 255 to obtain the accumulated value tmpSumLeft. A judgment is made each time the accumulated value tmpSumLeft is greater than threshLeft, and the current x-coordinate xLeft is recorded, which is equivalent to recording the corresponding differential pixel value dLeft2.
[0081] Step 414: Starting from the differential pixel value 255, accumulate the number of pixels of each differential pixel value one by one toward the differential pixel value 0 until the accumulated number of pixels is greater than or equal to the fifth quantity threshold, record the differential pixel value dRight2 at the time of the last accumulation, and obtain the second differential pixel value interval [dLeft2, dRight2], where the fifth quantity threshold is the product of the fourth pixel number and (1-α).
[0082] Let sumRight represent the fourth pixel number and threshRight represent the fifth pixel number threshold, then threshRight=sumRight×0.003. Figure 6 In the example, starting from the x-coordinate 510 and heading towards the x-coordinate 255, the number of pixels is accumulated one by one to obtain the accumulated value tmpSumRight. A judgment is made each time the accumulation is performed. When the accumulated value tmpSumRight is greater than threshRight, the current x-coordinate xRight is recorded, which is equivalent to recording the corresponding differential pixel value dRight2. Then the interval [xLeft, xRight] corresponds to the second differential pixel value interval [dLeft2, dRight2]. The width of the interval [xLeft, xRight] is dist = xRight - xLeft, which is the width of the second differential pixel value interval [dLeft2, dRight2]. The candidate position corresponding to the minimum value of dist is selected as the matching position.
[0083] For example Figure 5 In the similarity graph, eight sliding positions are selected as candidate positions based on similarity. The widths dist of the second differential pixel value intervals [dLeft2, dRight2] obtained for candidate positions 1 to 8 are 45, 47, 49, 23, 26, 29, 33, and 42, respectively. Therefore, candidate position 4 with a width dist of 23 is selected as the matching position.
[0084] Please refer to Figure 9 In another embodiment, obtaining the second differential pixel value interval includes the following steps 421 to 425.
[0085] Step 421: Obtain the minimum differential pixel value d in the differential image min and the maximum differential pixel value d max .
[0086] Step 422: Obtain the difference pixel value in the difference image in [d min ,0] interval to obtain the first pixel number.
[0087] Step 423: Obtain the difference pixel value in the difference image in [0,d max ] the number of pixels in the interval, and obtain the second number of pixels;
[0088] Step 424: From the minimum differential pixel value d min Initially, the number of pixels of each differential pixel value is accumulated one by one toward the differential pixel value 0 until the accumulated number of pixels is greater than or equal to the second quantity threshold, and the differential pixel value dLeft1 at the time of the last accumulation is recorded, where the second quantity threshold is the product of the first number of pixels and (1-α).
[0089] Step 425: From the maximum differential pixel value d max Initially, the number of pixels of each differential pixel value is accumulated one by one toward the differential pixel value 0 until the accumulated number of pixels is greater than or equal to the third quantity threshold, and the differential pixel value dRight1 at the last accumulation is recorded to obtain the second differential pixel value interval [dLeft1, dRight1], where the third quantity threshold is the product of the second number of pixels and (1-α).
[0090] The specific implementation of the above steps can be referred to steps 411 to 414 and will not be repeated here.
[0091] In this embodiment, the minimum differential pixel value and the maximum differential pixel value in the differential image are first obtained, and accumulation is performed from the minimum differential pixel value and the maximum differential pixel value respectively toward the differential pixel value 0, without starting from the differential pixel values -255 and 255 toward the differential pixel value 0, which can save time.
[0092] Since there are grayscale differences in the images of the wafer surface under different lighting, different manufacturing processes, different products and other factors, the differential pixel values in the differential image obtained after subtracting from the template image are also different, resulting in the interval where the differential pixel values are concentrated to shift left or right. The second differential pixel value interval is obtained through steps 411 to 414 or steps 421 to 425, and an endpoint is determined respectively according to the number of pixels to the left and right of the 0 differential pixel value. This can adapt to such changes and find a more suitable interval, thereby resisting interference from factors such as lighting, manufacturing processes, and product differences.
[0093] In some embodiments, selecting several sliding positions as candidate positions based on similarity includes: selecting the sliding position corresponding to the maximum similarity as a candidate position, and excluding the selected sliding position, and continuing to select the sliding position corresponding to the maximum similarity as another candidate position among the remaining sliding positions, and excluding the selected sliding position, until the maximum similarity is less than the similarity threshold or the number of candidate positions reaches a preset position number threshold.
[0094] Among them, the similarity threshold and the position quantity threshold can be set according to actual needs.
[0095] In some embodiments, the similarity threshold is the product of the maximum similarity among all similarities corresponding to the sliding positions (i.e., the similarity corresponding to the first selected sliding position) and the second proportionality coefficient β. Because changes in factors such as lighting, manufacturing process, and product can cause changes in similarity, setting the similarity threshold to the product of the maximum similarity among all similarities calculated for the sliding positions and the second proportionality coefficient β can adapt to current lighting, manufacturing process, and product conditions. To ensure effectiveness, the second proportionality coefficient β can be set to a value no less than 90%, for example, 90% or 95%.
[0096] In some embodiments, in order to balance the effect and computational efficiency, the position number threshold may be set to 10.
[0097] by Figure 5 For example, the similarity threshold is set to 90% of the maximum similarity among the similarities corresponding to all sliding positions, and the position number threshold is 10. Among all sliding positions, the maximum similarity is 0.9349, so the corresponding sliding position 1 is selected as a candidate position and excluded (for example, its corresponding similarity is set to 0); among the remaining sliding positions, the maximum similarity is 0.9053, which is greater than 90% of 0.9349 and the number of candidate positions is less than 10, so the corresponding sliding position 2 is selected as another candidate position and excluded, and so on, ultimately selecting candidate positions 1 to 8.
[0098] In some embodiments, the image matching method further includes: recording each sliding position and its corresponding similarity to form a similarity map (see Figure 5 ); When excluding the selected sliding position, other sliding positions in the neighborhood of the sliding position in the similarity graph are also excluded. The size of the neighborhood can be 3×3, 5×5, etc. Figure 5 A 5×5 neighborhood is used.
[0099] Since the image to be detected has multiple periodically distributed characteristic patterns, and usually only one position in a period may be the matching position, the other positions in the period can be excluded and not considered. Therefore, in this embodiment, other sliding positions in the neighborhood of the candidate position (these sliding positions and the candidate position roughly belong to the same period) are excluded, thereby improving the matching efficiency and accuracy.
[0100] In some embodiments, the size of the neighborhood is positively correlated with the period size of the periodically distributed characteristic pattern, so that the range of excluding sliding positions is adapted to the period of the characteristic pattern.
[0101] Based on the above image matching method, this application also provides a defect detection method, please refer to Figure 10 , the method comprising:
[0102] Step 10: Acquire the template image and the image of the wafer to be inspected;
[0103] Step 20: Obtain a matching position using the image matching method of any embodiment of the present application;
[0104] Step 30: Obtain the window area corresponding to the matching position as the target area, and perform defect detection on the target area to obtain a detection result. The defect detection can adopt any existing defect detection method.
[0105] Those skilled in the art will appreciate that all or part of the functions of the various methods in the above embodiments can be implemented by hardware or by computer program. When all or part of the functions in the above embodiments are implemented by computer program, the program can be stored in a computer-readable storage medium, and the storage medium can include: read-only memory, random access memory, disk, optical disk, hard disk, etc., and the program is executed by a computer to implement the above functions. For example, the program is stored in the memory of the device, and when the program in the memory is executed by the processor, all or part of the above functions can be implemented. In addition, when all or part of the functions in the above embodiments are implemented by computer program, the program can also be stored in a storage medium such as a server, another computer, disk, optical disk, flash disk or mobile hard disk, and saved in the memory of the local device by downloading or copying, or the system of the local device is updated. When the program in the memory is executed by the processor, all or part of the functions in the above embodiments can be implemented.
[0106] The above examples are used to illustrate the present invention, which are only used to help understand the present invention and are not intended to limit the present invention. Those skilled in the art can make several simple deductions, modifications or substitutions based on the concept of the present invention.
Claims
1. An image matching method, characterized in that: include: Acquire a template image and an image to be detected of a wafer, wherein the image to be detected has a plurality of periodic characteristic patterns, wherein the characteristic patterns use the template image as a detection reference; Slide the template image as a window on the image to be detected pixel by pixel, and calculate the similarity between the template image and the corresponding window area at each sliding position; Selecting a plurality of sliding positions as candidate positions based on similarity; For each candidate position, performing a difference operation on the template image and the window area corresponding to the candidate position to obtain a difference map, wherein the pixel values in the difference map are the difference pixel values between the corresponding pixel points of the template image and the window area; counting the number of pixels in each difference pixel value in the difference map, and evaluating the concentration of the difference pixel values in the difference map based on the statistical results; The candidate position corresponding to the highest concentration value is selected as the matching position.
2. The image matching method according to claim 1, wherein: The evaluating the concentration degree of the differential pixel values in the differential image according to the statistical results includes: Obtaining the number of pixels in the difference image whose differential pixel values are within a preset first differential pixel value interval, and using the number to represent the concentration of the differential pixel values in the difference image, wherein the first differential pixel value interval includes a differential pixel value of 0; Alternatively, a second differential pixel value interval is obtained, where the second differential pixel value interval includes a differential pixel value of 0, and the number of pixels whose differential pixel values are within the interval is not less than a first quantity threshold, and the width of the second differential pixel value interval is used to represent the concentration of the differential pixel values in the differential image.
3. The image matching method according to claim 2, wherein: The first quantity threshold is the product of the total number of pixels in the difference image and a first proportional coefficient α; The obtaining of the second differential pixel value interval includes: Get the minimum difference pixel value d in the difference image min and the maximum differential pixel value d max ; Get the difference pixel value in the difference image in [d min ,0] interval, and obtain the first pixel number; Get the difference pixel value in the difference image in [0,d max ] the number of pixels in the interval, and obtain the second number of pixels; From the minimum difference pixel value d min Starting from the beginning, the number of pixels of each differential pixel value is accumulated one by one towards the differential pixel value 0 until the accumulated number of pixels is greater than or equal to the second number threshold, and the differential pixel value dLeft1 at the last accumulation is recorded, where the second number threshold is the product of the first number of pixels and (1-α); From the maximum difference pixel value d max Starting from the beginning, the number of pixels of each differential pixel value is accumulated one by one toward the differential pixel value 0 until the accumulated number of pixels is greater than or equal to a third number threshold, and the differential pixel value dRight1 at the last accumulation is recorded to obtain a second differential pixel value interval [dLeft1, dRight1], where the third number threshold is the product of the second number of pixels and (1-α); Alternatively, obtaining the second differential pixel value interval includes: Obtaining the number of pixels in the difference image whose differential pixel values are in the interval [-255, 0] to obtain a third number of pixels; Obtaining the number of pixels in the difference image whose differential pixel values are in the interval [0, 255] to obtain a fourth number of pixels; Starting from the differential pixel value -255, accumulating the number of pixels of each differential pixel value one by one toward the differential pixel value 0 until the accumulated number of pixels is greater than or equal to a fourth number threshold, and recording the differential pixel value dLeft2 at the last accumulation, where the fourth number threshold is the product of the third number of pixels and (1-α); Starting from the differential pixel value 255, the number of pixels of each differential pixel value is accumulated one by one towards the differential pixel value 0 until the accumulated number of pixels is greater than or equal to the fifth quantity threshold, and the differential pixel value dRight2 at the time of the last accumulation is recorded to obtain the second differential pixel value interval [dLeft2, dRight2], where the fifth quantity threshold is the product of the fourth pixel number and (1-α).
4. The image matching method according to claim 2, wherein: The obtaining of the second differential pixel value interval includes: Starting from the differential pixel values -255 and 255, the number of pixels of each differential pixel value is accumulated towards the differential pixel value 0, and each time the accumulation is performed, it is determined whether the number of pixels currently accumulated is greater than or equal to the fourth number threshold. If so, the accumulation is stopped, and the current differential pixel values -Dif and Dif are recorded to obtain a second differential pixel value interval [-Dif, Dif]; Among them, one accumulation includes accumulating the number of pixels of a differential pixel value from the differential pixel value -255 to 0 and accumulating the number of pixels of a differential pixel value from the differential pixel value 255 to 0, and the sum of the fourth quantity threshold and the first quantity threshold is equal to the total number of pixels of the differential image.
5. The image matching method according to any one of claims 2 to 4, characterized in that: The selecting of a plurality of sliding positions as candidate positions based on similarity includes: The sliding position corresponding to the maximum similarity is selected as a candidate position, and the selected sliding position is excluded. The sliding position corresponding to the maximum similarity is selected as another candidate position among the remaining sliding positions, and the selected sliding positions are excluded until the maximum similarity is less than the similarity threshold or the number of candidate positions reaches a preset position number threshold.
6. The image matching method according to claim 5, wherein: The image detection method further includes: recording each of the sliding positions and their corresponding similarities to form a similarity map, wherein each pixel position in the similarity map corresponds to one of the sliding positions; and when excluding the selected sliding position, also excluding other sliding positions in the neighborhood of the sliding position in the similarity map.
7. The image matching method according to claim 6, wherein: The size of the neighborhood is positively correlated with the period size of the periodically distributed characteristic pattern.
8. The image matching method according to claim 5, wherein: The similarity threshold is the product of the maximum similarity among the similarities corresponding to all the sliding positions and the second proportional coefficient β.
9. A defect detection method, characterized in that: include: Acquire a template image and an image of the wafer to be inspected; Obtaining a matching position by the image matching method according to any one of claims 1 to 8; A window area corresponding to the matching position is obtained as a target area, and defect detection is performed on the target area to obtain a detection result.
10. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, which can be executed by a processor to implement the image matching method according to any one of claims 1 to 8 or the defect detection method according to claim 9.
Citation Information
Patent Citations
Wafer defect detection method based on characteristic matching
CN106600600A
Moving object detection method based on associated frame difference method
CN107993254A
Wafer defect detection method and system based on color difference image model
CN114463314A
Wafer detection method and device, storage medium and equipment
CN118967648A
Apparatus, method and program product for matching with a template
US20080205769A1