Mark positioning method, mark positioning device and storage medium

Through template matching and axisymmetric correction of marking, the problems of cumbersome marking positioning process and low accuracy in the prior art are solved, and efficient and accurate marking positioning is achieved.

CN119832350AActive Publication Date: 2025-04-15SKYVERSE TECH CO LTD

Patent Information

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

AI Technical Summary

Technical Problem

When positioning different types of marks, the prior art requires manual creation of multiple templates, resulting in cumbersome and inefficient processes and a decrease in the accuracy of automated positioning.

Method used

By obtaining the detected image and template image of the object to be tested, the template matching is used for template matching, and the matching area is obtained, and preliminary positioning is performed according to the fixed position relationship between the mark and the general structure. Then, the coordinate correction is performed using the axial symmetry of the mark to obtain the final coordinate of the mark center point.

Benefits of technology

The positioning of different types of marks using the same template is realized, which simplifies the process, improves the accuracy and efficiency of positioning, and avoids the steps of manually creating templates.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119832350A_ABST
    Figure CN119832350A_ABST
Patent Text Reader

Abstract

The invention discloses a mark positioning method, a mark positioning device and a storage medium, and the method comprises the steps: obtaining a template image comprising the contour information of a first general structure through employing the characteristics that the surface of a to-be-measured object is provided with the first general structure and a first mark, and the first mark and the first general structure have a fixed position relation; matching is carried out on the detection image of the to-be-detected object, and a matching area containing the first universal structure on the detection image is obtained; the first mark is positioned in the matching area according to the fixed position relation between the first mark and the first universal structure, and the initial coordinate of the center point of the first mark is obtained; and correcting the initial coordinate by using the axial symmetry of the first mark, so that the corrected coordinate is positioned on the symmetry axis, and the final coordinate of the central point of the first mark is obtained. According to the technical scheme, positioning of different types of marks can be achieved through the same template, and compared with the prior art, the method is simpler and more efficient.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of optical detection technology, and in particular to a marking positioning method, a marking positioning device and a storage medium. Background Art

[0002] In the optical inspection process of wafers, panels and other products, the products need to be aligned and their placement corrected before inspection. The main purpose is to correct the deviation and determine the location of specific inspection points to ensure the normal progress of subsequent inspection processes. In order to facilitate alignment, special marks are usually made on the products during the product manufacturing process, and the marks are positioned to help achieve product alignment.

[0003] Currently, template matching is often used to locate the mark. However, the marks of different products may be different. Please refer to Figure 1 , Figure 1 Four types of marks are shown, among which the cross-shaped structure in the center of each picture is the mark. It can be seen that there are differences between these marks. In order to locate different marks, a common method is to create a template for each mark, which can effectively ensure the matching accuracy, but the creation and adjustment of each template requires manual participation, so this method is cumbersome and inefficient. On this basis, an improved method is to create a template library and extract representative templates from the many templates in the template library to reduce the number of templates. Specifically, the template library is traversed and matched each time a match is made, and the template with the highest score is selected as the final template. Although this method has achieved automation, the accuracy rate has decreased. Summary of the invention

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

[0005] According to the first aspect, an embodiment provides a marking positioning method, including: Acquire a detection image of an object to be detected, wherein 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; Acquire a template image, wherein the template image includes contour information of the first general structure; Performing template matching on the detection image using the template image to obtain a matching area on the detection image that includes the first general structure; Positioning the first marker in the matching area according to a fixed positional relationship between the first marker and the first universal structure, and obtaining preliminary coordinates of a center point of the first marker; Taking the preliminary coordinates of the center point of the first mark in the detection image as a reference, a first area is obtained by expanding an area of ​​a preset size; Based on the first area, the deviation between the preliminary coordinates of the center point of the first mark and the axis of symmetry of the first mark is detected, and the preliminary coordinates of the center point of the first mark are corrected 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.

[0006] In some embodiments, performing template matching on the detection image using the template image to obtain a matching area on the detection image containing the first general structure includes: In a preset zoom multiple range, multiple zoom multiples are selected with a preset step length, and the template image is zoomed using the selected multiple zoom multiples to obtain multiple template images with different zoom multiples; Use the multiple template images with different zoom factors to perform template matching on the detection image respectively, obtain the matching area and matching score corresponding to each template image, and select the matching area with the largest matching score as the final matching area.

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

[0008] In some embodiments, before scaling the template image using the selected multiple scaling factors, the method further includes: calculating gradient information of each pixel in the template image, screening each pixel according to the gradient information, and obtaining a first contour feature point; the multiple template images with different scaling factors include the first contour feature point obtained after scaling; The using the multiple template images with different zoom factors to perform template matching on the detection image respectively to obtain a matching area and a matching score corresponding to each template image includes: Acquire a first contour feature point of each template image in the plurality of template images with different zoom factors; Calculating the gradient information of each pixel in the detection image, and screening each pixel according to the gradient information to obtain a second contour feature point; Quantizing the gradient information of the first contour feature point and the gradient information of the second contour feature point in a directional manner to obtain corresponding quantized gradient angles; For each template image, it is slid on the detection image, and a second area corresponding to the template image is formed on the detection image each time it slides to a position. The matching score of the second area is calculated based on 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 area, and the second area with the highest matching score is used as the matching area corresponding to the template image.

[0009] In some embodiments, the step of calculating the gradient information of each pixel in the template image and screening each pixel according to the gradient information to obtain the first contour feature point includes: calculating the gradient magnitude and gradient direction of each pixel in the template image, and for each pixel, determining whether the gradient magnitude of the pixel is greater than a first threshold value t 1 , and whether there are gradients with the same direction in the neighborhood of the pixel and the number is greater than the second threshold n 1 If yes, keep the pixel point as the first contour feature point; The step of calculating the gradient information of each pixel in the detection image and screening each pixel according to the gradient information to obtain a second contour feature point includes: calculating the gradient amplitude and gradient direction of each pixel in the detection image, and for each pixel, determining whether the gradient amplitude of the pixel is greater than a first threshold value t 1 , if so, retain the pixel as the second contour feature point.

