A marker positioning method, a marker positioning device, and a storage medium

By performing template matching and axisymmetry correction on the detection image of the object under test, the problem of cumbersome and inefficient localization processes for different types of markers is solved, achieving efficient and accurate marker localization.

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

Patent Information

Application Number
CN202510314645.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-03-18
Publication Date
2025-12-09
Estimated Expiration
2045-03-18

AI Technical Summary

Technical Problem

Existing technologies require the manual creation of multiple templates when locating different types of markers, resulting in a cumbersome, inefficient, and inaccurate process.

Method used

By acquiring the detection image and template image of the object to be tested, template matching is performed using the general structure of the surface of the object to be tested and the fixed positional relationship between the markers to obtain the preliminary coordinates of the markers. Then, the axial symmetry of the markers is used for correction to obtain the final coordinates of the markers.

Benefits of technology

It eliminates the need for manual template creation, simplifies the positioning process, and improves positioning accuracy and efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119832350B_ABST
    Figure CN119832350B_ABST
Patent Text Reader

Abstract

A marker positioning method, a marker positioning device and a storage medium, the method uses the features that the surface of the object to be measured has a first general structure and a first marker, and the first marker and the first general structure have a fixed positional relationship, acquires a template image including contour information of the first general structure, performs matching on a detection image of the object to be measured, and obtains a matching area containing the first general structure on the detection image; positions the first marker in the matching area according to the fixed positional relationship between the first marker and the first general structure, and acquires preliminary coordinates of a center point of the first marker; and corrects the preliminary coordinates by using the axial symmetry of the first marker, so that the corrected coordinates are located on the axis of symmetry, and finally obtains the final coordinates of the center point of the first marker. The technical scheme of the present application can realize positioning of different types of markers using the same template, and is more simple and efficient compared with the prior art.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of optical detection, in particular to a mark positioning method, a mark positioning device and a storage medium. BACKGROUND

[0002] In the optical detection process of wafers, panels and other products, before the products are detected, the products need to be aligned and the placement position of the products is corrected, the main purpose of which is to correct deviation and determine the position of specific detection points, so as to ensure the normal progress of the subsequent detection process. In order to facilitate alignment, a special mark is usually made on the product during the process of manufacturing the product, and the alignment of the product is achieved by positioning the mark.

[0003] At present, a template matching method is usually used to position the mark. However, different marks of different products are different. Please refer to Figure 1 , Figure 1 Four kinds of marks are shown, in which the cross-shaped structure in the center of each picture is a mark. As can be seen, there are differences between these marks. In order to position different marks, a common way is to create a template for each kind of mark, which can effectively ensure the matching accuracy, but the creation and adjustment of each template need human intervention, so this way is tedious and inefficient. On this basis, an improved way is to create a template library, and extract representative templates from the numerous templates in the template library, so as to reduce the number of templates. Specifically, the template library is traversed and matched each time, and the template with the highest score is selected as the final template. Although this way realizes automation, the accuracy is decreased. SUMMARY

[0004] The technical problem solved by the present application is how to efficiently adapt to the positioning requirements of different types of marks.

[0005] According to a first aspect, in an embodiment, a mark positioning method is provided, comprising:

[0006] obtaining a detection image of a to-be-detected object, the to-be-detected object having a first general structure and a first mark on the surface, the first mark and the first general structure having a fixed positional relationship, and the first mark having axial symmetry;

[0007] obtaining a template image, the template image comprising contour information of the first general structure;

[0008] performing template matching on the detection image using the template image to obtain a matching region of the detection image containing the first general structure;

[0009] locating the first mark in the matching region according to the fixed positional relationship between the first mark and the first general structure, and obtaining preliminary coordinates of the center point of the first mark;

[0010] expanding the first mark in the detection image according to the preliminary coordinates of the center point of the first mark to obtain a first region;

[0011] detecting a deviation between the preliminary coordinates of the center point of the first mark and a symmetry axis of the first mark based on the first region, correcting the preliminary coordinates of the center point of the first mark according to the deviation, so that the corrected coordinates are located on the symmetry axis to obtain final coordinates of the center point of the first mark.

[0012] In some embodiments, the template matching on the detection image using the template image to obtain a matching region containing the first general structure in the detection image comprises:

[0013] selecting a plurality of scaling factors in a preset scaling factor interval with a preset step, and scaling the template image using the selected plurality of scaling factors to obtain a plurality of template images with different scaling factors;

[0014] performing template matching on the detection image using the plurality of template images with different scaling factors respectively to obtain a matching region and a matching score corresponding to each template image, and selecting the matching region with the largest matching score as the final matching region.

[0015] In some embodiments, the upper limit value of the scaling factor interval is greater than 1, and the lower limit value is less than 1.

[0016] In some embodiments, before the scaling of the template image using the selected plurality of scaling factors, the method further comprises: calculating gradient information of each pixel point in the template image, and screening each pixel point according to the gradient information to obtain first contour feature points; and the plurality of template images with different scaling factors comprise the first contour feature points obtained after scaling.

[0017] The template matching on the detection image using the plurality of template images with different scaling factors respectively to obtain a matching region and a matching score corresponding to each template image comprises:

[0018] obtaining first contour feature points of each template image in the plurality of template images with different scaling factors;

[0019] calculating gradient information of each pixel point in the detection image, and screening each pixel point according to the gradient information to obtain second contour feature points;

[0020] quantize the gradient information of the first contour feature point and the gradient information of the second contour feature point in direction respectively to obtain corresponding quantized gradient angles;

[0021] For each template image, slide it on the detection image, and form a second region corresponding to the template image on the detection image at each position. Calculate the matching score of the second region according to the angle difference between the quantized gradient angle corresponding to the first contour feature point and the quantized gradient angle corresponding to the second contour feature point in the second region, and take the second region with the highest matching score as the matching region corresponding to the template image.

[0022] In some embodiments, the method further comprises: calculating the gradient information of each pixel point in the template image, and screening each pixel point according to the gradient information to obtain the first contour feature point, including: calculating the gradient amplitude and gradient direction of each pixel point in the template image, for each pixel point, judging whether the gradient amplitude of the pixel point is greater than a first threshold t1 and whether there are multiple pixel points with the same gradient direction and greater than a second threshold n1 in the neighborhood of the pixel point, if yes, retaining the pixel point as the first contour feature point.

[0023] The method further comprises: calculating the gradient information of each pixel point in the detection image, and screening each pixel point according to the gradient information to obtain the second contour feature point, including: calculating the gradient amplitude and gradient direction of each pixel point in the detection image, for each pixel point, judging whether the gradient amplitude of the pixel point is greater than a first threshold t1, if yes, retaining the pixel point as the second contour feature point.

[0024] In some embodiments, the method further comprises: quantizing the gradient information of the first contour feature point and the gradient information of the second contour feature point in direction respectively to obtain corresponding quantized gradient angles, including:

[0025] In the case of ignoring the influence of polarity, equally divide 0-180° into N angle intervals, and configure a unique value for each angle interval as the quantized gradient angle of the angle interval, where N is an integer not less than 2.

[0026] Judging the angle interval to which the gradient direction in the gradient information of the first contour feature point belongs, and taking the quantized gradient angle of the belonging angle interval as the quantized gradient angle corresponding to the first contour feature point.

[0027] Judging the angle interval to which the gradient direction in the gradient information of the second contour feature point belongs, and taking the quantized gradient angle of the belonging angle interval as the quantized gradient angle corresponding to the second contour feature point.

[0028] In some embodiments, after the gradient information of the first contour feature points and the gradient information of the second contour feature points are respectively quantized in the direction of angle to obtain corresponding quantized gradient angles, the method further comprises: for each first contour feature point in the template image, superimposing the corresponding quantized gradient angle on other pixel points in the neighborhood of the first contour feature point, so that other first contour feature points located in the neighborhood of the first contour feature point have at least two quantized gradient angles.

