Single-view camera extrinsic self-calibration method and system based on geometric prior
Through the single-frame camera external parameter self-calibration method based on geometric priors, the linear structure optimization rotation matrix and the ground three-dimensional point optimization translation matrix are used to solve the problems of cumbersome, slow speed and low accuracy of camera calibration in the existing technology, and achieve Fast and accurate automatic calibration of camera external parameters.
Patent Information
- Application Number
- CN202410818196.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-24
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2044-06-24
AI Technical Summary
Existing camera calibration methods have problems such as cumbersome manual interaction, slow calibration speed, and low accuracy.
A single-frame camera external parameter self-calibration method based on geometric priors is adopted. By optimizing the rotation matrix and the translation matrix, the camera's rotation matrix is automatically calibrated using the straight-line structure orthogonal to each other in the horizontal direction and the straight-line structure in the vertical direction, and based on the measured Ground three-dimensional point distance optimization translation matrix.
It achieves fast and accurate automatic calibration of camera external parameters without manual intervention. It is faster than traditional methods and ensures accuracy compared with self-calibration methods.
Smart Images

Figure CN118379366B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of camera calibration, and in particular to a method and system for self-calibration of extrinsic parameters of a single-frame camera based on geometric priors. Background Art
[0002] Camera calibration is an important foundation in the field of machine vision. It establishes a relationship between the three-dimensional geometric coordinates of a point on the surface of a spatial object and its pixel point in a two-dimensional image, thereby providing assistance for other computer vision fields such as three-dimensional reconstruction, machine vision, point cloud registration, and dimension measurement. In actual application, the accuracy of camera calibration often directly determines the accuracy and performance of the entire visual system: in some fields, camera calibration has a direct impact on its subsequent work. For example, in the positioning of industrial robots, camera calibration affects the placement accuracy of the manipulator on the target object; when measuring the distance of a target, the accuracy and stability of the calibration parameter results determine the accuracy of the system's distance measurement.
[0003] With the development of computer image processing and computer vision, industrial workers and scientific researchers have proposed many camera calibration methods to meet the needs of different scenarios and products. Camera calibration methods can be roughly divided into the following categories:
[0004] The first calibration method is to calibrate based on a known calibration target. Commonly used calibration plates include three-dimensional calibration plates and plane calibration plates. Plane calibration plates include checkerboard calibration plates, solid circle calibration plates, ring calibration plates and phase calibration plates. Typical calibration methods based on known calibration targets are mainly based on the above calibration plates using direct linear transformation method, two-step method, dual-plane method, ring identification method or phase target calibration method for calibration. Traditional calibration methods based on calibration plates, such as a method for calibrating camera rotation angles disclosed in Chinese Patent Publication No. CN106204583A, have the advantages of high calibration accuracy, simple calibration, and fast calibration speed. It can be applied to any camera model, so it is still a widely used camera calibration method. A three-dimensional calibration plate only needs one image to calibrate the camera. The calibration speed is fast and high calibration accuracy can be achieved. However, the processing and maintenance of high-precision three-dimensional calibration plates are relatively difficult. When calibrating a flat calibration plate, two or more images must be collected, which requires tedious manual interaction, cannot achieve automatic calibration, and lacks flexibility. However, it is simple to make and the accuracy is easy to guarantee.
[0005] The second calibration method is the self-calibration method. During the calibration process, the camera does not need a calibration reference object. Instead, the camera collects multiple image information to obtain the internal and external parameters of the camera. Self-calibration methods, such as the camera self-calibration method based on absolute quadratic curve image disclosed in Chinese Patent Publication No. CN109064516A, directly analyze the image information without relying on a reference object. The process is complicated and not suitable for occasions with high real-time requirements. Moreover, the camera is calibrated using the self-calibration method based on absolute quadratic curve or absolute quadratic surface, which requires direct or indirect solution of the Kruppa equation. The calibration method has low accuracy, slow speed, and insufficient robustness, and is not suitable for virtual reality, parts processing and measurement, and other occasions.
[0006] The third calibration method is a calibration method based on active vision. If certain motion information of the camera or the object being measured is known in advance, such as pure translation of the camera or the object being measured, rotation of the optical center, etc., the calibration method based on active vision uses this information to calibrate the camera. Typical methods include calibration based on pure rotation of the camera, calibration based on three orthogonal translations of the camera, calibration based on plane orthogonal motion, calibration based on the homography matrix of the infinite plane, and calibration based on projective reconstruction. Calibration methods based on active vision, such as an active vision camera calibration method based on a variable calibration target disclosed in Chinese Patent Publication No. CN106846414A, mainly feature the use of motion information of the camera or the object being measured to linearly solve all the internal parameters of the camera. However, in the actual camera calibration process, the measurement error of the motion information of the camera or the object being measured directly affects the accuracy of the camera calibration.
[0007] Other calibration methods, such as calibration based on geometric priors, specifically, use geometric structures to model the 3D-2D correspondence in the scene. Methods based on geometric priors, such as a method for fast calibration of cameras based on geometric principles disclosed in Chinese patent publication number CN106296657A, have greater flexibility, but they rely heavily on structured scenes and require rich geometric priors, resulting in poor calibration performance and low accuracy under normal conditions.
[0008] In summary, the camera parameter calibration methods in the prior art all have some problems to a greater or lesser extent, and a new camera parameter calibration method needs to be designed to overcome the above problems. Summary of the invention
[0009] The technical problem to be solved by the present invention is that the camera parameter calibration method in the prior art requires cumbersome manual interaction, cannot realize automatic calibration, and has slow calibration speed and low accuracy.
[0010] The present invention solves the above technical problems by the following technical means: a single-frame camera extrinsic self-calibration method based on geometric priors, wherein the camera extrinsic parameters include a rotation matrix and a translation matrix, and the method comprises the following steps:
[0011] Step 1, optimizing the rotation matrix based on the linear structures orthogonal to each other in the horizontal direction and the linear structures in the vertical direction;
[0012] Step 2: Optimize the translation matrix based on the distance of the measured ground 3D points.
[0013] Furthermore, the step 1 comprises:
[0014] Step 101: construct a camera imaging model;
[0015] Step 102, establish a world coordinate system, an image coordinate system and a camera coordinate system, use a camera to take a picture of a straight line segment along the coordinate axis direction of the world coordinate system, the camera forms an image in the image coordinate system after taking the picture, obtain the coordinates of the two end points of the straight line segment after imaging in the image coordinate system, determine the relationship between the two end points and the rotation matrix in the camera coordinate system, and optimize and solve the rotation matrix based on the relationship.
[0016] Furthermore, the step 101 includes:
[0017] The camera imaging model is
[0018]
[0019] in, is the distance depth coefficient, , is the pixel coordinate point in the image coordinate system, , is the coordinate point of the intersection of the camera optical axis and the image plane, , , is the world coordinate point in the XYZ direction in the world coordinate system, represents the rotation matrix, express The rotation matrix of represents the translation matrix, express The translation matrix, Respectively represent the focal length of the camera on the X and Y axes (in pixels).
[0020] Furthermore, the step 102 includes:
[0021] Take a point at the actual position of the object to be monitored as the origin of the world coordinate system, and establish the X-axis and Y-axis of the world coordinate system from the origin of the world coordinate system in two mutually orthogonal straight lines in the horizontal direction, and the vertical direction is the Z-axis direction of the world coordinate system. Set up a camera at any position around the actual object to be monitored, take the optical center of the camera as the origin of the camera, and the emission direction of the optical center of the camera as the Z-axis of the camera. The direction parallel to the length of the camera from the origin of the camera is the X-axis of the camera, and the direction parallel to the width of the camera from the origin of the camera is the Y-axis of the camera; along the Z-axis of the camera, take a point at a preset distance from the origin of the camera as the origin of the image coordinate system, and the preset distance is the focal length of the camera. The X-axis of the image coordinate system is in the same direction as the X-axis of the camera coordinate system, and the Y-axis of the image coordinate system is in the opposite direction to the Y-axis of the camera coordinate system; use the camera to take a picture of the straight line segment along the coordinate axis direction of the world coordinate system, and the camera forms an image in the image coordinate system after taking the picture, and obtain the coordinates of the two end points of the straight line segment after imaging in the image coordinate system as follows: , two end points , The three-dimensional distance is , two end points , The depths in the camera coordinate system are , , then, according to the projection formula:
[0022]
[0023]
[0024]
[0025] eliminate , , we can get the two end points , The relationship between the camera coordinate system and the rotation matrix
[0026]
[0027]
[0028] Among them, , the rotation matrix is The matrix, according to , Axial information, Corresponding to a column of the rotation matrix, are three elements in the column; when , When the corresponding straight line segment is along the Z-axis direction of the world coordinate system, is the third column of the rotation matrix. , When the corresponding straight line segment is along the X-axis direction of the world coordinate system, is the first column of the rotation matrix, when , When the corresponding straight line segment is along the Y-axis direction of the world coordinate system, is the second column of the rotation matrix; solved by optimization =0 to get Value, and then get the optimized rotation matrix.
[0029] Furthermore, the step 2 includes:
[0030] Step 201: Assuming the height of the camera, taking the point on the ground directly below the camera as the origin of the world coordinate system, determining the world coordinates of the camera, and constructing the camera's translation matrix formula based on the camera's world coordinates and the rotation matrix;
[0031] Step 202: Solve to obtain the height of the camera, thereby obtaining the world coordinates of the camera, and substitute it into the constructed camera translation matrix formula to obtain the camera translation matrix.
[0032] Furthermore, the step 201 includes:
[0033] Assuming the height of the camera is h, and the point directly below the camera on the ground is the origin of the world coordinate system, then the world coordinates of the camera are , then the camera's translation matrix is
[0034] .
[0035] Furthermore, the step 202 includes:
[0036] Use a camera to take pictures of two points on the ground. After taking pictures, the camera forms an image in the image coordinate system. Assume that the coordinates of the two end points of the two points on the ground after being formed in the image coordinate system are , two end points , The three-dimensional distance is , two end points , The depths in the camera coordinate system are , , then, in the world coordinate system, the two endpoints , The X-axis distance is , two end points , The Y-axis distance is , from the projection formula we can get
[0037]
[0038]
[0039] joint
[0040]
[0041] The optimization solution is , and then obtain the camera's translation matrix T;
[0042] in, express The X-axis and Y-axis coordinate values in the world coordinate system.
[0043] The present invention also provides a single-frame camera extrinsic self-calibration system based on geometric priors, wherein the camera extrinsic parameters include a rotation matrix and a translation matrix, and the system includes:
[0044] A rotation matrix acquisition module, used for optimizing the rotation matrix based on the linear structures orthogonal to each other in the horizontal direction and the linear structures in the vertical direction;
[0045] The translation matrix acquisition module is used to optimize the translation matrix based on the distance of the measured ground three-dimensional points.
[0046] Furthermore, the rotation matrix acquisition module includes:
[0047] A model building unit, used for building a camera imaging model;
[0048] The first solving unit is used to establish a world coordinate system, an image coordinate system and a camera coordinate system, use a camera to take a picture of a straight line segment along the coordinate axis direction of the world coordinate system, and form an image in the image coordinate system after the camera takes the picture, obtain the coordinates of the two end points of the straight line segment after imaging in the image coordinate system, determine the relationship between the two end points and the rotation matrix in the camera coordinate system, and optimize and solve the rotation matrix based on the relationship.
[0049] Furthermore, the model building unit is also used for:
[0050] The camera imaging model is
[0051]
[0052] in, is the distance depth coefficient, , is the pixel coordinate point in the image coordinate system, , is the coordinate point of the intersection of the camera optical axis and the image plane, , , is the world coordinate point in the XYZ direction in the world coordinate system, represents the rotation matrix, express The rotation matrix of represents the translation matrix, express The translation matrix, Respectively represent the focal length of the camera on the X and Y axes (in pixels).
[0053] Furthermore, the first solving unit is further used for:
[0054] Take a point at the actual position of the object to be monitored as the origin of the world coordinate system, and establish the X-axis and Y-axis of the world coordinate system from the origin of the world coordinate system in two mutually orthogonal straight lines in the horizontal direction, and the vertical direction is the Z-axis direction of the world coordinate system. Set up a camera at any position around the actual object to be monitored, take the optical center of the camera as the origin of the camera, and the emission direction of the optical center of the camera as the Z-axis of the camera. The direction parallel to the length of the camera from the origin of the camera is the X-axis of the camera, and the direction parallel to the width of the camera from the origin of the camera is the Y-axis of the camera; along the Z-axis of the camera, take a point at a preset distance from the origin of the camera as the origin of the image coordinate system, and the preset distance is the focal length of the camera. The X-axis of the image coordinate system is in the same direction as the X-axis of the camera coordinate system, and the Y-axis of the image coordinate system is in the opposite direction to the Y-axis of the camera coordinate system; use the camera to take a picture of the straight line segment along the coordinate axis direction of the world coordinate system, and the camera forms an image in the image coordinate system after taking the picture, and obtain the coordinates of the two end points of the straight line segment after imaging in the image coordinate system as follows: , two end points , The three-dimensional distance is , two end points , The depths in the camera coordinate system are , , then, according to the projection formula:
[0055]
[0056]
[0057]
[0058] eliminate , , we can get the two end points , The relationship between the camera coordinate system and the rotation matrix
[0059]
[0060]
[0061] Among them, , the rotation matrix is The matrix, according to , Axial information, Corresponding to a column of the rotation matrix, are three elements in the column; when , When the corresponding straight line segment is along the Z-axis direction of the world coordinate system, is the third column of the rotation matrix. , When the corresponding straight line segment is along the X-axis direction of the world coordinate system, is the first column of the rotation matrix, when , When the corresponding straight line segment is along the Y-axis direction of the world coordinate system, is the second column of the rotation matrix; solved by optimization =0 to get Value, and then get the optimized rotation matrix.
[0062] Furthermore, the translation matrix acquisition module includes:
[0063] A relationship building unit, used to assume the height of the camera, take the point on the ground directly below the camera as the origin of the world coordinate system, determine the world coordinates of the camera, and build a translation matrix formula of the camera based on the world coordinates of the camera and the rotation matrix;
[0064] The second solving unit is used to solve the height of the camera, thereby obtaining the world coordinates of the camera, substituting it into the constructed translation matrix formula of the camera to obtain the translation matrix of the camera.
[0065] Furthermore, the relationship building unit is also used for:
[0066] Assuming the height of the camera is h, and the point directly below the camera on the ground is the origin of the world coordinate system, then the world coordinates of the camera are , then the camera's translation matrix is
[0067] .
[0068] Furthermore, the second solving unit is further used for:
[0069] Use a camera to take pictures of two points on the ground. After taking pictures, the camera forms an image in the image coordinate system. Assume that the coordinates of the two end points of the two points on the ground after being formed in the image coordinate system are , two end points , The three-dimensional distance is , two end points , The depths in the camera coordinate system are , , then, in the world coordinate system, the two endpoints , The X-axis distance is , two end points , The Y-axis distance is , from the projection formula we can get
[0070]
[0071]
[0072] joint
[0073]
[0074] The optimization solution is , and then obtain the camera's translation matrix T;
[0075] in, express The X-axis and Y-axis coordinate values in the world coordinate system.
[0076] The advantages of the present invention are: for scenes in which there are mutually orthogonal straight line structures in the horizontal direction and straight line structures in the vertical direction in the picture, the present invention calibrates the extrinsic parameters of a monocular camera based on geometric priors, and combines image processing methods to automatically extract geometric prior information based on the picture, so as to quickly realize automatic calibration of camera extrinsic parameters without human intervention. Compared with traditional calibration methods that require cumbersome manual interaction, the calibration speed is fast. Compared with existing self-calibration methods, the algorithm first optimizes the rotation matrix based on the mutually orthogonal straight line structures in the horizontal direction and the straight line structures in the vertical direction, and then optimizes the translation matrix based on the measured distance of three-dimensional points on the ground, so as to ensure the accuracy of the camera extrinsic parameter calibration. BRIEF DESCRIPTION OF THE DRAWINGS
[0077] Figure 1 It is a flow chart of a method for self-calibration of extrinsic parameters of a single-frame camera based on geometric priors disclosed in an embodiment of the present invention;
[0078] Figure 2 The detailed logic process diagram of the single-frame camera extrinsic self-calibration method based on geometric priors disclosed in an embodiment of the present invention. DETAILED DESCRIPTION
[0079] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in combination with the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0080] Example 1
[0081] like Figure 1 and Figure 2 As shown, the present invention provides a single-frame camera extrinsic self-calibration method based on geometric priors, wherein the camera extrinsic parameters include a rotation matrix and a translation matrix, and the method includes the following steps:
[0082] S1. Optimize the rotation matrix based on the linear structure orthogonal to each other in the horizontal direction and the linear structure in the vertical direction. The specific process is as follows:
[0083] The camera imaging model is
[0084]
[0085] in, is the distance depth coefficient, , is the pixel coordinate point in the image coordinate system, , is the coordinate point of the intersection of the camera optical axis and the image plane, , , is the world coordinate point in the XYZ direction in the world coordinate system, represents the rotation matrix, express The rotation matrix of represents the translation matrix, express The translation matrix, Respectively represent the focal length of the camera on the X and Y axes (in pixels).
[0086] Take a point at the actual position of the object to be monitored as the origin of the world coordinate system, and establish the X-axis and Y-axis of the world coordinate system from the origin of the world coordinate system in two mutually orthogonal straight lines in the horizontal direction, and the vertical direction is the Z-axis direction of the world coordinate system. Set up a camera at any position around the actual object to be monitored, take the optical center of the camera as the origin of the camera, and the emission direction of the optical center of the camera as the Z-axis of the camera. The direction parallel to the length of the camera from the origin of the camera is the X-axis of the camera, and the direction parallel to the width of the camera from the origin of the camera is the Y-axis of the camera; along the Z-axis of the camera, take a point at a preset distance from the origin of the camera as the origin of the image coordinate system, and the preset distance is the focal length of the camera. The X-axis of the image coordinate system is in the same direction as the X-axis of the camera coordinate system, and the Y-axis of the image coordinate system is in the opposite direction to the Y-axis of the camera coordinate system; use the camera to take a picture of the straight line segment along the coordinate axis direction of the world coordinate system, and the camera forms an image in the image coordinate system after taking the picture, and obtain the coordinates of the two end points of the straight line segment after imaging in the image coordinate system as follows: , two end points , The three-dimensional distance is , two end points , The depths in the camera coordinate system are , , then, according to the projection formula:
[0087]
[0088]
[0089]
[0090] eliminate , , we can get the two end points , The relationship between the camera coordinate system and the rotation matrix
[0091]
[0092]
[0093] Among them, , the rotation matrix is The matrix, according to , Axial information, Corresponding to a column of the rotation matrix, are three elements in the column; when , When the corresponding straight line segment is along the Z-axis direction of the world coordinate system, is the third column of the rotation matrix. , When the corresponding straight line segment is along the X-axis direction of the world coordinate system, is the first column of the rotation matrix, when , When the corresponding straight line segment is along the Y-axis direction of the world coordinate system, is the second column of the rotation matrix. In the above formula, is an unknown quantity, while other parameters can be obtained through on-site measurement. , The corresponding straight line segment is taken along the X-axis direction of the world coordinate system, and the optimization solution is obtained. =0At this time, we get The value corresponds to the first column of the rotation matrix. , The corresponding straight line segment is taken along the Y-axis direction of the world coordinate system, and the optimization solution is obtained =0At this time, we get The value corresponds to the second column of the rotation matrix. , The corresponding straight line segment is taken along the Z-axis direction of the world coordinate system and optimized. =0At this time, we get The value corresponds to the third column of the rotation matrix. The data from the first to the third columns of the obtained rotation matrix are integrated to obtain the optimized rotation matrix.
[0094] S2. Optimize the translation matrix based on the distance of the measured ground 3D points. The specific process is as follows:
[0095] Assuming the height of the camera is h, and the point directly below the camera on the ground is the origin of the world coordinate system, then the world coordinates of the camera are , then the camera's translation matrix is
[0096] .
[0097] Use a camera to take pictures of two points on the ground. After taking pictures, the camera forms an image in the image coordinate system. Assume that the coordinates of the two end points of the two points on the ground after being formed in the image coordinate system are , two end points , The three-dimensional distance is , two end points , The depths in the camera coordinate system are , , then, in the world coordinate system, the two endpoints , The X-axis distance is , two end points , The Y-axis distance is , from the projection formula we can get
[0098]
[0099]
[0100]
[0101] in, express The world coordinate values of the X-axis and Y-axis in the world coordinate system.
[0102] Among the above three formulas, only is an unknown quantity, and other parameters can be obtained through on-site measurement. By combining the above three formulas, the optimization solution can be obtained ,Will Substitute the calculation formula of the camera's translation matrix T into the formula, and then obtain the camera's translation matrix T;
[0103] Through the above technical scheme, the present invention targets scenes in which there are mutually orthogonal straight line structures in the horizontal direction and straight line structures in the vertical direction in the picture, and calibrates the extrinsic parameters of a monocular camera based on geometric priors. Compared with the traditional calibration method, the calibration of the camera extrinsic parameters can be quickly realized with less human intervention. Compared with the self-calibration method, the accuracy of the camera extrinsic parameter calibration is guaranteed.
[0104] Example 2
[0105] Based on Example 1, Example 2 of the present invention further provides a single-image camera extrinsic self-calibration system based on geometric priors, wherein the camera extrinsic parameters include a rotation matrix and a translation matrix, and the system includes:
[0106] A rotation matrix acquisition module, used for optimizing the rotation matrix based on the linear structures orthogonal to each other in the horizontal direction and the linear structures in the vertical direction;
[0107] The translation matrix acquisition module is used to optimize the translation matrix based on the distance of the measured ground three-dimensional points.
[0108] Specifically, the rotation matrix acquisition module includes:
[0109] A model building unit, used for building a camera imaging model;
[0110] The first solving unit is used to establish a world coordinate system, an image coordinate system and a camera coordinate system, use a camera to take a picture of a straight line segment along the coordinate axis direction of the world coordinate system, and form an image in the image coordinate system after the camera takes the picture, obtain the coordinates of the two end points of the straight line segment after imaging in the image coordinate system, determine the relationship between the two end points and the rotation matrix in the camera coordinate system, and optimize and solve the rotation matrix based on the relationship.
[0111] More specifically, the model building unit is further used for:
[0112] The camera imaging model is
[0113]
[0114] in, is the distance depth coefficient, , is the pixel coordinate point in the image coordinate system, , is the coordinate point of the intersection of the camera optical axis and the image plane, , , is the world coordinate point in the XYZ direction in the world coordinate system, represents the rotation matrix, express The rotation matrix of represents the translation matrix, express The translation matrix, Respectively represent the focal length of the camera on the X and Y axes (in pixels).
[0115] More specifically, the first solving unit is further used for:
[0116] Take a point at the actual position of the object to be monitored as the origin of the world coordinate system, and establish the X-axis and Y-axis of the world coordinate system from the origin of the world coordinate system in two mutually orthogonal straight lines in the horizontal direction, and the vertical direction is the Z-axis direction of the world coordinate system. Set up a camera at any position around the actual object to be monitored, take the optical center of the camera as the origin of the camera, and the emission direction of the optical center of the camera as the Z-axis of the camera. The direction parallel to the length of the camera from the origin of the camera is the X-axis of the camera, and the direction parallel to the width of the camera from the origin of the camera is the Y-axis of the camera; along the Z-axis of the camera, take a point at a preset distance from the origin of the camera as the origin of the image coordinate system, and the preset distance is the focal length of the camera. The X-axis of the image coordinate system is in the same direction as the X-axis of the camera coordinate system, and the Y-axis of the image coordinate system is in the opposite direction to the Y-axis of the camera coordinate system; use the camera to take a picture of the straight line segment along the coordinate axis direction of the world coordinate system, and the camera forms an image in the image coordinate system after taking the picture, and obtain the coordinates of the two end points of the straight line segment after imaging in the image coordinate system as follows: , two end points , The three-dimensional distance is , two end points , The depths in the camera coordinate system are , , then, according to the projection formula:
[0117]
[0118]
[0119]
[0120] eliminate , , we can get the two end points , The relationship between the camera coordinate system and the rotation matrix
[0121]
[0122]
[0123] Among them, , the rotation matrix is The matrix, according to , Axial information, Corresponding to a column of the rotation matrix, are three elements in the column; when , When the corresponding straight line segment is along the Z-axis direction of the world coordinate system, is the third column of the rotation matrix. , When the corresponding straight line segment is along the X-axis direction of the world coordinate system, is the first column of the rotation matrix, when , When the corresponding straight line segment is along the Y-axis direction of the world coordinate system, is the second column of the rotation matrix; solved by optimization =0 to get Value, and then get the optimized rotation matrix.
[0124] More specifically, the translation matrix acquisition module includes:
[0125] A relationship building unit, used to assume the height of the camera, take the point on the ground directly below the camera as the origin of the world coordinate system, determine the world coordinates of the camera, and build a translation matrix formula of the camera based on the world coordinates of the camera and the rotation matrix;
[0126] The second solving unit is used to solve the height of the camera, thereby obtaining the world coordinates of the camera, substituting it into the constructed translation matrix formula of the camera to obtain the translation matrix of the camera.
[0127] More specifically, the relationship building unit is further used for:
[0128] Assuming the height of the camera is h, and the point directly below the camera on the ground is the origin of the world coordinate system, then the world coordinates of the camera are , then the camera's translation matrix is
[0129] .
[0130] More specifically, the second solving unit is further used for:
[0131] Use a camera to take pictures of two points on the ground. After taking pictures, the camera forms an image in the image coordinate system. Assume that the coordinates of the two end points of the two points on the ground after being formed in the image coordinate system are , two end points , The three-dimensional distance is , two end points , The depths in the camera coordinate system are , , then, in the world coordinate system, the two endpoints , The X-axis distance is , two end points , The Y-axis distance is , from the projection formula we can get
[0132]
[0133]
[0134] joint
[0135]
[0136] The optimization solution is , and then obtain the camera's translation matrix T;
[0137] in, express The X-axis and Y-axis coordinate values in the world coordinate system.
[0138] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A single-frame camera extrinsic self-calibration method based on geometric priors, wherein the camera extrinsic parameters include a rotation matrix and a translation matrix, characterized in that: The method comprises the following steps: Step 1: Optimize the rotation matrix based on the linear structure orthogonal to each other in the horizontal direction and the linear structure in the vertical direction; specifically: establish a world coordinate system, an image coordinate system and a camera coordinate system, use a camera to take a picture of the straight line segment along the coordinate axis direction of the world coordinate system, and the camera forms an image in the image coordinate system after taking the picture, and obtain the coordinates of the two end points of the straight line segment after imaging in the image coordinate system as follows: ; Determine the relationship between the two end points and the rotation matrix in the camera coordinate system, and optimize and solve the rotation matrix based on the relationship; the relationship is: Among them, , the rotation matrix is The matrix, according to , Axial information, Corresponding to a column of the rotation matrix, are three elements in the column; when , When the corresponding straight line segment is along the Z-axis direction of the world coordinate system, is the third column of the rotation matrix. , When the corresponding straight line segment is along the X-axis direction of the world coordinate system, is the first column of the rotation matrix, when , When the corresponding straight line segment is along the Y-axis direction of the world coordinate system, is the second column of the rotation matrix; solved by optimization =0 to get Value, and then get the optimized rotation matrix; Step 2: Optimize the translation matrix based on the distance of the measured ground 3D points; specifically: Use a camera to take pictures of two points on the ground. After taking pictures, the camera forms an image in the image coordinate system. Assume that the coordinates of the two end points of the two points on the ground after being formed in the image coordinate system are , two end points , The three-dimensional distance is , two end points , The depths in the camera coordinate system are , , then, in the world coordinate system, the two endpoints , The X-axis distance is , two end points , The Y-axis distance is , from the projection formula we can get joint The optimization solution is , and then obtain the camera's translation matrix T; in, express The X-axis and Y-axis coordinate values in the world coordinate system.
2. The method for self-calibration of external parameters of a single-frame camera based on geometric prior according to claim 1, characterized in that: The step one also includes the step of constructing a camera imaging model.
3. The method for self-calibration of external parameters of a single-frame camera based on geometric prior according to claim 2, characterized in that: The camera imaging model is in, is the distance depth coefficient, , is the pixel coordinate point in the image coordinate system, , is the coordinate point of the intersection of the camera optical axis and the image plane, , , is the world coordinate point in the XYZ direction in the world coordinate system, represents the rotation matrix, express The rotation matrix of represents the translation matrix, express The translation matrix, Represents the focal length of the camera on the X and Y axes respectively.
4. The method for self-calibration of external parameters of a single-frame camera based on geometric prior according to claim 3, characterized in that: The process of optimizing the rotation matrix in step 1 is specifically as follows: Take a point at the actual position of the object to be monitored as the origin of the world coordinate system, and establish the X-axis and Y-axis of the world coordinate system from the origin of the world coordinate system in two mutually orthogonal straight lines in the horizontal direction, and the vertical direction is the Z-axis direction of the world coordinate system. Set up a camera at any position around the actual object to be monitored, take the optical center of the camera as the origin of the camera, and the emission direction of the optical center of the camera as the Z-axis of the camera. The direction parallel to the length of the camera from the origin of the camera is the X-axis of the camera, and the direction parallel to the width of the camera from the origin of the camera is the Y-axis of the camera; along the Z-axis of the camera, take a point at a preset distance from the origin of the camera as the origin of the image coordinate system, and the preset distance is the focal length of the camera. The X-axis of the image coordinate system is in the same direction as the X-axis of the camera coordinate system, and the Y-axis of the image coordinate system is in the opposite direction to the Y-axis of the camera coordinate system; use the camera to take a picture of the straight line segment along the coordinate axis direction of the world coordinate system, and the camera forms an image in the image coordinate system after taking the picture, and obtain the coordinates of the two end points of the straight line segment after imaging in the image coordinate system as follows: , two end points , The three-dimensional distance is , two end points , The depths in the camera coordinate system are , , then, according to the projection formula: eliminate , , we can get the two end points , The relationship with the rotation matrix in the camera coordinate system.
5. The method for self-calibration of external parameters of a single-frame camera based on geometric prior according to claim 4, characterized in that: The second step comprises: Step 201: Assuming the height of the camera, taking the point on the ground directly below the camera as the origin of the world coordinate system, determining the world coordinates of the camera, and constructing the camera's translation matrix formula based on the camera's world coordinates and the rotation matrix; Step 202: Solve to obtain the height of the camera, thereby obtaining the world coordinates of the camera, and substitute it into the constructed camera translation matrix formula to obtain the camera translation matrix.
6. The method for self-calibration of external parameters of a single-frame camera based on geometric prior according to claim 5, characterized in that: The step 201 includes: Assuming the height of the camera is h, and the point directly below the camera on the ground is the origin of the world coordinate system, then the world coordinates of the camera are , then the camera's translation matrix is 。 7. A single-frame camera extrinsic self-calibration system based on geometric priors, wherein the camera extrinsic parameters include a rotation matrix and a translation matrix, characterized in that: The system comprises: The rotation matrix acquisition module is used to optimize the rotation matrix based on the linear structure orthogonal to each other in the horizontal direction and the linear structure in the vertical direction; specifically, it includes a first solving unit: establishing a world coordinate system, an image coordinate system and a camera coordinate system, using a camera to take a picture of a straight line segment along the coordinate axis direction of the world coordinate system, and the camera forms an image in the image coordinate system after taking the picture, and obtaining the coordinates of the two end points of the straight line segment after imaging in the image coordinate system as follows: ; Determine the relationship between the two end points and the rotation matrix in the camera coordinate system, and optimize and solve the rotation matrix based on the relationship; the relationship is: Among them, , the rotation matrix is The matrix, according to , Axial information, Corresponding to a column of the rotation matrix, are three elements in the column; when , When the corresponding straight line segment is along the Z-axis direction of the world coordinate system, is the third column of the rotation matrix. , When the corresponding straight line segment is along the X-axis direction of the world coordinate system, is the first column of the rotation matrix, when , When the corresponding straight line segment is along the Y-axis direction of the world coordinate system, is the second column of the rotation matrix; solved by optimization =0 to get Value, and then get the optimized rotation matrix; The translation matrix acquisition module is used to optimize the translation matrix based on the distance of the measured ground three-dimensional points; specifically: Use a camera to take pictures of two points on the ground. After taking pictures, the camera forms an image in the image coordinate system. Assume that the coordinates of the two end points of the two points on the ground after being formed in the image coordinate system are , two end points , The three-dimensional distance is , two end points , The depths in the camera coordinate system are , , then, in the world coordinate system, the two endpoints , The X-axis distance is , two end points , The Y-axis distance is , from the projection formula we can get joint The optimization solution is , and then obtain the camera's translation matrix T; in, express The X-axis and Y-axis coordinate values in the world coordinate system.
8. The single-frame camera extrinsic self-calibration system based on geometric priors according to claim 7, characterized in that: The rotation matrix acquisition module also includes a model building unit for building a camera imaging model.
9. The single-frame camera extrinsic self-calibration system based on geometric priors according to claim 8, characterized in that: The model building unit is further used for: The camera imaging model is in, is the distance depth coefficient, , is the pixel coordinate point in the image coordinate system, , is the coordinate point of the intersection of the camera optical axis and the image plane, , , is the world coordinate point in the XYZ direction in the world coordinate system, represents the rotation matrix, express The rotation matrix of represents the translation matrix, express The translation matrix, Represents the focal length of the camera on the X and Y axes respectively.