[0010] In some embodiments, the step of performing directional angle quantization on the gradient information of the first contour feature point and the gradient information of the second contour feature point to obtain corresponding quantized gradient angles includes: Ignoring the influence of polarity, 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; Determine the angle interval to which the gradient direction in the gradient information of the first contour feature point belongs, and use the quantized gradient angle of the belonging angle interval as the quantized gradient angle corresponding to 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 determined, and the quantized gradient angle in the angle interval is used as the quantized gradient angle corresponding to the second contour feature point.

[0011] In some embodiments, after the gradient information of the first contour feature point and the gradient information of the second contour feature point are respectively quantized in terms of angles to obtain corresponding quantized gradient angles, the method further includes: 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 in the neighborhood of the first contour feature point have at least two quantized gradient angles; 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 includes: For each first contour feature point, if the corresponding pixel position in the second area is a second contour feature point, and the quantization gradient angle of the second contour feature point is the same as any quantization gradient angle of the first contour feature point, a first score is calculated; If the corresponding pixel position in the second area is a second contour feature point, and the quantization gradient angle of the second contour feature point is not the same as any quantization gradient angle of the first contour feature point, but is adjacent to any quantization gradient angle of the first contour feature point, then a second score is calculated; If the corresponding pixel position in the second area is a second contour feature point, and the quantization gradient angle of the second contour feature point is neither the same as any quantization gradient angle of the first contour feature point nor adjacent to any quantization gradient angle of the first contour feature point, then a third score is calculated; If there is no second contour feature point at the corresponding pixel position in the second area, a third score is calculated; 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 together to obtain a matching score of the second area.

[0012] In some embodiments, 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 step of detecting, based on the first area, a deviation between the preliminary coordinates of the center point of the first mark and the axis of symmetry of the first mark, 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 the final coordinates of the center point of the first mark includes: Get the first sub-region, 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 ],in,( x 0 , y 0 ) are the preliminary coordinates of the center point of the first marker, x 1 and y 1 is the preset expansion amount, and x 1 > y 1 , 2 x 1 > w ,in w is the width of the first mark; based on the first sub-area, detecting the deviation between the X coordinate in the preliminary coordinates of the center point of the first mark and the symmetry axis parallel to the Y axis of the image, and correcting the X coordinate in the preliminary coordinates 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; Get the second sub-region, the coordinate range of the second sub-region 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 ],in, x 2 and y 2 is the preset expansion amount, and x 2 < y 2 , 2 y 2 > h ,in his the height of the first mark; based on the second sub-area, the deviation between the Y coordinate in the preliminary coordinates of the center point of the first mark and the symmetry axis 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 symmetry axis parallel to the X-axis of the image, and the final Y coordinate of the center point of the first mark is obtained.

[0013] In some embodiments, detecting, based on the first sub-region, a deviation between an X coordinate in the preliminary coordinates of the center point of the first mark and an axis of symmetry parallel to the Y axis of the image, and correcting the X coordinate in the preliminary coordinates of the center point of the first mark according to the deviation so that the corrected X coordinate is on the axis of symmetry parallel to the Y axis of the image, comprises: Performing grayscale projection in the Y direction on the first sub-region to obtain a first projection curve; calculating an autocorrelation function of the first projection curve; obtaining a coordinate offset corresponding to a maximum autocorrelation value of the autocorrelation function of the first projection curve, and correcting an X coordinate in the preliminary coordinates of the center point of the first mark according to the coordinate offset, so that the corrected X coordinate is on a symmetry axis parallel to the Y axis of the image; The detecting, based on the second sub-region, a deviation between the Y coordinate in the preliminary coordinates of the center point of the first mark and the symmetry axis parallel to the image X-axis, and correcting the Y coordinate in the preliminary coordinates 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, includes: Perform grayscale projection in the X direction on the second sub-area to obtain a second projection curve; calculate the autocorrelation function of the second projection curve; obtain the coordinate offset corresponding to the maximum autocorrelation value of the autocorrelation function of the second projection curve, and correct the Y coordinate in the preliminary coordinates of the center point of the first mark according to the coordinate offset so that the corrected Y coordinate is on a symmetry axis parallel to the X axis of the image.

[0014] According to the second aspect, an embodiment provides a marking positioning device, comprising: A detection image acquisition module, used for acquiring a detection image of an object to be detected, wherein 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; A template image acquisition module, used to acquire a template image, wherein the template image includes 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 area on the detection image that contains a first general structure; a preliminary positioning module, configured to position the first marker in the matching area according to a fixed positional relationship between the first marker and the first universal structure, and obtain preliminary coordinates of a center point of the first marker; A first region acquisition module, configured to obtain a first region by region expansion of a preset size in the detection image based on the preliminary coordinates of the center point of the first mark as a reference; 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 area, and 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.

[0015] In some embodiments, the template matching module uses the template image to perform template matching on the detection image to obtain a matching area on the detection image that contains the first general structure, including: The template matching module selects a plurality of zoom factors with a preset step length within a preset zoom factor interval, and scales the template image using the selected plurality of zoom factors to obtain a plurality of template images with different zoom factors; The template matching module uses the multiple template images with different zoom factors to perform template matching on the detection image respectively, obtains the matching area and matching score corresponding to each template image, and selects the matching area with the largest matching score as the final matching area.

[0016] In some embodiments, 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, 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 ],in,( x 0 , y 0) are the preliminary coordinates of the center point of the first marker, x 1 and y 1 is the preset expansion amount, and x 1 > y 1 , 2 x 1 > w ,in w is the width of the first mark; based on the first sub-area, detecting the deviation between the X coordinate in the preliminary coordinates of the center point of the first mark and the symmetry axis parallel to the Y axis of the image, and correcting the X coordinate in the preliminary coordinates 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; The final positioning module obtains the second sub-area, and the coordinate range of the second sub-area 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 ],in, x 2 and y 2 is the preset expansion amount, and x 2 < y 2 , 2 y 2 > h ,in h is the height of the first mark; based on the second sub-area, the deviation between the Y coordinate in the preliminary coordinates of the center point of the first mark and the symmetry axis 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 symmetry axis parallel to the X-axis of the image, and the final Y coordinate of the center point of the first mark is obtained.

[0017] According to the third aspect, an embodiment provides a computer-readable storage medium, on which a program is stored, and the program can be executed by a processor to implement the marking positioning method described in the first aspect.