[0029] The calculating the matching score of the second region according to the angle difference between the quantized gradient angle corresponding to the first contour feature point and the quantized gradient angle corresponding to the second contour feature point in the second region comprises:

[0030] For each first contour feature point, if the corresponding pixel position in the second region is a second contour feature point, and the quantized gradient angle of the second contour feature point is the same as any quantized gradient angle of the first contour feature point, a first score is counted.

[0031] If the corresponding pixel position in the second region is a second contour feature point, and the quantized gradient angle of the second contour feature point is not the same as any quantized gradient angle of the first contour feature point, but adjacent to any quantized gradient angle of the first contour feature point, a second score is counted.

[0032] If the corresponding pixel position in the second region is a second contour feature point, and the quantized gradient angle of the second contour feature point is neither the same as any quantized gradient angle of the first contour feature point nor adjacent to any quantized gradient angle of the first contour feature point, a third score is counted.

[0033] If the corresponding pixel position in the second region does not exist a second contour feature point, a third score is counted; wherein the first score is greater than the second score, and the second score is greater than the third score.

[0034] The scores of all first contour feature points are added to obtain the matching score of the second region.

[0035] In some embodiments, the first mark has a symmetry axis parallel to the X-axis of the image and a symmetry axis parallel to the Y-axis of the image, and the first region comprises a first sub-region and a second sub-region.

[0036] The correcting the preliminary coordinates of the center point of the first mark according to the deviation between the preliminary coordinates of the center point of the first mark and the symmetry axis of the first mark, so that the corrected coordinates are located on the symmetry axis to obtain the final coordinates of the center point of the first mark, comprises:

[0037] Obtain the first sub-region, whose coordinate range on the X-axis is [ x 0- x 1, x 0+ x 1], the coordinate range on the Y-axis is [ y 0- y 1, y 0+ y 1], where, ( x 0, y 0) represents the initial coordinates of the center point of the first mark. x 1 and y 1 is the preset expansion amount, and x 1> y 1,2 x 1> w ,in w The width of the first mark is given; based on the first sub-region, the deviation between the X coordinate in the preliminary coordinates of the center point of the first mark and the axis of symmetry parallel to the Y axis of the image is detected, and the X coordinate in the preliminary coordinates of the center point of the first mark is corrected according to the deviation, so that the corrected X coordinate is on the axis of symmetry parallel to the Y axis of the image, and the final X coordinate of the center point of the first mark is obtained.

[0038] Obtain the second sub-region, whose coordinate range on the X-axis is [ x 0- x 2, x 0+ x 2], the coordinate range on the Y-axis is [ y 0- y 2, y 0+ y 2], where, x 2 and y 2 is the preset expansion amount, and x 2< y 2,2 y 2> h ,in h The height of the first mark is given; based on the second sub-region, the deviation between the Y coordinate in the preliminary coordinates of the center point of the first mark and the axis of symmetry parallel to the X-axis of the image is detected, and the Y coordinate in the preliminary coordinates of the center point of the first mark is corrected according to the deviation, so that the corrected Y coordinate is on the axis of symmetry parallel to the X-axis of the image, thus obtaining the final Y coordinate of the center point of the first mark.

[0039] In some embodiments, the deviation between the X coordinate in the preliminary coordinate of the center point of the first mark and the symmetry axis parallel to the Y axis of the image is detected based on the first sub-region, and the X coordinate in the preliminary coordinate of the center point of the first mark is corrected according to the deviation, so that the corrected X coordinate is on the symmetry axis parallel to the Y axis of the image, including:

[0040] The gray scale projection in the Y direction is performed on the first sub-region to obtain a first projection curve, the autocorrelation function of the first projection curve is calculated, the coordinate offset corresponding to the maximum autocorrelation value of the autocorrelation function of the first projection curve is obtained, and the X coordinate in the preliminary coordinate of the center point of the first mark is corrected according to the coordinate offset, so that the corrected X coordinate is on the symmetry axis parallel to the Y axis of the image.

[0041] The deviation between the Y coordinate in the preliminary coordinate of the center point of the first mark and the symmetry axis parallel to the X axis of the image is detected based on the second sub-region, and the Y coordinate in the preliminary coordinate of the center point of the first mark is corrected according to the deviation, so that the corrected Y coordinate is on the symmetry axis parallel to the X axis of the image, including:

[0042] The gray scale projection in the X direction is performed on the second sub-region to obtain a second projection curve, the autocorrelation function of the second projection curve is calculated, the coordinate offset corresponding to the maximum autocorrelation value of the autocorrelation function of the second projection curve is obtained, and the Y coordinate in the preliminary coordinate of the center point of the first mark is corrected according to the coordinate offset, so that the corrected Y coordinate is on the symmetry axis parallel to the X axis of the image.

[0043] According to a second aspect, an embodiment provides a mark positioning device, including:

[0044] A detection image acquisition module is configured to acquire a detection image of an object to be detected, the surface of the object to be detected having a first general structure and a first mark, the first mark and the first general structure having a fixed positional relationship, and the first mark having axial symmetry.

[0045] A template image acquisition module is configured to acquire a template image, the template image including contour information of the first general structure.

[0046] A template matching module is configured to perform template matching on the detection image using the template image to obtain a matching region of the detection image containing the first general structure.

[0047] A preliminary positioning module is configured to position the first mark in the matching region according to the fixed positional relationship between the first mark and the first general structure, and acquire preliminary coordinates of a center point of the first mark.

[0048] The first region acquisition module is used to obtain a first region in the detection image by expanding the region by a preset size, based on the preliminary coordinates of the center point of the first mark.

[0049] The final positioning module is used to detect the deviation between the preliminary coordinates of the center point of the first mark and the axis of symmetry of the first mark based on the first region, and to correct the preliminary coordinates of the center point of the first mark according to the deviation so that the corrected coordinates are located on the axis of symmetry, thereby obtaining the final coordinates of the center point of the first mark.

[0050] In some embodiments, the template matching module uses the template image to perform template matching on the detection image to obtain a matching region on the detection image containing a first general structure, including:

[0051] The template matching module selects multiple scaling factors within a preset scaling factor range with a preset step size, and uses the selected multiple scaling factors to scale the template image to obtain multiple template images with different scaling factors.

[0052] The template matching module uses multiple template images with different scaling factors to perform template matching on the detection image, obtains the matching region and matching score corresponding to each template image, and selects the matching region with the highest matching score as the final matching region.

[0053] In some embodiments, the first marker has an axis of symmetry parallel to the X-axis of the image and an axis of symmetry parallel to the Y-axis of the image, and the first region includes a first sub-region and a second sub-region.

[0054] The final positioning module specifically performs the following operations:

[0055] The final positioning module obtains a first sub-region, and the coordinate range of the first sub-region on the X-axis is []. x 0- x 1, x 0+ x 1], the coordinate range on the Y-axis is [ y 0- y 1, y 0+ y 1], where, ( x 0, y 0) represents the initial coordinates of the center point of the first mark. x 1 and y 1 is the preset expansion amount, and x 1> y 1,2 x 1> w ,in wThe width of the first mark; based on the first sub-region, detecting a deviation between an X coordinate in the preliminary coordinate of the center point of the first mark and a symmetry axis parallel to the Y axis of the image, correcting the X coordinate in the preliminary coordinate of the center point of the first mark according to the deviation, so that the corrected X coordinate is on the symmetry axis parallel to the Y axis of the image, to obtain a final X coordinate of the center point of the first mark;

[0056] The final positioning module obtains a second sub-region, the coordinate range of the second sub-region on the X axis is [ x 0- x 2, x 0+ x 2] and the coordinate range of the second sub-region on the Y axis is [ y 0- y 2, y 0+ y 2], wherein x 2 and y 2 are preset extension amounts, and x 2< y 2, 2 y 2> h , wherein h is the height of the first mark; based on the second sub-region, detecting a deviation between a Y coordinate in the preliminary coordinate of the center point of the first mark and a symmetry axis parallel to the X axis of the image, correcting the Y coordinate in the preliminary coordinate of the center point of the first mark according to the deviation, so that the corrected Y coordinate is on the symmetry axis parallel to the X axis of the image, to obtain a final Y coordinate of the center point of the first mark.

