Anti-defocusing mark generation method and device, equipment and storage medium

By designing anti-defocus markers and employing a nested square frame shape and the centroid feature of a spatial circular projection ellipse, the problem of image defocusing caused by changes in viewing distance was solved, achieving high-precision and high-reliability pose measurement.

CN118936426APending Publication Date: 2024-11-12BEIJING INST OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411143207.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-20
Publication Date
2024-11-12

AI Technical Summary

Technical Problem

In high-precision visual measurement, changes in viewing distance can cause the marker image to lose focus, reducing measurement accuracy.

Method used

The design of anti-defocus markers adopts a nested square shape, with each nested layer containing multiple feature circles. The size of the marker, the number of feature circles, and the spacing are determined by calculating camera parameters. The centroid of the spatial circular projection ellipse is used as a visual measurement feature for pose measurement.

Benefits of technology

Even when out of focus, it can still achieve high-precision and high-reliability pose measurement, significantly reducing position error and normal vector roll angle error, thus improving the accuracy and robustness of the measurement.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118936426A_ABST
    Figure CN118936426A_ABST
Patent Text Reader

Abstract

The invention discloses an anti-defocus mark generation method and device, equipment and a storage medium, and the method comprises the steps: determining the layout of a mark, the layout is in a square frame nested shape, each nested layer comprises a plurality of feature circles, and the plurality of feature circles are arranged in a square array; calculating the size of the mark, the number of feature circles, the number of nested layers and the distance between the feature circles based on camera parameters to obtain parameter information of the mark; and generating an anti-defocusing mark based on the layout of the mark and the parameter information, and carrying out pose measurement by adopting the anti-defocusing mark. According to the mark designed by the invention, better pose measurement accuracy can be obtained, and mutual interference caused by out-of-focus dispersion and perspective transformation is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of posture measurement technology, and in particular to a method, device, equipment and storage medium for generating an anti-defocus mark. Background Art

[0002] The core task of pose measurement of cooperative targets is to accurately identify the spatial position and pose of the target. Planar markers, as a commonly used cooperative target, are easier to make and deploy than three-dimensional targets, and have more mature supporting algorithms and wider application scenarios. Markers can provide prior feature information for monocular pose measurement, and their design largely determines the accuracy and robustness of pose measurement.

[0003] At present, in the process of high-precision visual measurement, there will be a problem of large changes in viewing distance causing the mark imaging to be out of focus and thus reducing the measurement accuracy. Therefore, how to provide an anti-defocus mark that can achieve high-precision measurement throughout the entire process is a technical problem that needs to be urgently solved by technical personnel in this field. Summary of the invention

[0004] The embodiments of the present application provide a method, device, equipment and storage medium for generating an anti-defocus mark, so as to at least solve the problem in the related art that a large change in viewing distance causes the mark imaging to be defocused and reduces the measurement accuracy.

[0005] According to one aspect of an embodiment of the present application, a method for generating an anti-defocus mark is provided, comprising:

[0006] Determine the layout of the mark, the layout is in the shape of nested square frames, each nested layer contains a plurality of characteristic circles, and the plurality of characteristic circles are arranged in a square array;

[0007] Calculating the size, number of characteristic circles, number of nesting layers, and characteristic circle spacing of the marker based on camera parameters to obtain parameter information of the marker;

[0008] An anti-defocusing marker is generated based on the layout and parameter information of the marker, and the anti-defocusing marker is used to perform posture measurement.

[0009] In an optional embodiment, the size, number of characteristic circles, number of nesting layers, and characteristic circle spacing of the marker are calculated based on the camera parameters to obtain parameter information of the marker, including:

[0010] Calculate the size of the inner circle of the mark based on camera parameters;

[0011] Determine the number of inner circle characteristic circles, the size of the characteristic circles and the characteristic circle spacing;

[0012] Calculate the distance between the feature circle and the inner and outer frames, the number of feature circles, the distance between feature circles, and the size of the outer frame in the nested layer;

[0013] Repeat the steps of calculating the spacing between the feature circles and the inner and outer frames, the number of feature circles, the spacing between feature circles, and the size of the outer frame in the nested layer until the size of the outermost circle frame, the number of feature circles, and the spacing are determined, and the side length of the outermost circle frame is less than or equal to the preset maximum side length of the outermost circle, thereby obtaining the marked parameter information.

[0014] In an optional embodiment, calculating the size of the inner circle of the mark based on camera parameters includes:

[0015] Calculate the size of the inner circle of the mark based on the camera sensor's height, width, minimum object distance at which it operates, and the focal length of the lens.

[0016] In an optional embodiment, determining the number of inner circle characteristic circles, the sizes of the characteristic circles, and the characteristic circle spacings includes:

[0017] Based on the pre-simulation experimental results, determine the number of characteristic circles in the inner ring;

[0018] Calculate the size of the characteristic circle and the characteristic circle spacing according to the following conditions:

[0019]

[0020] d i ≥d b,i +r i ;

[0021] (n i -1)d i +2d b,i <a i ;

[0022] Among them, r i is the radius of the characteristic circle in the i-th circle, f x is the normalized focal length in the x direction in the camera intrinsic parameter matrix, d f is the maximum object distance when the camera sensor works, r u,min The radius r i The minimum number of pixels imaged at the farthest object distance, d b,i is the distance between the i-th circle border and the inner edge center, d i is the center distance of the i-th characteristic circle; n i Mark the number of characteristic circles in each row for the i-th circle, a i Indicates the side length of the i-th circle. In the case of an inner circle, the variable i is 1.

[0023] In an optional embodiment, the distance between the characteristic circle and the inner and outer frames in the nested layer and the size of the outer frame are calculated according to the following conditions:

[0024] distmin >c max ;

[0025]

[0026] Among them, dist min It represents the minimum distance between the feature circle and the inner and outer borders on the image plane, which is equal to the distance from the border to the center of the circle minus the radius, c max Indicates the maximum value of the defocus dispersion; d b,i is the distance between the i-th circle border and the center of the inner edge circle, and ai represents the side length of the i-th circle border.

[0027] In an optional embodiment, the number of nested layer characteristic circles and the characteristic circle spacing are calculated according to the following conditions:

[0028] d i ≥d b,i +r i ;

[0029] (n i -1)d i +2d b,i <a i ;

[0030] Among them, r i is the radius of the characteristic circle in the i-th circle, d b,i is the distance between the i-th circle border and the inner edge center, d i is the center distance of the i-th characteristic circle; n i Mark the number of characteristic circles in each row for the i-th circle, a i Represents the side length of the i-th circle.

[0031] In an optional embodiment, generating an anti-defocus mark based on the layout and parameter information of the mark, and using the anti-defocus mark to perform posture measurement includes:

[0032] Generate an anti-defocus mark based on the layout and parameter information of the mark;

[0033] The layout and parameter information of the markers are encoded, and the encoded markers are used for pose measurement.

[0034] According to another aspect of an embodiment of the present application, a device for generating an anti-defocus mark is also provided, including:

[0035] A layout design module, used to determine the layout of the mark, wherein the layout is in the shape of nested square frames, each nested layer includes a plurality of characteristic circles, and the plurality of characteristic circles are arranged in a square array;

[0036] A calculation module, used to calculate the size, number of characteristic circles, number of nesting layers and characteristic circle spacing of the mark based on camera parameters to obtain parameter information of the mark;

[0037] A marker generation module is used to generate an anti-defocus marker based on the layout and parameter information of the marker, and use the anti-defocus marker to perform posture measurement.

[0038] According to another aspect of an embodiment of the present application, there is also provided an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to execute the anti-defocus mark generation method through the computer program.

[0039] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned method for generating an anti-defocus mark when running.

[0040] The technical solution provided by the embodiments of the present application may have the following beneficial effects:

[0041] The mark provided in the embodiment of the present application is in the shape of a nested square frame, and each nested layer contains multiple feature circles. And calculate the size of the mark, the number of feature circles, the number of nested layers, and the spacing between feature circles. The use of a rectangular mark border can provide easily identifiable corner points and straight edge information, making the recognition and positioning of the mark simpler and more reliable. Therefore, the mark adopts a square border, and the mark feature circles are arranged in a square array. Using the centroid of the spatial circle projected ellipse as a visual measurement feature, the detection can achieve higher accuracy and higher robustness. When faced with the loss of high-frequency details of the image due to defocused imaging, the centroid of the ellipse can still be accurately located based on local grayscale features or geometric analysis when the edge cannot be accurately located. The obtained mark can achieve high-precision measurement throughout the process, so that the mark provides features that can be accurately detected in defocus conditions. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0043] Figure 1 is a flow chart of an optional method for generating an anti-defocus mark according to an embodiment of the present application;

