Visual inertial positioning method based on lightweight optical flow network

Through lightweight optical flow network and multi-frame reprojection residual detection, combined with a tightly coupled nonlinear optimization framework, the accuracy and efficiency problems of visual inertial positioning under dynamic lighting are solved, and efficient positioning in dynamic lighting scenes is achieved. .

CN118548877APending Publication Date: 2024-08-27UNIV OF SCI & TECH OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410556528.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-07
Publication Date
2024-08-27

AI Technical Summary

Technical Problem

In dynamic lighting scenes, visual inertial odometry based on the traditional optical flow method is difficult to achieve accurate feature tracking, resulting in poor positioning results. Deep learning methods require large calculations and are difficult to predict in real time, and cannot meet online positioning needs.

Method used

A visual inertial positioning method based on a lightweight optical flow network is used to perform feature tracking through a lightweight optical flow network, combined with motion consistency detection of multi-frame reprojection residuals and a tightly coupled nonlinear optimization framework to identify and remove anomalies. Feature points to achieve visual inertial positioning.

Benefits of technology

It improves feature tracking performance in dynamic lighting scenes, improves positioning accuracy and computing efficiency, and achieves real-time pose estimation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118548877A
    Figure CN118548877A
Patent Text Reader

Abstract

The invention relates to the technical field of perception and positioning, and discloses a visual inertial positioning method based on a lightweight optical flow network, which comprises the following steps of: performing feature tracking based on the lightweight optical flow network: predicting a dense optical flow field for a pair of image frames by using the lightweight optical flow network; inquiring an optical flow value corresponding to each feature point in the dense optical flow field by using a bilinear interpolation method to obtain motion information of the dense optical flow field so as to track the feature points; identifying and removing abnormal feature points based on a motion consistency detection strategy of a multi-frame re-projection residual error; based on a tight coupling nonlinear optimization framework, the optimal pose estimation is obtained by combining a visual measurement residual error and an inertial measurement unit measurement residual error, and visual inertial positioning is realized. According to the method, feature tracking is performed based on the lightweight optical flow network, and compared with a traditional method, the feature tracking performance in a dynamic illumination scene can be effectively improved, so that the positioning effect is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of robot perception and positioning technology, and in particular to a visual inertial positioning method based on a lightweight optical flow network. Background Art

[0002] The positioning module is a basic component of tasks such as autonomous driving and robot navigation. It provides accurate state estimation of the body, including rotational and translational motion. In recent years, the use of vision and inertial measurement unit (IMU) for data fusion and positioning has attracted much attention, where vision provides observation information and inertial measurement unit provides motion information. The complementary information of the two can achieve accurate state estimation.

[0003] However, in practical applications, since cameras are sensitive to changes in lighting, visual inertial odometers that track features based on traditional optical flow methods can easily fail to track features in scenes with changing lighting, resulting in poor positioning results. Deep learning-based methods can provide more accurate optical flow estimation results, but these methods are computationally intensive and difficult to predict in real time and use for feature tracking, and cannot meet the needs of online positioning. Therefore, using visual inertial data to provide accurate positioning information in dynamic lighting scenes is a challenging problem. Summary of the invention

[0004] In order to solve the above technical problems, the present invention provides a visual inertial positioning method based on a lightweight optical flow network.

[0005] In order to solve the above technical problems, the present invention adopts the following technical solutions:

[0006] A visual inertial positioning method based on a lightweight optical flow network comprises the following steps:

[0007] Step 1: Feature tracking based on lightweight optical flow network: For a pair of image frames I1 and I2, a dense optical flow field F is predicted using a lightweight optical flow network. The optical flow field contains the relative motion information of pixels between image frames I1 and I2. The optical flow value corresponding to the feature point extracted from the image frame is queried in the dense optical flow field using bilinear interpolation to obtain the motion information of the feature point, thereby tracking the feature point.

[0008] Step 2: Based on the motion consistency detection strategy of multi-frame reprojection residuals, identify and remove abnormal feature points:

[0009] Process A: Calculate the projection point position of the feature point P1 under the original camera under another common view camera after the pose change by reprojection, and calculate the residual between the projection point position and the real observation position under the common view camera;

[0010] Repeat process A to all other common-view cameras of feature point P1, and calculate the reprojection residual r of the kth feature point in multiple frames k , if r k If the value is higher than the set threshold, the kth feature point is considered as an outlier and is removed;