[0057] According to a third aspect, in an embodiment, a computer readable storage medium is provided, and the medium stores a program which can be executed by a processor to implement the mark positioning method of the first aspect.

[0058] The marker positioning method, marker positioning device, and storage medium according to the above embodiments utilize the feature that the surface of the object to be measured has a first general structure and a first marker, and that there is a fixed positional relationship between the first marker and the first general structure. A template image including the contour information of the first general structure is acquired, and matched on the detection image of the object to be measured to obtain a matching region containing the first general structure in the detection image. Based on the fixed positional relationship between the first marker and the first general structure, the first marker is positioned in the matching region, and the preliminary coordinates of the center point of the first marker are obtained. Then, the axial symmetry of the first marker is used to correct the preliminary coordinates of the center point of the first marker, so that the corrected coordinates are located on the axis of symmetry, thus obtaining the final coordinates of the center point of the first marker. The technical solution of this application can use the same template to achieve the positioning of different types of markers. Compared with the prior art, it does not require manual creation of templates or the creation of a template library, making it simpler and more efficient. Furthermore, after obtaining the preliminary coordinates of the center point of the first marker, the axial symmetry of the first marker is used for coordinate correction, improving the positioning accuracy. Attached Figure Description

[0059] Figure 1 Images of markings on the surface of some products;

[0060] Figure 2 Here are flowcharts of marker localization methods for some embodiments;

[0061] Figure 3 This is a template image for one embodiment;

[0062] Figure 4 To adopt Figure 3 A schematic diagram of the preliminary coordinates of the center point of the first mark obtained by template matching of two types of wafers using the template image;

[0063] Figure 5 To Figure 4 A schematic diagram showing the final coordinates of the center point of the first mark after correction based on the axial symmetry of the first mark;

[0064] Figure 6 This is a flowchart illustrating how multiple template images with different scaling factors are used to perform template matching on a detection image in one embodiment, thereby obtaining the matching region and matching score corresponding to each template image.

[0065] Figure 7 for Figure 3 A schematic diagram of the first contour feature points selected from the template image;

[0066] Figure 8 This is a schematic diagram of the quantized gradient angle of a portion of the first contour feature points on the template image in one embodiment;

[0067] Figure 9 For Figure 8 The result obtained after gradient diffusion is performed;

[0068] Figure 10 is a flowchart for calculating the matching score of the second region according to the angle difference between the quantized gradient angle corresponding to the first contour feature point and the quantized gradient angle corresponding to the second contour feature point in the second region in an embodiment;

[0069] Figure 11 is a schematic diagram of a first sub-region of an embodiment;

[0070] Figure 12 is a schematic diagram of a second sub-region of an embodiment;

[0071] Figure 13 is a structural schematic diagram of a marker positioning device of some embodiments. DETAILED DESCRIPTION

[0072] The application will be further described in details through specific embodiments in combination with the drawings. In different embodiments, similar elements are associated with similar element labels. In the following embodiments, many details are described in order to make the application better understood. However, those skilled in the art can easily recognize that some features can be omitted in different cases, or can be replaced by other elements, materials, methods. In some cases, some operations related to the application are not shown or described in the specification, in order to avoid the core part of the application being overwhelmed by too much description, and it is not necessary to describe these related operations in detail for those skilled in the art according to the description in the specification and general technical knowledge in the art.

[0073] In addition, the features, operations or characteristics described in the specification can be combined in any appropriate manner to form various embodiments. At the same time, the steps or actions in the method description can also be sequentially adjusted or adjusted in a manner that is obvious to those skilled in the art. Therefore, the order in the specification and the drawings is only for the purpose of clearly describing a certain embodiment, and does not mean that it is the necessary order, unless otherwise stated that a certain order must be followed.

[0074] The serial numbers of components in this paper, such as "first", "second", etc., are only used to distinguish the described objects, and do not have any order or technical meaning. Unless otherwise specified, "connection", "coupling" in this application includes direct and indirect connection (coupling).

[0075] Applicants find that for some products (such as wafers, display panels, substrates, etc.), there are commonalities among different products, i.e., their surfaces all have a same structure, and a mark is made at a specific position with a fixed positional relationship with the same structure. For example Figure 1 For wafer surface images, it can be seen that the surfaces of these wafers all have two intersecting cutting tracks formed by a cutting knife or laser cutting, and the mark is located at the center position of the intersection region of the two cutting tracks. In this application, these same structures are referred to as common structures. This application creates a template for the common structures, and by matching the common structures, the mark can be located according to the fixed positional relationship between the mark and the common structure. In this way, only one matching template for the common structures is needed, and a template does not need to be created for each type of mark, greatly simplifying the work needed to locate different types of marks.

[0076] In addition, the mark often has axial symmetry (such as the cross-shaped structure in Figure 1 ), and in order to further improve the positioning accuracy, after the preliminary position of the mark is determined by template matching, the axial symmetry of the mark is used to correct the preliminary position of the mark to obtain the final position. Through this coarse-to-fine positioning method, not only can different types of marks be located using a single template, but the positioning accuracy is also improved.

[0077] Referring to Figure 2 , the mark positioning method in some embodiments of this application includes steps 100-600, which are described in detail below.

[0078] Step 100: Obtain a detection image of an object to be measured.

[0079] The object to be measured can be a wafer, a display panel, a substrate, etc., and its surface has a first common structure and a first mark, and the first mark and the first common structure have a fixed positional relationship. Figure 1 An example is given, and in other embodiments, the first common structure can be other shapes of structures, such as a rectangular shape, a triangular shape, or a specific pattern, etc. The first mark and the first common structure can have other positional relationships, such as when the first common structure is a rectangular structure, the first mark can be located at the center of the rectangle or at one of the corners of the rectangle, etc. The first mark has axial symmetry, and in addition to the cross shape shown in Figure 1 , the first mark can also be other shapes, such as a star shape, etc.

[0080] Step 200: Obtain a template image, and the template image includes contour information of the first common structure.

[0081] The template image can be a binary image that depicts the contour or edge of the first common structure, and the binary image can be drawn according to the shape and size of the first common structure. For example, if the first common structure is a rectangular structure, the binary image can be drawn as follows:Figure 1 Taking the two intersecting cutting lines as an example, first, the width of the two cutting lines (in pixels) is estimated. Then, the outlines of the two intersecting cutting lines are drawn on the image. The edges of the two cutting lines are represented by high gray values ​​(e.g., 255), and the rest are represented by 0 gray values. Figure 3 As shown. Since the marker is located at the center of the intersection area of ​​the two cutting tracks, the intersection area of ​​the two cutting tracks is drawn at the center of the template image to facilitate the positioning of the marker. The length of the cutting track outline can be set according to actual needs.

[0082] Step 300: Use the template image to perform template matching on the detection image to obtain the matching region in the detection image that contains the first general structure.

[0083] Since the template image includes the contour information of the first general structure, the matching score between the region on the detection image and the template image can be calculated by shape matching to obtain the matching region containing the first general structure. In some embodiments, the template image is slid across the detection image, and a second region corresponding to the template image is formed on the detection image at each position, that is, the region on the detection image covered by the template image; then the matching score between the second region and the template image is calculated, and the second region with the highest matching score is taken as the matching region.

[0084] Due to the size of the first general structure (e.g.) Figure 1 The width of the cutting channel is usually estimated manually, and therefore may deviate from the actual size. Therefore, in some embodiments, the template image is scaled by multiple scaling factors, and template matching is performed using template images with different scaling factors. The matching region with the highest matching score is taken as the final matching region, thereby reducing the error caused by the deviation between the estimated size of the first general structure and the actual size. Specifically, step 300 includes: selecting multiple scaling factors within a preset scaling factor range with a preset step size; scaling the template image using the selected scaling factors to obtain multiple template images with different scaling factors; performing template matching on the detection image using the multiple template images with different scaling factors to obtain the matching region and matching score corresponding to each template image; and selecting the matching region with the highest matching score as the final matching region.