[0018] According to the marker positioning method, marker positioning device and storage medium of the above-mentioned embodiment, the feature 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 is utilized, a template image including contour information of the first general structure is obtained, matching is performed on the detection image of the object to be measured, a matching area containing the first general structure on the detection image is obtained, the first marker is positioned in the matching area according to the fixed positional relationship between the first marker and the first general structure, and the preliminary coordinates of the center point of the first marker are obtained; then, the preliminary coordinates of the center point of the first marker are corrected using the axial symmetry of the first marker, so that the corrected coordinates are located on the axis of symmetry, and the final coordinates of the center point of the first marker are obtained. The technical solution of the present application can use the same template to realize the positioning of different types of markers. Compared with the prior art, there is no need to manually create templates or create template libraries, which is simpler and more efficient; at the same time, after obtaining the preliminary coordinates of the center point of the first marker, the axial symmetry of the first marker is also used to perform coordinate correction, thereby improving the positioning accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 Images of markings on the surface of some products; Figure 2 A flowchart of a marker positioning method according to some embodiments; Figure 3 A template image of an embodiment; Figure 4 To adopt Figure 3 A schematic diagram of preliminary coordinates of a center point of a first mark obtained by performing template matching on two wafers respectively using template images of the same type; Figure 5 For Figure 4 A schematic diagram of the final coordinates of the center point of the first mark in the figure after the preliminary coordinates of the center point of the first mark are corrected according to the axial symmetry of the first mark; Figure 6 A flowchart of using a plurality of template images with different zoom factors to perform template matching on a detection image to obtain a matching area and a matching score corresponding to each template image in an embodiment; Figure 7 for Figure 3 A schematic diagram of the first contour feature points screened out from the template image; Figure 8 A schematic diagram of quantized gradient angles of some first contour feature points on a template image in an embodiment; Fig. 9for Figure 8 The result obtained after gradient diffusion; Fig.10 A flowchart of calculating a matching score of a second region according to an angle difference between a quantized gradient angle corresponding to a first contour feature point and a quantized gradient angle corresponding to a second contour feature point within the second region in an embodiment; Fig.11 is a schematic diagram of a first sub-region of an embodiment; Fig.12 is a schematic diagram of a second sub-region of an embodiment; Fig.13 Schematic diagram of the structure of the marking positioning device of some embodiments. DETAILED DESCRIPTION

[0020] The present invention is further described in detail below by specific embodiments in conjunction with the accompanying drawings. Wherein similar elements in different embodiments adopt associated similar element numbers. In the following embodiments, many detailed descriptions are for making the present application better understood. However, those skilled in the art can easily recognize that some features can be omitted in different situations, or can be replaced by other elements, materials, 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 part of the present application being overwhelmed by too much description, and for those skilled in the art, it is not necessary to describe these related operations in detail, and they can fully understand the related operations according to the description in the specification and the general technical knowledge in the art.

[0021] In addition, the features, operations or characteristics described in the specification can be combined in any appropriate manner to form various implementations. At the same time, the steps or actions in the method description can also be interchanged or adjusted in a manner that is obvious to those skilled in the art. Therefore, the various sequences in the specification and the drawings are only for the purpose of clearly describing a certain embodiment and are not meant to be a required sequence, unless otherwise specified that a certain sequence must be followed.

[0022] The serial numbers assigned to the components herein, such as "first", "second", etc., are only used to distinguish the objects described and do not have any order or technical meaning. The "connection" and "coupling" mentioned in this application, unless otherwise specified, include direct and indirect connections (couplings).

[0023] The applicant has found that for certain products (such as wafers, display panels, substrates, etc.), different products have something in common, that is, their surfaces all have the same structure, and the mark is made at a specific position and has a fixed positional relationship with the same structure. Figure 1It is an image of the wafer surface. It can be seen that the surfaces of these wafers have two intersecting cutting paths formed by a cutting knife or laser cutting, and the mark is located at the center of the intersection area of ​​the two cutting paths. In this application, these identical structures are referred to as universal structures. This application creates a template for the universal structure. By matching the universal structure, the mark can be positioned according to the fixed positional relationship between the mark and the universal structure. In this way, only one matching template for the universal structure is needed, and there is no need to create a template for each mark, which greatly simplifies the work required to locate different types of marks.