[0011] Step three, based on a tightly coupled nonlinear optimization framework, the visual measurement residuals and the inertial measurement unit measurement residuals are combined to obtain the optimal pose estimation and realize visual inertial positioning; the inertial measurement unit measurement residuals are calculated using pre-integration, and the visual measurement residuals are calculated by constructing a reprojection relationship between camera observations and three-dimensional points.

[0012] Furthermore, the lightweight optical flow network includes an encoder, a correlation cost body and a decoder; step one specifically includes:

[0013] A weight-sharing encoder is used to extract feature maps of a pair of image frames I1 and I2, and position encoding is performed on the feature maps; the encoder is used to extract text features of the first image frame; a first-layer correlation cost body is constructed by performing dot product of feature vectors in feature maps after two position encodings corresponding to a pair of image frames; and the last two dimensions of the first-layer correlation cost body are pooled;

[0014] The decoder iteratively estimates the optical flow, with the initial optical flow estimate set to zero. The iteration process is as follows;

[0015] The text features, the optical flow estimated in the previous iteration, and the correlation information indexed from the multi-layer correlation cost body using the optical flow estimation result are connected as the input of the decoder; then, the residual optical flow obtained after this iteration is obtained through four convolutional layers in the decoder; the residual optical flow obtained in this iteration is added to the optical flow estimated in the previous iteration as the optical flow estimated in this iteration;

[0016] During the training process, an upsampling module is used to upsample the optical flow estimated in each iteration to match the resolution of the image frames I1 and I2 to obtain the dense optical flow field F. During the deployment inference phase, only the optical flow estimated in the last iteration is upsampled to obtain the dense optical flow field F.

[0017] The bilinear interpolation method is used to query the optical flow value corresponding to each feature point in the dense optical flow field, obtain the motion information of each feature point, and perform feature point tracking.

[0018] Furthermore, when the lightweight optical flow network is trained, the absolute error of each iteration is multiplied by the weight and the sum is taken as the loss L used in the training:

[0019]

[0020] Among them, fgt represents the real optical flow, f s represents the optical flow estimated at the sth iteration, Υ is the weight factor, and N is the total number of iterations.

[0021] Furthermore, in step 2, the process A: calculating the position of the feature point under another common view camera after the posture change by reprojection, and calculating the residual between the reprojected position of the feature point and the real observation position under the camera, specifically includes:

[0022] For the kth feature point observed by the i-th camera Reprojection: The feature points The normalized coordinates of divided by the inverse depth get the feature point In the camera coordinate system, the three-dimensional coordinates are then calculated using the external parameter matrix between the camera and the inertial measurement unit. The feature points Convert to the inertial measurement unit coordinate system and use the estimated pose transformation matrix and The feature points Transfer to the j-th frame coordinate system, and finally pass the inverse matrix of the external parameter matrix between the camera and the inertial measurement unit Transfer to the camera coordinate system and get the projection point

[0023]

[0024] The reprojection residual is the difference between the normalized coordinates of the projected point and the normalized coordinates of the true observation;

[0025] Repeat the above reprojection process under other co-viewing n-1 cameras to obtain the reprojection residual r of the kth feature point under multiple frames k :

[0026]

[0027] Comparison k The relationship between the threshold and the value of r k Feature points above the threshold are removed.

[0028] Furthermore, in step 3, based on a tightly coupled nonlinear optimization framework, the visual measurement residual and the inertial measurement unit measurement residual are combined to obtain the optimal pose estimation, which specifically includes:

[0029] In the tightly coupled nonlinear optimization framework, the joint visual measurement residual and the IMU measurement residual are optimized as a whole. The cost function of the overall optimization solution is as follows:

[0030]

[0031] Among them, X is the pose to be estimated, e B and e C They are the inertial measurement unit measurement residual and the visual measurement residual. The inertial measurement unit measurement residual is calculated by pre-integration, and the visual measurement residual is calculated by constructing a reprojection relationship between camera observations and three-dimensional points; Σ b and Σ c The covariance matrix of the two residual terms is inverted to obtain the corresponding information matrix and represent the weight term; I p is the prior information generated by marginalization; ρ is the kernel function.

[0032] Furthermore, in step 3, when seeking the best pose estimation, a sliding window mechanism is introduced to perform pose estimation only on key frames within the sliding window; the sliding window mechanism includes:

[0033] Image frames whose camera parallax changes are greater than the set value, or image frames whose number of tracked feature points is less than the set value are set as key frames, and the key frames are sent into the sliding window for solution; at the same time, when a new key frame enters the sliding window, the old key frame is marginalized to maintain a sliding window of a fixed size.