[0085] The scaling factor range and step size can be set according to the actual application scenario. In some embodiments, considering that the estimated size of the first general structure may be larger or smaller than the actual size, the upper bound of the scaling factor range is greater than 1 and the lower bound is less than 1. For example, the scaling factor range is [0.8, 1.5] and the step size is 0.1.

[0086] Step 400: locating the first mark in the matching region according to the fixed positional relationship between the first mark and the first general structure, and obtaining the preliminary coordinates of the center point of the first mark.

[0087] It can be understood that, since the matching region contains the first general structure, and the positional relationship between the first mark and the first general structure is known, the first mark can be located in the matching region, and the preliminary coordinates of the center point of the first mark are obtained. For example, for the template image shown in Figure 3 , the intersection region of the two cutting tracks is drawn at the center of the template image, and the mark is located at the center position of the intersection region of the two cutting tracks, so the preliminary coordinates of the center point of the first mark are the coordinates of the center point of the matching region.

[0088] Please refer to Figure 4 , which is a schematic diagram of the preliminary coordinates of the center point of the first mark obtained by template matching of two wafers using the template image shown in Figure 3 . The black cross in the figure schematically shows the preliminary coordinates of the center point of the first mark. It can be seen that there is still deviation between the obtained preliminary coordinates and the actual position of the center point of the first mark, so the subsequent steps 500-600 are used to correct it by using the axial symmetry of the first mark.

[0089] Step 500: expanding a region of a preset size based on the preliminary coordinates of the center point of the first mark to obtain a first region in the detection image.

[0090] For example, if the preliminary coordinates of the center point of the first mark are (520, 520), and a region expansion of 100x10 is performed, the X coordinate range of the obtained first region is [470, 570], and the Y coordinate range is [515, 525]. The purpose of obtaining the first region is to detect the deviation between the preliminary coordinates of the center point of the first mark and the symmetry axis of the first mark. The size of the first region can be determined according to the direction of the symmetry axis, the size of the first mark, etc. For example, if the symmetry axis of the first mark is along the X axis direction of the image, a first region with higher height in the Y direction and narrower width in the X direction can be obtained, and the height of the first region in the Y direction is greater than the height of the first mark in the Y direction; if the symmetry axis of the first mark is along the Y axis direction of the image, a first region with wider width in the X direction and narrower height in the Y direction can be obtained, and the width of the first region in the X direction is greater than the width of the first mark in the X direction.

[0091] Step 600: based on the first region, detecting the deviation between the preliminary coordinates of the center point of the first mark and the symmetry axis of the first mark, and correcting the preliminary coordinates of the center point of the first mark according to the deviation, so that the corrected coordinates are located on the symmetry axis, to obtain the final coordinates of the center point of the first mark.

[0092] The deviation between the preliminary coordinate of the center point of the first mark and the symmetry axis of the first mark can be achieved by using related prior art, for example, performing gray-scale projection on the first region in the direction of the symmetry axis to obtain a projection curve, then obtaining the autocorrelation function of the projection curve, the independent variable of the autocorrelation function being the coordinate offset, determining the coordinate offset corresponding to the maximum autocorrelation value from the autocorrelation function, and correcting the preliminary coordinate of the center point of the first mark according to the coordinate offset.

[0093] Reference is made to Figure 5 , in order to correct Figure 4 the preliminary coordinate of the center point of the first mark in (a) according to the axial symmetry of the first mark, the final coordinate obtained can be seen from the schematic diagram, which basically coincides with the actual position of the center point of the first mark.

[0094] In some embodiments, the gradient information of the image is used for matching between the template image and the detection image. First, the contour feature points in the template image and the detection image are extracted, and the matching is performed according to the gradient angles of the contour feature points in the template image and the detection image. Since the template image is scaled by multiple scaling factors, and the contour feature points of each scaling factor of the template image are extracted, the calculation amount is large, so the template image is scaled after the contour feature points are extracted. Specifically, before the template image is scaled by the selected multiple scaling factors, the gradient information of each pixel point in the template image is calculated, and each pixel point is screened according to the gradient information to obtain first contour feature points. On this basis, as shown in Figure 6 , in step 300, the template images of multiple different scaling factors are used for template matching on the detection image to obtain the matching region and the matching score corresponding to each template image, including steps 310-340, which will be described below.

[0095] Step 310: Obtain the first contour feature points of each template image in the multiple template images of different scaling factors. It can be understood that the multiple template images of different scaling factors include the first contour feature points obtained after scaling.

[0096] Step 320: Calculate the gradient information of each pixel point in the detection image, and screen each pixel point according to the gradient information to obtain second contour feature points, that is, extract the contour feature points of the detection image.

[0097] The gradient information usually includes gradient amplitude and gradient direction. For the screening of contour feature points, since they are at the edge of the object, the gradient amplitude is large, and the pixel points with gradient amplitude greater than a set threshold value can be selected as contour feature points.

[0098] Step 330: quantize the gradient information of the first contour feature point and the gradient information of the second contour feature point in direction respectively to obtain corresponding quantized gradient angles.

[0099] Generally, the angle of the calculated gradient direction is continuous, ranging from 0-360°. When the gradient direction is quantized in angle, the angle range is equally divided into multiple angle intervals, and each angle interval is identified by a unique numerical value as the quantized gradient angle. The quantized gradient angle of the angle interval to which the gradient direction of the gradient information of the first contour feature point and the gradient information of the second contour feature point belongs is taken as the quantized gradient angle of the first contour feature point and the second contour feature point. For example, 0-360° is equally divided into 9 angle intervals, which are identified by numerical values 0-8, respectively. Then 0-40° is recorded as 0, 40-80° is recorded as 1, and so on.

[0100] In some embodiments, the influence of the polarity of the gradient angle can be ignored, i.e., the angle of 180°-360° is converted to the angle range of 0°-180°, so that the overall angle range is 0°-180°. At this time, step 330 specifically comprises: equally dividing 0-180° into N angle intervals, configuring a unique numerical value for each angle interval as the quantized gradient angle of the angle interval, wherein N is an integer not less than 2; judging the angle interval to which the gradient direction of the gradient information of the first contour feature point belongs, and taking the quantized gradient angle of the angle interval as the corresponding quantized gradient angle of the first contour feature point; judging the angle interval to which the gradient direction of the gradient information of the second contour feature point belongs, and taking the quantized gradient angle of the angle interval as the corresponding quantized gradient angle of the second contour feature point.

[0101] Step 340: for each template image, slide it on the detection image, and form a second region corresponding to the template image on the detection image at each position. Calculate the matching score of the second region according to the angle difference between the corresponding quantized gradient angle of the first contour feature point and the corresponding quantized gradient angle of the second contour feature point in the second region, and take the second region with the highest matching score as the matching region corresponding to the template image.

[0102] It can be understood that the smaller the angle difference between the corresponding quantized gradient angle of the first contour feature point and the corresponding quantized gradient angle of the second contour feature point, the higher the matching score.

[0103] In the embodiment, the gradient information of the first contour feature points and the gradient information of the second contour feature points are respectively quantized in the direction of angle to obtain corresponding quantized gradient angles, and a matching score is calculated according to the angle difference between the quantized gradient angles corresponding to the first contour feature points and the quantized gradient angles corresponding to the second contour feature points, so as to discretize the gradient angles into a limited number of discrete values, simplify the calculation process, and improve the calculation efficiency. Meanwhile, the quantized gradient angles can reduce the influence of noise and illumination changes on the features, which is conducive to improving the robustness to illumination changes and making the description of the contour features more stable and reliable.