[0024] In addition, the markings often have axial symmetry (e.g. Figure 1 In order to further improve the positioning accuracy, after determining the preliminary position of the marker by template matching, the present application also uses the axisymmetry of the marker to correct the preliminary position of the marker to obtain the final position. Through this coarse-to-fine positioning method, not only can a single template be used to locate different types of markers, but also the positioning accuracy is improved.

[0025] Please refer to Figure 2 The marking positioning method in some embodiments of the present application includes steps 100 to 600, which are described in detail below.

[0026] Step 100: Acquire a detection image of the object to be detected.

[0027] The object to be tested may be a wafer, a display panel, a substrate, etc., and a first general structure and a first mark are provided on the surface of the object, and a fixed positional relationship exists between the first mark and the first general structure. Figure 1 An example is given. In other embodiments, the first general structure may be a structure of other shapes, such as a rectangle, a triangle, or a specific pattern. The first mark and the first general structure may have other positional relationships. For example, when the first general structure is a rectangular structure, the first mark may be located at the center of the rectangle or at one of the corners of the rectangle. The first mark has axial symmetry, except Figure 1 The first mark is a cross shape as shown in the figure, and can also be other shapes, such as a star shape.

[0028] Step 200: Acquire a template image, where the template image includes contour information of a first general structure.

[0029] The template image may be a binary image that depicts the outline or edge of the first general structure, and the binary image may be drawn according to the shape and size of the first general structure. Figure 1Taking the two intersecting cutting paths shown in the figure as an example, first estimate the width of the two cutting paths (in pixels), and then draw the outlines of the two intersecting cutting paths on the image, where the edges of the two cutting paths are represented by high grayscale values ​​(such as 255), and the rest are represented by 0 grayscale values, as shown in the figure. Figure 3 As shown. Since the mark is located at the center of the intersection area of ​​the two cutting paths, the intersection area of ​​the two cutting paths is drawn at the center of the template image to facilitate the positioning of the mark, and the length of the cutting path contour line can be set according to actual needs.

[0030] Step 300: Perform template matching on the detection image using the template image to obtain a matching area on the detection image that includes the first general structure.

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

[0032] Due to the size of the first generic structure (e.g. Figure 1 The width of the cutting path in the middle is usually estimated artificially, so there may be deviations from the actual size. Therefore, in some embodiments, the template image is scaled by multiple zoom factors, and template matching is performed using multiple template images with different zoom factors respectively, and the matching area with the largest matching score is used as the final matching area, 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: within a preset zoom factor range, multiple zoom factors are selected with a preset step size, and the template image is scaled using the selected multiple zoom factors to obtain multiple template images with different zoom factors; template matching is performed on the detection image using multiple template images with different zoom factors respectively, and the matching area and matching score corresponding to each template image are obtained, and the matching area with the largest matching score is selected as the final matching area.

[0033] The zoom factor interval 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 limit of the zoom factor interval is greater than 1 and the lower limit is less than 1. For example, the zoom factor interval is [0.8, 1.5] and the step size is 0.1.

[0034] Step 400: Position the first marker in the matching area according to the fixed positional relationship between the first marker and the first universal structure, and obtain preliminary coordinates of the center point of the first marker.

[0035] It can be understood that since the matching area includes the first general structure and the positional relationship between the first marker and the first general structure is known, the first marker can be located in the matching area and the preliminary coordinates of the center point of the first marker can be obtained. Figure 3 In the template image shown, the intersection area of ​​the two cutting lanes is drawn at the center of the template image, and the mark is located at the center of the intersection area of ​​the two cutting lanes, so the preliminary coordinates of the center point of the first mark are the coordinates of the center point of the matching area.

[0036] Please refer to Figure 4 , for the adoption of Figure 3 The template image shown is a schematic diagram of the preliminary coordinates of the center point of the first mark obtained by template matching the two wafers. The black cross in the figure indicates the preliminary coordinates of the center point of the first mark. It can be seen that there is still a deviation between the obtained preliminary coordinates and the actual position of the center point of the first mark. Therefore, through the subsequent steps 500~600, the axial symmetry of the first mark is used to correct it.

[0037] Step 500: Taking the preliminary coordinates of the center point of the first mark in the detection image as a reference, a first area is obtained by expanding the area of ​​a preset size.

[0038] For example, the preliminary coordinates of the center point of the first mark are (520, 520), and the region expansion is performed with a size of 100×10. Then, the range of the X coordinate of the first region is [470, 570], and the range of the Y coordinate 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 axis of symmetry of the first mark. The size of the first region can be determined according to the direction of the axis of symmetry, the size of the first mark, etc. For example, if the axis of symmetry of the first mark is along the X-axis direction of the image, a first region that is higher in the Y direction and narrower 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 axis of symmetry of the first mark is along the Y-axis direction of the image, a first region that is wider in the X direction and narrower 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.

[0039] Step 600: Based on the first area, detect the deviation between the preliminary coordinates of the center point of the first mark and the axis of symmetry of the first mark, correct the preliminary coordinates of the center point of the first mark according to the deviation so that the corrected coordinates are on the axis of symmetry, and obtain the final coordinates of the center point of the first mark.

[0040] Detecting the deviation between the preliminary coordinates of the center point of the first mark and the axis of symmetry of the first mark can be achieved by using relevant existing technologies. For example, the first area is projected in grayscale along the axis of symmetry to obtain a projection curve. Then, the autocorrelation function of the projection curve can be obtained. The independent variable of the autocorrelation function is the coordinate offset. The coordinate offset corresponding to the maximum autocorrelation value is determined by the autocorrelation function. Based on the coordinate offset, the deviation between the preliminary coordinates of the center point of the first mark and the axis of symmetry of the first mark can be determined, and the preliminary coordinates of the center point of the first mark can be corrected accordingly.

[0041] Please refer to Figure 5 , for Figure 4 (a) is a schematic diagram of the final coordinates of the center point of the first marker obtained after the preliminary coordinates of the center point of the first marker are corrected according to the axial symmetry of the first marker. It can be seen that the final coordinates are basically consistent with the actual position of the center point of the first marker.

[0042] In some embodiments, the gradient information of the image is used to match the template image and the detection image. First, contour feature points in the template image and the detection image are extracted, and then matching is performed based on the gradient angles of the contour feature points of the template image and the detection image. Since it is computationally intensive to extract contour feature points from the template image at each scaling factor after scaling the template image by multiple scaling factors, the contour feature points of the template image are first extracted and then scaled. Specifically, before scaling the template image by the selected multiple scaling factors, the gradient information of each pixel in the template image is first calculated, and each pixel is screened based on the gradient information to obtain the first contour feature point. On this basis, Figure 6 As shown, in step 300, multiple template images with different zoom factors are used to perform template matching on the detection image respectively to obtain the matching area and matching score corresponding to each template image, including steps 310~340, which are explained below respectively.

[0043] Step 310: Acquire the first contour feature point of each template image in a plurality of template images with different scaling factors. It can be understood that the plurality of template images with different scaling factors include the first contour feature point obtained after scaling.

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

[0045] 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. Pixel points with gradient amplitude greater than the set threshold can be selected as contour feature points.

[0046] Step 330: quantizing the angles of the gradient information of the first contour feature point and the gradient information of the second contour feature point in a direction to obtain corresponding quantized gradient angles.

[0047] Usually, the angle of the calculated gradient direction is continuous, ranging from 0 to 360°. To quantize the gradient direction angle, the angle range is evenly divided into multiple angle intervals, and each angle interval is identified with a unique value as the quantized gradient angle. The angle interval to which the gradient direction belongs in the gradient information of the first contour feature point and the second contour feature point is determined, and the quantized gradient angle of the attributed angle interval is used as the quantized gradient angle of the first contour feature point and the second contour feature point. For example, 0-360° is evenly divided into 9 angle intervals, which are identified with values ​​0-8 respectively, then 0-40° will be recorded as 0, 40-80° will be recorded as 1, and so on.

[0048] In some embodiments, the influence of the polarity of the gradient angle can be ignored, that is, 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 includes: ignoring the influence of polarity, dividing 0-180° equally into N angle intervals, configuring 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; determining the angle interval to which the gradient direction in the gradient information of the first contour feature point belongs, and using the quantized gradient angle of the angle interval as the quantized gradient angle corresponding to the first contour feature point; determining the angle interval to which the gradient direction in the gradient information of the second contour feature point belongs, and using the quantized gradient angle of the angle interval as the quantized gradient angle corresponding to the second contour feature point.

[0049] Step 340: For each template image, slide it on the detection image, and each time it slides to a position, a second area corresponding to the template image is formed on the detection image. The matching score of the second area is calculated based on 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 area, and the second area with the highest matching score is used as the matching area corresponding to the template image.

[0050] It can be understood that the smaller 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 is, the higher the matching score is.

[0051] In this embodiment, the gradient information of the first contour feature point and the gradient information of the second contour feature point are quantized in terms of angles to obtain corresponding quantized gradient angles. The matching score is calculated based on 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, thereby discretizing the gradient angle into a limited number of discrete values, simplifying the calculation process and improving calculation efficiency. At the same time, quantizing the gradient angle can reduce the impact of noise and illumination changes on features, which is beneficial to improving the robustness to illumination changes, making the description of contour features more stable and reliable. In some embodiments, the step of calculating the gradient information of each pixel in the template image and screening each pixel according to the gradient information to obtain the first contour feature point includes: calculating the gradient magnitude and gradient direction of each pixel in the template image, and for each pixel, determining whether the gradient magnitude of the pixel is greater than a first threshold value t 1 , and whether there are gradients with the same direction in the neighborhood of the pixel and the number is greater than the second threshold n 1 If so, the pixel point is retained as the first contour feature point. The size of the neighborhood can be 3×3, etc. Figure 7 Shows Figure 3 The first contour feature point is screened out from the template image. The calculation of the gradient information of each pixel in the detection image, screening each pixel according to the gradient information, and obtaining the second contour feature point includes: calculating the gradient amplitude and gradient direction of each pixel in the detection image, for each pixel, determining whether the gradient amplitude of the pixel is greater than a first threshold value t 1 , if so, retain the pixel as the second contour feature point.

[0052] In this embodiment, for a pixel point of the template image, it is not only determined whether its gradient amplitude is large, but also whether there are pixels around it with a number greater than the second threshold value n. 1 The pixel points with the same gradient direction as the image are selected, so that the first contour feature points can be extracted more accurately; while for the detection image, the second contour feature points are extracted only according to the gradient amplitude, avoiding screening out too many pixel points, so that more useful information can be retained.

[0053] In some embodiments, 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 angle to obtain the corresponding quantized gradient angles, gradient diffusion is also 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.

[0054] Please refer to Figure 8 and Fig. 9 , Figure 8 The quantized gradient angles of six first contour feature points are shown. If the diffusion neighborhood size is set to 3×3, then for the first contour feature point g, its quantized gradient angle will be superimposed on the eight surrounding pixels. Since the first contour feature point in the neighborhood already has a quantized gradient angle, and then the quantized gradient angles diffused from other first contour feature points are superimposed, there will be at least two quantized gradient angles. Figure 8 After gradient diffusion of the six first contour feature points, we can get Fig. 9 From the gradient diffusion result shown, it can be seen that the first contour feature point g now contains three quantized gradient angles.

[0055] Please refer to 10. In step 340, 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 includes steps 341 to 347, which are described below respectively.

[0056] Step 341: for each first contour feature point, determine whether the corresponding pixel position in the second area is a second contour feature point, if so, execute step 342, otherwise execute step 346.

[0057] Step 342: Compare the quantized gradient angle of the second contour feature point with the quantized gradient angle 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, execute step 343; 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, execute step 344; 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, execute step 345.

[0058] Assume that the quantized gradient angle contained in the first contour feature point is [0, 2, 5], if the quantized gradient angle of the second contour feature point is 0, 2 or 5, execute step 343, if the quantized gradient angle of the second contour feature point is 1, 3, 4 or 6, execute step 344, if the quantized gradient angle of the second contour feature point is 7 or 8, execute step 345.

[0059] Step 343: Calculate a first score.

[0060] Step 344: Calculate a second score, wherein the first score and the second score satisfy that the first score is greater than the second score.

[0061] Step 345: Calculate a third score, wherein the second score and the third score satisfy that the second score is greater than the third score.

[0062] Step 346: Calculate a third score. At this time, there is no second contour feature point at the corresponding pixel position in the second area, which obviously does not match the first contour feature point, and thus a low score should be calculated.

[0063] Step 347: Add the scores of all the first contour feature points to obtain a matching score for the second area.

[0064] In this embodiment, the template image is gradient diffused and then matched with the detection image. The gradients of all first contour feature points in the neighborhood are considered instead of the gradient of a single first contour feature point. This can enhance the robustness of the algorithm and make the matching result more reliable.

[0065] In some embodiments, the first marker has both an axis of symmetry parallel to the image X-axis and an axis of symmetry parallel to the image Y-axis (eg Figure 1 In the example of FIG. 5 , the first region includes a first sub-region and a second sub-region respectively obtained by the two region expansions. The first sub-region and the second sub-region are respectively used to correct the X coordinate of the preliminary coordinates of the center point of the first mark by using the symmetry axis parallel to the Y axis of the image, and to correct the Y coordinate of the preliminary coordinates of the center point of the first mark by using the symmetry axis parallel to the X axis of the image.

[0066] On this basis, step 600 includes: acquiring a first sub-region, based on the first sub-region, detecting a deviation between an X coordinate in the preliminary coordinates of the center point of the first mark and an axis of symmetry parallel to the Y axis of the image, and correcting the X coordinate in the preliminary coordinates of the center point of the first mark 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 obtaining a final X coordinate of the center point of the first mark; acquiring a second sub-region, based on the second sub-region, detecting a deviation between a Y coordinate in the preliminary coordinates of the center point of the first mark and an axis of symmetry parallel to the X axis of the image, and correcting the Y coordinate in the preliminary coordinates of the center point of the first mark according to the deviation, so that the corrected Y coordinate is on the axis of symmetry parallel to the X axis of the image, and obtaining a final Y coordinate of the center point of the first mark.

[0067] 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 ],in,( x 0 , y 0 ) are the preliminary coordinates of the center point of the first marker, x 1 and y 1 is a preset expansion amount, used to determine the size of the first sub-area, 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. Fig.11 for Figure 4 Schematic diagram of the first sub-region obtained in (a) of FIG. Similarly, the coordinate range of the second sub-region 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 ],in, x 2 and y 2 is the preset expansion amount, and x 2 < y 2 , 2 y 2 > h , h is the height of the first marker. Fig.12 for Figure 4 Schematic diagram of the second sub-region obtained in (a).

[0068] In some embodiments, based on the first sub-region, detecting the deviation between the X coordinate in the preliminary coordinates of the center point of the first mark and the symmetry axis parallel to the Y axis of the image, and correcting the X coordinate in the preliminary coordinates 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, includes: performing grayscale projection in the Y direction on the first sub-region to obtain a first projection curve; calculating the autocorrelation function of the first projection curve; obtaining a 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 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.

[0069] The method of detecting 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 based on the second sub-region, and correcting the Y coordinate in the preliminary coordinates of the center point of the first mark according to the deviation so that the corrected Y coordinate is on the axis of symmetry parallel to the X-axis of the image, includes: 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 a 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 mark according to the coordinate offset so that the corrected Y coordinate is on the axis of symmetry parallel to the X-axis of the image.

[0070] The marking positioning method provided in the embodiment of the present application utilizes the feature that the surface of the object to be measured has a first general structure and a first mark, and there is a fixed positional relationship between the first mark and the first general structure, and constructs a template image including the contour information of the first general structure, and matches it on the detection image of the object to be measured to obtain a matching area containing the first general structure, and then the first mark can be positioned in the matching area according to the fixed positional relationship between the first mark and the first general structure, so that the same template can be used to achieve the positioning of different types of marks. Compared with the prior art, there is no need to manually create templates or create template libraries, which is simpler and more efficient. In addition, after obtaining the preliminary coordinates of the center point of the first mark through template matching, the axial symmetry of the first mark is also used to correct the preliminary coordinates of the center point of the first mark, so that the corrected coordinates are located on the axis of symmetry, and the final coordinates of the center point of the first mark are obtained, thereby improving the accuracy of positioning. It has been verified experimentally that the accuracy can reach within one pixel.

[0071] Based on the above-mentioned marking positioning method, the present invention also provides a marking positioning device, please refer to Fig.13 In some embodiments, the device includes a detection image acquisition module 1, a template image acquisition module 2, a template matching module 3, a preliminary positioning module 4, a first area acquisition module 5 and a final positioning module 6, which are described below respectively.

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

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

[0074] The template matching module 3 is used to perform template matching on the detection image using the template image to obtain a matching area on the detection image that contains the first general structure.

[0075] In some embodiments, the template matching module 3 uses a template image to perform template matching on a detection image to obtain a matching area on the detection image that contains a first general structure, including: the template matching module 3 selects multiple zoom factors with a preset step size within a preset zoom factor range, and scales the template image using the selected multiple zoom factors to obtain multiple template images with different zoom factors; the template matching module 3 uses multiple template images with different zoom factors to perform template matching on the detection image respectively, obtains a matching area and a matching score corresponding to each template image, and selects the matching area with the largest matching score as the final matching area.

[0076] In some embodiments, before scaling the template image using the selected multiple scaling factors, the template matching module 3 calculates the 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.

[0077] The template matching module 3 uses a plurality of template images with different zoom factors to perform template matching on the detection image respectively, and obtains the matching area and matching score corresponding to each template image, including: obtaining the first contour feature point of each template image in the plurality of template images with different zoom factors; calculating the gradient information of each pixel point in the detection image, screening each pixel point according to the gradient information, and obtaining the second contour feature point; performing directional angle quantization on the gradient information of the first contour feature point and the gradient information of the second contour feature point respectively, and obtaining the corresponding quantized gradient angle; for each template image, sliding it on the detection image, and forming a second area corresponding to the template image on the detection image each time it slides to a position, and calculating the matching score of the second area 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 area, and taking the second area with the highest matching score as the matching area corresponding to the template image. For angle quantization, please refer to step 330 above, which will not be repeated here.

[0078] In some embodiments, the template matching module 3 calculates the 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 gradient direction of each pixel in the template image, and for each pixel, determines whether the gradient amplitude of the pixel is greater than a first threshold value t 1 , and whether there are gradients with the same direction in the neighborhood of the pixel and the number is greater than the second threshold n 1 If the pixel points are equal, the pixel points are retained as the first contour feature points. The template matching module 3 calculates the gradient information of each pixel point in the detection image, and screens each pixel point according to the gradient information to obtain the second contour feature point, including: the template matching module 3 calculates the gradient amplitude and gradient direction of each pixel point in the detection image, and for each pixel point, determines whether the gradient amplitude of the pixel point is greater than the first threshold value t 1 , if so, retain the pixel as the second contour feature point.

[0079] In some embodiments, after the template matching module 3 performs directional angle quantization on the gradient information of the first contour feature point and the gradient information of the second contour feature point to obtain the corresponding quantized gradient angle, it also superimposes the corresponding quantized gradient angle on other pixel points in the neighborhood of the first contour feature point in each template image, so that other first contour feature points in the neighborhood of the first contour feature point have at least two quantized gradient angles.

[0080] The template matching module 3 calculates the matching score of the second area 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 area, including: for each first contour feature point, if the corresponding pixel position in the second area 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, then a first score is calculated; if the corresponding pixel position in the second area 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 is adjacent to any quantized gradient angle of the first contour feature point, then a second score is calculated; if the corresponding pixel position in the second area 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, then a third score is calculated; if there is no second contour feature point at the corresponding pixel position in the second area, then a third score is calculated; the scores of all first contour feature points are added to obtain the matching score of the second area. Wherein, the first score is greater than the second score, and the second score is greater than the third score.

[0081] The preliminary positioning module 4 is used to position the first marker in the matching area according to the fixed positional relationship between the first marker and the first universal structure, and obtain preliminary coordinates of the center point of the first marker.

[0082] The first region acquisition module 5 is used to obtain the first region by expanding the region of a preset size based on the preliminary coordinates of the center point of the first mark in the detection image. Please refer to the above introduction of step 500 for details, which will not be repeated here.

[0083] The final positioning module 6 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 area, and 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.

[0084] In some embodiments, 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 6 specifically performs the following operations: Finally, the 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 ], the coordinate range on the Y axis is [ y 0 - y 1 , y 0 + y 1 ],in,( x 0 , y 0 ) are the preliminary coordinates of the center point of the first marker, x 1 and y 1 is the preset expansion amount, and x 1 > y 1 , 2 x 1 > w ,in wis the width of the first mark; based on the first sub-area, detecting the deviation between the X coordinate in the preliminary coordinates of the center point of the first mark and the symmetry axis parallel to the Y axis of the image, and correcting the X coordinate in the preliminary coordinates 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; Finally, the positioning module 6 obtains the second sub-area, and the coordinate range of the second sub-area 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 ],in, x 2 and y 2 is the preset expansion amount, and x 2 < y 2 , 2 y 2 > h ,in h is the height of the first mark; based on the second sub-area, 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, and the final Y coordinate of the center point of the first mark is obtained.