[0044] Figure 2 It is a marking schematic diagram provided according to an embodiment of the present application;

[0045] Figure 3 It is a conventional marking schematic diagram in the prior art;

[0046] Figure 4 is a structural diagram of an optional anti-defocus mark generation device according to an embodiment of the present application;

[0047] Figure 5 It is a schematic diagram of the structure of an optional electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0048] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0049] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0050] In the visual measurement scenario of cooperative targets, when the viewing distance changes during measurement and the mark exceeds the depth of field of the camera, the image will be out of focus, which affects the accuracy and reliability of the measurement. In order to solve the problem that the large change in viewing distance during high-precision visual measurement causes the mark image to be out of focus and reduces the measurement accuracy, the embodiment of the present application proposes a method for designing an anti-defocusing mark that can achieve high-precision measurement throughout the process. In order to enable the mark to provide features that can be accurately detected in the case of defocus, the center of mass of the spatial circle projection ellipse that does not directly rely on high-frequency information for positioning is selected as the feature by analyzing the imaging defocus model, different feature detection and pose solution algorithm. In order to maximize the number of features to improve the accuracy while ensuring the feature area of ​​the mark and the feature does not interfere due to defocus, and to measure even when the imaging is incomplete, the mark frame size, feature size, spacing and number are designed by analyzing the influence of defocus and feature layout on pose measurement. Compared with conventional markers, the position error of the marker designed by the proposed method is reduced by 91.87% during pose measurement, and the normal vector and roll angle errors are reduced by 79.53% and 51.33% respectively, which can achieve high-precision and high-reliability pose measurement throughout the process.

[0051] The following is combined with Figure 1 The method for generating the anti-defocus mark in the embodiment of the present application is introduced in detail. Figure 1 As shown, the method mainly includes the following steps:

[0052] S101 determines the layout of the mark, the layout is in the shape of nested square frames, each nested layer contains multiple feature circles, and the multiple feature circles are arranged in a square array.

[0053] This application designs planar markers based on spatial circle features. In order to maximize the number of features to improve measurement accuracy while ensuring the feature area of ​​the marker and that the features do not interfere with each other due to defocus, and to be able to perform measurements even when the imaging is incomplete, the effects of defocus and feature layout on posture measurement are studied, and the design of marker border size, feature size, spacing and number is proposed.

[0054] like Figure 2 As shown, the overall layout of the mark is in the shape of a nested square frame, each nested layer contains multiple feature circles, and the multiple feature circles are arranged in a square array. Figure 3 The markup structure in is completely different.

[0055] Among them, the rectangular mark border can provide easily identifiable corner points and straight edge information, making the recognition and positioning of the mark simpler and more reliable. Therefore, the mark adopts a square border and the mark features are arranged in a square array.

[0056] In actual application scenarios, when the marker is fully imaged at the closest working object distance of the camera, the image size of the marker at the farthest working object distance will be significantly reduced. This situation will not significantly reduce the accuracy of feature positioning, but will still reduce the accuracy of pose measurement. Therefore, considering that the camera parameters are known, the marker is not fully imaged at the closest working object distance, but can be fully imaged at the farthest working object distance. Make the markers nested in the shape of a "U" character.

[0057] In one possible implementation, the main reasons for using the centroid of the spatial circular projection ellipse as the visual measurement feature are:

[0058] (1) Due to its geometric characteristics and spatial projection properties, the projection of a circle on the image plane is generally an ellipse, and its characteristic symmetry is always maintained. It can be identified and located through a relatively simple and reliable detection algorithm.

[0059] (2) Compared with corner points, the detection of ellipse centroid can achieve higher accuracy and robustness in images with complex backgrounds, low resolution and noise interference.

[0060] (3) Compared with corner points, spatial circle features can still be projected as ellipses on the image plane and better maintain their shape characteristics even when perspective distortion is severe. However, corner points are prone to have their local gradient features weakened due to perspective distortion, which can lead to missed detection.

[0061] (4) In a defocused image, the accuracy and robustness of corner location will be greatly affected due to its reliance on high-frequency local features. However, the centroid location of the spatial circular projection ellipse does not directly rely on higher local gradient features. Therefore, when faced with the loss of high-frequency details of the image due to defocused imaging, the centroid of the ellipse can still be accurately located based on local grayscale features or geometric analysis when the edge cannot be accurately located.