[0104] In some embodiments, the gradient information of each pixel point in the template image is calculated, each pixel point is screened according to the gradient information, and the first contour feature points are obtained. The gradient amplitude and the gradient direction of each pixel point in the template image are calculated. For each pixel point, it is determined whether the gradient amplitude of the pixel point is greater than a first threshold t1 and whether there are a plurality of pixel points with the same gradient direction in the neighborhood of the pixel point and the number of the pixel points is greater than a second threshold n1. If yes, the pixel point is retained as the first contour feature point. The size of the neighborhood can be 3*3, etc. Figure 7 The first contour feature points screened from the template image are shown in Figure 3 . The gradient information of each pixel point in the detection image is calculated, and each pixel point is screened according to the gradient information to obtain the second contour feature points. The gradient amplitude and the gradient direction of each pixel point in the detection image are calculated. For each pixel point, it is determined whether the gradient amplitude of the pixel point is greater than the first threshold t1. If yes, the pixel point is retained as the second contour feature point.

[0105] In the embodiment, for the pixel points of the template image, it is not only determined whether the gradient amplitude is large, but also determined whether there are a plurality of pixel points with the same gradient direction in the neighborhood and the number of the pixel points is greater than the second threshold n1, so that the first contour feature points can be more accurately extracted. For the detection image, the second contour feature points are extracted according to the gradient amplitude only, so that too many pixel points are not screened out, and more useful information can be retained.

[0106] In some embodiments, after the gradient information of the first contour feature points and the gradient information of the second contour feature points are respectively quantized in the direction of angle to obtain corresponding quantized gradient angles, gradient diffusion is performed on the template image. Specifically, for each first contour feature point in the template image, the corresponding quantized gradient angle is superimposed on other pixel points in the neighborhood of the first contour feature point, so that other first contour feature points located in the neighborhood of the first contour feature point have at least two quantized gradient angles.

[0107] Please refer to Figure 8 and Figure 9 , Figure 8The quantized gradient angles of the six first contour feature points are shown. If the neighborhood size of diffusion is set as 3x3, the quantized gradient angle of the first contour feature point g is superimposed on the eight surrounding pixel points. Since the first contour feature point in the neighborhood already has a quantized gradient angle, and the quantized gradient angle of the other first contour feature points is superimposed, the first contour feature point g will have at least two quantized gradient angles. Figure 8 The gradient diffusion results of the six first contour feature points in the first region are shown. Figure 9 It can be seen from the gradient diffusion results shown that the first contour feature point g contains three quantized gradient angles.

[0108] Referring to FIG. 10, in step 340, the matching score of the second region is calculated according to the angle difference between the quantized gradient angle of the first contour feature point and the quantized gradient angle of the second contour feature point in the second region, which includes steps 341-347, which are described below.

[0109] Step 341: For each first contour feature point, it is determined whether the corresponding pixel position in the second region is a second contour feature point. If yes, step 342 is performed, otherwise, step 346 is performed.

[0110] Step 342: The quantized gradient angle of the second contour feature point is compared with the quantized gradient angles contained in the first contour feature point. If the quantized gradient angle of the second contour feature point is the same as any quantized gradient angle of the first contour feature point, step 343 is performed. If the quantized gradient angle of the second contour feature point is not the same as any quantized gradient angle of the first contour feature point, but is adjacent to any quantized gradient angle of the first contour feature point, step 344 is performed. If the quantized gradient angle of the second contour feature point is neither the same as any quantized gradient angle of the first contour feature point nor adjacent to any quantized gradient angle of the first contour feature point, step 345 is performed.

[0111] Suppose the quantized gradient angles contained in the first contour feature point are [0, 2, 5]. If the quantized gradient angle of the second contour feature point is 0, 2 or 5, step 343 is performed. If the quantized gradient angle of the second contour feature point is 1, 3, 4 or 6, step 344 is performed. If the quantized gradient angle of the second contour feature point is 7 or 8, step 345 is performed.

[0112] Step 343: A first score is counted.

[0113] Step 344: A second score is counted, wherein the first score is greater than the second score.

[0114] Step 345: A third score is counted, wherein the second score is greater than the third score.

[0115] Step 346: count the third score. At this time, the corresponding pixel position in the second region does not exist the second contour feature point, and is obviously not matched with the first contour feature point, so a low score should be counted.

[0116] Step 347: add the scores of all the first contour feature points to obtain the matching score of the second region.

[0117] In this embodiment, the template image is matched with the detection image after gradient diffusion, and the gradient of all the first contour feature points in the neighborhood is considered instead of the gradient of a single first contour feature point, which can enhance the robustness of the algorithm, so that the matching result is more reliable.