[0085] In some embodiments, the final positioning module 6 detects the deviation between the X coordinate in the preliminary coordinates 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-area, and corrects the X coordinate in the preliminary coordinates 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, including: the final positioning module 6 performs grayscale projection in the Y direction on the first sub-area to obtain a first projection curve; calculates the autocorrelation function of the first projection curve; obtains the coordinate offset corresponding to the maximum autocorrelation value of the autocorrelation function of the first projection curve, and corrects the X coordinate in the preliminary coordinates 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.

[0086] The final positioning module 6 detects the deviation between the Y coordinate in the preliminary coordinates 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-area, and corrects the Y coordinate in the preliminary coordinates 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, including: the final positioning module 6 performs grayscale projection in the X direction on the second sub-area to obtain a second projection curve; calculates the autocorrelation function of the second projection curve; obtains the coordinate offset corresponding to the maximum autocorrelation value of the autocorrelation function of the second projection curve, and corrects the Y coordinate in the preliminary coordinates 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 X-axis of the image.

[0087] Those skilled in the art will appreciate that all or part of the functions of the various methods in the above-mentioned embodiments can be implemented by hardware or by computer programs. When all or part of the functions in the above-mentioned embodiments are implemented by computer programs, 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-mentioned 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-mentioned functions can be implemented. In addition, when all or part of the functions in the above-mentioned embodiments are implemented by computer programs, 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 can be downloaded or copied and saved in the memory of the local device, or the system of the local device is updated, and when the program in the memory is executed by the processor, all or part of the functions in the above-mentioned embodiments can be implemented.