[0062] In scenes with uneven lighting, for elliptical features with large imaging areas and regular edges, the detection effect of the centroid extraction algorithm based on edge fitting is usually better than that of the centroid extraction algorithm based on grayscale. However, in the case of defocus, the accuracy and robustness of edge fitting will be affected due to the weakening of gradient features. Although the gradient descent effect caused by defocus blur on the edge of the ellipse will still have a negative impact on the positioning accuracy of the edge of the projected ellipse, this negative impact is mainly reflected in the deviation of the estimation of the size of the projected ellipse outline, and will not significantly affect the accuracy of centroid positioning.

[0063] Therefore, the markings obtained by the layout method of the present application can achieve high-precision measurement throughout the entire process, so that the markings provide features that can be accurately detected in out-of-focus conditions.

[0064] S102 calculates the size of the marker, the number of characteristic circles, the number of nesting layers, and the characteristic circle spacing based on the camera parameters to obtain parameter information of the marker.

[0065] In an optional embodiment, the size of the mark, the number of characteristic circles, the number of nesting layers and the characteristic circle spacing are calculated based on the camera parameters to obtain parameter information of the mark, including first calculating the size of the inner circle of the mark based on the camera parameters.

[0066] Specifically, the size of the inner circle of the mark is calculated based on the height, width, minimum object distance of the camera sensor, and focal length of the lens. When the width is greater than the height, the size of the inner circle of the mark can be calculated based on the following conditions:

[0067]

[0068] Where a1 is the length of the inner circle, hs is the height of the camera sensor, f is the focal length of the lens, and d is the n Indicates the minimum object distance during operation. When the above conditions are met, a1 is maximized as much as possible.

[0069] If the parameters of the camera and lens are unknown, but the maximum allowable side length of the marker is known to be a max and the closest working object distance d n In order to make the mark have the largest imaging area at the farthest working object distance, the side length of the mark is maximized, that is, a = a max At the same time, in order to ensure that the marker can be fully imaged in all postures at the closest working object distance, the following conditions must be met when selecting the camera and lens:

[0070]

[0071] In addition, if conditions permit, a larger sensor should be selected to obtain lower noise levels and higher resolution.

[0072] However, in actual application scenarios, when the mark is fully imaged at the closest working object distance of the camera, the image size of the mark at the farthest working object distance is significantly reduced, that is, d f / d n >>1, d f is the maximum object distance during operation. This situation will not significantly reduce the accuracy of feature positioning, but it will still reduce the accuracy of pose measurement. Therefore, considering that the camera parameters are known, the marker is not fully imaged at the closest working object distance, but can be fully imaged at the farthest working object distance. Make the markers nested in the shape of a "U" and set the side length of the outermost circle to a o , and a o max ​, the side length of the inner circle is ai (i ≥ 1, i represents the number of circles counted from the inside to the outside). At the farthest working object distance, the entire mark can be fully imaged in any posture, so the focal length of the lens should meet

[0073]

[0074] In order to maximize the use of the imaging area of ​​the sensor, the focal length f should not be too small and should be as large as possible.

[0075] Based on the above analysis, the size of the innermost circle of the mark can be determined, and the maximum size of the outermost circle is limited.

[0076] Furthermore, the number of inner circle characteristic circles, the sizes of the characteristic circles and the characteristic circle spacing are determined.

[0077] In a possible implementation, the number of characteristic circles in the inner ring can be determined based on the results of a pre-simulation experiment. Then, the size of the characteristic circles and the characteristic circle spacing can be calculated according to the following conditions:

[0078]

[0079] d i ≥d b,i +r i ;

[0080] (n i -1)d i +2d b,i <a i ;

[0081] Among them, r i is the radius of the characteristic circle in the i-th circle, f x is the normalized focal length in the x direction in the camera intrinsic parameter matrix, d f is the maximum object distance when the camera sensor works, r u,min The radius r i The minimum number of pixels imaged at the farthest object distance, d b,i is the distance between the i-th circle border and the inner edge center, d i is the center distance of the i-th characteristic circle; n i Mark the number of characteristic circles in each row for the i-th circle, a i Indicates the side length of the i-th circle. In the case of an inner circle, the variable i is 1.

[0082] By solving the above conditions, the radius of the characteristic circle that meets the above conditions can be obtained. When the above conditions are met, the radius of the characteristic circle of the inner circle and the radius of the characteristic circles in the remaining nested layers can be made the same.

