A method for camera focal length and attitude calibration based on dual vanishing points

By using a camera focal length and attitude calibration method based on double vanishing points, and utilizing known double vanishing points and camera positions, only two sets of parallel lines and their corresponding two vanishing points are needed. This solves the complex camera focal length and attitude calibration problem in the prior art and achieves efficient and accurate camera parameter calibration.

CN116012465BActive Publication Date: 2025-12-02CHINESE PEOPLES LIBERATION ARMY UNIT 63660
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310046595.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-01-31
Publication Date
2025-12-02
Estimated Expiration
2043-01-31

AI Technical Summary

Technical Problem

In existing technologies, camera focal length and attitude calibration methods require at least three vanishing points, and at least four vanishing points when some intrinsic parameters are unknown, which makes the calibration process complex and time-consuming.

Method used

A camera focal length and attitude calibration method based on double vanishing points is proposed. Using the known double vanishing points and camera position, through geometric constraints and geometric rotation, only two sets of parallel lines and their corresponding two vanishing points are needed to solve for the camera's focal length and attitude. The calibration is performed using a standard pinhole camera model and rigid body transformation.

Benefits of technology

It enables simultaneous calculation of camera focal length and attitude using only two vanishing points, yielding a unique solution. This improves calibration accuracy and efficiency, making it suitable for applications where the camera position is known and the number of vanishing points is small.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116012465B_ABST
    Figure CN116012465B_ABST
Patent Text Reader

Abstract

This invention proposes a camera focal length and attitude calibration method based on camera position and dual vanishing points, belonging to the fields of computer vision, SLAM, and photogrammetry. This invention only requires knowledge of two sets of parallel lines in space, measuring the camera position and the unit direction vectors of the parallel lines, capturing feature images of the parallel lines, obtaining the imaging relationship in the camera, and extracting the corresponding vanishing points. Utilizing the important geometric phenomenon that the angle between two straight lines in the camera coordinate system is equal to the angle between the unit direction vectors of the two sets of parallel lines, a method for quickly solving the camera focal length is established. Finally, the correspondence of unit direction vectors is converted into the correspondence of spatial points between two coordinate systems with the same origin to solve for the camera attitude. This invention reduces the number of vanishing points required for camera calibration, shortens the calibration time, provides a unique solution, and can simultaneously solve for focal length and attitude, among other advantages.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the technical fields of computer vision, SLAM, photogrammetry, etc., and specifically relates to a camera focal length and attitude calibration method based on dual vanishing points. Background Technology

[0002] In fields such as computer vision, SLAM, and photogrammetry, calibration of intrinsic and extrinsic parameters of the camera, such as focal length and attitude, is necessary for measurement and estimation. Currently, there are many methods for extrinsic and extrinsic parameter calibration, such as: a novel parametrization of the perspective-three-point problem for a direct computation of absolute camera position and orientation; a general and simple method for camera pose and focal length determination; and a closed-form solution to minimal absolute pose problems with known vertical direction, and a novel method for Intrinsic and Extrinsic Parameters Estimation by Solving Perspective-Three-Point Problem with Known Camera Position. With the development of positioning technology, positioning devices have become increasingly miniaturized, inexpensive, and accurate enough to meet engineering requirements, leading to their widespread application in camera positioning to obtain camera position.

[0003] Currently, depending on the external features used during calibration, camera calibration methods mainly fall into two categories: feature point-based and feature line-based methods. Among feature line-based methods, there are methods based on non-parallel lines, called the PnL method; and another category is based on parallel lines. The images of parallel lines in an image intersect at a single point, called the vanishing point. This type of method uses 3D parallel lines in space and the corresponding vanishing point in the image to calibrate parameters such as pose. According to the principles of camera imaging, one vanishing point can impose two constraints. Therefore, without prior knowledge, at least three vanishing points are needed to calibrate the camera's external parameters. If some intrinsic parameters are unknown, such as when the camera uses a zoom lens with an unknown focal length, camera calibration in this case requires at least four vanishing points. Thus, current vanishing point-based camera calibration methods require at least three vanishing points; to simultaneously solve for some intrinsic parameters, at least four vanishing points are needed. Summary of the Invention