[0118] In some embodiments, the first mark has both a symmetry axis parallel to the X axis of the image and a symmetry axis parallel to the Y axis of the image (for example, the mark in Figure 1 In step 500, two region expansions can be performed, and the first region includes the first sub-region and the second sub-region obtained by the two region expansions, respectively, and the first sub-region and the second sub-region are respectively used to correct the X coordinate of the preliminary coordinate of the center point of the first mark by using the symmetry axis parallel to the Y axis of the image, and correct the Y coordinate of the preliminary coordinate of the center point of the first mark by using the symmetry axis parallel to the X axis of the image.

[0119] On this basis, step 600 includes: obtaining the first sub-region, detecting the deviation between the X coordinate of the preliminary coordinate of the center point of the first mark and the symmetry axis parallel to the Y axis of the image based on the first sub-region, correcting the X coordinate of the preliminary coordinate of the center point of the first mark according to the deviation, so that the corrected X coordinate is on the symmetry axis parallel to the Y axis of the image, and obtaining the final X coordinate of the center point of the first mark; obtaining the second sub-region, detecting the deviation between the Y coordinate of the preliminary coordinate of the center point of the first mark and the symmetry axis parallel to the X axis of the image based on the second sub-region, correcting the Y coordinate of the preliminary coordinate of the center point of the first mark according to the deviation, so that the corrected Y coordinate is on the symmetry axis parallel to the X axis of the image, and obtaining the final Y coordinate of the center point of the first mark.

[0120] wherein the coordinate range of the first sub-region on the X axis is [ x 0- x 1, x 0+ x 1], and the coordinate range of the first sub-region on the Y axis is [ y 0- y 1, y 0+ y 1], wherein ( x 0, y 0) is the preliminary coordinate of the center point of the first mark, x1 and y 1 is a preset extension amount for determining the size of the first sub-region, and x 1> y 1, 2 x 1> w , w is the width of the first mark, so that the first sub-region is wider in the X direction and narrower in the Y direction, and the width in the X direction is greater than the width of the first mark in the X direction. Figure 11 is Figure 4 a schematic diagram of the first sub-region obtained in (a) in the above formula (1). Similarly, the coordinate range of the second sub-region on the X axis is [ x 0- x 2, x 0+ x 2] and the coordinate range on the Y axis is [ y 0- y 2, y 0+ y 2], wherein x 2 and y 2 are preset extension amounts, and x 2 y 2, 2 y 2> h , h is the height of the first mark. Figure 12 is Figure 4 a schematic diagram of the second sub-region obtained in (a) in the above formula (2).

[0121] In some embodiments, the deviation between the X coordinate of the preliminary coordinate of the center point of the first mark and the symmetry axis parallel to the Y axis of the image is detected based on the first sub-region, and the X coordinate of the preliminary coordinate of the center point of the first mark is corrected according to the deviation, so that the corrected X coordinate is on the symmetry axis parallel to the Y axis of the image, which includes: performing Y direction gray projection on the first sub-region to obtain a first projection curve; calculating the autocorrelation function of the first projection curve; obtaining the coordinate offset corresponding to the maximum autocorrelation value of the autocorrelation function of the first projection curve, and correcting the X coordinate of the preliminary coordinate of the center point of the first mark according to the coordinate offset, so that the corrected X coordinate is on the symmetry axis parallel to the Y axis of the image.

[0122] The method comprises the following steps: obtaining a second projection curve by performing X direction gray projection on the second sub-region; calculating an autocorrelation function of the second projection curve; obtaining a coordinate offset corresponding to a maximum autocorrelation value of the autocorrelation function of the second projection curve; and correcting the Y coordinate of the preliminary coordinate of the center point of the first mark according to the coordinate offset, so that the corrected Y coordinate is on the symmetry axis parallel to the image X axis.

[0123] The mark positioning method provided by the embodiment of the application uses the characteristics that the surface of the object to be detected has a first general structure and a first mark, and the first mark and the first general structure have a fixed positional relationship, constructs a template image including contour information of the first general structure, performs matching on a detection image of the object to be detected, obtains a matching region containing the first general structure, and then positions the first mark in the matching region according to the fixed positional relationship between the first mark and the first general structure, so that the same template can be used to position different types of marks, and compared with the prior art, the template does not need to be created manually, and a template library does not need to be created, so that the method is more simple and efficient. In addition, after the preliminary coordinate of the center point of the first mark is obtained by template matching, the preliminary coordinate of the center point of the first mark is corrected according to the axial symmetry of the first mark, so that the corrected coordinate is located on the symmetry axis, and the final coordinate of the center point of the first mark is obtained, so that the positioning accuracy is improved. It is verified by experiments that the accuracy can reach one pixel.

[0124] On the basis of the above-mentioned mark positioning method, the application further provides a mark positioning device, please refer to Figure 13 In some embodiments, the device comprises a detection image acquisition module 1, a template image acquisition module 2, a template matching module 3, a preliminary positioning module 4, a first region acquisition module 5 and a final positioning module 6, which are described below.

[0125] The detection image acquisition module 1 is used to acquire a detection image of an object to be detected, the surface of the object to be detected has a first general structure and a first mark, the first mark and the first general structure have a fixed positional relationship, and the first mark has axial symmetry.

[0126] The template image acquisition module 2 is used to acquire a template image, and the template image includes contour information of the first general structure.

[0127] The template matching module 3 is used to perform template matching on the detection image using the template image, and obtain a matching region containing the first general structure on the detection image.

[0128] In some embodiments, the template matching module 3 performs template matching on the detection image using the template image to obtain a matching region on the detection image containing the first general structure, including: the template matching module 3 selects a plurality of scaling factors within a preset scaling factor range with a preset step size, and scales the template image using the selected plurality of scaling factors to obtain a plurality of template images with different scaling factors; the template matching module 3 performs template matching on the detection image using the plurality of template images with different scaling factors to obtain a matching region and a matching score corresponding to each template image, and selects the matching region with the highest matching score as the final matching region.

[0129] In some embodiments, before the template matching module 3 scales the template image using the selected plurality of scaling factors, the template matching module 3 calculates gradient information of each pixel point in the template image, and filters each pixel point according to the gradient information to obtain first contour feature points.

[0130] The template matching module 3 performs template matching on the detection image using the plurality of template images with different scaling factors to obtain a matching region and a matching score corresponding to each template image, including: obtaining first contour feature points of each template image in the plurality of template images with different scaling factors; calculating gradient information of each pixel point in the detection image, and filtering each pixel point according to the gradient information to obtain second contour feature points; performing angular quantization on the gradient information of the first contour feature points and the gradient information of the second contour feature points, respectively, to obtain corresponding quantized gradient angles; for each template image, slide it on the detection image, and each time it slides to a position, it forms a second region on the detection image corresponding to the template image, calculates a matching score of the second region according to the angle difference between the quantized gradient angles of the first contour feature points and the quantized gradient angles of the second contour feature points in the second region, and selects the second region with the highest matching score as the matching region corresponding to the template image. For angular quantization, please refer to step 330 above, which will not be repeated here.

[0131] In some embodiments, the template matching module 3 calculates gradient information of each pixel in the template image, and screens each pixel according to the gradient information to obtain the first contour feature point, including: the template matching module 3 calculates the gradient amplitude and the gradient direction of each pixel in the template image, for each pixel, judges whether the gradient amplitude of the pixel is greater than a first threshold t1, and whether there are multiple pixels with the same gradient direction and greater than a second threshold n1 in the neighborhood of the pixel, if yes, the pixel is reserved as the first contour feature point. The template matching module 3 calculates the gradient information of each pixel in the detection image, and screens each pixel according to the gradient information to obtain the second contour feature point, including: the template matching module 3 calculates the gradient amplitude and the gradient direction of each pixel in the detection image, for each pixel, judges whether the gradient amplitude of the pixel is greater than the first threshold t1, if yes, the pixel is reserved as the second contour feature point.

[0132] In some embodiments, after the template matching module 3 respectively quantizes the gradient information of the first contour feature point and the gradient information of the second contour feature point in the direction of the angle to obtain the corresponding quantized gradient angle, the template matching module 3 further superimposes the corresponding quantized gradient angle of each first contour feature point in each template image on other pixels in the neighborhood of the first contour feature point, so that other first contour feature points located in the neighborhood of the first contour feature point have at least two quantized gradient angles.

[0133] The template matching module 3 calculates the matching score of the second region according to the angle difference between the quantized gradient angle corresponding to the first contour feature point and the quantized gradient angle corresponding to the second contour feature point in the second region, including: for each first contour feature point, if the corresponding pixel position in the second region is a second contour feature point, and the quantized gradient angle of the second contour feature point is the same as any quantized gradient angle of the first contour feature point, a first score is counted; if the corresponding pixel position in the second region is a second contour feature point, and the quantized gradient angle of the second contour feature point is not the same as any quantized gradient angle of the first contour feature point, but adjacent to any quantized gradient angle of the first contour feature point, a second score is counted; if the corresponding pixel position in the second region is a second contour feature point, and the quantized gradient angle of the second contour feature point is neither the same as any quantized gradient angle of the first contour feature point nor adjacent to any quantized gradient angle of the first contour feature point, a third score is counted; if there is no second contour feature point in the corresponding pixel position in the second region, a third score is counted; the scores of all first contour feature points are added to obtain the matching score of the second region. Wherein, the first score is greater than the second score, and the second score is greater than the third score.

[0134] The preliminary positioning module 4 is configured to position the first mark in the matching region according to the fixed positional relationship between the first mark and the first general structure, and obtain a preliminary coordinate of the center point of the first mark.

[0135] The first region obtaining module 5 is configured to expand the preliminary coordinate of the center point of the first mark by a preset size to obtain a first region in the detection image. For details, refer to the description of step 500 above, which will not be repeated here.

[0136] The final positioning module 6 is configured to correct the preliminary coordinate of the center point of the first mark based on the first region and a deviation between the preliminary coordinate of the center point of the first mark and the symmetry axis of the first mark, so that the corrected coordinate is located on the symmetry axis, and obtain a final coordinate of the center point of the first mark.

[0137] In some embodiments, the first mark has a symmetry axis parallel to the X axis of the image and a symmetry axis parallel to the Y axis of the image, and the first region includes a first sub-region and a second sub-region. The final positioning module 6 specifically performs the following operations:

[0138] The final positioning module 6 obtains the first sub-region, and the coordinate range of the first sub-region on the X axis is [ x 0- x 1, x 0+ x 1] and the coordinate range of the first sub-region on the Y axis is [ y 0- y 1, y 0+ y 1], wherein x 0, y 0) is the preliminary coordinate of the center point of the first mark, x 1 and y 1 are preset expansion amounts, and x 1> y 1, 2 x 1> w , wherein w is the width of the first mark; the final positioning module 6 detects a deviation between the X coordinate in the preliminary coordinate of the center point of the first mark and the symmetry axis parallel to the Y axis of the image based on the first sub-region, and corrects the X coordinate in the preliminary coordinate of the center point of the first mark according to the deviation, so that the corrected X coordinate is located on the symmetry axis parallel to the Y axis of the image, and obtains a final X coordinate of the center point of the first mark.