[0083] When designing the mark, it is necessary to adjust the spacing between the circles and the spacing between the circles and the mark frame so that no matter what posture or degree of defocus the mark is in when it is imaged on the image plane, its features will not interfere with each other. Based on the above conditions, d i , the center distance of the i-th characteristic circle, and the characteristic circle spacing. According to the calculation d b,i is the distance between the border of the i-th circle and the center of the inner edge, and the distance from the characteristic circle to the border can be obtained.

[0084] Furthermore, in an optional embodiment, the distance between the characteristic circle and the inner and outer frames in the nested layer and the size of the outer frame are calculated according to the following conditions:

[0085] dist min >c max ;

[0086]

[0087] Among them, dist min It represents the minimum distance between the feature circle and the inner and outer borders on the image plane, which is equal to the distance from the border to the center of the circle minus the radius, c max Indicates the maximum value of the defocus dispersion; d b,i is the distance between the i-th circle border and the inner edge circle center, and ai represents the side length of the i-th circle border. By solving the above conditions, the distance between the characteristic circle and the inner and outer frames and the size of the outer frame in the nested layer that meets the conditions can be obtained.

[0088] Among them, when considering the situation of out-of-focus imaging, in order to minimize the maximum diffuse spot diameter of the mark imaging at the entire working object distance, it is necessary to adjust the distance d of the focus plane PoF , so that the diffuse spot diameter c at the minimum working object distance and the maximum working object distance are the same. The relationship between the diffuse spot diameter and the focal length, aperture factor, focal plane distance and actual object distance can be obtained:

[0089]

[0090] as well as

[0091]

[0092] Equating the above two equations, we can find the optimal value of the focusing distance.

[0093]

[0094] At this time, within the actual measurement object distance range, the maximum value of the defocus dispersion c is:

[0095]

[0096] Expressing cmax in pixels, we have:

[0097]

[0098] Among them, N F Represents focal ratio, side length s of square pixel p In general visual measurement scenarios, the magnitude of cmax is usually 10 0 ~10 2 pixel.

[0099] In addition, due to the symmetry of the circular feature, the Euler angle θ of the rotation around the X axis is considered here X , then the feature that is most likely to interfere with defocus dispersion appears on the side farther from the camera, that is, the circle closest to the edge and the border of the mark. Assuming that the position of the mark is at the maximum object distance df, and the imaging defocus dispersion diameter of each position of the mark is regarded as c, then the coordinates of the center of the feature circle in the target coordinate system are (0, a i / 2–d b,i ,0), ai is the length of the edge marked in the i-th circle, d b,i is the distance between the i-th circle border and the inner edge circle center. At this time, the minimum distance between the marked border and the edge feature circle on the image plane is dist min (Unit: pixel) can be expressed as:

[0100]

[0101] Among them, ri is the radius of the characteristic circle in the i-th circle, fx and fy are the normalized focal lengths in the camera intrinsic parameter matrix (unit: pixel). i / 2–d b,i +r i i / 2, then:

[0102]

[0103] If d f >>a i / 2 and d f >>a i / 2–d b,i +r i , then dist min The magnitude is usually 10 0 ~10 2 When r i / d b,i >0.7 or d f When it is large, it may cause dist min Only single-digit pixels can easily interfere with feature detection; when r​i / d b,i <0.7 or d f When it is small, usually dist min Therefore, when designing the feature layout of the marker, the r of the feature circle should be minimized. i / d b,i <0.7. In order to make the image size of the marked feature large enough at the maximum working object distance, the minimum radius of the feature circle should be limited according to the specific detection algorithm. Assume that the minimum number of pixels imaged by the radius ri at the farthest object distance is r u,min , then according to the camera linear imaging model, it should satisfy

[0104]

[0105] If the feature circle and the border, as well as the feature circles, are not to interfere with each other due to defocus dispersion, the following conditions must be met:

[0106] dist min >c max ;

[0107] and

[0108] d i ≥d b,i +r i ;

[0109] In an optional embodiment, the number of nested layer characteristic circles and the characteristic circle spacing are calculated according to the following conditions:

[0110] d i ≥d b,i +r i ;

[0111] (n i -1)d i +2d b,i <a i ;

[0112] Among them, r i is the radius of the characteristic circle in the i-th circle, d b,i is the distance between the i-th circle border and the inner edge center, d i is the center distance of the i-th characteristic circle; n i Mark the number of characteristic circles in each row for the i-th circle, a i Represents the side length of the i-th circle.

