Sliding window optimization method for visual-inertial SLAM system based on common view projection matching
Through common-view projection matching and the construction of multiple constraint factors, the sliding window of the visual-inertial SLAM system is optimized, which solves the problem of low sliding window optimization accuracy, improves pose estimation accuracy and positioning accuracy, and ensures the rapidity of the system.
Patent Information
- Application Number
- CN202311384144.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-24
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2043-10-24
AI Technical Summary
The sliding window optimization method in the backend of the existing visual-inertial SLAM system has low accuracy and cannot effectively improve the accuracy of pose estimation in large-scale scene environments.
The visual inertial SLAM system sliding window optimization method based on common-view projection matching is used to eliminate ghost map points, increase the observation field of view of key frames, and construct visual constraint factors and IMU predictions through projection matching of common-view map points in the sliding window. The integral constraint factor and the marginalization prior constraint factor are added to the sliding window factor graph optimization model for nonlinear optimization.
It improves the observation accuracy of map points and the accuracy of pose estimation, ensuring the rapid optimization operation of the SLAM system while taking into account the improvement of positioning accuracy.
Smart Images

Figure CN117421384B
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of SLAM. Background Art
[0002] SLAM (Simultaneous Localization and Mapping) technology enables mobile robots to achieve autonomous navigation, positioning and planning. Through one or more sensor devices carried by the mobile robot itself, it can perceive environmental information, measure its own posture, track the posture of the mobile robot itself, locate its position relative to the surrounding environment, and build an environmental map at the same time. The SLAM system can be divided into two parts: the front end and the back end. The front end realizes functions such as environmental perception, posture tracking, and loop detection, while the back end realizes functions such as posture optimization, trajectory correction, and map construction. The front end mainly completes data processing-related tasks so that SLAM can display and update interactive information in real time, and the back end mainly completes optimization-related tasks such as eliminating cumulative errors, which are computationally intensive and time-consuming. The back-end optimization methods of SLAM are divided into filtering method and nonlinear optimization method. The filtering method estimates the posterior probability of the mobile robot's posture through prediction and measurement information based on Bayesian theory, thereby realizing the update of its posture. However, the covariance matrix and the state quantity are in a square growth relationship, resulting in too much data and is not suitable for use in large scene environments. The nonlinear optimization method incorporates the mobile robot's posture information, measurement constraint relationships, and even the location information of map points into the factor graph model, and realizes the overall update of its state estimation through nonlinear optimization methods.
[0003] At present, nonlinear optimization methods are the mainstream solution for SLAM backend processing. In order to achieve the purpose of quickly correcting and updating the posture state of the mobile robot, the SLAM backend usually adopts a local optimization method, that is, a part of the key frames are selected for local posture optimization, so as to speed up the response speed of the backend optimization. The sliding window method is a classic local area screening optimization method. By setting a sliding window with a fixed number of key frames, a constraint relationship model for visual and inertial measurements is established in the local area, and then the model is optimized. The sliding window method is often used for local area screening in the optimization of the SLAM backend of visual inertial fusion. Typical examples include "VINS-Mono: A Robust and VersatileMonocular Visual-Inertial State Estimator" written by Shen Shaojie's team at the Hong Kong University of Science and Technology, and "Keyframe-based Visual-inertial SLAM using Nonlinear Optimization" by Leutenegger et al. The sliding window method updates the keyframes in the sliding window through the Schur complement operation, marginalizes the keyframes that slide in or out while retaining the constraint relationship between the keyframes, and ensures that the number of keyframes in the sliding window remains unchanged, so that the SLAM system can complete the optimization calculation in a faster time. However, the optimization accuracy cannot be guaranteed. The optimization accuracy is completely determined by the quality of the keyframes and the error constraint relationship. Therefore, the traditional visual inertial SLAM system needs to further improve its back-end sliding window optimization method to improve its optimization accuracy. Summary of the invention
[0004] The present invention aims to solve the problem of low precision of the sliding window optimization method of the back end of the existing visual inertial SLAM system, and now provides a visual inertial SLAM system sliding window optimization method based on common view projection matching.
[0005] The sliding window optimization method of the visual inertial SLAM system based on common view projection matching of the present invention comprises the following steps:
[0006] Step 1: When the back-end module of the visual inertial SLAM system subscribes to the latest frame image of the robot released by its front-end module, it determines whether the sliding window is full. If so, it executes step 2, otherwise it executes step 4;
[0007] Step 2: Determine whether the next newest frame image is a key frame, if so, marginalize the oldest frame image in the sliding window and then execute step 3, otherwise marginalize the next newest frame image and then execute step 3;
[0008] Step 3: Reconstruct the constraint relationship of the sliding window according to the Schur complement theory, and then execute step 4;
[0009] Step 4: Determine whether the latest frame image is a key frame based on the disparity between the latest frame image and the current latest key frame image in the sliding window. If yes, project the map points in the sliding window onto the latest frame image. The map points are the map points observed by the key frames in the sliding window that can be viewed together with the latest frame image. Then execute step 5. Otherwise, update the IMU constraint relationship corresponding to the latest frame image, and then return to step 1.
[0010] Step 5: Match the projection points on the latest frame image with the feature points, delete the projection points that are not matched with the feature points, and determine whether the feature points with matching projection points have original map points. The original map points are map points that can correspond to the feature points in the sliding window before matching. If yes, execute step 6, otherwise execute step 7;
[0011] Step 6: Compare the number of observations of the map point corresponding to the projection point and the original map point corresponding to the feature point, and only retain the map point with a large number of observations, so that the visual observation constraints of each key frame in the sliding window are updated, and then execute step 8;
[0012] Step 7: adding a new map point so that an observation constraint is established between the latest frame image and the newly added map point, and then executing step 8;
[0013] Step 8: Determine whether the number of key frames in the sliding window is full, if yes, execute step 9, otherwise return to step 1;
[0014] Step nine: construct a visual constraint factor, an IMU pre-integration constraint factor, and a marginalization prior constraint factor respectively, and add the visual constraint factor, the IMU pre-integration constraint factor, and the marginalization prior constraint factor to the sliding window factor graph optimization model to construct an objective function;
[0015] Step 10: Optimize the objective function using a nonlinear optimization algorithm, update the state of the robot in the sliding window, and complete the sliding window optimization.
[0016] Furthermore, the step 2 of marginalizing the oldest frame image in the sliding window includes:
[0017] Delete the oldest frame image and its corresponding IMU constraint relationship in the sliding window, and retain the visual constraint relationship of the oldest frame image;
[0018] The marginalization of the next new frame image in step 2 includes:
[0019] The next-to-latest frame image and its visual constraint relationship are deleted, and the IMU constraint relationship corresponding to the next-to-latest frame image is retained.
[0020] Furthermore, the above step 3 reconstructs the constraint relationship of the sliding window according to the Schur complement theory, including:
[0021] The state variable χ of all image frames in the sliding window is expressed as an incremental equation as follows:
[0022]
[0023] Among them, δχ d is the state vector to be marginalized, δχ s is the retained state vector, H a is δχ d The covariance matrix, H c is δχ s The covariance matrix of Indicates H b The transpose of H b is δχ d With δχ s The covariance matrix between d and b s are δχ d and δχ s constant vector;
[0024] According to the Schur complement theory, Gaussian elimination is performed on the incremental equation of the state variable χ and the following is derived:
[0025]
[0026] Then, according to the above formula, the retained state vector δχ is obtained s , realizing the reconstruction of sliding window constraint relationship.
[0027] Furthermore, in the above step 5, if the projection point on the latest frame image matches the descriptor of the feature point, then the projection point matches the feature point.
[0028] Furthermore, in the above step nine, the state quantity to be optimized of the visual constraint factor χ c for:
[0029]
[0030] in, and are the positions of the camera in the i-th frame and the j-th frame respectively, and are the postures of the camera in the i-th frame and the j-th frame, respectively. The i-th frame and the j-th frame are two adjacent key frames. and are the position and rotation of the camera relative to the IMU, and λ is the inverse depth of the map point.
[0031] Further, in the above step nine, the variable to be optimized x of the IMU pre-integration constraint factor is imu for:
[0032]
[0033] in, and t i Time and t j The speed of the IMU at that moment, and t i Time and t j The accelerometer bias of the IMU at the moment, and t i Time and t j The gyroscope bias of the IMU at time t i Time and t j The moments are the moments when the camera takes the i-th image frame and the j-th image frame respectively.
[0034] Furthermore, in the above step nine, the objective function expression is as follows:
[0035]
[0036] Among them, χ is the state variable of all image frames in the sliding window and has k∈[0,N],λ m is the inverse depth of the mth map point, m is the total number of map points observed in the key frame image, N is the total number of all frame images in the sliding window, and the state vector of the kth frame and are the position, velocity and posture of the camera in the kth frame, b a and b ω They are the accelerometer bias and gyroscope bias of the IMU respectively. and are the position and rotation of the camera relative to the IMU, e C (x i ,x j ), e B (x i ,x j ) and e M They represent the visual constraint residual, IMU pre-integrated constraint residual and marginalized prior constraint residual, respectively, i and xj are the state vectors of the i-th frame image and the j-th frame image respectively.
[0037] Furthermore, the above visual constraint residual e C (x i ,x j ) is expressed as follows:
[0038]
[0039] in, is the projection coordinate of the map point P in the space on the normalized plane of the j-th frame image, It is the observed coordinates of the map point P in the space when it is first observed in the j-th frame image.
[0040] Furthermore, the above IMU pre-integration constraint residual e B (x i ,x j ) is expressed as:
[0041]
[0042] Among them, r p 、r q 、r v , t i Time to t j The position residual, attitude residual, velocity residual, accelerometer residual and gyroscope residual of the robot at the moment t i Time and t j The moments are the moments when the camera takes the i-th image frame and the j-th image frame respectively.
[0043] Furthermore, the above marginalized prior constrained residual e M The expression is:
[0044] e M =b p -H p δχ 1:N ,
[0045] Among them, δχ 1:N is the state increment of all key frames in the sliding window,
[0046]
[0047] H a is the state vector δχ to be marginalized d The covariance matrix, H c is the retained state vector δχ s The covariance matrix of Indicates Hb The transpose of H b is δχ d With δχ s The covariance matrix between d and b s are δχ d and δχ s Constant vector.
[0048] The beneficial effects of the invention are as follows:
[0049] The present invention improves the sliding window optimization method of the SLAM backend and proposes a sliding window optimization method for a visual inertial SLAM system based on common view projection matching.
[0050] This method solves the problem of ghosting caused by the same map point being created multiple times in different SLAM operation stages or different threads by matching the projections of the common-view map points in the sliding window. These "shadow" map points are merged into one map point, which improves the observation accuracy of the map points and thus improves the accuracy of the SLAM system in estimating the position and posture of the mobile robot.
[0051] Furthermore, the present invention increases the number of map points successfully matched by the latest key frame by screening the projection points of common view matching, expands the observation field of the key frame, and adds visual observation constraints to the SLAM system, thereby improving the accuracy of the sliding window optimization estimation of the pose, and further improving the accuracy of the SLAM system in locating the position of the mobile robot.
[0052] Furthermore, the present invention does not change the size of the sliding window optimization area, and the number of key frames to be optimized that the sliding window can accommodate remains fixed, which can ensure the rapidity of the optimization operation, thereby ensuring the rapidity of the visual inertial SLAM operation, while also improving the accuracy of SLAM in positioning and posture estimation of the mobile robot. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] Figure 1 It is a flowchart of the visual inertial SLAM system;
[0054] Figure 2 It is a flowchart of the sliding window optimization method of the visual inertial SLAM system based on common view projection matching described in the specific implementation method;
[0055] Figure 3 Schematic diagram of the sliding window update process when the next latest frame image is a key frame;
[0056] Figure 4 Schematic diagram of the sliding window update process when the next latest frame image is not a key frame;
[0057] Figure 5A schematic diagram of the co-viewing relationship between the current key frame and its co-viewing key frame;
[0058] Figure 6 It is a schematic diagram of the projection matching relationship between the latest key frame in the sliding window and its co-viewing key frame;
[0059] Figure 7 Schematic diagram of the sliding window factor graph optimization model for visual-inertial fusion;
[0060] Figure 8 The UAV flight trajectory map estimated by our-VINS-Mono on the Machine Hall 01 dataset;
[0061] Fig. 9 for Figure 8 The relationship curve between the displacement change of the flight trajectory on the three coordinate axes of x, y and z and time;
[0062] Fig.10 To evaluate the absolute pose error (APE) Figure 8 The relationship between the APE curve of the flight trajectory and time is shown, and the root mean square error (rmse), median error (median), mean error (mean) and standard deviation (std) of the global trajectory are given;
[0063] Fig.11 Comparison of the APE error box plots of the flight trajectories estimated by VINS-Mono and our-VINS-Mono on the Machine Hall 01 dataset;
[0064] Fig.12 Comparison of the APE errors of the flight trajectories estimated by VINS-Mono and our-VINS-Mono on the Machine Hall 01 dataset under different error evaluation indicators;
[0065] Fig.13 The flight trajectories estimated by VINS-Mono and our-VINS-Mono on the Machine Hall 01 dataset, and the comparison of the density distribution of trajectory errors and the relationship between APE errors. DETAILED DESCRIPTION
[0066] The following will be combined with the accompanying drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than 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 belong to the scope of protection of the present invention. It should be noted that the embodiments of the present invention and the features in the embodiments can be combined with each other without conflict.
[0067] Reference Figures 1 to 13 Specifically describing this embodiment, the sliding window optimization method of the visual inertial SLAM system based on common view projection matching described in this embodiment includes the following steps:
[0068] Step 1: Set the sliding window size to accommodate N number of key frames to be optimized.
[0069] Step 2: Use the back-end module of the visual inertial SLAM system to subscribe to the posture status information of the mobile robot published by the front-end module. When the back-end module collects a new image frame, it determines whether the sliding window is full. If it is full, it is necessary to update the sliding window and execute step 3; if it is not full, execute step 4.
[0070] Step 3: Determine whether the disparity between the latest frame image and the current latest key frame image in the sliding window reaches a threshold.
[0071] If the threshold is reached, the next newest frame is a key frame. At this time, the oldest frame in the sliding window needs to be marginalized, that is, the oldest frame in the sliding window and its corresponding IMU constraint relationship are deleted, and the visual constraint relationship of the oldest frame is retained, that is, the map point constraint relationship observed by the oldest frame is stored in the key frame in the sliding window that has a common view relationship with the oldest frame. Reconstruct the constraint relationship of the sliding window according to the Schur complement theory, and then execute step 5.
[0072] If the threshold is not reached, the next-new frame image is not a key frame. In this case, the next-new frame image is marginalized, that is, the next-new frame image and its visual constraint relationship in the sliding window are deleted, and the IMU constraint relationship corresponding to the next-new frame image is retained. The constraint relationship of the sliding window is reconstructed according to the Schur complement theory, and then step 5 is executed.
[0073] Step 3 implements the update function of the key frame in the sliding window. Depending on whether the next newest frame is a key frame, it is decided to slide in or slide out the sliding window. If the next newest frame is a key frame, the oldest frame in the sliding window is marginalized, that is, slide out. Figure 3 The following is a schematic diagram of sliding window update when the next latest frame is a key frame. If the next latest frame is not a key frame, the next latest frame is marginalized, i.e., it is updated by sliding in. Figure 4A schematic diagram of sliding window update is given when the next latest frame is not a key frame.
[0074] The purpose of updating the sliding window is to add and delete keyframes in the sliding window area while preserving the keyframe constraints. The essence of choosing to update by sliding in or sliding out is to make the keyframes in the sliding window have the largest field of view, avoiding the narrow and overlapping fields of view of these keyframes. The process of deleting a keyframe from the sliding window while still preserving the keyframe constraints is called marginalizing the keyframe from the sliding window, which is usually achieved by the Schur complement method.
[0075] The state variables χ of all image frames in the sliding window construct the least squares expression in the sliding window and simplify it to the form of Hδχ=b, where H is the system covariance matrix, δχ is the increment of the state quantity, and b is a constant vector. The state variables χ are divided into two categories, namely, the state quantity δχ to be marginalized d And the state quantity δχ that needs to be retained s . Split the system covariance matrix H into four block matrices H a , H c , H b , H a is δχ d The covariance matrix of H is the marginalized variable; c is δχ s The covariance matrix of , that is, the covariance matrix of the retained state variables; Indicates H b The transpose of H b is δχ d With δχ s The covariance matrix between .
[0076] The state variable χ is expressed as an incremental equation as follows:
[0077]
[0078] Among them, b d and b s are δχ d and δχ s Constant vector.
[0079] According to the Schul complement theory, without calculating the marginalized state quantity δχ d In the case of s , and perform Gaussian elimination to obtain:
[0080]
[0081] in, Indicates Ha In H b According to the above formula, we can deduce δχ s for:
[0082]
[0083] The only state quantity in the above formula is δχ s , so that the constraint information of the marginalized keyframes can be retained, and the state quantity of the marginalized keyframes can be eliminated without losing accuracy. In the marginalization process, although the state variables are constantly updated, the linearization point is fixed by optimizing the consistency strategy, that is, when calculating the marginalized Jacobian matrix, the value of the derivative variable is fixed, instead of using the state variables updated after each iteration to calculate the Jacobian, so as to ensure the unobservable dimension of the system and avoid changes in the null space of the covariance matrix.
[0084] Step 4: Determine whether the latest frame image is a key frame.
[0085] If it is a key frame, it is called the latest key frame. Project the map points in the sliding window onto the latest frame image, the map points being the map points observed by the key frame in the sliding window that can be viewed together with the latest frame image, and then execute step 5.
[0086] If it is not a key frame, only update the IMU constraint relationship corresponding to the latest frame image, and then return to step 2.
[0087] Step 5: Determine whether the projection points on the latest frame image can be successfully matched with the feature points on the latest frame image (two-dimensional feature points in the image plane, extracted using the ORB or SIFT method), that is, the projection points on the latest frame image match the descriptors of the feature points. If a projection point cannot find a matching point in the feature points of the latest key frame, then discard the projection point; if a projection point can find a matching point in the feature points on the latest key frame, then determine whether the feature point with the matching projection point has an original map point. The original map point is a map point that can correspond to the feature point in the sliding window before matching. If so, execute step 6, otherwise execute step 7.
[0088] Step 6: Compare the number of observations of the map point corresponding to the projection point and the original map point corresponding to the feature point, retain the map point with more observations and update the visual observation constraints of each key frame in the sliding window, delete the map point with less observations, that is, replace the map point. Then execute step 8.
[0089] Step 7: Add a new map point so that an observation constraint is established between the latest frame image and the newly added map point, that is, the map point is added. Then execute step 8.
[0090] For steps 5, 6, and 7, all map points that can be observed by all key frames that are co-viewed with the latest key frame are projected onto the latest key frame. Further processing measures for the map points are determined based on the relationship between the projected points and the feature points and whether the feature points originally have corresponding map points. Figure 5 As shown in the figure, a schematic diagram of the co-view relationship between the current keyframe and its co-view keyframe is given. The same map point may be observed at different stages of the mobile robot's motion, or may be created in different threads of the SLAM system, resulting in the "shadow" map point phenomenon. By performing projection matching on the map points and replacing the map points, the "shadow" map points can be screened, thereby improving the accuracy of the map points; by adding new map points, the field of view of the keyframe observing the map points can be increased, and the number of keyframes successfully matching the map points can be increased, thereby increasing the visual observation constraint relationship.
[0091] Projection matching of map points is performed based on the camera visual imaging perspective relationship. Figure 6 A schematic diagram of the projection matching relationship between the latest keyframe in the sliding window and its co-view keyframe is given. In the projection calculation, the pose of the keyframe is estimated by the SLAM tracking module. Even if the pose accuracy is not high, it does not matter. Candidate matching feature points can be found in the circular neighborhood of the projection point, and the pose is continuously optimized and corrected by the SLAM backend. The following formula gives the perspective projection coordinate transformation expression of the pinhole camera model from a 3D map point to a 2D image:
[0092]
[0093] In the above formula, It is the homogeneous coordinate of the projection point in the pixel coordinate system on the imaging plane, and u and v are the horizontal and vertical coordinates of the projection point in the pixel coordinate system respectively. x and f y are the focal lengths of the camera in the horizontal and vertical directions, c x and c y are the horizontal and vertical pixel numbers of the difference between the center pixel coordinate of the image and the pixel coordinate of the image origin. Z is the depth value of the optical axis when transforming from the camera coordinate system to the normalized coordinate system, R is the rotation matrix of the mobile robot, t is the translation vector of the mobile robot, is the homogeneous coordinate of the map point in the world coordinate system, x w ,y w 、z w They are the coordinate values of the three axes in the world coordinate system, K is the camera intrinsic parameter matrix, and T represents the transformation matrix of the camera pose.
[0094] Step 8: Determine whether the number of key frames in the sliding window is full. If not, return to step 2; if full, execute step 9.
[0095] Step 9: Based on the visual reprojection perspective relationship, construct the visual constraint factor between the position and map point of the mobile robot. According to the IMU (Inertial Measurement Unit) pre-integration theory, construct the IMU pre-integration constraint factor. According to the marginalization processing result of the updated sliding window, construct the prior constraint factor. Add the visual constraint factor, IMU pre-integration constraint factor and marginalization prior constraint factor to the sliding window factor graph optimization model to construct the objective function. Figure 7 A schematic diagram of the sliding window factor graph optimization model constructed by three constraint factors is given.
[0096] According to the sliding window factor graph optimization model, the tightly coupled bundle adjustment optimization objective function is established. By minimizing the sum of the visual constraint residual, the IMU pre-integrated constraint residual, and the marginalized prior constraint residual, the maximum a posteriori probability estimate of the state is obtained. The form is as follows:
[0097] State variables of all frame images in the sliding window N is the total number of image frames in the sliding window, λ m is the inverse depth of the mth map point, m is the total number of map points observed in the key frame image, and the objective function expression is as follows:
[0098]
[0099] Among them, the state vector of the kth frame and are the position, velocity and posture of the camera in the kth frame, b a and b ω They are the accelerometer bias and gyroscope bias of the IMU respectively, and are the position and rotation of the camera relative to the IMU, e C (x i ,x j )、e B (x i ,x j ) and e M They represent the visual constraint residual, IMU pre-integrated constraint residual and marginalized prior constraint residual, respectively, i and x j are the state vectors of the i-th frame image and the j-th frame image respectively.
[0100] The visual constraint factor is constructed based on the reprojection error. The map point in space is projected onto each key frame that can observe the map point. The coordinates of the projected point should coincide with the observed coordinates of the map point. The reprojection error of the two types of coordinates is the residual of the visual constraint factor. In the visual-inertial SLAM system, the state quantity χ of the visual factor to be optimized is c It is expressed as:
[0101]
[0102] in, and are the positions of the camera in the i-th frame and the j-th frame respectively, and are the postures of the camera in the i-th frame and the j-th frame, respectively. The i-th frame and the j-th frame are two adjacent key frames. and are the position and rotation of the camera relative to the IMU, and λ is the inverse depth of the map point.
[0103] Assume that there is a map point P in the space, its index number is l, and its projection coordinates on the normalized plane of the jth frame are The observation coordinates in the jth frame are Then there is a visual constraint residual e C (x i ,x j ) is expressed as follows:
[0104]
[0105] in, It can be obtained from the estimated model of reprojection, and the expression is:
[0106]
[0107] In the above formula, It represents the observation value of the map point P on the normalized plane of the i-th frame when it is first observed in the i-th frame. is the rotation from the IMU coordinate system to the camera coordinate system, is the rotation from the world coordinate system to the j-th frame IMU coordinate system, is the rotation amount from the IMU coordinate system to the world coordinate system in the i-th frame, is the rotation from the camera coordinate system to the IMU coordinate system.
[0108] The IMU pre-integration constraint factor is used to describe the relative position change relationship of the IMU measurement information between the time difference of two key frames. Align the i and j moments of the IMU sampling with the kth and k+1th frames of the image, and the variable to be optimized of the IMU pre-integration factor is expressed as:
[0109]
[0110] in, and t i Time and t j The speed of the IMU at that moment, and t i Time and t j The accelerometer bias of the IMU at the moment, and t i Time and t j The gyroscope bias of the IMU at time t i Time and t j The moments are the moments when the camera takes the i-th frame and the j-th frame respectively.
[0111] The j The position of the IMU at this moment speed and posture Obtained by the following formula:
[0112]
[0113] Where Δt is the time interval between the i-th frame and the j-th frame, t i ≤t≤t j , is the rotation matrix from the IMU coordinate system to the world coordinate system, g w is the gravity vector in the world coordinate system, δt is the time interval between two adjacent IMU measurement data, The position of the carrier at the time t in the IMU coordinate system is taken as the reference, and the carrier is relative to t i The amount of rotation at that moment.
[0114] and They are the accelerometer bias and gyroscope bias of the IMU at time t respectively.
[0115] and Respectively represent the acceleration and angular velocity output by the IMU at time t, and Respectively represent the acceleration noise and angular velocity noise of the IMU measurement information at time t, and assume that they are white noises that obey Gaussian distribution. Transform the above formula, transform the reference coordinate system of the position, velocity and rotation from the world coordinate system to the body coordinate system of the i-th frame, and we can get:
[0116]
[0117] In the above formula That is, the IMU pre-integrated variables of position, velocity, and attitude, and the expressions are as follows:
[0118]
[0119] represents time t relative to t i IMU pre-integrated variables of the robot posture at time t.
[0120] It can be seen that the state quantity at the jth frame is only related to the measurement value of the IMU and will not be affected by the state quantity at the i-th frame, thus ensuring that the measurement value is independent of the state quantity and avoiding repeated integration. Then there is the IMU pre-integration constraint residual e B (x i ,x j ) is expressed as follows:
[0121]
[0122] Among them, r p 、r q 、r v , t i Time to t j The position residual, attitude residual, velocity residual, accelerometer residual and gyroscope residual of the robot at the moment t i Time and t j The moments are the moments when the camera takes the i-th and j-th frames of images, respectively. is the quaternion multiplication symbol, [·] xyz It means taking the imaginary part of the quaternion to form a three-dimensional vector. From the world coordinate system to t i The rotation of the IMU coordinate system at the moment (quaternion representation), From t i The IMU coordinate system at time t j The rotation of the IMU coordinate system at this moment (in quaternion notation).
[0123] The prior constraint factor is the constraint relationship that is retained after removing the marginalized keyframes when updating the sliding window. The least squares expression is constructed using the factor graph optimization model, and the state vector χ is set as a node, and the marginalized state vector χ d The pose information in the map points and the constraint relationship are added to the retained state vector χ in the form of prior information. s In the optimization relationship of , the loss of constraint information corresponding to the key frames that are marginalized after updating the sliding window is avoided. After marginalization, the prior matrix H pand the corresponding prior residual b p , which is consistent with the marginalization expression in step 3, which prior constrains the residual e M The expression is:
[0124] e M =b p -H p δχ 1:N ,
[0125] Among them, δχ 1:N is the state increment of all key frames in the sliding window,
[0126]
[0127] H a is the state vector δχ to be marginalized d The covariance matrix, H c is the retained state vector δχ s The covariance matrix of Indicates H b The transpose of H b is δχ d With δχ s The covariance matrix between d and b s are δχ d and δχ s Constant vector.
[0128] Step 10: Optimize the objective function using a nonlinear optimization algorithm, such as the Gauss-Newton method, the Levenberg-Marquadt method, etc. Taking the Levenberg-Marquadt method as an example, by setting a confidence region for the state increment, the approximation failure caused by the large change of the state increment is avoided, and the coefficient matrix of the linear equation system is avoided. The non-singularity and ill-conditioned problems are avoided, so that a more stable and accurate state increment can be provided. The objective function is constructed in the form of a state increment equation:
[0129] (H h +μI)Δχ=g,
[0130] In the above formula, H h is the Hessian matrix, μ is the Lagrange multiplier, and the accuracy of the nonlinear quadratic approximation model is reflected by adjusting the size of the parameter μ, and then the optimal solution is obtained by iterative optimization.
[0131] Update the poses of all key frames in the sliding window, complete a sliding window optimization, and determine whether the optimization thread of the SLAM backend is terminated. If not, return to step 2; if it is terminated, end.
[0132] Without changing the rapidity of sliding window optimization, this implementation improves the sliding window optimization method through common view projection matching relationships, eliminates "shadow" map points, and improves the accuracy of map points; increases the number of successfully matched map points in key frames, expands the observation field of key frames, and adds visual observation constraints to the SLAM system, thereby improving the accuracy of sliding window optimization estimation of pose, and further improving the positioning accuracy of the mobile robot.
[0133] Implementation and verification of the present invention:
[0134] The present invention proposes a visual inertial SLAM method based on common view projection matching and improved sliding window optimization, which is implemented by programming in C++ language. The beneficial effects of the present invention are verified by evaluating the accuracy of the motion trajectory of the mobile robot estimated by the SLAM system. Based on the visual inertial SLAM system - VINS-Mono framework, VINS-Mono using the improved sliding window optimization method proposed in the present invention is named our-VINS-Mono. The EuRoc flight data set published by the Swiss Federal Institute of Technology is used as a verification data set. The data set uses a micro-rotor aircraft as a carrier, equipped with a visible light camera sensor and an inertial measurement unit, which is used to perceive the surrounding environment information and measure the aircraft's own motion posture.
[0135] Taking the Machine Hall 01 data subset in the EuRoc flight dataset as an example, VINS-Mono and our-VINS-Mono are used to estimate the flight trajectory of the rotorcraft in the Machine Hall 01 dataset respectively, and then different evaluation indicators are used to evaluate the accuracy of the two trajectories. Figure 8 The estimated UAV flight trajectory diagram of our-VINS-Mono on the Machine Hall 01 dataset is given. Fig. 9 Given Figure 8 The relationship curve between the displacement change of the flight trajectory on the three coordinate axes of x, y and z and time; Fig.10 The absolute pose error (APE) is used to evaluate Figure 8 The relationship between the APE error curve of the flight trajectory and time is shown, and the root mean square error (rmse), median error (median), mean error (mean) and standard deviation (std) of the global trajectory are given. Fig.11This is a comparison of the APE error box plots of the flight trajectories estimated by VINS-Mono and our-VINS-Mono on the Machine Hall 01 dataset. It can be seen from the figure that the median APE error of our-VINS-Mono is significantly lower than that of VINS-Mono, and the error partition has shifted downward as a whole. Fig.12 This is a comparison of the APE errors of the flight trajectories estimated by VINS-Mono and our-VINS-Mono on the Machine Hall 01 dataset under different error evaluation indicators. It can be seen from the figure that the APE errors of our-VINS-Mono under the max (maximum error value), std, median, mean, and rmse indicators are all smaller than those of VINS-Mono, while the APE error under the min (minimum error) indicator is larger, indicating that the overall error tends to be close to the median, and the outliers have little impact on the overall error. Fig.13 This is a comparison of the flight trajectories estimated by VINS-Mono and our-VINS-Mono on the Machine Hall 01 dataset, and the density distribution of trajectory errors and the relationship between APE errors. It can be seen from the figure that the distribution of the errors of our-VINS-Mono is relatively concentrated, which is consistent with the fact that the errors in the box plot are concentrated on the median.
[0136] In summary, the present invention proposes a visual inertial SLAM method based on common view projection matching to improve sliding window optimization, which aims to optimize the position accuracy of map points, eliminate ghost map points, increase the observation constraints between key frames and map points, and improve the pose estimation accuracy of the visual inertial SLAM system by performing projection matching on the common view map points of key frames in the sliding window, thereby improving the positioning accuracy of the mobile robot. In the sliding window, all map points that can be observed by all key frames that have a common view relationship with the latest key frame are projected onto the latest key frame, and the matching relationship between each projection point and the feature point is determined. By replacing the map points, the "shadow" map points are eliminated, and redundant storage is avoided; by adding the map points, the number of successful matches between the key frames and the map points is increased, and the observation field of the key frames is expanded. In addition, the present invention does not change the size of the sliding window, and the sliding window still has a fixed number of key frames, which can ensure the rapidity of the operation time.
[0137] Although the present invention is described herein with reference to specific embodiments, it should be understood that these embodiments are merely examples of the principles and applications of the present invention. It should therefore be understood that many modifications may be made to the exemplary embodiments and that other arrangements may be devised without departing from the spirit and scope of the present invention as defined by the appended claims. It should be understood that the various dependent claims and features described herein may be combined in a manner different from that described in the original claims. It should also be understood that the features described in conjunction with a single embodiment may be used in other described embodiments.
Claims
1. A sliding window optimization method for a visual inertial SLAM system based on common view projection matching, characterized in that: The following steps are involved: Step 1: When the back-end module of the visual inertial SLAM system subscribes to the latest frame image of the robot released by its front-end module, it determines whether the sliding window is full. If so, it executes step 2, otherwise it executes step 4; Step 2: Determine whether the next newest frame image is a key frame, if so, marginalize the oldest frame image in the sliding window and then execute step 3, otherwise marginalize the next newest frame image and then execute step 3; Step 3: Reconstruct the constraint relationship of the sliding window according to the Schur complement theory, and then execute step 4; Step 4: Determine whether the latest frame image is a key frame based on the disparity between the latest frame image and the current latest key frame image in the sliding window. If yes, project the map points in the sliding window onto the latest frame image. The map points are the map points observed by the key frames in the sliding window that can be viewed together with the latest frame image. Then execute step 5. Otherwise, update the IMU constraint relationship corresponding to the latest frame image, and then return to step 1. Step 5: Match the projection points on the latest frame image with the feature points, delete the projection points that are not matched with the feature points, and determine whether the feature points with matching projection points have original map points. The original map points are map points that can correspond to the feature points in the sliding window before matching. If yes, execute step 6, otherwise execute step 7; Step 6: Compare the number of observations of the map point corresponding to the projection point and the original map point corresponding to the feature point, and only retain the map point with a large number of observations, so that the visual observation constraints of each key frame in the sliding window are updated, and then execute step 8; Step 7: adding a new map point so that an observation constraint is established between the latest frame image and the newly added map point, and then executing step 8; Step 8: Determine whether the number of key frames in the sliding window is full, if yes, execute step 9, otherwise return to step 1; Step nine: construct a visual constraint factor, an IMU pre-integration constraint factor, and a marginalization prior constraint factor respectively, and add the visual constraint factor, the IMU pre-integration constraint factor, and the marginalization prior constraint factor to the sliding window factor graph optimization model to construct an objective function; Step 10: Optimize the objective function using a nonlinear optimization algorithm, update the state of the robot in the sliding window, and complete the sliding window optimization.
Citation Information
Patent Citations
RGBD and IMU hybrid tracking registration method based on sliding window optimization
CN114529576A
Mobile robot positioning method based on depth camera and inertial fusion
CN115371665A
Event and distance fused visual inertial odometer method
CN115479602A
Camera motion state-based binocular-inertial fusion pose estimation method, electronic equipment and storage medium
CN116205947A
Inverse sliding-window filters for vision-aided inertial navigation systems
US20160327395A1
