A target posture positioning method and system for distortion estimation
By making single-target determination of the calibration plate, a dynamic spatial model of distortion variables is established, and the distortion coefficient of the target object is calculated, the error problem caused by distortion in visual measurement is solved, the accuracy is improved, and the needs of actual engineering are met.
Patent Information
- Application Number
- CN202310947248.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-31
- Publication Date
- 2025-05-16
- Estimated Expiration
- 2043-07-31
AI Technical Summary
The prior art rarely considers the distortion of the camera lens in visual measurement, resulting in large errors.
By performing single target determination on the calibration plate, obtaining distortion coefficients, establishing a spatial dynamic model of distortion variables, interpolation calculation of the distortion coefficients of the target object, and thus improving the accuracy of positioning.
It effectively reduces the error caused by inconsistent distortion coefficients, improves the accuracy of visual measurement, and meets the usage requirements in actual engineering.
Smart Images

Figure CN117252922B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of machine vision, and in particular relates to a target posture positioning method and system for estimating distortion amount. Background Art
[0002] At present, most visual measurements pay little attention to the distortion coefficient of the camera lens. They are generally based on polynomial calibration and division model calibration. These two calibration methods belong to multi-parameter calibration and single-parameter calibration. However, distortion is the cumulative effect of the complex prism system, camera geometry and image sensor surface, and the distortion coefficients at different focal lengths, areas and heights are different, resulting in large errors in visual measurement. Summary of the invention
[0003] The present invention provides a target posture positioning method and system for distortion estimation, which can improve the error problem caused by the distortion coefficient in visual measurement and enhance the accuracy of visual measurement.
[0004] In order to achieve the above object, the technical solution adopted by the present invention is:
[0005] A first aspect of the present invention provides a method for positioning a target posture for estimating a distortion amount, comprising:
[0006] The set calibration plate B0 is calibrated by a single target to obtain the distortion coefficient κ0; the image obtained by each calibration plate B0 is projected to the set projection height h ty ;
[0007] Use the distortion coefficient κ0 to identify and calculate the corresponding calibration plate B0 posture [R0 T0] and the pixel coordinates of the landmark point (x0, y0); R0 is represented as the rotation matrix of the calibration plate B0 posture; T0 is represented as the translation vector of the calibration plate B0 posture;
[0008] The calibration plate B is obtained by performing monocular pose iteration on the pose [R0 T0] of each calibration plate B0 through the translation vector and rotation matrix. k , calculate the calibration plate B based on the pixel coordinates (x0, y0) k The corresponding actual distortion coefficient κ k , with calibration plate B k The two-dimensional pixel coordinates of the landmark point (x k ,y k ) is the independent variable, the distortion coefficient κ k As the dependent variable, a spatial dynamic model of distortion is established;
[0009] Substitute the pixel coordinates (x, y) of the target object into the distortion space dynamic model for interpolation, and calculate the distortion coefficient value κ corresponding to the pixel coordinates (x, y);
[0010] The distortion coefficient value κ is substituted into the posture detection algorithm to calculate the posture result corresponding to the target object.
[0011] Preferably, the monocular pose iteration method for the pose [R0 T0] of each calibration plate B0 by using the translation vector and the rotation matrix includes:
[0012]
[0013]
[0014] In the formula, p i is the coordinate of the i-th marker point in the world coordinate system, n is the number of marker points, t (k) (R) is the calibration plate B in the kth iteration k The translation vector of the pose, R (k+1) For the calibration plate B in the k+1th iteration k The rotation matrix of the pose; V i It is represented as a projection matrix; I is represented as a third-order identity matrix, R is represented as a directional rotation matrix, and T is represented as a directional translation vector.
[0015] Preferably, the calibration plate B is calculated based on the pixel coordinates (x0, y0) k The corresponding actual distortion coefficient κ k The methods include:
[0016] The calibration plate B is calibrated by the distortion coefficient κ0 k The image is dedistorted to obtain the calibration plate B t The actual posture height of the calibration plate B is calculated k The actual posture height and projection height h ty The difference Q;
[0017] When the difference Q is less than the set height difference threshold, calculate the calibration plate B k The pixel coordinates (x k ,y k ); based on the pixel coordinates (x0, y0) and the pixel coordinates (x k ,y k ) Calculate the calibration plate B k The corresponding actual distortion coefficient κ k ;
[0018] When the difference Q is greater than the set height difference threshold, the distortion coefficient κ0 is increased and decreased at the same time, and the iteration is repeated until the calibration plate B is calculated. k The corresponding actual distortion coefficient κ k .
[0019] Preferably, the method of simultaneously increasing and decreasing the distortion coefficient κ0 comprises:
[0020] κ0=κ0±10m
[0021] In the formula, m is expressed as the number of times the distortion coefficient κ0 increases and decreases.
[0022] Preferably, based on the pixel coordinates (x0, y0) and the pixel coordinates (x k ,y k ) Calculate the calibration plate B k The corresponding actual distortion coefficient κ k The methods include:
[0023]
[0024] In the formula, k represents the number of monocular pose iterations for the pose [R0 T0] of each calibration plate B0.
[0025] Preferably, the method of substituting the pixel coordinates (x, y) of the target object into the distortion amount space dynamic model for interpolation and calculating the distortion coefficient value κ corresponding to the pixel coordinates (x, y) includes:
[0026]
[0027]
[0028] In the formula, f(x,y) is the interpolation result of the pixel coordinates (x,y), that is, the distortion coefficient value κ corresponding to the pixel coordinates (x,y); (x i ,y i ) is represented by the coordinates of the ith sample point of the neighboring pixel point coordinates (x, y) in the distortion space dynamic model; f i is the distortion coefficient value of the i-th sample point, w i (x i ,y i ) is the weight of the i-th sample point with respect to the interpolation point (x, y), and its value range is [0, 1]; L i is the side length between the pixel coordinates (x, y) and the i-th sample point; D is the number of sample points adjacent to the pixel coordinates (x, y) in the distortion space dynamic model.
[0029] A second aspect of the present invention provides a target posture positioning system for estimating distortion, comprising:
[0030] The calibration module is used to perform single-target calibration on the set calibration plate B0 to obtain the distortion coefficient κ0; the image obtained by each calibration plate B0 is projected to the set projection height h ty; Use the distortion coefficient κ0 to identify and calculate the corresponding calibration plate B0 posture [R0 T0] and the pixel coordinates of the landmark point (x0, y0); R0 is represented as the rotation matrix of the calibration plate B0 posture; T0 is represented as the translation vector of the calibration plate B0 posture;
[0031] The model building module is used to iterate the monocular pose of each calibration plate B0 through the translation vector and rotation matrix [R0 T0] to obtain the calibration plate B k , calculate the calibration plate B based on the pixel coordinates (x0, y0) k The corresponding actual distortion coefficient κ k , with calibration plate B k The two-dimensional pixel coordinates of the landmark point (x k ,y k ) is the independent variable, the distortion coefficient κ k As the dependent variable, a spatial dynamic model of distortion is established;
[0032] The posture detection module is used to substitute the pixel coordinates (x, y) of the target object into the distortion space dynamic model for interpolation, calculate the distortion coefficient value κ corresponding to the pixel coordinates (x, y); substitute the distortion coefficient value κ into the posture detection algorithm to calculate the posture result corresponding to the target object.
[0033] The third aspect of the present invention provides a computer-readable storage medium, characterized in that a computer program is stored thereon, and when the program is executed by a processor, the steps of the target posture positioning method described in the first aspect are implemented.
[0034] Compared with the prior art, the present invention has the following beneficial effects:
[0035] After establishing a distortion quantity spatial dynamic model, the present invention substitutes the pixel point coordinates (x, y) of the target object into the distortion quantity spatial dynamic model for interpolation, and calculates the distortion coefficient value κ corresponding to the pixel point coordinates (x, y); substitutes the distortion coefficient value κ into a posture detection algorithm to calculate a posture result corresponding to the target object; the present invention can solve the problem of inconsistent distortion coefficients in different areas during camera calibration, the calibration process is simple and easy to operate, and the error caused by inconsistent distortion coefficients in visual measurement is reduced to the maximum extent. Compared with the traditional polynomial distortion coefficient model and the division model distortion coefficient, the calibration method meets the use requirements in actual engineering. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 is a flow chart of the target posture positioning method provided in Example 1;
[0037] Figure 2 is a schematic diagram of the spatial dynamic model of distortion provided in Example 1;
[0038] Figure 3It is a schematic diagram of the interpolation model provided in Example 1. DETAILED DESCRIPTION
[0039] The present invention will be further described below in conjunction with the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and cannot be used to limit the protection scope of the present invention.
[0040] Example 1
[0041] like Figures 1 to 3 As shown, this embodiment provides a target posture positioning method for distortion estimation, including:
[0042] The set calibration plate B0 is calibrated by a single target to obtain the distortion coefficient κ0; the image obtained by each calibration plate B0 is projected to the set projection height h ty ; In this embodiment, the calibration plate B0 is set to 20;
[0043] Use the distortion coefficient κ0 to identify and calculate the corresponding calibration plate B0 posture [R0 T0] and the pixel coordinates of the landmark point (x0, y0); R0 is represented as the rotation matrix of the calibration plate B0 posture; T0 is represented as the translation vector of the calibration plate B0 posture;
[0044] The monocular pose iteration of each calibration plate B0 [R0 T0] is performed through the translation vector and rotation matrix. The pose iteration of calibration plate B0 is calibration plate B k , the iteration formula is:
[0045]
[0046]
[0047] In the formula, p i is the coordinate of the i-th marker point in the world coordinate system, n is the number of marker points, t (k) (R) is the calibration plate B in the kth iteration k The translation vector of the pose, R (k+1) For the calibration plate B in the k+1th iteration k The rotation matrix of the pose; V i It is represented as a projection matrix; I is represented as a third-order identity matrix, R is represented as a directional rotation matrix, and T is represented as a directional translation vector; R and T can be obtained by minimizing the object-side residual and function calculation.
[0048] Calculate the calibration plate B based on the pixel coordinates (x0, y0) k The corresponding actual distortion coefficient κ k The methods include:
[0049] The calibration plate B is calibrated by the distortion coefficient κ0k The image is dedistorted to obtain the calibration plate B t The actual posture height of the calibration plate B is calculated k The actual posture height and projection height h ty The difference Q;
[0050] When the difference Q is less than the set height difference threshold, calculate the calibration plate B k The pixel coordinates (x k ,y k ); based on the pixel coordinates (x0, y0) and the pixel coordinates (x k ,y k ) Calculate the calibration plate B k The corresponding actual distortion coefficient κ k The methods include:
[0051]
[0052] In the formula, k represents the number of monocular pose iterations for the pose [R0 T0] of each calibration plate B0;
[0053] When the difference Q is greater than the set height difference threshold, the expression formula for increasing and decreasing the distortion coefficient κ0 at the same time is: κ0=κ0±10m, where m is the number of times the distortion coefficient κ0 increases and decreases. Repeat this process until the calibration plate B is calculated. k The corresponding actual distortion coefficient κ k .
[0054] like Figure 2 As shown, after traversing the camera field of view through the calibration plate, the calibration plate B k The two-dimensional pixel coordinates of the landmark point (x k ,y k ) is the independent variable, the distortion coefficient κ k As the dependent variable, a spatial dynamic model of distortion is established;
[0055] The target object image is captured by a monocular camera, and the pixel coordinates (x, y) corresponding to the origin of the target object's world coordinate system in the image are calculated by template matching;
[0056] like Figure 3 As shown, the pixel coordinates (x, y) of the target object are substituted into the distortion space dynamic model for interpolation, and the method for calculating the distortion coefficient value κ corresponding to the pixel coordinates (x, y) includes:
[0057]
[0058]
[0059] In the formula, f(x,y) is the interpolation result of the pixel coordinates (x,y), that is, the distortion coefficient value κ corresponding to the pixel coordinates (x,y); (x i ,y i ) is represented by the coordinates of the ith sample point of the neighboring pixel point coordinates (x, y) in the distortion space dynamic model; f i is the distortion coefficient value of the i-th sample point adjacent to the pixel coordinate (x, y), w i (x i ,y i ) is the weight of the i-th sample point adjacent to the pixel coordinate (x, y) with respect to the interpolation point (x, y), and its value range is [0, 1]; L i is the side length between the pixel coordinate (x, y) and the i-th adjacent sample point; D represents the number of sample points adjacent to the pixel coordinate (x, y) in the distortion space dynamic model.
[0060] The distortion coefficient value κ is substituted into the posture detection algorithm to dedistort the target object image, and the posture result corresponding to the target object is calculated to achieve high-precision positioning; this embodiment can solve the problem of inconsistent distortion coefficients in different areas during camera calibration. The calibration process is simple and easy to operate, and the error caused by inconsistent distortion coefficients in visual measurement is minimized. Compared with the traditional polynomial distortion coefficient model and division model distortion coefficient, this calibration method meets the use requirements in actual engineering.
[0061] Example 2
[0062] This embodiment provides a target posture positioning system for estimating distortion amount. The target posture positioning in this embodiment can be applied to the target posture positioning method described in Example 1. The target posture positioning system includes:
[0063] The calibration module is used to perform single-target calibration on the set calibration plate B0 to obtain the distortion coefficient κ0; the image obtained by each calibration plate B0 is projected to the set projection height h ty ; Use the distortion coefficient κ0 to identify and calculate the corresponding calibration plate B0 posture [R0 T0] and the pixel coordinates of the landmark point (x0, y0); R0 is represented as the rotation matrix of the calibration plate B0 posture; T0 is represented as the translation vector of the calibration plate B0 posture;
[0064] The model building module is used to iterate the monocular pose of each calibration plate B0 through the translation vector and rotation matrix [R0 T0] to obtain the calibration plate B k , calculate the calibration plate B based on the pixel coordinates (x0, y0) k The corresponding actual distortion coefficient κ k , with calibration plate B k The two-dimensional pixel coordinates of the landmark point (x k,y k ) is the independent variable, the distortion coefficient κ k As the dependent variable, a spatial dynamic model of distortion is established;
[0065] The posture detection module is used to substitute the pixel coordinates (x, y) of the target object into the distortion space dynamic model for interpolation, calculate the distortion coefficient value κ corresponding to the pixel coordinates (x, y); substitute the distortion coefficient value κ into the posture detection algorithm to calculate the posture result corresponding to the target object.
[0066] The model building module is used to calculate the calibration plate B based on the pixel coordinates (x0, y0) k The corresponding actual distortion coefficient κ k The methods include:
[0067] The calibration plate B is calibrated by the distortion coefficient κ0 k The image is dedistorted to obtain the calibration plate B k The actual posture height of the calibration plate B is calculated k The actual posture height and projection height h ty The difference Q;
[0068] When the difference Q is less than the set height difference threshold, calculate the calibration plate B k The pixel coordinates (x k ,y k ); based on the pixel coordinates (x0, y0) and the pixel coordinates (x k ,y k ) Calculate the calibration plate B k The corresponding actual distortion coefficient κ k ;
[0069] When the difference Q is greater than the set height difference threshold, the distortion coefficient κ0 is increased and decreased at the same time, and the iteration is repeated until the calibration plate B is calculated. k The corresponding actual distortion coefficient κ k .
[0070] Example 3
[0071] This embodiment provides a computer-readable storage medium, characterized in that a computer program is stored thereon, and when the program is executed by a processor, the steps of the target posture positioning method described in Example 1 are implemented.
[0072] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0073] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0074] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0075] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0076] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the technical principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for positioning a target posture for estimating distortion, characterized in that: include: The set calibration plate B0 is calibrated by a single target to obtain the distortion coefficient κ0; the image obtained by each calibration plate B0 is projected to the set projection height h ty ; Use the distortion coefficient κ0 to identify and calculate the corresponding calibration plate B0's pose [R0 T0] and the pixel coordinates of its landmarks (x0, y0); R0 is represented as the rotation matrix of the calibration plate B0's pose; T0 represents the translation vector of the calibration plate B0 pose; The calibration plate B is obtained by performing monocular pose iteration on the pose [R0 T0] of each calibration plate B0 through the translation vector and rotation matrix. k , calculate the calibration plate B based on the pixel coordinates (x0, y0) k The corresponding actual distortion coefficient κ k , with calibration plate B k The two-dimensional pixel coordinates of the landmark point (x k ,y k ) is the independent variable, the distortion coefficient κ k As the dependent variable, a spatial dynamic model of distortion is established; Substitute the pixel coordinates (x, y) of the target object into the distortion space dynamic model for interpolation, and calculate the distortion coefficient value κ corresponding to the pixel coordinates (x, y); The distortion coefficient value κ is substituted into the posture detection algorithm to calculate the posture result corresponding to the target object.
2. The target posture positioning method for distortion estimation according to claim 1, characterized in that: The calibration plate B is obtained by performing monocular pose iteration on the pose [R0 T0] of each calibration plate B0 through the translation vector and rotation matrix. k Methods include: In the formula, p i is the coordinate of the i-th marker point in the world coordinate system, n is the number of marker points, t (k) (R) is the calibration plate B in the kth iteration k The translation vector of the pose, R (k+1) For the calibration plate B in the k+1th iteration k The rotation matrix of the pose; V i It is represented as a projection matrix; I is represented as a third-order identity matrix, R is represented as a directional rotation matrix, and T is represented as a directional translation vector.
3. The target posture positioning method for distortion estimation according to claim 1, characterized in that: Calculate the calibration plate B based on the pixel coordinates (x0, y0) k The corresponding actual distortion coefficient κ k The methods include: The calibration plate B is calibrated by the distortion coefficient κ0 k The image is dedistorted to obtain the calibration plate B k The actual posture height of the calibration plate B is calculated k The actual posture height and projection height h ty The difference Q; When the difference Q is less than the set height difference threshold, calculate the calibration plate B k The pixel coordinates (x k ,y k ); based on the pixel coordinates (x0, y0) and the pixel coordinates (x k ,y k ) Calculate the calibration plate B k The corresponding actual distortion coefficient κ k ; When the difference Q is greater than the set height difference threshold, the distortion coefficient κ0 is increased and decreased at the same time, and the iteration is repeated until the calibration plate B is calculated. k The corresponding actual distortion coefficient κ k .
4. The target posture positioning method for distortion estimation according to claim 3, characterized in that: Methods for simultaneously increasing and decreasing the distortion coefficient κ0 include: κ0=κ0±10m In the formula, m is expressed as the number of times the distortion coefficient κ0 increases and decreases.
5. The target posture positioning method for distortion estimation according to claim 3, characterized in that: Based on the pixel coordinates (x0, y0) and the pixel coordinates (x k ,y k ) Calculate the calibration plate B k The corresponding actual distortion coefficient κ k The methods include: In the formula, k represents the number of monocular pose iterations for the pose [R0 T0] of each calibration plate B0.
6. The target posture positioning method for distortion estimation according to claim 1, characterized in that: Substituting the pixel coordinates (x, y) of the target object into the distortion space dynamic model for interpolation, and calculating the distortion coefficient value κ corresponding to the pixel coordinates (x, y) includes: In the formula, f(x,y) is the interpolation result of the pixel coordinates (x,y), that is, the distortion coefficient value κ corresponding to the pixel coordinates (x,y); (x i ,y i ) is represented by the coordinates of the ith sample point of the neighboring pixel point coordinates (x, y) in the distortion space dynamic model; f i is the distortion coefficient value of the i-th sample point, w i (x i ,y i ) is the weight of the i-th sample point with respect to the interpolation point (x, y), and its value range is [0, 1]; L i is the side length between the pixel coordinates (x, y) and the i-th sample point; D is the number of sample points adjacent to the pixel coordinates (x, y) in the distortion space dynamic model.
7. An application system of a method for positioning a target posture for estimating distortion according to any one of claims 1 to 6, characterized in that: include: The calibration module is used to perform single-target calibration on the set calibration plate B0 to obtain the distortion coefficient κ0; the image obtained by each calibration plate B0 is projected to the set projection height h ty ; Use the distortion coefficient κ0 to identify and calculate the corresponding calibration plate B0 posture [R0 T0] and the pixel coordinates of the landmark point (x0, y0); R0 is represented as the rotation matrix of the calibration plate B0 posture; T0 is represented as the translation vector of the calibration plate B0 posture; The model building module is used to iterate the monocular pose of each calibration plate B0 through the translation vector and rotation matrix [R0 T0] to obtain the calibration plate B k , calculate the calibration plate B based on the pixel coordinates (x0, y0) k The corresponding actual distortion coefficient κ k , with calibration plate B k The two-dimensional pixel coordinates of the landmark point (x k ,y k ) is the independent variable, the distortion coefficient κ k As the dependent variable, a spatial dynamic model of distortion is established; The posture detection module is used to substitute the pixel coordinates (x, y) of the target object into the distortion space dynamic model for interpolation, calculate the distortion coefficient value κ corresponding to the pixel coordinates (x, y); substitute the distortion coefficient value κ into the posture detection algorithm to calculate the posture result corresponding to the target object.
8. A computer-readable storage medium, characterized in that A computer program is stored thereon, and when the program is executed by a processor, the steps of the target posture positioning method described in any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Vehicle pose acquisition method and device
CN115239981A
Parameter calibration method, device and equipment of binocular fisheye camera and storage medium
CN115564842A