[0088] The above specific examples are used to illustrate the present invention, which is only used to help understand the present invention and is not intended to limit the present invention. For those skilled in the art, according to the concept of the present invention, some simple deductions, modifications or substitutions can be made.

Claims

1. A marking positioning method, characterized in that: include: Acquire a detection image of an object to be detected, wherein 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; Acquire a template image, wherein the template image includes contour information of the first general structure; Performing template matching on the detection image using the template image to obtain a matching area on the detection image that includes the first general structure; Positioning the first marker in the matching area according to a fixed positional relationship between the first marker and the first universal structure, and obtaining preliminary coordinates of a center point of the first marker; Taking the preliminary coordinates of the center point of the first mark in the detection image as a reference, a first area is obtained by expanding an area of ​​a preset size; Based on the first area, the deviation between the preliminary coordinates of the center point of the first mark and the axis of symmetry of the first mark is detected, and the preliminary coordinates of the center point of the first mark are corrected 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.

2. The marking positioning method according to claim 1, characterized in that: The using the template image to perform template matching on the detection image to obtain a matching area on the detection image that includes the first general structure includes: In a preset zoom multiple range, multiple zoom multiples are selected with a preset step length, and the template image is zoomed using the selected multiple zoom multiples to obtain multiple template images with different zoom multiples; Use the multiple template images with different zoom factors to perform template matching on the detection image respectively, obtain the matching area and matching score corresponding to each template image, and select the matching area with the largest matching score as the final matching area.