[0034] Compared with the prior art, the beneficial technical effects of the present invention are:

[0035] 1. The present invention performs feature tracking based on a lightweight optical flow network. Compared with traditional methods, it can effectively improve the feature tracking performance in dynamic lighting scenes, thereby improving the positioning effect.

[0036] 2. The present invention identifies and removes outliers based on multi-frame reprojection errors. This method has significant computational efficiency and can further improve the positioning accuracy of the system, thereby promoting the implementation of the positioning algorithm.

[0037] 3. The present invention is based on a tightly coupled nonlinear optimization framework, combined with visual measurement residuals and IMU measurement residuals, and can perform efficient posture solution and realize real-time posture estimation. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 It is a flowchart of the visual inertial positioning method based on a lightweight optical flow network in the present invention;

[0039] Figure 2 is a structural diagram of a lightweight optical flow network involved in the present invention;

[0040] Figure 3 This is a schematic diagram of the trajectory results of positioning in the embodiment;

[0041] Figure 4 It is a schematic diagram of the trajectory result of positioning in the embodiment. DETAILED DESCRIPTION

[0042] A preferred embodiment of the present invention is described in detail below with reference to the accompanying drawings.

[0043] The present invention directly predicts optical flow through an end-to-end optical flow network. Compared with the traditional optical flow method based on the grayscale invariance assumption, the deep learning-based method does not rely on the grayscale invariance assumption. Even in scenes with changing lighting, it can accurately predict dense optical flow fields, thereby achieving robust feature tracking and improving positioning performance. The process of the visual inertial positioning method based on a lightweight optical flow network in the present invention can be found in Figure 1 .

[0044] The lightweight optical flow network consists of three parts: encoder, correlation cost body and decoder. The overall structure is shown in Figure 2 . The encoder adopts the Bottleneck structure in Resnet. The encoder extracts high-dimensional feature maps from the two input image frames. The number of channels of the input image frame is 3, and the number of channels of the extracted feature map is 128, but the length and width of the feature map are reduced to 1 / 8 of the original image resolution. Then the extracted feature map is positionally encoded, so that when constructing the similarity cost body, not only the feature similarity between the two feature vectors is considered, but also the similarity between their spatial positions. At the same time, the same structure encoder is used to extract the text features of the first image frame as the input of the subsequent decoder. The first layer of correlation cost body is constructed by dot product of the feature vectors in the two feature maps, and its dimension is h×w×h×w, where h and w are 1 / 8 of the height and width of the input image frame respectively. In order to estimate larger displacements, the last two dimensions of the first layer cost body are pooled, with a pooling kernel size of 4 and a stride of 4. The dimension of the second layer correlation cost body after pooling is h×w×h / 4×w / 4. This can retain the receptive field of large displacements and small displacements at the same time.

[0045] The decoder of the lightweight optical flow network iteratively estimates the optical flow, and the initial optical flow estimate is set to zero. The text features, the optical flow estimated in the previous iteration, and the indexed correlation information are concatenated as the input of the decoder. Then, after passing through four convolutional layers in the decoder, the residual optical flow of this iteration is obtained. The residual optical flow of this iteration is added to the previously estimated optical flow as the estimated optical flow of this iteration, and input into the next iteration; a learnable upsampling module is used to upsample the estimated optical flow to match the resolution of the original image frame. The upsampling module consists of two convolutional layers and a softmax activation function. The mask of each new pixel is predicted, and through weighting, the predicted dense optical flow field is finally obtained.

[0046] During the training of the lightweight optical flow network, the following loss function is used and the optimizer optimization function is set to "Adam":

[0047]

[0048] Among them, f gt represents the real optical flow, f i represents the optical flow estimated at the i-th iteration, Υ is the weight factor, and the absolute error of each iteration is multiplied by the weight and summed as the final loss. Υ is set to 0.8. For the optical flow estimated at the beginning of the iteration, the weight is lower, and the optical flow at the end of the iteration, the weight is increased.

[0049] In order to make the lightweight optical flow network converge faster, it is first trained on the FlyingChairs dataset with a batch size of 8 and 120k iterations, then trained on the FlyingThings3D dataset with a batch size of 5 and 120k iterations, and finally fine-tuned on the Sintel dataset with a batch size of 5 and 120k iterations.