[0004] The purpose of this invention is to provide a camera focal length and attitude calibration method based on two vanishing points. The method calibrates the camera focal length and attitude based on the known two vanishing points and the camera position, solving the technical problem that traditional parameter calibration methods of this type require ≥3 vanishing points.

[0005] To achieve the above objectives and solve the above technical problems, the technical solution of the present invention is as follows:

[0006] A method for camera focal length and attitude calibration based on dual vanishing points includes the following steps:

[0007] There are two sets of parallel lines L i (i = 1, 2), its unit direction vector in the world coordinate system S w1 (O w _X w Y w Z w Given the following, and simultaneously, the camera position O c Given that both sets of parallel lines contain two 3D lines, denoted as L, and also known in this coordinate system, assume that each set of parallel lines contains two 3D lines. i-j (j=1,2), the corresponding image on the image plane is represented as l i-j ;

[0008] Step 1: Camera focal length calibration

[0009] In camera coordinate system S c1 (O c _X c Y c Z c Under ) 3D straight line L i-j The unit direction vector is represented as d i_c =(d i-x d i-y di-z ), unknown; any 3D point P i-j (p i-jx p i-jy p i-jz Located on 3D line L i-j Above, unknown, 3D straight line L i-j Represented as:

[0010] L i-j =P i-j +k i-j ·d i_c (1)

[0011] Where, k i-j Let P be an arbitrary scale factor, where the vanishing point in the image is an image of a 3D point at infinity in space; assume that these 3D points are visible and denoted as P. v1 ,P v2 According to formula (1), P v1 ,P v2 The coordinates are represented as:

[0012]

[0013] Where, k v1 k v2 P represents the corresponding scale factor, all of which are infinite. v1 ,P v2 The image on the image plane is represented as p v1 ,p v2 ;

[0014] World coordinate system S w1 lower straight line O c P v1 and O c P v2 The unit direction vector is represented as

[0015]

[0016] Assume α is not only the world coordinate system S w1 lower straight line O c P v1 and O c P v2 The included angle is also the angle of the camera coordinate system S. c1 O c p v1 and O c p v2 The angle α between the two is calculated as follows:

[0017]

[0018] As can be seen, this angle is the angle between the unit direction vectors of two sets of parallel lines in the camera coordinate system, and is therefore equal to the angle between the unit direction vectors of the two sets of parallel lines; thus, angle α is known. In the camera coordinate system S... c1 Below, straight line O c p v1 and O c p v2 The direction vector is represented as

[0019]

[0020] Where f is the focal length in pixels; based on the properties of the included angle α, we obtain

[0021]

[0022] Let cosα = m1, u 1-vp ·u 2-vp +v 1-vp ·v 2-vp =m2,

[0023] Then formula (6) simplifies to

[0024]

[0025] At this time, f 2 Treating it as an unknown parameter, the above equation is a quadratic equation in one variable;

[0026] According to f > 0, f 2 If the value is greater than 0, a unique solution for f is obtained, and the camera focal length calibration is complete;

[0027] Step 2: Camera orientation calibration

[0028] Using a standard pinhole camera model, the straight line L is obtained. i-j Mapping in the image i-j as follows

[0029]

[0030] Where f is the focal length, if k i-j tending to infinity and d i-z If the value is not zero, the mapping is a vanishing point and its expression is:

[0031]

[0032] The expression for the vanishing point is determined by the direction vector of the corresponding parallel line and the focal length in the camera coordinate system;

[0033] Through feature extraction, the straight line l is obtained from the image. i-jThe expression for the vanishing point is obtained by finding the intersection of the two lines in the image. Therefore, the coordinates of the vanishing point (u) are given. i-vp v i-vp Given that ), according to formula (9), the direction vector of the 3D line corresponding to the vanishing point in the camera coordinate system is obtained as follows:

[0034]

[0035] The unit direction vector in the camera coordinate system is expressed as:

[0036]

[0037] The unit direction vector of parallel lines in the camera coordinate system is calculated from the corresponding vanishing point. Therefore, the camera coordinate system S... c1 Lower unit direction vector d i-c Given; as input, the world coordinate system S w1 The unit direction vector d of the corresponding parallel lines below i w Also known; according to rigid body transformation, we obtain

[0038] d i_c =R w-c ·d i_w (12)

[0039] Among them, R w-c World coordinate system S w1 and camera coordinate system S c1 The rotation matrix between them is the parameter to be determined for attitude calibration;

[0040] The transformation relationship between formula (12) and the traditional coordinate system is as follows:

[0041] P c =R w-c ·P w +t (13)

[0042] The meaning of formula (13) is: in the world coordinate system S w1 Below, a 3D point P w Through rotation matrix R w-c The translation vector t can be transformed into the camera coordinate system S. c1 The next 3D point P c ;

[0043] If we let t = 0, the world coordinate system and the camera coordinate system share a common origin, and let...

[0044]

[0045] Then formulas (12) and (13) are the same; formula (12) is the transformation relationship between 3D points when the translation vector is zero, and the coordinates of the 3D points are the values ​​of the corresponding unit direction vectors;

[0046] To achieve the transformation between 3D points when the translation vector is zero, a new world coordinate system and two virtual 3D points need to be established.

[0047] Establish a new world coordinate system S w2 (O w2 _X w2 Y w2 Z w2 It is parallel to the original world coordinate system S. w1 World coordinate system S w2 The origin is located at camera position O. c The transformation relationship between these two world coordinate systems is as follows:

[0048] S w2 =S w1 -O c (15)

[0049] Based on the values ​​of the two unit direction vectors, in the world coordinate system S w1 Lower and camera coordinate system S c1 Two virtual spatial points P are established respectively. wi and P ci , i = 1, 2;

[0050] P wi and P ci The conversion relationship is as follows:

[0051] P ci =R w-c ·P wi (16)

[0052] Here, R w-c World coordinate system S w2 and camera coordinate system S c1 The rotation matrix between them is also the world coordinate system S. w1 and camera coordinate system S c1 The rotation matrix between the two virtual spatial points is determined; below, the rotation matrix R is estimated using these two virtual spatial points. w-c That is, camera pose;

[0053] Establish a new world coordinate system S w3 (O w3 _X w3 Y w3 Z w3 ) and the new camera coordinate system S c2 (O c2 _Xc2 Y c2 Z c2 These two coordinate systems coincide in space, and their origin is located at the camera position O. c The new camera coordinate system S c2 The expressions for each coordinate axis are as follows:

[0054]

[0055] Camera coordinate system S c2 S c1 The conversion between

[0056]

[0057] New world coordinate system S w3 The expressions for each coordinate axis are as follows:

[0058]

[0059] World coordinate system S w3 S w2 The conversion between

[0060]

[0061] Coordinate system S c2 (O c2 _X c2 Y c2 Z c2 ) and S w3 (O w3 _X w3 Y w3 Z w3 () are in the same coordinate system;

[0062] Thus, the original world coordinate system S is obtained. w1 and camera coordinate system S c1 The relationship is as follows:

[0063]

[0064] Thus, the camera attitude calibration is complete.

[0065] The effective benefits of this invention compared to the prior art

[0066] 1. The method proposed in this invention solves the problem that existing camera attitude calibration algorithms based on vanishing points require at least 3 vanishing points, and require at least 4 vanishing points when calibrating some intrinsic parameters, such as focal length.

[0067] 2. The method proposed in this invention only requires two vanishing points and a known camera position to simultaneously solve for the camera's focal length and attitude, and has a unique solution. In addition, compared with other camera attitude calibration methods based on vanishing points, this invention does not involve nonlinear iterative algorithms, which improves both accuracy and efficiency.

[0068] 3. This invention does not require knowledge of the specific spatial location of the parallel lines, but only their unit direction vector.

[0069] 4. This invention is applicable to application scenarios where the camera position can be obtained in advance, the focal length is unknown, and the number of vanishing points available in the camera's field of view is small. Attached Figure Description

[0070] Figure 1 An imaging schematic diagram of the double vanishing point and its corresponding parallel line group in this invention;

[0071] Figure 2 A schematic diagram of the double vanishing point imaging method used in this invention for focal length calibration;

[0072] Figure 3 A schematic diagram of the new world coordinate system and two virtual 3D points of this invention;

[0073] Figure 4 The new camera coordinate system S of this invention c2 and the new world coordinate system S w3 ;

[0074] Figure 5 A schematic diagram illustrating the transformation relationships between different coordinate systems in this invention;

[0075] Figure 6 A schematic diagram of the imaging of two sets of parallel lines in an image according to an embodiment of the present invention. Detailed Implementation

[0076] The present invention will now be explained and described in detail with reference to the accompanying drawings and specific embodiments.

[0077] The overall concept of this invention is as follows: To minimize the number of vanishing points and expand the application scenarios of the calibration method, this invention proposes a camera focal length and attitude calibration method based on two vanishing points. This invention only requires two sets of parallel lines and their corresponding two vanishing points, along with the known camera position, to solve for the camera's focal length and attitude parameters through geometric constraints and rotations. Furthermore, it provides a unique solution without multiple solutions. This invention decomposes the calibration problem into two sub-problems, simplifying the problem and making the solution more efficient. The first problem is to solve for the focal length, and the second problem is to solve for the camera attitude.

[0078] In the first problem, each vanishing point and the camera position in the camera coordinate system can form a straight line. Since there are two vanishing points, we can obtain two straight lines in the camera coordinate system. According to the properties of vanishing points, the angle between these two lines is equal to the angle between the corresponding two sets of parallel lines in the world coordinate system. Since the unit direction vectors of the two sets of parallel lines are known, this angle can be solved. Furthermore, the angle between the two straight lines in the camera coordinate system is a function of the focal length; therefore, the focal length can be calculated using this angle.

[0079] In the second problem, using the focal length obtained in the first problem, and based on the properties of the vanishing point, the unit direction vector of the corresponding parallel line in the camera coordinate system can be obtained using the pixel coordinates of the vanishing point and the focal length. Since the unit direction vector of this parallel line in the world coordinate system is known, a rotation matrix can be used to obtain the transformation relationship between the two unit direction vectors. This transformation relationship can be viewed as the transformation relationship between two 3D points after translating the origin of the world coordinate system to the origin of the camera coordinate system, where the coordinates of the 3D points are equal to the aforementioned unit direction vectors in the corresponding coordinate systems. Now, we have transformed the correspondence of unit direction vectors into the correspondence of 3D points. Using the camera position, we can quickly solve for the rotation matrix; using the rotation matrix, we can obtain the corresponding translation vector. Thus, the attitude calibration is complete.

[0080] To achieve the above objectives, the present invention adopts the following technical solution, comprising the following steps:

[0081] There are two sets of parallel lines L i (i = 1, 2), its unit direction vector in the world coordinate system S w1 (O w _X w Y w Z w Given the following, and simultaneously, the camera position O c This is also known in this coordinate system. For ease of derivation, we assume that both sets of parallel lines each contain two 3D lines, denoted as L. i-j (j=1,2), the corresponding image on the image plane is represented as l i-j Geometric structure such as Figure 1 As shown.

[0082] Below, we will implement focal length and attitude calibration step by step. The specific steps are as follows.

[0083] Step 1: Focal length calibration

[0084] In camera coordinate system S c1 (O c _X c Y c Z c Under ) 3D straight line L i-j The unit direction vector is represented as di_c =(d i-x d i-y d i-z ), unknown. A 3D point P i-j (p i-jx p i-jy p i-jz The unknown element lies on this line. Now, this line can be represented as...

[0085] L i-j =P i-j +k i-j ·d i_c (twenty two)

[0086] Where, k i-j Let P be an arbitrary scale factor. The vanishing point in the image is an image of a 3D point at infinity in space. We assume that these 3D points are visible and represent them as P. v1 ,P v2 According to formula (1), their coordinates can be expressed as

[0087]

[0088] Where, k v1 k v2 denoted as the corresponding scale factor, all of which are infinite. Their image on the image plane is represented as p. v1 ,p v2 Its geometric structure is as follows Figure 2 As shown.

[0089] Figure 2 In this context, α is not only the world coordinate system S w1 lower straight line O c P v1 and O c P v2 The included angle is also the angle of the camera coordinate system S. c1 O c p v1 and O c p v2 The included angle. World coordinate system S w1 lower straight line O c P v1 and O c P v2 The unit direction vector can be expressed as

[0090]

[0091] Then we can calculate the included angle α.

[0092]

[0093] As can be seen, this angle is the angle between the unit direction vectors of two sets of parallel lines in the camera coordinate system, and is therefore equal to the angle between the unit direction vectors of the two sets of parallel lines; thus, angle α is known. In the camera coordinate system S... c1 Below, straight line O c p v1 and O c p v2 The direction vector can be represented as

[0094]

[0095] Where f is the focal length, in pixels. Based on the properties of the included angle α, we can obtain...

[0096]

[0097] Let cosα = m1, Then formula (6) can be simplified to

[0098]

[0099] f 2 Treating it as an unknown parameter, the above equation becomes a quadratic equation in one variable. According to f > 0, f 2 If the value is greater than 0, we can obtain a unique solution for f. At this point, the focal length calibration is complete.

[0100] (2) Attitude calibration

[0101] Using a standard pinhole camera model, we obtain the straight line L. i-j Mapping in the image i-j as follows

[0102]

[0103] Where f is the focal length. If k i-j tending to infinity and d i-z If the value is not zero, the mapping is a vanishing point and its expression is:

[0104]

[0105] As can be seen, the expression for the vanishing point is determined solely by the direction vector of the corresponding parallel line in the camera coordinate system and the focal length.

[0106] Through feature extraction, we can obtain the straight line l from the image. i-j Therefore, we can obtain the expressions for the two lines in the image. The intersection of these two lines is the vanishing point, and thus the coordinates of the vanishing point (u...) i-vp v i-vp) is known. And according to formula (9), we can obtain the direction vector of the 3D line corresponding to the vanishing point in the camera coordinate system as:

[0107]

[0108] Then, the unit direction vector in the camera coordinate system can be expressed as:

[0109]

[0110] It can be seen that the unit direction vector of parallel lines in the camera coordinate system can be calculated from the corresponding vanishing point. Because the vanishing point can be calculated, the camera coordinate system S... c1 Lower unit direction vector d i c This is known. Additionally, as input, the world coordinate system S... w1 The unit direction vector d of the corresponding parallel lines below i_w It is also known.

[0111] According to rigid body transformation, we can obtain

[0112] d i_c =R w-c ·d i_w (33)

[0113] Among them, R w-c World coordinate system S w1 and camera coordinate system S c1 The rotation matrix between coordinate systems is the parameter to be determined for attitude calibration in this invention. This formula is similar to the traditional transformation relationships between coordinate systems, as follows:

[0114] P c =R w-c ·P w +t (34)

[0115] Formula (13) means that the world coordinate system S w1 Next 3D point P w Through rotation matrix R w-c The translation vector t can be transformed into the camera coordinate system S. c1 The next point P c If we set t = 0, this means that the world coordinate system and the camera coordinate system share a common origin, and let...

[0116]

[0117] Now, formulas (12) and (13) are the same. Then, we can say that formula (12) is the transformation relationship between 3D points when the translation vector is zero, and the coordinates of the 3D points are the values ​​of the corresponding unit direction vectors. This is a key step in this invention. Specifically, we transform the transformation between unit direction vectors into the transformation between 3D points. To achieve the above transformation when the translation vector is zero, we need to establish a new world coordinate system and two virtual 3D points, such as Figure 3 As shown.

[0118] Figure 3 In this process, we established a new world coordinate system S. w2 (O w2 _X w2 Y w2 Z w2 It is parallel to the original world coordinate system S. w1 World coordinate system S w2 The origin is located at camera position O. c Then we can obtain the transformation relationship between these two world coordinate systems as follows.

[0119] S w2 =S w1 -O c (36)

[0120] Furthermore, based on the values ​​of the two unit direction vectors, in the world coordinate system S... w1 Lower and camera coordinate system S c1 Two virtual spatial points P are established respectively. wi and P ci i = 1, 2; they are in world coordinate system S w2 and camera coordinate system S c1 The coordinates below are also Figure 3 The following is an example of their transformation relationship:

[0121] P ci =R w-c ·P wi (37)

[0122] Here, R w-c World coordinate system S w2 and camera coordinate system S c1 The rotation matrix between them is also the world coordinate system S. w1 and camera coordinate system S c1 The rotation matrix between these two virtual space points is then determined. Next, the rotation matrix, or attitude, is estimated using these two virtual space points. Before this, two new intermediate coordinate systems need to be established, namely the new world coordinate system S. w3 (O w3 _X w3Y w3 Z w3 ) and the new camera coordinate system S c2 (O c2 _X c2 Y c2 Z c2 These two coordinate systems coincide in space, and their origin is located at the camera position O. c ,like Figure 4 As shown. Here, the new camera coordinate system S c2 The expressions for each coordinate axis are as follows:

[0123]

[0124] Then, the camera coordinate system S c2 S c1 The conversion between

[0125]

[0126] New world coordinate system S w3 The expressions for each coordinate axis are as follows:

[0127]

[0128] Then, the world coordinate system S w3 S w2 The conversion between

[0129]

[0130] Here, coordinate system S c2 (O c2 _X c2 Y c2 Z c2 ) and S w3 (O w3 _X w3 Y w3 Z w3 ( ) are in the same coordinate system. Now, the transformation relationships between the coordinate systems are as follows: Figure 5 As shown.

[0131] Therefore, the original world coordinate system S can be obtained. w1 and camera coordinate system S c1 The relationship is as follows.

[0132]

[0133] Attitude calibration is now complete.

[0134] Example 1

[0135] Given two sets of parallel lines, each set containing two lines. The unit direction vector of the first set of parallel lines in the world coordinate system is (0.6448 0.7410 0.1873), and passes through (-9.80391 4.0925 6 0.1058) and (4.89411 7.20715 7.9148) respectively. The unit direction vector of the second set of parallel lines in the world coordinate system is (0.3373 0.7844 0.5206), and passes through (-0.1264 3.40685 9.1480) and (1.0987 -4.7193 5 5.7940) respectively. Camera position O c (2, 2, 2). The camera focal length is set to 20mm, and other camera intrinsic parameters are known. The theoretical extrinsic rotation matrix for the camera is set as follows:

[0136]

[0137] The image of two sets of parallel lines in the camera is as follows Figure 6 As shown.

[0138] In the simulation, a 0.1 pixel error was introduced into the image feature extraction. Using the above imaging method to obtain two vanishing points, the focal length was calculated to be 20.0143 mm using the method of this invention, with an error of 0.0143 mm. The measurement results of the extrinsic parameter rotation matrix are as follows:

[0139]

[0140] The error in attitude angle conversion is 0.0241°. It can be seen that the errors in focal length and attitude are very small, indicating that this invention has high calibration accuracy for camera focal length and attitude.

[0141] This invention proposes a camera focal length and attitude calibration method based on camera position and dual vanishing points. This method only requires knowledge of two sets of parallel lines in space, measuring the camera position and the unit direction vectors of the parallel lines, capturing feature images of the parallel lines, obtaining their imaging relationship in the camera, and extracting the corresponding vanishing points. Utilizing the important geometric phenomenon that the angle between two straight lines in the camera coordinate system is equal to the angle between the unit direction vectors of the two sets of parallel lines, a method for quickly solving the camera focal length is established. Finally, the correspondence of unit direction vectors is converted into the correspondence of spatial points between two coordinate systems with the same origin to solve for the camera attitude. This method reduces the number of vanishing points required for calibration, shortens the calibration time, provides a unique solution, and can simultaneously solve for focal length and attitude.

[0142] The above description, in conjunction with specific embodiments, provides a further detailed explanation of the present invention. It should not be construed that the specific implementation of the present invention is limited to these descriptions. For those skilled in the art, various simple deductions or substitutions can be made without departing from the concept of the present invention, and all such modifications and substitutions should be considered within the scope of protection of the present invention.

Claims

1. A method for camera focal length and attitude calibration based on dual vanishing points, characterized in that, Includes the following steps: Suppose there are two sets of parallel lines L in space. i (i = 1, 2), its unit direction vector in the world coordinate system S w1 (O w _X w Y w Z w Given the following, and simultaneously, the camera position O c In the world coordinate system S w1 Given the following, assume that both sets of parallel lines each contain two 3D lines, denoted as L. i-j (j=1,2), the corresponding image on the image plane is represented as l i-j ; Step 1: Camera focal length calibration In camera coordinate system S c1 (O c _X c Y c Z c Under ) 3D straight line L i-j The unit direction vector is represented as d i_c =(d i-x d i-y d i-z ), d i unknown; Any 3D point P i-j (p i-jx p i-jy p i-jz Located on 3D line L i-j Above, P i-j Unknown, 3D straight line L i-j Represented as: L i-j =P i-j +k i-j ·d i_c (1) Where, k i-j Let P be an arbitrary scale factor, where the vanishing point in the image is an image of a 3D point at infinity in space; assume that these 3D points are visible and denoted as P. v1 ,P v2 According to formula (1), P v1 ,P v2 The coordinates are represented as: Where, k v1 k v2 P represents the corresponding scale factor, all of which are infinite. v1 ,P v2 The image on the image plane is represented as p v1 ,p v2 ; World coordinate system S w1 lower straight line O c P v1 and O c P v2 The unit direction vector is represented as Assume α is not only the world coordinate system S w1 lower straight line O c P v1 and O c P v2 The included angle is also the angle of the camera coordinate system S. c1 O c p v1 and O c p v2 The angle α between the two is calculated as follows: Therefore, the included angle α is the angle between the unit direction vectors of the two sets of parallel lines in the camera coordinate system, and is equal to the angle between the unit direction vectors of the two sets of parallel lines. Thus, the included angle α is known. In the camera coordinate system S... c1 Below, straight line O c p v1 and O c p v2 The direction vector is represented as Where f is the focal length in pixels; based on the properties of the included angle α, we obtain Let cosα = m1, u 1-vp ·u 2-vp +v 1-vp ·v 2-vp = m2, Then formula (6) simplifies to At this time, f 2 If we consider it as an unknown parameter, then the above equation is a quadratic equation in one variable; According to f > 0, f 2 If the value is greater than 0, a unique solution for f is obtained, and the camera focal length calibration is complete; Step 2: Camera orientation calibration Using a standard pinhole camera model, the straight line L is obtained. i-j Mapping in the image i-j as follows: Where f is the focal length, if k i-j tending to infinity and d i-z If the value is not zero, the mapping is a vanishing point and its expression is: The expression for the vanishing point is determined by the direction vector of the corresponding parallel line and the focal length in the camera coordinate system; Through feature extraction, the straight line l is obtained from the image. i-j The expression for the vanishing point is obtained by finding the intersection of the two lines in the image. Therefore, the coordinates of the vanishing point (u) are given. i-vp v i-vp Given that ), according to formula (9), the direction vector of the 3D line corresponding to the vanishing point in the camera coordinate system is obtained as follows: The unit direction vector in the camera coordinate system is expressed as: The unit direction vector of parallel lines in the camera coordinate system is calculated from the corresponding vanishing point. Therefore, the camera coordinate system S... c1 Lower unit direction vector d i_c Given; as input, the world coordinate system S w1 The unit direction vector d of the corresponding parallel lines below i_w Also known; according to rigid body transformation, we obtain d i_c =R w-c ·d i_w (12) Among them, R w-c World coordinate system S w1 and camera coordinate system S c1 The rotation matrix between them is the parameter to be determined for attitude calibration; The transformation relationship between formula (12) and the traditional coordinate system is as follows: P c =R w-c ·P w +t (13) The meaning of formula (13) is: in the world coordinate system S w1 Below, a 3D point P w Through rotation matrix R w-c The translation vector t can be transformed into the camera coordinate system S. c1 The next 3D point P c ; If we let t = 0, the world coordinate system and the camera coordinate system have a common origin, and let... Then formulas (12) and (13) are the same; formula (12) is the transformation relationship between 3D points when the translation vector is zero, and the coordinates of the 3D points are the values ​​of the corresponding unit direction vectors; To achieve the transformation between 3D points when the translation vector is zero, a new world coordinate system and two virtual 3D points need to be established. Establish a new world coordinate system S w2 (O w2 _X w2 Y w2 Z w2 It is parallel to the original world coordinate system S. w1 World coordinate system S w2 The origin is located at camera position O. c The transformation relationship between these two world coordinate systems is as follows: S w2 =S w1 -O c (15) Based on the values ​​of the two unit direction vectors, in the world coordinate system S w1 Lower and camera coordinate system S c1 Two virtual spatial points P are established respectively. wi and P ci , i = 1, 2; P wi and P ci The conversion relationship is as follows: P ci =R w-c ·P wi (16) Here, R w-c World coordinate system S w2 and camera coordinate system S c1 The rotation matrix between them is also the world coordinate system S. w1 and camera coordinate system S c1 The rotation matrix between the two virtual spatial points is determined; below, the rotation matrix R is estimated using these two virtual spatial points. w-c That is, camera pose; Establish a new world coordinate system S w3 (O w3 _X w3 Y w3 Z w3 ) and the new camera coordinate system S c2 (O c2 _X c2 Y c2 Z c2 These two coordinate systems coincide in space, and their origin is located at the camera position O. c The new camera coordinate system S c2 The expressions for each coordinate axis are as follows: Camera coordinate system S c2 S c1 The conversion between New world coordinate system S w3 The expressions for each coordinate axis are as follows: World coordinate system S w3 S w2 The conversion between Coordinate system S c2 (O c2 _X c2 Y c2 Z c2 ) and S w3 (O w3 _X w3 Y w3 Z w3 () are in the same coordinate system; thus, the original world coordinate system S is obtained. w1 and camera coordinate system S c1 The relationship is as follows: Thus, the camera attitude calibration is complete.

Citation Information

Patent Citations

  • Method for solving internal parameters of camera by using regular triangular prism as target

    CN102110290A

  • Camera calibrating device and method

    CN108022267A