[0139] The final positioning module 6 obtains the second sub-region, and the coordinate range of the second sub-region on the X axis is [ x 0- x 2, x 0+ x 2] and the coordinate range of the second sub-region on the Y axis is [y 0- y 2, y 0+ y 2], where, x 2 and y 2 is the preset expansion amount, and x 2< y 2,2 y 2> h ,in h The height of the first marker is given; based on the second sub-region, the deviation between the Y coordinate in the preliminary coordinates of the center point of the first marker and the axis of symmetry parallel to the X-axis of the image is detected, and the Y coordinate in the preliminary coordinates of the center point of the first marker is corrected according to the deviation, so that the corrected Y coordinate is on the axis of symmetry parallel to the X-axis of the image, thus obtaining the final Y coordinate of the center point of the first marker.

[0140] In some embodiments, the final positioning module 6, based on a first sub-region, detects the deviation between the X-coordinate in the preliminary coordinates of the center point of the first marker and the axis of symmetry parallel to the Y-axis of the image, and corrects the X-coordinate in the preliminary coordinates of the center point of the first marker according to the deviation, so that the corrected X-coordinate is on the axis of symmetry parallel to the Y-axis of the image. This includes: the final positioning module 6 performing grayscale projection of the first sub-region in the Y direction to obtain a first projection curve; calculating the autocorrelation function of the first projection curve; obtaining the coordinate offset corresponding to the maximum autocorrelation value of the autocorrelation function of the first projection curve; and correcting the X-coordinate in the preliminary coordinates of the center point of the first marker according to the coordinate offset, so that the corrected X-coordinate is on the axis of symmetry parallel to the Y-axis of the image.

[0141] The final positioning module 6, based on the second sub-region, detects the deviation between the Y-coordinate in the preliminary coordinates of the center point of the first marker and the axis of symmetry parallel to the X-axis of the image. Based on this deviation, it corrects the Y-coordinate in the preliminary coordinates of the center point of the first marker so that the corrected Y-coordinate lies on the axis of symmetry parallel to the X-axis of the image. This includes: the final positioning module 6 performing grayscale projection in the X-direction on the second sub-region to obtain a second projection curve; calculating the autocorrelation function of the second projection curve; obtaining the coordinate offset corresponding to the maximum autocorrelation value of the autocorrelation function of the second projection curve; and correcting the Y-coordinate in the preliminary coordinates of the center point of the first marker based on this coordinate offset so that the corrected Y-coordinate lies on the axis of symmetry parallel to the X-axis of the image.

[0142] Those skilled in the art can understand that all or part of the functions of various methods in the above embodiments can be realized by hardware or by a computer program. When all or part of the functions in the above embodiments are realized by a computer program, the program can be stored in a computer readable storage medium, which can include a read-only memory, a random access memory, a magnetic disk, an optical disk, a hard disk, and the like. The above functions are realized by executing the program by a computer. For example, the program is stored in a memory of a device, and the above functions are realized by executing the program in the memory by a processor. In addition, when all or part of the functions in the above embodiments are realized by a computer program, the program can also be stored in a storage medium such as a server, another computer, a disk, an optical disk, a flash disk, or a mobile hard disk, and is saved in a memory of a local device by downloading or copying, or the system of the local device is updated, and the above functions are realized by executing the program in the memory by a processor.

[0143] The above application of specific examples to the present application is described, which is only used to help understand the present application and does not limit the present application. For those skilled in the art, according to the idea of the present application, a number of simple deductions, deformations or substitutions can be made.

Claims

1. A method of marker localization, the method comprising: The method comprises the following steps: obtaining a detection image of a to-be-detected object, the to-be-detected object having a first general structure and a first mark, the first mark and the first general structure having a fixed positional relationship, and the first mark having axial symmetry; obtaining a template image, the template image comprising contour information of the first general structure; performing template matching on the detection image using the template image to obtain a matching region of the detection image containing the first general structure; locating the first mark in the matching region according to the fixed positional relationship between the first mark and the first general structure, and obtaining preliminary coordinates of a center point of the first mark; expanding a first region by a preset size based on the preliminary coordinates of the center point of the first mark in the detection image; detecting a deviation between the preliminary coordinates of the center point of the first mark and an axis of symmetry of the first mark based on the first region, correcting the preliminary coordinates of the center point of the first mark according to the deviation, so that the corrected coordinates are located on the axis of symmetry, and obtaining final coordinates of the center point of the first mark; the step of performing template matching on the detection image using the template image to obtain a matching region of the detection image containing the first general structure comprises the following steps: selecting a plurality of scaling factors in a preset scaling factor interval with a preset step, and scaling the template image using the selected plurality of scaling factors to obtain a plurality of template images with different scaling factors; wherein, before the scaling of the template image using the selected plurality of scaling factors, gradient information of each pixel point in the template image is calculated, and each pixel point is screened according to the gradient information to obtain first contour feature points; the plurality of template images with different scaling factors comprise the first contour feature points obtained after scaling; obtaining the first contour feature points of each template image in the plurality of template images with different scaling factors; calculating gradient information of each pixel point in the detection image, and screening each pixel point according to the gradient information to obtain second contour feature points; performing angular quantization on the gradient information of the first contour feature points and the gradient information of the second contour feature points in the direction to obtain corresponding quantized gradient angles; for each template image, sliding the template image on the detection image, and forming a second region corresponding to the template image on the detection image when sliding to a position, calculating a matching score of the second region according to the angle difference between the quantized gradient angles corresponding to the first contour feature points and the quantized gradient angles corresponding to the second contour feature points in the second region, and taking the second region with the highest matching score as the matching region corresponding to the template image; selecting the matching region with the highest matching score as the final matching region.

2. The marker positioning method of claim 1, wherein The upper limit of the scaling factor interval is greater than 1, and the lower limit is less than 1.

3. The marker positioning method of claim 1, wherein The gradient information of each pixel point in the template image is calculated, and each pixel point is screened according to the gradient information to obtain first contour feature points, including: the gradient amplitude and the gradient direction of each pixel point in the template image are calculated, for each pixel point, it is judged whether the gradient amplitude of the pixel point is greater than a first threshold t1 and whether there are multiple pixel points with the same gradient direction and greater than a second threshold n1 in the neighborhood of the pixel point, if yes, the pixel point is reserved as a first contour feature point; The gradient information of each pixel point in the detection image is calculated, and each pixel point is screened according to the gradient information to obtain second contour feature points, including: the gradient amplitude and the gradient direction of each pixel point in the detection image are calculated, for each pixel point, it is judged whether the gradient amplitude of the pixel point is greater than a first threshold t1, if yes, the pixel point is reserved as a second contour feature point.

4. The marker positioning method of claim 1, wherein The gradient information of the first contour feature point and the gradient information of the second contour feature point are respectively quantized in the direction of the angle to obtain corresponding quantized gradient angles, including: In the case of ignoring the polarity influence, 0-180° is equally divided into N angle intervals, and a unique value is configured for each angle interval as the quantized gradient angle of the angle interval, where N is an integer not less than 2; The angle interval to which the gradient direction in the gradient information of the first contour feature point belongs is judged, and the quantized gradient angle of the belonging angle interval is taken as the corresponding quantized gradient angle of the first contour feature point; The angle interval to which the gradient direction in the gradient information of the second contour feature point belongs is judged, and the quantized gradient angle of the belonging angle interval is taken as the corresponding quantized gradient angle of the second contour feature point.