[0050] In order to further improve the positioning accuracy, the present invention designs a motion consistency detection strategy to identify and remove mismatched feature points and dynamic feature points.

[0051] For the kth feature point observed by the i-th camera Reprojection: First, divide its normalized coordinates by the inverse depth to obtain its three-dimensional coordinates in the camera coordinate system, and then use the external parameter matrix between the camera and IMU Transfer it to the IMU coordinate system and use the estimated pose transformation matrix Transfer it to the j-th frame coordinate system, and finally pass the inverse matrix of the external parameter matrix between the camera and IMU Transfer it to the camera coordinate system and get

[0052]

[0053] The reprojection process is summarized as follows:

[0054]

[0055] The residual is the difference between the normalized coordinates of the projection point and the normalized coordinates of the actual observation. Repeat the above steps to other n-1 frames of co-viewing cameras. The multi-frame reprojection residual calculation process is as follows:

[0056]

[0057] r kRepresents the reprojection error of the kth feature point in multiple frames. By comparing r k The relationship between the error and the set threshold is determined, and the feature points with errors higher than the threshold are removed.

[0058] The positioning method of the present invention adopts a tightly coupled nonlinear optimization framework at the back end, and combines the visual measurement residual and the IMU measurement residual to perform overall optimization and solution. The overall cost function is as follows:

[0059]

[0060] Among them, X is the pose state to be estimated, e B and e C They are IMU measurement residuals and visual measurement residuals. IMU measurement residuals are calculated using pre-integration, and visual measurement residuals are calculated by constructing a reprojection relationship between camera observations and three-dimensional points. b and Σ c The covariance matrix of the two residual terms is inverted to obtain the corresponding information matrix and represent the weight term. p is the prior information generated by marginalization. ρ is the Huber kernel function, which can reduce the weight of large visual residuals, so that it will not have much impact on the optimization results. The optimization problem in the above formula is actually a least squares problem, which is solved iteratively using the Gauss-Newton method.

[0061] In order to reduce the computational complexity, a sliding window mechanism is introduced. By designing a key frame screening method, image frames with large camera parallax changes or image frames with the number of tracked feature points less than the threshold are set as key frames, and the key frames are sent into the sliding window for pose solution; at the same time, when a new key frame enters the sliding window, the old key frame is marginalized to maintain a fixed-size sliding window.

[0062] The present invention can effectively improve the positioning effect of the visual inertial method in dynamic lighting scenes, and the positioning trajectory comparison Figure 3 , Figure 4 As shown, the method proposed in the present invention has the ability to provide accurate positioning information in dynamic lighting scenes.

[0063] The above is the detailed description of the present invention.

[0064] It is obvious to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential features of the present invention. Therefore, from any point of view, the embodiments should be regarded as exemplary and non-limiting, and the scope of the present invention is defined by the appended claims rather than the above description, and it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention, and any reference numerals in the claims should not be regarded as limiting the claims involved.

[0065] In addition, it should be understood that although this specification is described in terms of implementation methods, not every implementation method contains only one independent technical solution. This narrative method of the specification is only for the sake of clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each embodiment may also be appropriately combined to form other implementation methods that can be understood by those skilled in the art.

Claims

1. A visual inertial positioning method based on lightweight optical flow network, It is characterized in that The following steps are involved: Step 1: Feature tracking based on lightweight optical flow network: For a pair of image frames I 1 , I 2 , using a lightweight optical flow network to predict a dense optical flow field F, which contains image frames I 1 , I 2 Relative motion information of pixels between Using bilinear interpolation, the optical flow values ​​corresponding to the feature points extracted from the image frame are queried in the dense optical flow field to obtain the motion information of the feature points, thereby tracking the feature points. Step 2: Identify and remove abnormal feature points based on the motion consistency detection strategy of multi-frame reprojection residuals: Process A: Calculate the projection point position of the feature point P1 under the original camera under another common view camera after the pose change by reprojection, and calculate the residual between the projection point position and the real observation position under the common view camera; Repeat process A to all other common-view cameras of feature point P1, and calculate the reprojection residual r of the kth feature point in multiple frames k , if r k If the value is higher than the set threshold, the kth feature point is considered as an outlier and is removed; Step three, based on a tightly coupled nonlinear optimization framework, the visual measurement residuals and the inertial measurement unit measurement residuals are combined to obtain the optimal pose estimation and realize visual inertial positioning; the inertial measurement unit measurement residuals are calculated using pre-integration, and the visual measurement residuals are calculated by constructing a reprojection relationship between camera observations and three-dimensional points.