[0113] According to the above conditions, the number of characteristic circles in each row marked by the solved ni for the i-th circle can be determined, and the number of characteristic circles in the nested layer can be determined according to the solved d i is the center distance of the i-th characteristic circle, which can determine the spacing between characteristic circles in the nested layer.

[0114] Repeat the steps of calculating the spacing between the feature circles and the inner and outer frames, the number of feature circles, the spacing between feature circles, and the size of the outer frame in the nested layer until the size of the outermost circle frame, the number of feature circles, and the spacing are determined, and the side length of the outermost circle frame is less than or equal to the preset maximum side length of the outermost circle, thereby obtaining the marked parameter information.

[0115] S103 generates an anti-defocus marker based on the layout and parameter information of the marker, and uses the anti-defocus marker to perform posture measurement.

[0116] In an optional embodiment, an anti-defocus mark is generated based on the layout and parameter information of the mark, and the anti-defocus mark is used for posture measurement, including: generating an anti-defocus mark based on the layout and parameter information of the mark; encoding the layout and parameter information of the mark, and using the encoded mark for posture measurement.

[0117] When designing a planar marker, it is necessary to encode the feature information of the marker to identify the marker. In addition, after the feature points are detected, they need to be sorted in a specific order so that the pixel coordinates of the feature points can be matched with the target coordinates, and then the PnP algorithm can be used for pose calculation. To this end, a planar marker encoding and decoding method is proposed, and its specific process is as follows:

[0118] (1) The nested circles are marked in black and white and can be easily identified by the related properties of the connected domain.

[0119] (2) Add features containing special information to the marker to identify the rotation direction. In the circular array of the marker, use a 2-layer concentric circle as a vertex, and set its center to point A. The features of the black and white concentric circles can be easily identified in the ellipse detection and centroid positioning stages.

[0120] (3) After detecting the centers of all projected ellipses, the center of mass G of all center points in the pixel coordinate system is calculated, and the center of mass G and the vertex A are used as input to determine a straight line l1:α1u+β1v+γ1=0 (α1>0).

[0121] (4) Define δ1 = α1u + β1v + ​​γ1, substitute the pixel coordinates of each feature point into the above equation, and calculate the δ1 value corresponding to each feature point. Since δ1 is an algebraic value containing positive and negative signs, vertex B and vertex D can be directly determined by its maximum and minimum values. Among them, vertices A, B, C, and D are defined to be arranged in a clockwise direction around the normal vector of the marking plane.

[0122] (5) Taking vertices B and D as input, another straight line l2 is obtained: α2u+β2v+γ2=0 (α2>0). Following step 3, vertex C can be located by calculating δ2=α2u+β2v+γ2.

[0123] (6) After the four vertices are determined, the four vertices are connected in pairs. By calculating the distances from the feature points other than the vertices to the straight line and the Euclidean distances to the vertices at both ends, the arrangement of all feature points on the four sides of the array can be determined. If it is not the innermost circle of the mark, then the feature points on the four sides of the array are all the feature points, and they are sorted in a clockwise order starting from vertex A.

[0124] For marking the innermost circle, in addition to the feature point array on the periphery, the feature points in the middle of the array also need to be sorted. Since all the feature points on the four sides of the array have been determined, the feature points at both ends of each row of the array have also been determined. By connecting these endpoints, the arrangement of all feature points in the middle of the array can be determined according to the method in step 6. After obtaining the specific positions of all feature points, they are sorted from left to right and from top to bottom.

[0125] When performing pose measurement, the image of the marker is captured by the camera, and the captured image is used to identify and locate the marker through image processing algorithms. It includes steps such as edge detection and feature point recognition. Once the position of the marker is determined in the image, the position and orientation of the marker in three-dimensional space can be calculated through known camera parameters and the geometric information of the marker. Planar markers are used in many fields, such as robot navigation, augmented reality, object tracking, 3D modeling, motion capture, etc. The method using planar markers has the advantages of high cost-effectiveness, easy implementation and good flexibility. They can be quickly identified and tracked, providing an effective solution for pose measurement.

