A method and system for monocular camera-imu joint calibration
The monocular camera-IMU joint calibration method, which combines complex motion trajectories and data preprocessing, solves the problems of single motion mode and complex data preprocessing in existing technologies, and achieves efficient and stable calibration results.
Patent Information
- Application Number
- CN202410213645.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-27
- Publication Date
- 2026-11-24
- Estimated Expiration
- 2044-02-27
AI Technical Summary
In existing monocular camera-IMU joint calibration methods, the single motion mode leads to insufficient excitation of the IMU, which may result in corner detection failure and non-convergence of calculations. In addition, the data preprocessing is complex and time-consuming, reducing calibration efficiency.
The control calibration device moves according to a complex preset motion trajectory. The data is preprocessed by combining video frame processing and IMU timestamp processing. The Kalibr calibration toolbox is used to calculate the optimal transformation matrix between the camera coordinate system and the IMU coordinate system.
It improves calibration accuracy and stability, simplifies the calibration process, is suitable for multiple experimental scenarios, and improves data preprocessing efficiency.
Smart Images

Figure CN118037858B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of computer vision and inertial navigation technology, and more specifically, to a method and system for joint calibration of a monocular camera and an IMU. Background Technology
[0002] With the continuous development of computer vision and inertial navigation technologies, the combined application of monocular cameras and IMUs has broad prospects in fields such as robot navigation, augmented reality, and virtual reality. Monocular cameras provide image information, while IMUs can measure motion information such as the acceleration and angular velocity of objects. By jointly calibrating the two, more accurate attitude and position estimation results can be obtained.
[0003] In existing monocular camera-IMU joint calibration methods, the common approach is to move the calibration device along each axis of the IMU to excite the sensor. However, this method is too simplistic and cannot adequately excite the IMU, potentially leading to corner detection failures and computational non-convergence during calibration. Before performing monocular camera-IMU joint calibration, preprocessing of the raw data is usually required. Existing techniques are often complex and time-consuming, significantly reducing calibration efficiency, especially in scenarios requiring repeated experiments, where the calibration process becomes cumbersome and time-consuming.
[0004] Therefore, based on existing technologies, further optimization and improvement of the monocular camera-IMU joint calibration method are needed to enhance calibration accuracy and stability, as well as calibration efficiency and operability. Summary of the Invention
[0005] To address the aforementioned technical problems, this application provides a method and system for joint calibration of a monocular camera and an IMU, which is implemented as follows.
[0006] Specifically, the technical solution of this application is as follows:
[0007] Firstly, this application discloses a method for joint calibration of a monocular camera and an IMU, including:
[0008] The calibration device is controlled to move according to a preset motion trajectory. The calibration device includes a monocular camera and an inertial measurement unit (IMU), and the monocular camera and the IMU are rigidly connected.
[0009] During the movement, the monocular camera captures data from the calibration board to obtain first camera data; the IMU acquires first IMU data at a specified frequency; the calibration board is fixed on a vertical plane and is provided with feature calibration points.
[0010] The first camera data and the first IMU data are preprocessed using a preset program.
[0011] The optimal transformation matrix and calibration error between the camera coordinate system and the IMU coordinate system are calculated using the Kalibr calibration toolbox.
[0012] In some embodiments, the control calibration device moves according to a preset motion trajectory, including:
[0013] A three-dimensional spatial coordinate system is established with the calibration device as the origin;
[0014] The calibration device is controlled to perform reciprocating motion within a first preset distance along the first axis direction, repeating this motion a preset number of times.
[0015] The calibration device is controlled to perform reciprocating motion within a second preset distance along the second axis direction, repeating this motion a preset number of times.
[0016] The calibration device is controlled to perform reciprocating motion within a third preset distance along the third axis direction, repeating this motion a preset number of times.
[0017] The calibration device is controlled to perform a reciprocating motion within the first preset distance along the first axis direction. While performing the reciprocating motion, the calibration device is controlled to rotate around the vertical direction perpendicular to the calibration plate as an axis, repeating the motion a preset number of times.
[0018] The calibration device is controlled to perform a reciprocating motion within the second preset distance along the second axis direction. While performing the reciprocating motion, the calibration device is controlled to perform a lateral swing motion within a specified angle, repeating the motion a preset number of times.
[0019] The calibration device is controlled to perform reciprocating motion within the third preset distance along the third axis direction. While performing the reciprocating motion, the calibration device is controlled to perform pitch motion within a specified angle, repeating the motion a preset number of times.
[0020] In some implementations, the first axis, the second axis, and the third axis correspond to any one of the X-axis, Y-axis, and Z-axis in the three-dimensional spatial coordinate system.
[0021] In some embodiments, the calibration plate remains within the data acquisition area of the calibration device during its movement.
[0022] In some embodiments, the preprocessing of the first camera data and the first IMU data through a preset procedure includes:
[0023] A preset video frame processing program is used to extract video frame images from the first camera data according to the target frame rate parameter, and save the video frame images according to the specified Unix timestamp format to obtain the second camera data.
[0024] A preset IMU timestamp processing program is used; through the IMU timestamp processing program, labels are added to the data obtained under each of the motion trajectories in the first IMU data, the timestamp data is reconstructed according to the specified format and saved to obtain the second IMU data.
[0025] In some implementations, the step of extracting video frame images from the first camera data according to the target frame rate parameter using the video frame processing program, and saving the video frame images according to a specified Unix timestamp format, includes:
[0026] The initial frame rate and initial timestamp of the first camera data are obtained through the video frame processing program for program initialization.
[0027] Obtain the preset target frame rate parameters and the relevant parameters of the specified Unix timestamp format;
[0028] The frame extraction interval coefficient and timestamp precision conversion coefficient are calculated using the obtained parameters.
[0029] Iterate through each frame of the first camera data and extract the video frame image according to the frame extraction interval coefficient;
[0030] The initial timestamp is converted using the timestamp precision conversion factor; the video frame image is named and saved using the timestamp format after precision conversion.
[0031] In some implementations, the reconstructing and saving of timestamp data according to a specified format includes:
[0032] The IMU timestamp processing program iterates through each motion trajectory to obtain the initial timestamp data from the first IMU data.
[0033] The initial timestamp data is recalculated and saved based on the timestamp precision conversion coefficient.
[0034] In some implementations, calculating the optimal transformation matrix and calibration error between the camera coordinate system and the IMU coordinate system using the Kalibr calibration toolbox includes:
[0035] A camera coordinate system is established with the monocular camera as the origin; an IMU coordinate system is established with the IMU as the origin.
[0036] Using the three-dimensional spatial coordinate system, the relative coordinate positions of the feature calibration points on the calibration plate in the camera coordinate system and the IMU coordinate system during the movement of the calibration device can be deduced.
[0037] Calculate the relative rotation angle and relative translation of the feature calibration point in the camera coordinate system and the IMU coordinate system;
[0038] Based on the relative rotation angle and relative translation amount, and by using the method of minimizing calibration error, the optimal transformation matrix between the camera coordinate system and the IMU coordinate system is calculated.
[0039] In some implementations, the Kalibr calibration toolbox specifically performs the following calculation steps:
[0040] The transformation relationship between the three-dimensional spatial coordinate system, the camera coordinate system, and the IMU coordinate system is derived using the following formula:
[0041] T wb =T wc ·T cb (1.1);
[0042]
[0043] Expanding equation (1.2), we get:
[0044] R wb =R wc ·R cb (1.3);
[0045] t wb =R wc ·t cb +t wc (1.4);
[0046] Among them, R wb R is the transformation matrix from the three-dimensional spatial coordinate system to the IMU coordinate system. wb Let t be the relative rotation angle between the three-dimensional spatial coordinate system and the IMU coordinate system. wb T represents the relative translation between the three-dimensional spatial coordinate system and the IMU coordinate system. wc R is the transformation matrix from the 3D spatial coordinate system to the camera coordinate system. wc Let t be the relative rotation angle between the 3D spatial coordinate system and the camera coordinate system. wc T represents the relative translation between the 3D spatial coordinate system and the camera coordinate system. cb R is the transformation matrix from the camera coordinate system to the IMU coordinate system. cbLet t be the relative rotation angle between the camera coordinate system and the IMU coordinate system. cb This represents the relative translation between the camera coordinate system and the IMU coordinate system.
[0047] Align the camera rotation angle obtained by tracking the feature calibration points with the IMU rotation angle to calculate the relative rotation angle R between the camera coordinate system and the IMU coordinate system. cb ;
[0048] In a unit time interval [t, t+1], the attitude changes of the monocular camera and the IMU are represented by quaternions as follows: and Because the monocular camera and the IMU are rigidly connected, therefore the and Synchronization; the quaternion q for transforming from the camera coordinate system to the IMU coordinate system. cb The following rotational relationship must be satisfied:
[0049]
[0050] Among them, (q) cb ) * Represented as quaternion q cb Conjugate;
[0051] The optimal quaternion is obtained by maximizing equation (1.5).
[0052]
[0053] The obtained optimal quaternion Converting to matrix form yields the optimally estimated relative rotation angle between the camera coordinate system and the IMU coordinate system.
[0054]
[0055] The optimal estimated relative translation between the camera coordinate system and the IMU coordinate system is obtained by calculating using equation (1.8).
[0056]
[0057] Among them, The camera translation amount obtained by tracking the feature calibration point within a unit time interval [t, t+1]; The IMU translation amount obtained by tracking the feature calibration point within a unit time interval [t, t+1]. The optimal estimated relative rotation angle between the camera coordinate system and the IMU coordinate system;
[0058] The calibration error is jointly optimized nonlinearly by using a nonlinear least squares algorithm. The calibration error includes reprojection error, IMU error, and initial value error.
[0059] By iterating multiple times to minimize the calibration error, the optimal transformation matrix between the camera coordinate system and the IMU coordinate system is obtained.
[0060]
[0061] Secondly, this application also discloses a system for joint calibration of a monocular camera and an IMU, the system being used to implement the method for joint calibration of a monocular camera and an IMU as described in any of the above embodiments, comprising:
[0062] Calibration equipment; the calibration equipment includes a monocular camera and an inertial measurement unit (IMU), wherein the monocular camera and the IMU are rigidly connected;
[0063] A calibration plate; the calibration plate is fixed on a vertical plane, and the calibration plate is provided with characteristic calibration points; the calibration plate meets the target illumination conditions;
[0064] Motion component; the motion component is connected to the calibration device and is used to receive upper-level motion commands and execute the motion commands to make the calibration device move according to a preset motion trajectory to achieve the target pose;
[0065] During the movement, the monocular camera is used to photograph the calibration board to obtain first camera data; the IMU is used to acquire first IMU data at a specified frequency.
[0066] The main control module is connected to both the calibration device and the motion component; it is used to send motion commands to the motion component and to preprocess the first camera data and the first IMU data through a preset program.
[0067] The main control module is also used to calculate the optimal transformation matrix and calibration error between the camera coordinate system and the IMU coordinate system using the Kalibr calibration toolbox.
[0068] Compared with the prior art, this application has at least one of the following beneficial effects:
[0069] 1. The monocular camera-IMU joint calibration method proposed in this application involves controlling the calibration device to move according to a preset motion trajectory and taking pictures of the calibration board. The preset motion mode and trajectory in this application can fully excite the IMU sensor when shooting calibration video, reducing problems such as corner detection failure and non-convergence of calculation during the calibration process, thereby improving calibration accuracy and stability.
[0070] 2. In this application, the collected raw calibration video data and IMU data are preprocessed through a calibration optimization program. The calibration optimization program can greatly improve the efficiency of raw data preprocessing, adapt to the input format commonly used by calibration tools, simplify the calibration experiment process, and is suitable for scenarios that require multiple experiments. Attached Figure Description
[0071] The preferred embodiments will now be described in a clear and easy-to-understand manner, in conjunction with the accompanying drawings, to further explain the above-mentioned characteristics, technical features, advantages, and implementation methods of this application.
[0072] Figure 1 This is a flowchart illustrating the steps of one method embodiment of this application;
[0073] Figure 2 This is a schematic diagram showing the positions of the calibration device and the calibration board in the embodiments of this application;
[0074] Figure 3 A flowchart illustrating the steps of another method embodiment provided in this application;
[0075] Figure 4 A flowchart illustrating the steps of another method embodiment provided in this application;
[0076] Figure 5 A flowchart illustrating the steps of another method embodiment provided in this application;
[0077] Figure 6 This is a structural block diagram of a system embodiment of this application. Detailed Implementation
[0078] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application can also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.
[0079] It should be understood that, when used in this specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or sets.
[0080] To keep the drawings concise, each figure only schematically shows the parts relevant to the invention, and these do not represent the actual structure of the product. Furthermore, to facilitate understanding, in some figures, only one of components with the same structure or function is schematically depicted, or only one is labeled. In this document, "one" not only means "only one," but can also mean "more than one."
[0081] It should also be further understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0082] In this document, it should be noted that, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to fixed connections, detachable connections, or integral connections. They can refer to mechanical connections or electrical connections. They can refer to direct connections or indirect connections through an intermediate medium, or internal connections between two components. Those skilled in the art can understand the specific meaning of the above terms in this application based on the specific circumstances.
[0083] In specific implementations, the terminal devices described in the embodiments of this application include, but are not limited to, other portable devices such as mobile phones, laptops, educational computers, or tablet computers with touch-sensitive surfaces (e.g., touchscreen displays and / or touchpads). It should also be understood that in some embodiments, the terminal device is not a portable communication device, but a desktop computer with touch-sensitive surfaces (e.g., touchscreen displays and / or touchpads).
[0084] Furthermore, in the description of this application, the terms "first," "second," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0085] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the specific implementation methods of this application will be described below with reference to the accompanying drawings. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings and other implementation methods can be obtained based on these drawings without creative effort.
[0086] Camera and IMU (Inertial Measurement Unit) joint calibration is a widely used technique. Its main purpose is to efficiently fuse data from the camera and the IMU to achieve accurate positioning and attitude estimation. This technique plays a crucial role in numerous fields, providing accurate data support for various applications.
[0087] A camera, as an image acquisition device, can capture the position and motion of an object in space. An IMU, on the other hand, is a sensor that measures the angular and linear velocities of an object. When these two devices are combined, they complement each other, improving measurement accuracy. The camera provides high-precision two-dimensional images, while the IMU provides angular and linear velocity data in three-dimensional space. Through joint calibration, this data can be fused together to achieve precise positioning and attitude estimation of the object in three-dimensional space.
[0088] Current monocular camera-IMU joint calibration methods commonly employ a motion approach where the calibration device moves separately along each axis of the IMU to excite the sensor. However, this approach is too simplistic and fails to adequately excite the IMU, potentially leading to corner detection failures and computational non-convergence during calibration. Therefore, a method is needed that can both stabilize the motion of the calibration device and adequately excite each axis of the IMU to improve calibration accuracy and stability.
[0089] Before performing joint calibration of a monocular camera and IMU, preprocessing of the raw data is usually required. Existing techniques are often complex and time-consuming, significantly reducing calibration efficiency, especially in scenarios requiring repeated experiments, where the calibration process becomes cumbersome and time-consuming. Therefore, a simpler and more efficient data preprocessing method is needed to improve calibration efficiency and operability.
[0090] Based on the above two points, this application improves the existing camera-IMU joint calibration method. (See attached specification.) Figure 1 An embodiment of a method for joint calibration of a monocular camera and an IMU provided in this application includes the following steps:
[0091] S110, control the calibration device to move according to a preset motion trajectory. The calibration device includes a monocular camera and an inertial measurement unit (IMU), and the monocular camera and the IMU are rigidly connected.
[0092] S120, during the movement, the monocular camera captures data from the calibration board to obtain first camera data. The IMU acquires first IMU data at a specified frequency. The calibration board is fixed on a vertical plane and has characteristic calibration points. Specifically, during the movement of the calibration device, the calibration board remains within the data acquisition area of the calibration device. During calibration, the monocular camera and calibration board are in a well-lit calibration environment.
[0093] S130, the first camera data and the first IMU data are preprocessed according to a preset program.
[0094] S140 uses the Kalibr calibration toolbox to calculate the optimal transformation matrix and calibration error between the camera coordinate system and the IMU coordinate system.
[0095] Specifically, in this embodiment, in S110, the control calibration device moves according to a preset motion trajectory, including:
[0096] S111, establish a three-dimensional spatial coordinate system with the calibration device as the origin, and control the calibration device to perform reciprocating motion within a first preset distance along the first axis direction, repeating the motion a preset number of times.
[0097] S112, control the calibration device to perform reciprocating motion within a second preset distance along the second axis direction, repeating the motion a preset number of times.
[0098] S113, control the calibration device to perform reciprocating motion within a third preset distance along the third axis direction, repeating the motion a preset number of times.
[0099] S114, control the calibration device to perform reciprocating motion within the first preset distance along the first axis direction, and while performing the reciprocating motion, control the calibration device to rotate around the vertical direction perpendicular to the calibration plate as the axis, repeating the preset number of times.
[0100] S115, control the calibration device to perform reciprocating motion within the second preset distance along the second axis direction, and while performing the reciprocating motion, control the calibration device to perform lateral swing motion within a specified angle, repeating the preset number of times.
[0101] S116, control the calibration device to perform reciprocating motion within the third preset distance along the third axis direction, and while performing the reciprocating motion, control the calibration device to perform pitch motion within a specified angle, repeating the preset number of times.
[0102] In one embodiment of this example, the first axis, the second axis, and the third axis respectively correspond to any one of the X-axis, Y-axis, and Z-axis in the three-dimensional spatial coordinate system, for reference. Figure 2 .
[0103] In another embodiment of this example, the first axis is the Y-axis, the second axis is the X-axis, and the third axis is the Z-axis.
[0104] Alternatively, the first axis may be the X-axis, the second axis the Y-axis, and the third axis the Z-axis, or any other combination thereof. The X, Y, and Z axes represent relative directions only and cannot be used to represent absolute directions or positional relationships.
[0105] In another embodiment provided in this application, based on the above embodiment, step S130, which involves preprocessing the first camera data and the first IMU data using a preset program, includes:
[0106] S131, Preset video frame processing program. Using the video frame processing program, video frame images are extracted from the first camera data according to the target frame rate parameter, and the video frame images are saved according to the specified Unix timestamp format to obtain the second camera data.
[0107] Specifically, the initial frame rate and initial timestamp of the first camera data are obtained through the video frame processing program for program initialization. Preset target frame rate parameters and relevant parameters of the specified Unix timestamp format are obtained. A frame extraction interval coefficient and a timestamp precision conversion coefficient are calculated using the obtained parameters. Each frame of the first camera data is traversed, and the video frame image is extracted according to the frame extraction interval coefficient. The initial timestamp is converted using the timestamp precision conversion coefficient. The video frame image is named and saved using the precision-converted timestamp format.
[0108] S132, Preset IMU timestamp processing procedure. Using the IMU timestamp processing procedure, labels are sequentially added to the data obtained under each of the motion trajectories in the first IMU data. The timestamp data is reconstructed according to a specified format and saved to obtain the second IMU data.
[0109] Specifically, the IMU timestamp processing program iterates through each of the motion trajectories to obtain the initial timestamp data from the first IMU data. Based on the timestamp precision conversion coefficient, the initial timestamp data is recalculated and saved.
[0110] In another embodiment provided in this application, based on the above embodiment, the step S140, which involves calculating the optimal transformation matrix and calibration error between the camera coordinate system and the IMU coordinate system using the Kalibr calibration toolbox, specifically includes:
[0111] S141, establish the camera coordinate system with the monocular camera as the origin. Establish the IMU coordinate system with the IMU as the origin.
[0112] S142, using the three-dimensional spatial coordinate system, the relative coordinate positions of the feature calibration points on the calibration plate in the camera coordinate system and the IMU coordinate system are obtained during the movement of the calibration device.
[0113] S143, calculate the relative rotation angle and relative translation of the feature calibration point in the camera coordinate system and the IMU coordinate system.
[0114] S144. Based on the relative rotation angle and relative translation amount, and by using the method of minimizing calibration error, the optimal transformation matrix between the camera coordinate system and the IMU coordinate system is calculated.
[0115] Kalibr, created by ETHZ in Switzerland, is a widely used camera calibration toolkit, also known as the Vision-Inertial Calibration Toolkit. It is primarily used for calibration in three main areas: 1. Multi-camera calibration: Intrinsic and extrinsic parameter calibration of camera systems with non-globally shared overlapping fields of view. 2. Camera-IMU calibration: Intrinsic and extrinsic parameter calibration of the IMU and camera. 3. Rolling shutter camera calibration: Calibration of cameras with rolling shutters.
[0116] Alternatively, other existing calculation methods can be used for calibration calculations.
[0117] Another embodiment of the method for joint calibration of a monocular camera and IMU disclosed in this application is shown in the appendix to the specification. Figure 3 As shown, it includes the following steps:
[0118] The S210 rigidly connects the monocular camera to the IMU and fixes the calibration plate on a well-lit vertical plane.
[0119] Specifically, the calibration plate is designed with planar calibration features. The planar calibration features consist of irregular QR code patterns.
[0120] S220 drives the calibration device to move along a set trajectory and starts recording calibration video, while simultaneously acquiring and saving the IMU raw data at a certain frequency.
[0121] Specifically, in the initial state, the front of the calibration device is aligned with the calibration plate, and during the movement, the calibration plate is within the field of view of the lens.
[0122] S230 preprocesses the acquired raw calibration video data and IMU data through a calibration optimization program.
[0123] Specifically, the video frame processing program extracts the original calibration video frame images at a set frequency, renames and saves the video frame images according to the set Unix timestamp format. More preferably, the default output frequency of the video frame images is set to 4Hz, which can be adjusted according to the camera recording frequency and the requirements of the selected calibration tool.
[0124] The IMU timestamp processing program adds headers sequentially to the first row of each axis measurement data in the original CSV format IMU data file, reconstructs the Unix timestamp data according to the set format, and saves it. The default output of the Unix timestamp format is 19 bits, which can be adjusted according to the requirements of the selected calibration tool. In some other embodiments of this example, the IMU data of each axis measurement is sequentially titled with "timestamp", "alpha_x", "alpha_y", "alpha_z", "omega_x", "omega_y", and "omega_z".
[0125] The S240 uses the Kalibr toolbox to calculate the transformation matrix between the camera coordinate system and the IMU coordinate system, as well as the calibration error, from the preprocessed data.
[0126] Another embodiment of the method for joint calibration of a monocular camera and IMU disclosed in this application is shown in the appendix to the specification. Figure 4 As shown, based on one embodiment of the above method, step S220 specifically includes the following sub-steps:
[0127] S221, In the initial state, align the front of the calibration device with the calibration board and start collecting and saving the raw IMU data at a certain frequency.
[0128] S222 drives the calibration device to reciprocate along each axis 3-4 times from rest, starting from a standstill. During the movement, the calibration plate remains within the field of view of the lens.
[0129] S223 drives the calibration device from rest using three composite motion modes: X-axis and flip axis, Y-axis and side-swing axis, and Z-axis and pitch axis. It adds rotational motion in the corresponding direction while performing translational motion, repeating 3-4 times. During the motion, the calibration plate is always within the field of view of the lens.
[0130] Another embodiment of the method for joint calibration of a monocular camera and IMU disclosed in this application is shown in the appendix to the specification. Figure 5 As shown, based on one embodiment of the above method, step S230 specifically includes the following sub-steps:
[0131] S231 inputs the acquired raw calibration video data into the video frame processing program.
[0132] S232, the program obtains the original frame rate and the current timestamp of the calibration video for program initialization.
[0133] S233 obtains the desired video frame rate parameters and timestamp accuracy parameters through user interaction.
[0134] S234 calculates the frame skipping interval coefficient and timestamp precision conversion coefficient using the acquired parameters.
[0135] S235 iterates through each frame of the calibrated video, outputs the video frame image according to the frame extraction interval, and names it with the timestamp after precision conversion.
[0136] S236, input the collected raw IMU data into the IMU timestamp processing program.
[0137] S237, initialize the raw IMU timestamp data offset, and add headers to the measurement data of each axis in sequence.
[0138] S238 Iterate through each row of original timestamp data, recalculate the original timestamp data based on the current timestamp and timestamp precision conversion factor, and save the data.
[0139] The optimized method for monocular camera-IMU joint calibration proposed in this application can fully stimulate the IMU sensor when capturing calibration videos, reducing problems such as corner detection failure and computational non-convergence during the calibration process, thereby improving calibration accuracy and stability. Simultaneously, the calibration optimization program can significantly improve the efficiency of raw data preprocessing, adapt to commonly used input formats of calibration tools, simplify the calibration experiment process, and is suitable for scenarios requiring multiple experiments.
[0140] Another embodiment of the monocular camera-IMU joint calibration method provided in this application, based on any of the above embodiments, specifically includes the following sub-steps in step S240:
[0141] S241, the optimal transformation matrix between the camera coordinate system and the IMU coordinate system is solved by minimizing the calibration error, which includes the relative rotation angle and the relative translation amount, as shown in the following equation:
[0142] T wb =T wc ·T cb (1.1)
[0143]
[0144] Among them, T wb R is the transformation matrix from the three-dimensional spatial coordinate system to the IMU coordinate system. wbLet t be the relative rotation angle between the three-dimensional spatial coordinate system and the IMU coordinate system. wb T represents the relative translation between the three-dimensional spatial coordinate system and the IMU coordinate system. wc R is the transformation matrix from the 3D spatial coordinate system to the camera coordinate system. wc Let t be the relative rotation angle between the 3D spatial coordinate system and the camera coordinate system. wc T represents the relative translation between the 3D spatial coordinate system and the camera coordinate system. cb R is the transformation matrix from the camera coordinate system to the IMU coordinate system. cb Let t be the relative rotation angle between the camera coordinate system and the IMU coordinate system. cb Let be the relative translation between the camera coordinate system and the IMU coordinate system. Expanding equation (1.2), we get:
[0145] R wb =R wc ·R cb (1.3)
[0146] t wb =R wc ·t cb +t wc (1.4)
[0147] S242, the relative rotation angle between the camera coordinate system and the IMU coordinate system during the time interval [t, t+1] can be obtained by aligning the camera rotation obtained from the feature calibration points of the tracking calibration board with the IMU rotation obtained after pre-integrating the IMU data. During the time interval [t, t+1], the attitude changes of the camera and IMU are represented by quaternions as follows: and Since the camera and IMU are rigidly connected in this application, the above-mentioned and This represents the same rotational motion. Therefore, the quaternion q transforms the camera coordinate system to the IMU coordinate system. cb The following rotational relationship must be satisfied:
[0148]
[0149] Among them, (q) cb ) * Represented as quaternion q cb The conjugate of . Then, the optimal quaternion is obtained by maximizing the following expression.
[0150]
[0151] The obtained optimal quaternion Converting to matrix form yields the optimally estimated relative rotation angle between the camera coordinate system and the IMU coordinate system.
[0152]
[0153] S243, within the time interval [t, t+1] This refers to the camera translation amount obtained by tracking the feature calibration points on the calibration board. This refers to the IMU translation amount obtained after pre-integrating the IMU data. This represents the optimally estimated relative rotation angle between the camera coordinate system and the IMU coordinate system. The optimally estimated relative translation between the camera coordinate system and the IMU coordinate system is then calculated using the following formula.
[0154] S244 employs a nonlinear least squares algorithm to perform joint nonlinear optimization on calibration errors such as reprojection error, IMU error, and initial value error. Through multiple iterations, the calibration errors are minimized, yielding the optimal transformation matrix between the camera coordinate system and the IMU coordinate system at this point.
[0155] Another embodiment of the method for joint calibration of a monocular camera and an IMU disclosed in this application includes the following steps: rigidly connecting the monocular camera and the IMU, and fixing the calibration plate on a well-lit vertical plane; initially aligning the front of the calibration device with the calibration plate, driving the calibration device to move along a set trajectory and starting to capture calibration video, while simultaneously acquiring and saving raw IMU data at a certain frequency, with the calibration plate within the field of view of the lens during the movement; preprocessing the acquired raw calibration video data and IMU data using a calibration optimization program; and using the Kalibr toolbox to calculate the transformation matrix of the camera coordinate system and the IMU coordinate system, as well as the calibration error, from the preprocessed data.
[0156] Specifically, the motion trajectory, with the calibration device as the origin, consists of translational motion along the X, Y, and Z axes, and rotational motion around the flip, yaw, and pitch axes. The motion trajectory includes the following steps: along the X, Y, and Z axes respectively, refer to the attached instruction manual. Figure 2As shown, starting from rest, the calibration device is driven to reciprocate along each axis 3-4 times in sequence. During the movement, the calibration plate remains within the field of view of the lens. Using three composite motion modes, namely X-axis and flip axis, Y-axis and side-swing axis, and Z-axis and pitch axis, the calibration device is driven from rest, with rotational motion added in the corresponding direction while translating, and repeated 3-4 times. During the movement, the calibration plate remains within the field of view of the lens.
[0157] More preferably, the calibration optimization program is written in Python or other programming languages. The calibration optimization program consists of a video frame processing program and an IMU timestamp processing program, and includes the following steps: using the video frame processing program, extracting original calibration video frame images at a set frequency, renaming and saving the video frame images according to a set Unix timestamp format; using the IMU timestamp processing program, adding headers to the first row of each axis measurement data in the original CSV file column by column, reconstructing the Unix timestamp data according to a set format, and saving it.
[0158] Based on the same technical concept, this application also discloses a system for joint calibration of a monocular camera and an IMU. This system can be used to implement any of the above-mentioned methods for joint calibration of a monocular camera and an IMU. Specifically, an embodiment of a system for joint calibration of a monocular camera and an IMU of this application is shown in the appendix to the specification. Figure 6 As shown, it includes:
[0159] Calibration equipment. The calibration equipment includes a monocular camera and an inertial measurement unit (IMU), wherein the monocular camera and the IMU are rigidly connected.
[0160] A calibration plate. The calibration plate is fixed on a vertical plane and has characteristic calibration points. The calibration plate meets the target illumination conditions.
[0161] A motion component. This motion component is connected to the calibration device and is used to receive motion commands from the upper layer. It executes these commands to cause the calibration device to move along a preset trajectory to achieve the target pose. Specifically, the motion commands are issued by the main control module.
[0162] During the movement, the monocular camera is used to capture images of the calibration board to obtain first camera data. The IMU is used to acquire first IMU data at a specified frequency.
[0163] The main control module is connected to both the calibration device and the motion component. It is used to issue motion commands to the motion component and to preprocess the first camera data and the first IMU data according to a preset program.
[0164] The main control module is also used to calculate the optimal transformation matrix and calibration error between the camera coordinate system and the IMU coordinate system using the Kalibr calibration toolbox.
[0165] Another embodiment of the monocular camera-IMU joint calibration system provided in this application, based on the above system embodiment, in the monocular camera-IMU joint calibration system, the main control module is also used to indirectly control the calibration device to perform the following actions:
[0166] The calibration device is controlled to perform reciprocating motion along the first axis direction within a first preset distance, repeating the motion a preset number of times.
[0167] The calibration device is controlled to perform reciprocating motion within a second preset distance along the second axis direction, repeating the motion a preset number of times.
[0168] The calibration device is controlled to perform reciprocating motion along the third axis direction within a third preset distance, repeating the motion a preset number of times.
[0169] The calibration device is controlled to perform reciprocating motion within the first preset distance along the first axis direction. While performing the reciprocating motion, the calibration device is controlled to rotate around the vertical direction perpendicular to the calibration plate as an axis, repeating the motion a preset number of times.
[0170] The calibration device is controlled to perform reciprocating motion within the second preset distance along the second axis direction. While performing the reciprocating motion, the calibration device is controlled to perform lateral swing motion within a specified angle, repeating the motion a preset number of times.
[0171] The calibration device is controlled to perform reciprocating motion within the third preset distance along the third axis direction. While performing the reciprocating motion, the calibration device is controlled to perform pitch motion within a specified angle, repeating the motion a preset number of times.
[0172] In other embodiments of this example, the first axis, the second axis, and the third axis correspond to any one of the X-axis, Y-axis, and Z-axis in the three-dimensional spatial coordinate system.
[0173] During the movement of the calibration equipment, the calibration plate remains within the data acquisition area of the calibration equipment.
[0174] Another embodiment of a monocular camera-IMU joint calibration system provided in this application, wherein the main control module in the monocular camera-IMU joint calibration system is specifically used for:
[0175] A preset video frame processing program is used. This program extracts video frame images from the first camera data according to the target frame rate parameter and saves them according to a specified Unix timestamp format to obtain the second camera data.
[0176] A preset IMU timestamp processing procedure is used. Through this procedure, tags are added sequentially to the data obtained under each of the motion trajectories in the first IMU data. The timestamp data is then reconstructed according to a specified format and saved to obtain the second IMU data.
[0177] The method and system for joint calibration of a monocular camera and an IMU in this application have the same technical concept, and the technical details of the embodiments of the two are applicable to each other. To reduce repetition, they will not be described again here.
[0178] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of program modules is merely an example. In practical applications, the above functions can be assigned to different program modules as needed, that is, the internal structure of the device can be divided into different program units or modules to complete all or part of the functions described above. The program modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one processing unit. The integrated unit can be implemented in hardware or as a software program unit. Furthermore, the specific names of the program modules are only for easy differentiation and are not intended to limit the scope of protection of this application.
[0179] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0180] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0181] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; the division of modules or units is merely a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling or direct coupling or communication connection may be through some interface; the indirect coupling or communication connection of apparatus or units may be electrical, mechanical, or other forms.
[0182] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment, depending on actual needs.
[0183] Furthermore, the functional units in the various embodiments of this application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The integrated unit described above can be implemented in hardware or as a software functional unit.
[0184] Although preferred embodiments of this application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of this application.
[0185] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
Claims
1. A method for joint calibration of a monocular camera and an IMU, characterized in that, include: The calibration device is controlled to move according to a preset motion trajectory. The calibration device includes a monocular camera and an inertial measurement unit (IMU), and the monocular camera and the IMU are rigidly connected. During the movement, the monocular camera captures data from the calibration board to obtain first camera data; the IMU acquires first IMU data at a specified frequency; the calibration board is fixed on a vertical plane and is provided with feature calibration points. The first camera data and the first IMU data are preprocessed using a preset program. Using the Kalibr calibration toolbox, the optimal transformation matrix between the camera coordinate system and the IMU coordinate system, as well as the calibration error, are calculated. The control calibration device moves according to a preset motion trajectory, including: A three-dimensional spatial coordinate system is established with the calibration device as the origin; The calibration device is controlled to perform reciprocating motion within a first preset distance along the first axis direction, repeating this motion a preset number of times. The calibration device is controlled to perform reciprocating motion within a second preset distance along the second axis direction, repeating this motion a preset number of times. The calibration device is controlled to perform reciprocating motion within a third preset distance along the third axis direction, repeating this motion a preset number of times. The calibration device is controlled to perform a reciprocating motion within the first preset distance along the first axis direction. While performing the reciprocating motion, the calibration device is controlled to rotate around the vertical direction perpendicular to the calibration plate as an axis, repeating the motion a preset number of times. The calibration device is controlled to perform a reciprocating motion within the second preset distance along the second axis direction. While performing the reciprocating motion, the calibration device is controlled to perform a lateral swing motion within a specified angle, repeating the motion a preset number of times. The calibration device is controlled to perform reciprocating motion within the third preset distance along the third axis direction. While performing the reciprocating motion, the calibration device is controlled to perform pitch motion within a specified angle, repeating the process a preset number of times. The first axis, the second axis, and the third axis correspond to any one of the X-axis, Y-axis, and Z-axis in the three-dimensional spatial coordinate system, respectively; during the movement of the calibration device, the calibration plate is always within the data acquisition area of the calibration device.
2. The method for joint calibration of a monocular camera and IMU as described in claim 1, characterized in that, The preprocessing of the first camera data and the first IMU data through a preset program includes: A preset video frame processing program is used to extract video frame images from the first camera data according to the target frame rate parameter, and save the video frame images according to the specified Unix timestamp format to obtain the second camera data. A preset IMU timestamp processing program is used; through the IMU timestamp processing program, labels are added to the data obtained under each of the motion trajectories in the first IMU data, the timestamp data is reconstructed according to the specified format and saved to obtain the second IMU data.
3. The method for joint calibration of a monocular camera and IMU as described in claim 2, characterized in that, The process of extracting video frame images from the first camera data according to the target frame rate parameter using the video frame processing program, and saving the video frame images according to the specified Unix timestamp format, includes: The initial frame rate and initial timestamp of the first camera data are obtained through the video frame processing program for program initialization. Obtain the preset target frame rate parameters and the relevant parameters of the specified Unix timestamp format; The frame extraction interval coefficient and timestamp precision conversion coefficient are calculated using the obtained parameters. Iterate through each frame of the first camera data and extract the video frame image according to the frame extraction interval coefficient; The initial timestamp is converted using the timestamp precision conversion factor; the video frame image is named and saved using the timestamp format after precision conversion.
4. The method for joint calibration of a monocular camera and IMU as described in claim 3, characterized in that, The process of reconstructing and saving timestamp data according to a specified format includes: The IMU timestamp processing program iterates through each motion trajectory to obtain the initial timestamp data from the first IMU data. The initial timestamp data is recalculated and saved based on the timestamp precision conversion coefficient.
5. The method for joint calibration of a monocular camera and IMU as described in claim 2, characterized in that, The calculation of the optimal transformation matrix and calibration error between the camera coordinate system and the IMU coordinate system using the Kalibr calibration toolbox includes: A camera coordinate system is established with the monocular camera as the origin; an IMU coordinate system is established with the IMU as the origin. Using the three-dimensional spatial coordinate system, the relative coordinate positions of the feature calibration points on the calibration plate in the camera coordinate system and the IMU coordinate system during the movement of the calibration device can be deduced. Calculate the relative rotation angle and relative translation of the feature calibration point in the camera coordinate system and the IMU coordinate system; Based on the relative rotation angle and relative translation amount, and by using the method of minimizing calibration error, the optimal transformation matrix between the camera coordinate system and the IMU coordinate system is calculated.
6. The method for joint calibration of a monocular camera and IMU as described in claim 5, characterized in that, The Kalibr calibration toolbox specifically performs the following calculation steps: The transformation relationship between the three-dimensional spatial coordinate system, the camera coordinate system, and the IMU coordinate system is derived using the following formula: ; ; Expanding equation (1.2), we get: ; ; in, This is the transformation matrix from the three-dimensional spatial coordinate system to the IMU coordinate system. The relative rotation angle between the three-dimensional spatial coordinate system and the IMU coordinate system. This represents the relative translation between the three-dimensional spatial coordinate system and the IMU coordinate system. This is the transformation matrix from the 3D spatial coordinate system to the camera coordinate system. The relative rotation angle between the 3D spatial coordinate system and the camera coordinate system. This represents the relative translation between the 3D spatial coordinate system and the camera coordinate system. This is the transformation matrix from the camera coordinate system to the IMU coordinate system. The relative rotation angle between the camera coordinate system and the IMU coordinate system. This represents the relative translation between the camera coordinate system and the IMU coordinate system. Align the camera rotation angle obtained by tracking the feature calibration points with the IMU rotation angle, and calculate the relative rotation angle between the camera coordinate system and the IMU coordinate system. ; In a unit time interval [t, t+1], the attitude changes of the monocular camera and the IMU are represented by quaternions as follows: and Because the monocular camera and the IMU are rigidly connected, therefore the and Synchronization; Quaternions for transformation from the camera coordinate system to the IMU coordinate system The following rotational relationship must be satisfied: ; in, Represented as quaternions Conjugate; The optimal quaternion is obtained by maximizing equation (1.5). : ; The obtained optimal quaternion Converting to matrix form yields the optimally estimated relative rotation angle between the camera coordinate system and the IMU coordinate system. : ; The optimal estimated relative translation between the camera coordinate system and the IMU coordinate system is calculated using equation (1.8). : ; Among them, The camera translation amount obtained by tracking the feature calibration point within a unit time interval [t, t+1]; The IMU translation amount obtained by tracking the feature calibration point within a unit time interval [t, t+1]. The optimal estimated relative rotation angle between the camera coordinate system and the IMU coordinate system; The calibration error is jointly optimized nonlinearly by using a nonlinear least squares algorithm. The calibration error includes reprojection error, IMU error, and initial value error. By iterating multiple times to minimize the calibration error, the optimal transformation matrix between the camera coordinate system and the IMU coordinate system is obtained. : 。 7. A system for joint calibration of a monocular camera and an IMU, characterized in that, The system is used to implement the method for monocular camera-IMU joint calibration as described in any one of claims 1-6, comprising: Calibration equipment; the calibration equipment includes a monocular camera and an inertial measurement unit (IMU), wherein the monocular camera and the IMU are rigidly connected; A calibration plate; the calibration plate is fixed on a vertical plane, and the calibration plate is provided with characteristic calibration points; the calibration plate meets the target illumination conditions; Motion component; the motion component is connected to the calibration device and is used to receive upper-level motion commands and execute the motion commands to make the calibration device move according to a preset motion trajectory to achieve the target pose; During the movement, the monocular camera is used to photograph the calibration board to obtain first camera data; the IMU is used to acquire first IMU data at a specified frequency. The main control module is connected to both the calibration device and the motion component; it is used to send motion commands to the motion component and to preprocess the first camera data and the first IMU data through a preset program. The main control module is also used to calculate the optimal transformation matrix and calibration error between the camera coordinate system and the IMU coordinate system using the Kalibr calibration toolbox; Specifically, the motion component is used to execute the following motion commands: A three-dimensional spatial coordinate system is established with the calibration device as the origin; The calibration device is controlled to perform reciprocating motion within a first preset distance along the first axis direction, repeating this motion a preset number of times. The calibration device is controlled to perform reciprocating motion within a second preset distance along the second axis direction, repeating this motion a preset number of times. The calibration device is controlled to perform reciprocating motion within a third preset distance along the third axis direction, repeating this motion a preset number of times. The calibration device is controlled to perform a reciprocating motion within the first preset distance along the first axis direction. While performing the reciprocating motion, the calibration device is controlled to rotate around the vertical direction perpendicular to the calibration plate as an axis, repeating the motion a preset number of times. The calibration device is controlled to perform a reciprocating motion within the second preset distance along the second axis direction. While performing the reciprocating motion, the calibration device is controlled to perform a lateral swing motion within a specified angle, repeating the motion a preset number of times. The calibration device is controlled to perform reciprocating motion within the third preset distance along the third axis direction. While performing the reciprocating motion, the calibration device is controlled to perform pitch motion within a specified angle, repeating the process a preset number of times. The first axis, the second axis, and the third axis correspond to any one of the X-axis, Y-axis, and Z-axis in the three-dimensional spatial coordinate system, respectively; during the movement of the calibration device, the calibration plate is always within the data acquisition area of the calibration device.
Citation Information
Patent Citations
Automation method for IMU-camera joint calibration
CN109949370A
Method and apparatus for processing video data
CN114679576A