2. The visual inertial positioning method based on a lightweight optical flow network according to claim 1, It is characterized in that The lightweight optical flow network includes an encoder, a correlation cost body and a decoder; step one specifically includes: Use the weight-sharing encoder to extract a pair of image frames I 1 , I 2 The feature map of the image frame is encoded by position; the text feature of the first image frame is extracted by using the encoder; the first layer of correlation cost body is constructed by performing dot product of feature vectors in the feature map after two position encodings corresponding to a pair of image frames; the last two dimensions of the first layer of correlation cost body are pooled; The decoder iteratively estimates the optical flow, with the initial optical flow estimate set to zero. The iteration process is as follows; The text features, the optical flow estimated in the previous iteration, and the correlation information indexed from the multi-layer correlation cost body using the optical flow estimation result are connected as the input of the decoder; then, the residual optical flow obtained after this iteration is obtained through four convolutional layers in the decoder; the residual optical flow obtained in this iteration is added to the optical flow estimated in the previous iteration as the optical flow estimated in this iteration; During the training process, the upsampling module is used to upsample the estimated optical flow at each iteration to match the image frame I 1 , I 2 The dense optical flow field F is obtained by upsampling only the optical flow estimated in the last iteration in the deployment reasoning stage to obtain the dense optical flow field F; The bilinear interpolation method is used to query the optical flow value corresponding to each feature point in the dense optical flow field, obtain the motion information of each feature point, and perform feature point tracking.

3. The visual inertial positioning method based on a lightweight optical flow network according to claim 1, It is characterized in that When training the lightweight optical flow network, the absolute error of each iteration is multiplied by the weight and summed as the loss L used in training: Among them, f gt represents the real optical flow, f s represents the optical flow estimated at the sth iteration, γ is the weight factor, and N is the total number of iterations.

4. The visual inertial positioning method based on a lightweight optical flow network according to claim 1, It is characterized in that In step 2, the process A: calculating the position of the feature point under another common view camera after the posture change by reprojection, and calculating the residual between the reprojected position of the feature point and the real observation position under the camera, specifically includes: For the kth feature point observed by the i-th camera Reprojection: The feature points The normalized coordinates of divided by the inverse depth get the feature point In the camera coordinate system, the three-dimensional coordinates are then calculated using the external parameter matrix between the camera and the inertial measurement unit. The feature points Convert to the inertial measurement unit coordinate system and use the estimated pose transformation matrix and The feature points Transfer to the j-th frame coordinate system, and finally pass the inverse matrix of the external parameter matrix between the camera and the inertial measurement unit Transfer to the camera coordinate system and get the projection point The reprojection residual is the difference between the normalized coordinates of the projected point and the normalized coordinates of the true observation; Repeat the above reprojection process under other co-viewing n-1 cameras to obtain the reprojection residual r of the kth feature point under multiple frames k : Comparison k The relationship between the threshold and the value of r k Feature points above the threshold are removed.

5. The visual inertial positioning method based on a lightweight optical flow network according to claim 1, It is characterized in that In step 3, based on a tightly coupled nonlinear optimization framework, the best pose estimation is obtained by combining the visual measurement residuals and the inertial measurement unit measurement residuals, which includes: In the tightly coupled nonlinear optimization framework, the joint visual measurement residual and the IMU measurement residual are optimized as a whole. The cost function of the overall optimization solution is as follows: Among them, X is the pose to be estimated, e B and e C They are the inertial measurement unit measurement residual and the visual measurement residual. The inertial measurement unit measurement residual is calculated by pre-integration, and the visual measurement residual is calculated by constructing a reprojection relationship between camera observations and three-dimensional points; ∑ b and∑ c The covariance matrix of the two residual terms is inverted to obtain the corresponding information matrix and represent the weight term; I p is the prior information generated by marginalization; ρ is the kernel function.

6. The visual inertial positioning method based on a lightweight optical flow network according to claim 5, It is characterized in that In step 3, when finding the best pose estimation, a sliding window mechanism is introduced to perform pose estimation only on the key frames within the sliding window. The sliding window mechanism includes: Image frames whose camera parallax changes are greater than the set value, or image frames whose number of tracked feature points is less than the set value are set as key frames, and the key frames are sent into the sliding window for solution; at the same time, when a new key frame enters the sliding window, the old key frame is marginalized to maintain a sliding window of a fixed size.