5. The marker positioning method of claim 1, wherein After the gradient information of the first contour feature point and the gradient information of the second contour feature point are respectively quantized in the direction of the angle to obtain corresponding quantized gradient angles, it further includes: for each first contour feature point in the template image, the corresponding quantized gradient angle is superimposed on other pixel points in the neighborhood of the first contour feature point, so that other first contour feature points located in the neighborhood of the first contour feature point have at least two quantized gradient angles; The matching score of the second region is calculated according to the angle difference between the corresponding quantized gradient angle of the first contour feature point and the corresponding quantized gradient angle of the second contour feature point in the second region, including: For each first contour feature point, if the corresponding pixel position in the second region is a second contour feature point, and the quantized gradient angle of the second contour feature point is the same as any quantized gradient angle of the first contour feature point, a first score is counted; If the corresponding pixel position in the second region is a second contour feature point, and the quantized gradient angle of the second contour feature point is not the same as any quantized gradient angle of the first contour feature point, but adjacent to any quantized gradient angle of the first contour feature point, a second score is counted; if the corresponding pixel position in the second region is a second contour feature point, and a quantized gradient angle of the second contour feature point is neither same nor adjacent to any quantized gradient angle of the first contour feature point, then a third score is counted; if the corresponding pixel position in the second region is not a second contour feature point, then the third score is counted; wherein the first score is greater than the second score, and the second score is greater than the third score; the scores of all the first contour feature points are added to obtain a matching score of the second region.

6. The marker localization method of claim 1, wherein, the first mark has a symmetry axis parallel to an X axis of an image and a symmetry axis parallel to a Y axis of the image, and the first region includes a first sub-region and a second sub-region; the deviation between the preliminary coordinate of the center point of the first mark and the symmetry axis parallel to the Y axis of the image is detected based on the first sub-region, and the preliminary coordinate of the center point of the first mark is corrected according to the deviation, so that the corrected coordinate is located on the symmetry axis parallel to the Y axis of the image, to obtain a final X coordinate of the center point of the first mark. the deviation between the preliminary coordinate of the center point of the first mark and the symmetry axis parallel to the Y axis of the image is detected based on the first sub-region, and the preliminary coordinate of the center point of the first mark is corrected according to the deviation, so that the corrected coordinate is located on the symmetry axis parallel to the Y axis of the image, to obtain a final X coordinate of the center point of the first mark. the deviation between the preliminary coordinate of the center point of the first mark and the symmetry axis parallel to the Y axis of the image is detected based on the first sub-region, and the preliminary coordinate of the center point of the first mark is corrected according to the deviation, so that the corrected coordinate is located on the symmetry axis parallel to the Y axis of the image, to obtain a final X coordinate of the center point of the first mark.

7. The marker positioning method of claim 6, wherein the deviation between the preliminary coordinate of the center point of the first mark and the symmetry axis parallel to the Y axis of the image is detected based on the first sub-region, and the preliminary coordinate of the center point of the first mark is corrected according to the deviation, so that the corrected coordinate is located on the symmetry axis parallel to the Y axis of the image, to obtain a final X coordinate of the center point of the first mark. the deviation between the preliminary coordinate of the center point of the first mark and the symmetry axis parallel to the Y axis of the image is detected based on the first sub-region, and the preliminary coordinate of the center point of the first mark is corrected according to the deviation, so that the corrected coordinate is located on the symmetry axis parallel to the Y axis of the image, to obtain a final X coordinate of the center point of the first mark. Wherein, the coordinate range of the first sub-region on the X-axis is [ x 0- x 1, x 0+ x 1], the coordinate range on the Y-axis is [ y 0- y 1, y 0+ y 1], where, ( x 0, y 0) represents the initial coordinates of the center point of the first mark. x 1 and y 1 is the preset expansion amount, and x 1> y 1,2 x 1> w ,in w The width of the first mark; the deviation between the preliminary coordinate of the center point of the first mark and the symmetry axis parallel to the Y axis of the image is detected based on the first sub-region, and the preliminary coordinate of the center point of the first mark is corrected according to the deviation, so that the corrected coordinate is located on the symmetry axis parallel to the Y axis of the image, to obtain a final X coordinate of the center point of the first mark. performing gray-scale projection on the second sub-region in an X direction to obtain a second projection curve; calculating an autocorrelation function of the second projection curve; obtaining a coordinate offset corresponding to a maximum autocorrelation value of the autocorrelation function of the second projection curve, and correcting a Y coordinate in a preliminary coordinate of a center point of the first mark according to the coordinate offset, so that the corrected Y coordinate is on a symmetry axis parallel to an X axis of the image; The coordinate range of the second sub-region on the X axis is [x x 0- x 2, x 0+ x 2], and the coordinate range of the second sub-region on the Y axis is [y y 0- y 2, y 0+ y 2], wherein x x 2 and y y 2 are preset extension amounts, and x x 2 y 2, y y 2 h , wherein h h is the height of the first mark.

8. A marker positioning device, characterized by comprise: an image acquisition module configured to acquire a detection image of a to-be-detected object, the to-be-detected object having a first general structure and a first mark, the first mark and the first general structure having a fixed positional relationship, and the first mark having axial symmetry; a template image acquisition module configured to acquire a template image, the template image comprising contour information of the first general structure; a template matching module configured to perform template matching on the detection image using the template image to obtain a matching region comprising the first general structure in the detection image; a preliminary positioning module configured to position the first mark in the matching region according to the fixed positional relationship between the first mark and the first general structure, and acquire a preliminary coordinate of a center point of the first mark; a first region acquisition module configured to expand a region of a preset size based on the preliminary coordinate of the center point of the first mark to obtain a first region in the detection image; a final positioning module configured to detect a deviation between the preliminary coordinate of the center point of the first mark and a symmetry axis of the first mark based on the first region, correct the preliminary coordinate of the center point of the first mark according to the deviation, so that the corrected coordinate is on the symmetry axis, and obtain a final coordinate of the center point of the first mark; the template matching module performs template matching on the detection image using the template image to obtain a matching region comprising the first general structure in the detection image, comprising: the template matching module selects a plurality of scaling factors with a preset step size in a preset scaling factor interval, scales the template image using the selected plurality of scaling factors to obtain a plurality of template images with different scaling factors; before the template matching module scales the template image using the selected plurality of scaling factors, the template matching module calculates gradient information of each pixel point in the template image, selects each pixel point according to the gradient information, and obtains first contour feature points; the plurality of template images with different scaling factors comprise the first contour feature points obtained after scaling. The template matching module obtains first contour feature points of each of the plurality of template images of different scaling factors, calculates gradient information of each pixel point in the detection image, screens each pixel point according to the gradient information, obtains second contour feature points, and quantizes the gradient information of the first contour feature points and the gradient information of the second contour feature points in the direction of the angle to obtain corresponding quantized gradient angles. For each template image, the template image is slid on the detection image, and a second region corresponding to the template image is formed on the detection image when the template image is slid to a position. The matching score of the second region is calculated according to the angle difference between the quantized gradient angles corresponding to the first contour feature points and the quantized gradient angles corresponding to the second contour feature points in the second region. The second region with the highest matching score is taken as the matching region corresponding to the template image, and the matching region with the highest matching score is selected as the final matching region.

9. The marker positioning device of claim 8, wherein, The first mark has a symmetry axis parallel to the image X axis and a symmetry axis parallel to the image Y axis, and the first region includes a first sub-region and a second sub-region. The final positioning module specifically performs the following operations: The final positioning module obtains the first sub-region, detects the deviation between the X coordinate in the preliminary coordinate of the center point of the first mark and the symmetry axis parallel to the image Y axis based on the first sub-region, corrects the X coordinate in the preliminary coordinate of the center point of the first mark according to the deviation, so that the corrected X coordinate is on the symmetry axis parallel to the image Y axis, and obtains the final X coordinate of the center point of the first mark. The final positioning module obtains the second sub-region, detects the deviation between the Y coordinate in the preliminary coordinate of the center point of the first mark and the symmetry axis parallel to the image X axis based on the second sub-region, corrects the Y coordinate in the preliminary coordinate of the center point of the first mark according to the deviation, so that the corrected Y coordinate is on the symmetry axis parallel to the image X axis, and obtains the final Y coordinate of the center point of the first mark.

10. A computer-readable storage medium, characterized in that, The medium stores a program, and the program can be executed by the processor to implement the mark positioning method in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Method and system for correcting position of detection area of display screen

    CN117392225A

  • Intelligent overlay control method for proximity contact type photoetching machine

    CN118330989A