[0126] This application studies the relationship between feature layout and pose measurement accuracy, designs the size and feature layout of the marker based on the imaging defocus model, and provides basic principles and procedures for marker design under defocus and changing viewing distance. In addition, a simple marker encoding and decoding method is proposed to identify the marker and eliminate rotation angle ambiguity. According to the basic marker design principles and procedures proposed in this application, markers are designed for prototype experiments and pose measurement simulation experiments are carried out. The results show that in the case of defocus and changing viewing distance, the markers designed based on the method of this application are significantly superior to conventional markers in terms of accuracy and reliability of pose measurement.

[0127] According to another aspect of the embodiments of the present application, a device for generating an anti-defocus mark for implementing the above-mentioned method for generating an anti-defocus mark is also provided. Figure 4 As shown, the device comprises:

[0128] The layout design module 401 is used to determine the layout of the mark, the layout is in the shape of nested square frames, each nested layer contains multiple feature circles, and the multiple feature circles are arranged in a square array;

[0129] A calculation module 402 is used to calculate the size of the mark, the number of characteristic circles, the number of nesting layers and the characteristic circle spacing based on the camera parameters to obtain parameter information of the mark;

[0130] The marker generation module 403 is used to generate an anti-defocus marker based on the layout and parameter information of the marker, and use the anti-defocus marker to perform posture measurement.

[0131] It should be noted that the device for generating anti-defocus marks provided in the above-mentioned embodiments only uses the division of the above-mentioned functional modules as an example when executing the method for generating anti-defocus marks. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device for generating anti-defocus marks provided in the above-mentioned embodiments and the method for generating anti-defocus marks belong to the same concept, and the implementation process thereof is detailed in the method embodiment, which will not be repeated here.

[0132] According to another aspect of an embodiment of the present application, an electronic device corresponding to the method for generating an anti-defocus mark provided in the aforementioned embodiment is also provided to execute the aforementioned method for generating an anti-defocus mark.

[0133] Please refer to Figure 5 , which shows a schematic diagram of an electronic device provided by some embodiments of the present application. Figure 5 As shown, the electronic device includes: a processor 500, a memory 501, a bus 502 and a communication interface 503, and the processor 500, the communication interface 503 and the memory 501 are connected via the bus 502; the memory 501 stores a computer program that can be run on the processor 500, and when the processor 500 runs the computer program, it executes the method for generating anti-defocus marks provided in any of the aforementioned embodiments of the present application.

[0134] The memory 501 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk storage. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 503 (which may be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. may be used.

[0135] The bus 502 may be an ISA bus, a PCI bus, or an EISA bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. Among them, the memory 501 is used to store programs, and the processor 500 executes the program after receiving the execution instruction. The method for generating an anti-defocus mark disclosed in any implementation of the embodiment of the present application may be applied to the processor 500, or implemented by the processor 500.

[0136] The processor 500 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 500. The above processor 500 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in the embodiments of the present application can be directly embodied as a hardware decoding processor to be executed, or the hardware and software modules in the decoding processor can be executed. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 501, and the processor 500 reads the information in the memory 501 and completes the steps of the above method in combination with its hardware.

[0137] The electronic device provided in the embodiment of the present application and the method for generating an anti-defocus mark provided in the embodiment of the present application are based on the same inventive concept and have the same beneficial effects as the methods adopted, operated or implemented therein.

[0138] According to another aspect of the embodiments of the present application, a computer-readable storage medium corresponding to the method for generating anti-defocus marks provided in the aforementioned embodiments is also provided, on which a computer program (i.e., a program product) is stored. When the computer program is run by a processor, it will execute the method for generating anti-defocus marks provided in any of the aforementioned embodiments.

[0139] It should be noted that examples of computer-readable storage media may also include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other optical or magnetic storage media, which are not listed here one by one.

[0140] The computer-readable storage medium provided in the above-mentioned embodiments of the present application and the method for generating anti-defocus marks provided in the embodiments of the present application are based on the same inventive concept and have the same beneficial effects as the methods adopted, run or implemented by the application programs stored therein.

[0141] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0142] The above embodiments only express several implementation methods of the present invention, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present invention. It should be pointed out that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the present invention patent shall be subject to the attached claims.

Claims

1. A method for generating an anti-defocus mark, characterized in that: include: Determine the layout of the mark, the layout is in the shape of nested square frames, each nested layer contains a plurality of characteristic circles, and the plurality of characteristic circles are arranged in a square array; Calculating the size, number of characteristic circles, number of nesting layers, and characteristic circle spacing of the marker based on camera parameters to obtain parameter information of the marker; An anti-defocusing marker is generated based on the layout and parameter information of the marker, and the anti-defocusing marker is used to perform posture measurement.