3. The marking positioning method according to claim 2, characterized in that: The upper limit value of the zoom multiple interval is greater than 1, and the lower limit value is less than 1.

4. The marking positioning method according to claim 2, characterized in that: Before scaling the template image by the selected multiple scaling factors, the method further includes: calculating the gradient information of each pixel in the template image, screening each pixel according to the gradient information, and obtaining a first contour feature point; the template images of the multiple different scaling factors include the first contour feature point obtained after scaling; The using the multiple template images with different zoom factors to perform template matching on the detection image respectively to obtain a matching area and a matching score corresponding to each template image includes: Acquire a first contour feature point of each template image in the plurality of template images with different zoom factors; Calculating the gradient information of each pixel in the detection image, and screening each pixel according to the gradient information to obtain a second contour feature point; Quantizing the gradient information of the first contour feature point and the gradient information of the second contour feature point in a directional manner to obtain corresponding quantized gradient angles; For each template image, it is slid on the detection image, and a second area corresponding to the template image is formed on the detection image each time it slides to a position. The matching score of the second area is calculated based on 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 area, and the second area with the highest matching score is used as the matching area corresponding to the template image.

5. The marking positioning method according to claim 4, characterized in that: The step of calculating the gradient information of each pixel in the template image and screening each pixel according to the gradient information to obtain the first contour feature point includes: calculating the gradient amplitude and gradient direction of each pixel in the template image, and for each pixel, determining whether the gradient amplitude of the pixel is greater than a first threshold value t1, and whether there are multiple pixels with the same gradient direction and a number greater than a second threshold value n1 in the neighborhood of the pixel, and if so, retaining the pixel as the first contour feature point; The step of calculating the gradient information of each pixel in the detection image and screening each pixel according to the gradient information to obtain a second contour feature point includes: calculating the gradient amplitude and gradient direction of each pixel in the detection image, and for each pixel, determining whether the gradient amplitude of the pixel is greater than a first threshold value t1, and if so, retaining the pixel as a second contour feature point.

6. The marking positioning method according to claim 4, characterized in that: The step of respectively performing directional angle quantization on the gradient information of the first contour feature point and the gradient information of the second contour feature point to obtain corresponding quantized gradient angles includes: Ignoring the influence of polarity, 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; Determine the angle interval to which the gradient direction in the gradient information of the first contour feature point belongs, and use the quantized gradient angle of the belonging angle interval as the quantized gradient angle corresponding to 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 determined, and the quantized gradient angle in the angle interval is used as the quantized gradient angle corresponding to the second contour feature point.

