A method for estimating the external parameters of a camera based on disk recognition
Through the camera external parameter estimation method based on disc recognition, the pitch angle and heading angle of the camera are analyzed by projection geometry, and the rotation and displacement matrix of the camera are calculated, solving the problems of complex calculations and poor interaction performance in the prior art, and achieving fast and efficient camera pose estimation.
Patent Information
- Application Number
- CN202110118953.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-28
- Publication Date
- 2025-06-27
- Estimated Expiration
- 2041-01-28
AI Technical Summary
Existing vision-based pose estimation methods require markers to have rich textures, resulting in complex calculations, long running time, and markers stand out from the natural environment, resulting in poor interaction performance and poor experience.
Using the camera external parameter estimation method based on disc recognition, the camera acquires disc images at different angles and distances, and uses projection geometry to analyze the relationship between the pitch angle, heading angle, the flatness of the disc image and the position of the marking block, calculate the camera rotation matrix and displacement matrix, and finally merge into the pose matrix to complete the camera pose estimation.
It realizes the rapid and efficient completion of camera pose estimation, reduces the difficulty of pose estimation algorithm, does not require the markers to have rich textures, and improves interactive performance and experience.
Smart Images

Figure CN112767488B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the combination of computer graphics and virtual reality, and in particular to a camera extrinsic parameter estimation method based on disk recognition. Background Art
[0002] At present, vision-based pose estimation requires the marker to have rich textures to satisfy the feature operator and facilitate feature extraction. This also leads to problems such as complex calculations and long running time in the process of extracting feature operators. At the same time, because the markers often protrude from the natural environment, it leads to poor interactive performance and poor user experience.
[0003] Pose estimation is the most important part of augmented reality system. At present, the most commonly used solution is to collect the texture pattern of the marker and extract the feature points, match the feature point set with the pre-stored marker template, and solve the PnP problem by solving an overdetermined equation to achieve camera pose estimation. However, the process of extracting feature points is inefficient and requires the marker to have rich texture. Summary of the invention
[0004] Purpose of the invention: The purpose of the present invention is to provide a camera extrinsic parameter estimation method based on disk recognition, so as to achieve fast and efficient camera pose estimation.
[0005] Technical solution: A camera extrinsic parameter estimation method based on disk recognition, comprising the following steps:
[0006] Step 1: Place a disk on a plane, establish a three-dimensional Cartesian coordinate system with the center of the disk as the origin, place a camera above the disk, adjust the camera pitch angle, and calculate the camera pitch angle through the relationship between the flatness of the disk image and the position of the marker block;
[0007] Step 2: Fix the camera position and rotate the disk horizontally, which is equivalent to the imaging effect of fixing the disk and rotating it at the same horizontal height of the camera; calculate the camera heading angle through the relationship between the flatness of the disk image and the position of the marker block;
[0008] Step 3: By analyzing the imaging characteristics of the disk, the camera displacement matrix is calculated using the similar triangles formed by the camera, the disk image and the disk;
[0009] Step 4: Calculate the camera rotation matrix based on the camera pitch angle in step 1 and the camera heading angle in step 2; fuse the camera rotation matrix and the camera displacement matrix in step 3 to form a posture matrix to finally complete the camera pose estimation.
[0010] Preferably, step 1 specifically comprises:
[0011] The camera first rotates around the X-axis, then the Y-axis, and finally the Z-axis in sequence for attitude transformation. A three-dimensional Cartesian coordinate system is established with the center of the disc as the coordinate origin, which is the world coordinate system, and a camera coordinate system is established with the optical center of the camera. The camera attitude is described by the three-order pair (pitch, yaw, roll), representing the camera rotating around the X-axis, Y-axis, and Z-axis by pitch, yaw, and roll angles respectively.
[0012] According to projective geometry, when the camera's pitch angle is α, the minor semi-axis of the ellipse projected from a circle with a radius of R is Rcosα.
[0013] The camera's pitch angle is inversely deduced from the elliptical image. That is, the expression for the camera's pitch angle Pitch is:
[0014]
[0015] where a and b are the major and minor semi-axes of the ellipse.
[0016] Preferably, step 2 is specifically as follows:
[0017] Select the centroid of the marker block to represent the marker block and denote it as point B. After fitting the ellipse, calculate the center of the ellipse and denote it as point O, with the minor semi-axis of the ellipse being b. Connect B and O. Calculate the angle between B and O and the angle represents the camera's heading angle at this time.
[0018] Preferably, step 3 is specifically as follows:
[0019] Step 3.1: Denote the distance between the image of the disc with the major axis a and the camera as L. Since a is projected from the radius R of the disc, there is a similarity relationship.
[0020]
[0021] Then the depth of the disc is l, that is, the distance Z between the disc and the camera is Z = l.
[0022] Step 3.2: X is the position of the center of the disc in the world coordinates, x is the position of the center of the disc in the image, that is, the position on the photo, and it is also the position of the center of the disc relative to the center of the registered disc. A right-handed coordinate system is established with the center of the registered disc as the origin of the world coordinate system. From similar triangles, we can get:
[0023] The expression for the X offset is:
[0024]
[0025] The expression for the Y offset is:
[0026]
[0027] According to the geometric meaning of the displacement matrix, the displacement matrix t can be obtained by combining formulas (2), (3), and (4):
[0028]
[0029] This results in a displacement matrix.
[0030] Preferably, step 4 is specifically:
[0031] Substitute the camera Euler angle into the formula, where
[0032]
[0033] Roll=0 (7)
[0034] Substitute the rotation matrix into:
[0035]
[0036] Formula (8) is the camera rotation matrix.
[0037] The matrix vector (5) represents the coordinates of the center of the disk in the camera coordinate system, not the coordinates of the camera in the world coordinate system. Therefore, the displacement vector is inverted to convert it into the coordinates of the camera in the world coordinate system. The inversion of (5) gives the camera position vector t c :
[0038]
[0039] From formula (8) and formula (9), we can get:
[0040]
[0041] Formula (10) calculates the camera pose matrix.
[0042] Beneficial effects: Compared with the prior art, the present invention has the following significant advantages: the present invention uses a camera to collect disk images at different angles and distances, and fixes the camera posture, obtains the disk image when the disk is rotated horizontally, and uses projection geometry to analyze the relationship between the camera's pitch angle, heading angle, and the flatness of the disk image and the position of the marker block, thereby obtaining the camera's rotation matrix; then, by analyzing the imaging characteristics of the disk, using the similar triangles formed by the camera, the disk image, and the disk, the camera's displacement matrix is obtained, and finally the camera rotation matrix and the disk displacement matrix are fused to form a posture matrix to finally complete the camera posture estimation. In the present invention, the disk does not need to have rich textures, which reduces the difficulty of the posture estimation algorithm and enables fast and efficient completion of the camera posture estimation. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 It is a coordinate schematic diagram of the present invention;
[0044] Figure 2 Schematic diagram of the disc at a heading angle of 30 degrees of the present invention;
[0045] Figure 3 Left / main view of the camera frustum of the present invention. Detailed implementation manners
[0046] The technical solution of the present invention will be further described below with reference to the accompanying drawings.
[0047] A method for estimating the external parameters of a camera based on disc recognition according to the present invention is specifically implemented according to the following steps:
[0048] Step 1: Calculate the camera pitch angle from the obtained image parameters.
[0049] It is agreed that the camera first rotates around the X-axis, then around the Y-axis, and finally around the Z-axis in sequence for attitude transformation. A three-dimensional Cartesian coordinate system is established with the center of the disc as the coordinate origin, which is the world coordinate system, and a camera coordinate system is established with the optical center of the camera. The camera attitude is described by a three-tuple (pitch, yaw, roll), which represents the camera rotates around the X-axis, Y-axis, and Z-axis by pitch, yaw, and roll angles respectively. As Figure 1 shown. The imaging plane is the plane where the photo is generated. C is the optical center of the camera, c is the projection of the optical center C of the camera on the imaging plane, and 0’ is the intersection point of the line connecting the center 0 of the disc and C.
[0050] From the perspective of projective geometry, when the camera pitch angle is α, the short semi-axis of the ellipse projected by a circle with a radius of R is Rcosα.
[0051] Therefore, according to projective geometry, the pitch angle of the camera is inversely deduced from an elliptical image. That is, the pitch angle Pitch of the camera can be written as formula (1):
[0052]
[0053] where a and b are the long and short semi-axes of the ellipse.
[0054] Step 2: Calculate the camera heading angle.
[0055] As Figure 2 shown, it is a schematic diagram of the disc at a heading angle of 30 degrees.
[0056] Select the centroid of the marker block 1 to represent the marker block 1 and denote it as point B. After fitting the ellipse, calculate the center 3 of the ellipse and denote it as point 0, and denote the short semi-axis 2 of the ellipse as b. Connect B0. Calculate the angle between B0 and b, and the angle represents the current camera heading angle.
[0057] Step 3: Obtain the displacement matrix of the camera.
[0058] Meanwhile, according to the pinhole imaging model, the displacement estimation of the center of the disc can be realized. As Figure 3 shown, it is the left / main view of the camera's visual cone; Figure 3 In it, the optical center c of the camera, the center o of the verification plane, and the center of the disc are on a straight line and perpendicular to the disc, that is, the camera is facing the disc directly. At this time, the imaging plane is the verification plane.
[0059] Step 3.1: Denote the distance between the disc image with the major axis a and the camera as L, and the radius of the disc as R. Since a is projected from the disc radius R, there is a similarity relationship. Then
[0060]
[0061] Then the depth of the disc is l, that is, the distance Z between the disc and the camera == l;
[0062] Step 3.2: X is the position of the center of the disc in the world coordinates, x is the position of the center of the disc image, that is, the position on the photo, and it is also the center position of the current disc center compared to the registered disc. Establish a right-handed coordinate system with the center of the registered disc as the origin of the world coordinate system. From similar triangles, we can get:
[0063] The X offset can be calculated as:
[0064]
[0065] Similarly, the Y offset can be calculated as:
[0066]
[0067] According to the geometric meaning of the displacement matrix, by combining formulas (2), (3), and (4), the displacement matrix t can be obtained:
[0068]
[0069] Step 4 is specifically:
[0070] Substitute the camera Euler angles into the formula. Among them
[0071]
[0072] Roll = 0(7)
[0073] Substitute into the rotation matrix to get:
[0074]
[0075] Formula (8) is the camera rotation matrix.
[0076] The matrix vector represents the coordinates of the center of the disc in the camera coordinate system as shown in Equation (5), rather than the coordinates of the camera in the world coordinate system. Therefore, this displacement vector must be inverted to obtain the coordinates of the camera in the world coordinate system. Inverting Equation (5) gives the position vector t of the camera. c :
[0077]
[0078] From Equations (8) and (9), the pose matrix of the camera is:
[0079]
[0080] The pose matrix of the camera is calculated by Equation (10).
Claims
1. A method for estimating the external parameters of a camera based on disk recognition, characterized in that, The steps include: Step 1: Place a disk on a plane, establish a three-dimensional Cartesian coordinate system with the center of the disk as the coordinate origin, place a camera above the disk, adjust the camera pitch angle, and calculate the camera pitch angle through the relationship between the flatness of the disk image and the position of the marker block; Step 2: Fix the camera posture and rotate the disk horizontally, which is equivalent to the imaging effect of fixing the disk and rotating it at the same horizontal height of the camera; calculate the camera heading angle through the relationship between the flatness of the disk image and the position of the marker block; Step 3: By analyzing the imaging characteristics of the disk, the camera displacement matrix is calculated using the similar triangles formed by the camera, the disk image and the disk; Step 4: Calculate the camera rotation matrix according to the camera pitch angle in step 1 and the camera heading angle in step 2; fuse the camera rotation matrix and the camera displacement matrix in step 3 to form a posture matrix to finally complete the camera posture estimation; The step 1 is specifically as follows: The camera rotates around the X-axis, then around the Y-axis, and finally around the Z-axis to perform posture transformation. A three-dimensional Cartesian coordinate system is established with the center of the disk as the coordinate origin. This is the world coordinate system. The camera coordinate system is established with the camera optical center. The camera posture is described by using a three-element ordered number pair (pitch, yaw, roll) to represent the pitch, yaw, and roll angles of the camera rotating around the X-axis, Y-axis, and Z-axis respectively. According to projection geometry, when the camera pitch angle is α, the minor semi-axis of the ellipse projected by the circle with a radius of R is b, b = Rcosα; The pitch angle of the camera is obtained by inversely deducing the elliptical image, that is, the pitch angle expression of the camera is: Among them, a is the major semi-axis of the ellipse, and b is the minor semi-axis of the ellipse; The step 2 is specifically as follows: Select the centroid of the marker block to represent the marker block and record it as point B. After fitting the ellipse, calculate the center of the ellipse and record it as point O. The minor semi-axis of the ellipse is b, and connect BO. Calculate the angle between BO and b, which represents the heading angle of the camera at this time. The step 3 is specifically as follows: Step 3.1: Let the distance between the disk image with major axis a and the camera be L, because a is projected from the disk radius R, and has a similar relationship. Then the depth of the disk is l, that is, the distance between the disk and the camera is Z = l; Step 3.2: x is the position of the image formed by the center of the disk, that is, the position on the photo, and also the center position of the disk center relative to the audit plane; establish a right-handed coordinate system with the center of the audit plane as the origin of the world coordinate system; similar triangles can be obtained: The expression for the X-axis offset is: The expression for the Y-axis offset is: According to the geometric meaning of the displacement matrix, the displacement matrix t can be obtained by combining formulas (2), (3), and (4): This results in a displacement matrix; The step 4 is specifically as follows: Substitute the camera Euler angle into the formula, where roll=0 (6) Substitute the rotation matrix into: Formula (7) is the camera rotation matrix; The matrix vector represents the coordinates of the center of the disk in the camera coordinate system as shown in Equation (5), rather than the coordinates of the camera in the world coordinate system. Therefore, the inverse of this displacement vector is taken to convert it into the coordinates of the camera in the world coordinate system, and the inverse of Equation (5) is taken to obtain the position vector t of the camera c : From formula (7) and formula (8), we can get: Formula (9) calculates the camera pose matrix.