2. The method according to claim 1, characterized in that: The size, number of characteristic circles, number of nesting layers, and characteristic circle spacing of the marker are calculated based on the camera parameters to obtain parameter information of the marker, including: Calculate the size of the inner circle of the mark based on camera parameters; Determine the number of inner circle characteristic circles, the size of the characteristic circles and the characteristic circle spacing; Calculate the distance between the feature circle and the inner and outer frames, the number of feature circles, the distance between feature circles, and the size of the outer frame in the nested layer; Repeat the steps of calculating the spacing between the feature circles and the inner and outer frames, the number of feature circles, the spacing between feature circles, and the size of the outer frame in the nested layer until the size of the outermost circle frame, the number of feature circles, and the spacing are determined, and the side length of the outermost circle frame is less than or equal to the preset maximum side length of the outermost circle, thereby obtaining the marked parameter information.

3. The method according to claim 2, characterized in that The size of the inner circle of the marker is calculated based on the camera parameters, including: Calculate the size of the inner circle of the mark based on the camera sensor's height, width, minimum object distance at which it operates, and the focal length of the lens.

4. The method according to claim 2, characterized in that: Determine the number of inner circle feature circles, their sizes, and their spacing, including: Based on the pre-simulation experimental results, determine the number of characteristic circles in the inner ring; Calculate the size of the characteristic circle and the characteristic circle spacing according to the following conditions: d i ≥d b,i +r i ; (n i -1)d i +2d b,i <a i ; Among them, r i is the radius of the characteristic circle in the i-th circle, f x is the normalized focal length in the x direction in the camera intrinsic parameter matrix, d f is the maximum object distance when the camera sensor works, r u,min The radius r i The minimum number of pixels imaged at the farthest object distance, d b,i is the distance between the i-th circle border and the inner edge center, d i is the center distance of the i-th characteristic circle; n i Mark the number of characteristic circles in each row for the i-th circle, a i Indicates the side length of the i-th circle. In the case of an inner circle, the variable i is 1.

5. The method according to claim 2, characterized in that: The distance between the feature circle and the inner and outer frames in the nested layer and the size of the outer frame are calculated according to the following conditions: dist min >c max ; Among them, dist min It represents the minimum distance between the feature circle and the inner and outer borders on the image plane, which is equal to the distance from the border to the center of the circle minus the radius, c max Indicates the maximum value of the defocus dispersion; d b,i is the distance between the border of the i-th circle and the center of the inner edge, a i Indicates the length of the border of the i-th circle.

6. The method according to claim 2, characterized in that The number of nested feature circles and the feature circle spacing are calculated according to the following conditions: d i ≥d b,i +r i ; (n i -1)d i +2d b,i <a i ; Among them, r i is the radius of the characteristic circle in the i-th circle, d b,i is the distance between the i-th circle border and the inner edge center, d i is the center distance of the i-th characteristic circle; n i Mark the number of characteristic circles in each row for the i-th circle, a i Represents the side length of the i-th circle.

7. The method according to claim 1, characterized in that Generate an anti-defocus mark based on the layout and parameter information of the mark, and use the anti-defocus mark to perform posture measurement, including: Generate an anti-defocus mark based on the layout and parameter information of the mark; The layout and parameter information of the markers are encoded, and the encoded markers are used for pose measurement.

8. A device for generating an anti-defocus mark, characterized in that: include: A layout design module, used to determine the layout of the mark, wherein the layout is in the shape of nested square frames, each nested layer includes a plurality of characteristic circles, and the plurality of characteristic circles are arranged in a square array; A calculation module, used to calculate the size, number of characteristic circles, number of nesting layers and characteristic circle spacing of the mark based on camera parameters to obtain parameter information of the mark; A marker generation module is used to generate an anti-defocus marker based on the layout and parameter information of the marker, and use the anti-defocus marker to perform posture measurement.

9. An electronic device, characterized in that: It comprises a processor and a memory storing program instructions, wherein the processor is configured to execute the method for generating an anti-defocus mark according to any one of claims 1 to 7 when executing the program instructions.

10. A computer-readable medium, characterized in that Computer-readable instructions are stored thereon, and the computer-readable instructions are executed by a processor to implement a method for generating an anti-defocus mark as described in any one of claims 1 to 7.