7. The marking positioning method according to claim 4, characterized in that: After respectively performing directional angle quantization on the gradient information of the first contour feature point and the gradient information of the second contour feature point to obtain corresponding quantized gradient angles, the method further includes: 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 in the neighborhood of the first contour feature point have at least two quantized gradient angles; 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 includes: For each first contour feature point, if the corresponding pixel position in the second area is a second contour feature point, and the quantization gradient angle of the second contour feature point is the same as any quantization gradient angle of the first contour feature point, a first score is calculated; If the corresponding pixel position in the second area is a second contour feature point, and the quantization gradient angle of the second contour feature point is not the same as any quantization gradient angle of the first contour feature point, but is adjacent to any quantization gradient angle of the first contour feature point, then a second score is calculated; If the corresponding pixel position in the second area is a second contour feature point, and the quantization gradient angle of the second contour feature point is neither the same as any quantization gradient angle of the first contour feature point nor adjacent to any quantization gradient angle of the first contour feature point, then a third score is calculated; If there is no second contour feature point at the corresponding pixel position in the second area, a third score is calculated; 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 together to obtain a matching score of the second area.

8. The marking positioning method according to claim 1, characterized in that: 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 step of detecting, based on the first area, a deviation between the preliminary coordinates of the center point of the first mark and the axis of symmetry of the first mark, 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 the final coordinates of the center point of the first mark includes: Acquire a first sub-region, and based on the first sub-region, detect a deviation between an X coordinate in the preliminary coordinates of the center point of the first mark and an axis of symmetry parallel to the Y axis of the image, and correct the X coordinate in the preliminary coordinates of the center point of the first mark according to the deviation so that the corrected X coordinate is on the axis of symmetry parallel to the Y axis of the image, thereby obtaining a final X coordinate of the center point of the first mark; Acquire a second sub-area, and based on the second sub-area, detect a 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, and correct the Y coordinate in the preliminary coordinates of the center point of the first mark according to the deviation so that the corrected Y coordinate is on the axis of symmetry parallel to the X-axis of the image, so as to obtain the final Y coordinate of the center point of the first mark.

9. The marking positioning method according to claim 8, characterized in that: The detecting, based on the first sub-region, a deviation between an X coordinate in the preliminary coordinates of the center point of the first mark and an axis of symmetry parallel to the Y axis of the image, and correcting the X coordinate in the preliminary coordinates of the center point of the first mark according to the deviation so that the corrected X coordinate is on the axis of symmetry parallel to the Y axis of the image, comprises: Performing grayscale projection in the Y direction on the first sub-region to obtain a first projection curve; calculating an autocorrelation function of the first projection curve; obtaining a coordinate offset corresponding to a maximum autocorrelation value of the autocorrelation function of the first projection curve, and correcting an X coordinate in the preliminary coordinates of the center point of the first mark according to the coordinate offset, so that the corrected X coordinate is on a symmetry axis parallel to the Y axis of the image; 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) is the preliminary coordinate of the center point of the first marker, x 1 and y 1 is the preset expansion amount, and x 1> y 1, 2 x 1> w ,in w is the width of the first mark; The detecting, based on the second sub-region, a deviation between the Y coordinate in the preliminary coordinates of the center point of the first mark and the symmetry axis parallel to the image X-axis, and correcting the Y coordinate in the preliminary coordinates 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, includes: Performing grayscale projection in the X direction on the second sub-area 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 the Y coordinate in the preliminary coordinates of the center point of the first mark according to the coordinate offset, so that the corrected Y coordinate is on a symmetry axis parallel to the X axis of the image; The coordinate range of the second sub-region 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 is the height of the first marker.

10. A marking positioning device, characterized in that: include: A detection image acquisition module, used for acquiring a detection image of an object to be detected, wherein 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; A template image acquisition module, used to acquire a template image, wherein the template image includes 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 area on the detection image that contains a first general structure; a preliminary positioning module, configured to position the first marker in the matching area according to a fixed positional relationship between the first marker and the first universal structure, and obtain preliminary coordinates of a center point of the first marker; A first region acquisition module, configured to obtain a first region by region expansion of a preset size in the detection image based on the preliminary coordinates of the center point of the first mark as a reference; A 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 area, 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.

11. The marking positioning device according to claim 10, characterized in that: The template matching module uses the template image to perform template matching on the detection image to obtain a matching area on the detection image that contains a first general structure, including: The template matching module selects a plurality of zoom factors with a preset step length within a preset zoom factor interval, and scales the template image using the selected plurality of zoom factors to obtain a plurality of template images with different zoom factors; The template matching module uses the multiple template images with different zoom factors to perform template matching on the detection image respectively, obtains the matching area and matching score corresponding to each template image, and selects the matching area with the largest matching score as the final matching area.

12. The marking positioning device according to claim 10, characterized in that: 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 acquires the first sub-region, and based on the first sub-region, detects a deviation between an X coordinate in the preliminary coordinates of the center point of the first mark and an 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 mark according to the deviation, so that the corrected X coordinate is on the axis of symmetry parallel to the Y axis of the image, thereby obtaining a final X coordinate of the center point of the first mark; The final positioning module acquires the second sub-area, and based on the second sub-area, detects 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 image X-axis, and corrects the Y coordinate in the preliminary coordinates of the center point of the first mark according to the deviation, so that the corrected Y coordinate is on the axis of symmetry parallel to the image X-axis, thereby obtaining the final Y coordinate of the center point of the first mark.

13. A computer-readable storage medium, characterized in that: The medium stores a program, which can be executed by a processor to implement the marking positioning method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Marked hole positioning method and device, assembly equipment and storage medium

    CN115082552A

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

    CN117392225A

  • Intelligent overlay control method for proximity contact type photoetching machine

    CN118330989A

  • Polygon mark point rapid identification and positioning method and system, and storage medium

    CN119418027A

  • X-ray detecting method for reference mark of multilayer laminated board

    JP2002252471A

Cited By

  • Method and system for marking glioma area in neuromedical image

    CN120580224A

  • Complex line alignment matching method, device and equipment and readable storage medium

    CN121685377A