Dynamic vision SLAM (Simultaneous Localization and Mapping) method suitable for low-illumination scene

By enhancing the image through the IAT network and improving the target detection network to eliminate dynamic feature points, the problem of positioning accuracy and robustness of visual SLAM in low light and dynamic object environments is solved, achieving higher positioning accuracy and system stability.

CN118736010APending Publication Date: 2024-10-01CHONGQING UNIV OF POSTS & TELECOMM
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202410857355.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-28
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

Existing visual SLAM algorithms have limited positioning accuracy and robustness in low-light and dynamic object interference environments, making it difficult to effectively handle the problems of insufficient illumination and dynamic object interference.

Method used

The IAT network is used for image enhancement and exposure correction, combined with the improved lightweight target detection network and LK optical flow method, to separate static feature points, only use static feature points for feature matching and pose estimation, and eliminate dynamic feature points.

Benefits of technology

It improves feature detection accuracy and system robustness in low-light environments, enhances resistance to interference from dynamic objects, and improves positioning accuracy and map construction stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118736010A_ABST
    Figure CN118736010A_ABST
Patent Text Reader

Abstract

The invention relates to a dynamic vision SLAM (Simultaneous Localization and Mapping) method suitable for a low-light scene, which belongs to the field of image processing and comprises the following steps of: acquiring an RGB (Red, Green and Blue) image of the scene, classifying according to image brightness, dividing the image into a normal-brightness image and a low-light image, and if the input image is the low-light image, carrying out low-light enhancement by adopting IAT (International Attention Transform); acquiring a color image and a depth image in real time, and uniformly extracting ORB feature points; classifying the targets according to priori knowledge, and putting feature points in a dynamic target anchor frame, a potential dynamic target anchor frame and a static target anchor frame into different sets; removing feature points with dynamic characteristics from the identified dynamic object bounding box; and carrying out inter-frame feature point matching on all static feature points in the obtained ORB feature points to obtain an optimal matching feature point, and carrying out camera pose estimation to obtain a camera motion result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of image processing and visual synchronous positioning and mapping, and relates to a dynamic visual SLAM method suitable for low-light scenes. Background Art

[0002] With the gradual development of SLAM (Simultaneous Localization and Mapping) technology, vision-based SLAM algorithms have gradually become a hot topic of research. However, the application of visual navigation and positioning technology is currently limited to static and texture-rich scenes, and requires good lighting conditions, which greatly affects the positioning accuracy of visual SLAM in complex light scenes and in the presence of interference from moving objects.

[0003] When the camera is in a low-light or even dark scene, insufficient light will cause the image to be too dark and lose details, and the visual SLAM algorithm cannot extract effective image information to complete the positioning task. The most direct way to improve the positioning accuracy of the visual SLAM algorithm in low-light scenes is to enhance the image in low light and restore the image details that were originally unobservable in the image. Traditional low-light enhancement algorithms are mainly divided into two categories. The first category uses the histogram to count the grayscale distribution law of the image and enhances the image contrast by equalizing the grayscale values ​​of the image pixels. Although it can significantly improve the brightness of the image, it still cannot get rid of the problems of introducing noise, overexposure of the image, and uneven brightness distribution in practical applications, and cannot be directly applied to image enhancement in low-light scenes; the second category is based on the Retinex algorithm, which realizes image enhancement by estimating the illumination layer and decomposing the reflection layer of the image. Although the enhancement algorithm based on the Retinex theory can perform outstandingly in improving image contrast, it also introduces additional noise while enhancing low-light images, and may cause image artifacts.

[0004] When there are dynamic objects in the environment, such as vehicles and pedestrians, the traditional visual SLAM algorithm assumes that the objects in the environment are static or have low motion, which will affect its application in the actual environment. The presence of dynamic objects in the environment will bring erroneous observation data to the system, seriously affecting the accuracy and robustness of the system. Therefore, it is necessary to detect moving objects and remove feature points in dynamic areas (or reduce their weight when optimizing posture) to reduce the impact of object movement on visual positioning. Summary of the invention

[0005] In view of this, the purpose of the present invention is to address the problem that the existing visual SLAM navigation and positioning cannot effectively resist the interference caused by low-light scenes and the presence of moving objects, and propose a dynamic visual SLAM method suitable for low-light scenes to improve positioning accuracy and positioning robustness. The method first classifies the image according to the image brightness, and divides the image into a normal brightness image and a low-light image. If the input image is a low-light image, the IAT network is introduced to perform image enhancement and exposure correction on the image. Then the processed image is subjected to feature point extraction, and the dynamic feature points are eliminated using the improved lightweight target detection network and the LK optical flow method. Finally, only static feature points are used for feature matching and camera pose estimation.

[0006] In order to achieve the above object, the present invention provides the following technical solutions:

[0007] A dynamic visual SLAM method suitable for low-light scenes includes the following steps:

[0008] S1: Get the RGB image of the scene, first classify it according to the image brightness, and divide it into normal brightness image and low light image. If the input image is a low light image, use the low illumination image enhancement network IAT to perform low light enhancement;

[0009] S2: Acquire color images and depth images in real time, and extract ORB feature points by homogenizing the acquired RGB images;

[0010] S3: Using the improved lightweight target detection network, the targets are classified according to prior knowledge, and the feature points in the dynamic target anchor box, potential dynamic target anchor box and static target anchor box are put into different sets;

[0011] S4: Using the LK optical flow method combined with the ORB feature detection technology and referring to the boundary information of potential dynamic feature points and actual dynamic feature points, those feature points with dynamic characteristics are removed from the identified dynamic object boundary box;

[0012] S5: Perform inter-frame feature point matching on all static feature points in the obtained ORB feature points to obtain the best matching feature points, perform camera pose estimation based on the RANSAC algorithm and the best matching feature points to obtain the camera motion result.

[0013] Further, in step S1, an RGB-D camera is used to obtain an RGB image of the scene; low-light enhancement of the image by the IAT network specifically includes the following steps:

[0014] The sRGB image captured under low light conditions is taken as input, which is denoted as I i ∈R H×W×3 , where H×W represents the size dimension and 3 represents the channel dimension {r, g, b};

[0015] In the local branch processing part of the IAT network, the input low-light sRGB image is first convolved 3×3 to expand the channel dimension, and then passed to two independent branches stacked by the pixel enhancement module PEM. Each PEM encodes the position information through deep convolution and uses the combined structure of partial widening convolution PWConv and deep separation convolution DWConv to enhance local details. Then the light normalization technology adjusts the scale and bias through two learnable parameters, and the skip connection connects the output features to the input features through element-by-element addition. Finally, the channel dimension is reduced through 3×3 convolution and the activation function is used to generate the local components M and A for correcting the influence of illumination.

[0016] In the global ISP branch processing part of the IAT network, the lightweight encoder encodes high-dimensional features at low resolution by stacking two convolutional layers. Then the global prediction module GPM uses the global component query initialized to zero to decode and predict the parameters required for white balance and color matrix transformation. Finally, the color matrix and gamma value are output through the feedforward network FFN and the additional parameters with special initialization.

[0017] After being processed by the IAT network, we finally get the target illumination condition L t The enhanced image I t ∈RH×W×3.

[0018] Further, the real-time extraction of ORB feature points from the RGB image in step S2 specifically includes:

[0019] S21: performing multi-scale Gaussian blur processing and downsampling operations on the ORB image in sequence to form an image pyramid consisting of multi-scale images, and performing FAST feature point extraction on all layers of the image pyramid as ORB feature points;

[0020] S22: defining a moment for the image block in the ORB image, finding its centroid through the moment, and connecting the geometric center and the centroid of the image block to obtain the ORB feature point direction vector.

[0021] Furthermore, in step S2, the main direction of the ORB feature point is calculated using the grayscale centroid method, and the centroid position of the image block is found according to the image moment:

[0022]

[0023] In the formula, C is the image centroid, m is the moment of the defined image block, and its expression is:

[0024]

[0025] From the center of mass C and the geometric center O, we get the direction vector The direction of the feature point is defined as:

[0026] θ=arctan(m 01 / m 10 )

[0027] After obtaining the ORB feature points with direction information, proceed to the next step of calculation.

[0028] Further, the improved lightweight target detection network described in step S3 uses the GhostNetV2 bottleneck module to replace the backbone network part of YOLOv8n. When the step size is equal to 1, the input feature is first subjected to the GhostNetV2 convolution for feature enhancement, and then the number of channels is adjusted by the Ghost convolution to obtain the output feature; when the step size is equal to 2, after the input feature is subjected to the GhostNetV2 convolution, the size is adjusted by the depthwise separable convolution Dwconv, and then the output feature is obtained by a Ghost convolution;

[0029] In the network feature fusion part, it is processed by the GSConv module, and then combined with feature maps of other scales through upsampling and splicing operations. The processed feature maps are passed through the GSConv module again, and finally the VoV-GSCSP module is used to further extract and fuse features;

[0030] Finally, the features are passed to the DyHead classification head to map to the target category by combining the three attention mechanisms of scale, space and task. The model output is converted into a probability distribution after post-processing, and the category of unknown data is accurately predicted during evaluation and testing. The feature points in the dynamic target anchor box, potential dynamic target anchor box and static target anchor box are placed into different sets.

[0031] Further, step S3 specifically includes the following steps:

[0032] S31: Input the enhanced image into the target detection network. The network receives an input image I∈R H ×W×3 ; Where I is the input image, H is the height of the image, W is the width of the image, and 3 is the number of color channels;

[0033] S32: The input features are sent to the Ghost module branch and the DFC attention mechanism branch. The Ghost module convolution operation generates a partial output feature map Y′. Y′ is connected with other feature maps generated by simple linear transformation to obtain the final output feature map Y. The specific formula is as follows:

[0034] Y′=X*F 1×1 ,

[0035] Y=Concat(Y′,Y′*F dp )

[0036] Among them: F 1×1 is the point-by-point convolution; F dp is the depth convolution;

[0037] The attention map A generated by the DFC module in the FC layer is A={a 11 ,a 12 ,…,a HW}, the specific formula is as follows:

[0038]

[0039] in: represents element-by-element multiplication; F is the learnable weight in the fully connected layer;

[0040] The information obtained from the two branches of the attention graph is aggregated and then output. The specific formula is as follows:

[0041]

[0042] where the output O∈R H×W×C is the product of the outputs of the two branches, Sigmoid is a scaling function that normalizes the attention map A to the range (0, 1), and V() represents the Ghost module operation;

[0043] S33: The input feature map passes through a convolution layer, the number of output channels of this layer is C2 / 2, and then the depth-wise separable convolution DWConv performs convolution operation on each channel of the input feature map independently. The feature map generated by splicing the outputs of the Conv and DWConv layers is shuffled to rearrange the feature channels, and finally outputs a feature map with C2 channels. The feature fusion part first processes the input feature maps of different scales through the GSConv module, and then combines them with feature maps of other scales through upsampling and splicing operations. The processed feature map passes through the GSConv module again, and finally uses the VoV-GSCSP module to further extract and fuse features;

[0044] S34: The extracted feature map is sent to the Dyhead detection head, which uses the self-attention mechanism to unify the scale-aware attention, space-aware attention and task-aware attention to identify the targets in the image and predict their positions, and outputs the category and position information of the targets. The specific formula is as follows:

[0045] W(F)=π C (π S (π L (F)·F)·F)·F

[0046] Among them, F represents an input three-dimensional tensor L×S×C, π L(.), π s (.) and π C (.) are scale-aware attention module, space-aware attention module and task-aware attention module respectively;

[0047] S35: Predict the category of the image according to the target detection result, and put the feature points in the dynamic target anchor box, the potential dynamic target anchor box and the static target anchor box into different sets.

[0048] Further, the step S4 of detecting and removing dynamic objects in the scene by combining the LK optical flow method includes the following steps:

[0049] S41: Assuming that the grayscale of the image is regarded as a function of time, at time t, the grayscale of the ORB feature point located at the image coordinate (xy,) is expressed as I(x,y,t):

[0050] I(x,y,t)=I(x+dx,y+dy,t+dt)

[0051] Among them, t and t+dt are the times corresponding to adjacent image frames, and I(x,y,t) and I(x+dx,y+dy,t+dt) are the corresponding grayscales;

[0052] Based on the grayscale invariance assumption of the optical flow method, we get:

[0053]

[0054] In the formula, I xi is the grayscale gradient in the x direction at the i-th pixel in the window, I yi is the grayscale gradient in the y direction at the i-th pixel in the window, I ti is the gradient of the time at the i-th pixel in the window, u is the speed of the pixel in the window in the x direction, v is the speed of the pixel in the window in the y direction, and N is the total number of pixels contained in the window;

[0055] Using the least squares method to solve it, we get:

[0056]

[0057] but The superscript T represents transposition, and the superscript -1 represents the inverse of the matrix. The displacement of the feature point in the x direction is obtained according to u, and the displacement of the feature point in the y direction is obtained according to v. Then, the position of the feature point in the current captured image is obtained according to the displacement in the x direction and the displacement in the y direction.

[0058] S42: using the LK optical flow method to calculate the optical flow vectors of the feature points in the static area set S and the potential area P, taking the optical flow vectors of the feature points in the set S as the optical flow vectors of the static area, and calculating the average optical flow vector;

[0059]

[0060] Where N is the number of feature points, u k and v k are the horizontal and vertical components of the optical flow vector of the kth feature point, respectively. U is the horizontal coordinate of the pixel, and V is the vertical coordinate of the pixel.

[0061] Further, in step S4, whether a feature point is a dynamic feature point in the potential dynamic object boundary frame is determined by the following formula:

[0062]

[0063] Where u and v are the velocity vectors of the pixel along the x-axis and y-axis respectively, and l is the threshold for judging whether the feature point is a dynamic feature point. If it is greater than the threshold, it is judged as a dynamic feature point, otherwise it is a static feature point. The obtained static feature point is input into the tracking thread of ORB-SLAM3.

[0064] Further, in step S5, all the static feature points in the obtained ORB feature points are matched between frames to obtain the best matching feature points, which specifically includes:

[0065] S51: randomly extract 4 non-collinear feature points, calculate the homography matrix H and record it as model M, use model M to test all ORB feature points in the RGB image frame, calculate the projection error between all ORB feature points in the image frame and model M; if the error is less than a preset threshold, add the inlier set I, judge that the current inlier set element is greater than the preset optimal inlier set, then update the inlier set and the corresponding number of iterations k; if the maximum number of iterations is met, stop the iteration, and the obtained model is the optimal model, that is, the best inter-frame matching is achieved;

[0066] S52: After the camera pose estimation, a key frame is selected for local mapping thread, loop detection thread and bundle adjustment for mapping processing; wherein the key frame is a frame selected from a series of local ordinary frames as a representative of the local frame, recording local information, and the local frame is a frame within the set distance range of the key frame; the best matching feature points are extracted from adjacent key frames, and the relative pose change between the two frames and the corresponding three-dimensional map points are calculated;

[0067] The selection of the key frame satisfies at least one of the following conditions: the number of frames defined by the preset maximum value Max has passed between the previous key frame; the local mapping thread is in an idle state, and the number of frames defined by the preset minimum value Min is ensured to be at least separated from the previous key frame; the number or proportion of static feature points added to the tracking thread at the current perspective is lower than the preset value.

[0068] The beneficial effects of the present invention are:

[0069] (1) Under different lighting conditions, the features of the image may become less obvious, affecting the effectiveness of feature detection and descriptors, and thus affecting the performance of the SLAM algorithm. To improve this, the present invention integrates an image enhancement network (IAT), which enhances the visibility of features by adjusting the contrast and brightness of the input image. As a preprocessing step, IAT improves the accuracy of feature point detection, especially in poor lighting conditions. In this way, the illumination adaptability of ORB-SLAM3 has been significantly improved, ensuring high-performance operation in various lighting environments, enhancing the system's applicability and user experience.

[0070] (2) When there are occlusions or dynamic objects in the environment, these factors will interfere with the accurate extraction and tracking of feature points, reducing the accuracy of positioning and map construction. In order to overcome this challenge, the present invention introduces an improved fusion target detection network, which can effectively capture long-distance dependencies in images and improve the model's ability to understand complex scenes. By removing dynamic feature points through improved target detection, ORB-SLAM3 can better handle the interference caused by occlusions and dynamic objects, improving the robustness of the algorithm. Such improvements provide the system with more stable and accurate positioning and map construction performance in a changing environment.

[0071] (3) Traditional SLAM algorithms often rely on complex feature extraction and data association processes, which have high demands on computing resources and are difficult to achieve efficient operation on resource-constrained devices. In order to solve this problem, the present invention adopts an improved target detection network, which significantly reduces the demand for computing resources through its lightweight architecture and efficient feature extraction capabilities. This design enables ORB-SLAM3 to implement an efficient SLAM process on low-power devices, thereby significantly reducing the operating cost of the system and expanding the scope of application of the algorithm.

[0072] Other advantages, objectives and features of the present invention will be described in the following description to some extent, and to some extent, will be obvious to those skilled in the art based on the following examination and study, or can be taught from the practice of the present invention. The objectives and other advantages of the present invention can be realized and obtained through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0073] In order to make the purpose, technical solutions and advantages of the present invention more clear, the present invention will be described in detail below in conjunction with the accompanying drawings, wherein:

[0074] Figure 1 It is an overall flow chart of a specific implementation mode of the present invention;

[0075] Figure 2 It is a SLAM system framework diagram of a specific embodiment of the present invention;

[0076] Figure 3 A schematic diagram of an improved target detection network model according to a specific embodiment of the present invention;

[0077] Figure 4 A schematic diagram of a specific network structure for a specific implementation of the present invention;

[0078] Figure 5 It is a schematic diagram of LK optical flow of a specific embodiment of the present invention;

[0079] Figure 6 The static feature points extracted by the present invention in a dynamic environment;

[0080] Figure 7 This is a rendering of the present invention in a dynamic environment. DETAILED DESCRIPTION

[0081] The following describes the embodiments of the present invention by specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the illustrations provided in the following embodiments only illustrate the basic concept of the present invention in a schematic manner, and the following embodiments and features in the embodiments can be combined with each other without conflict.

[0082] Among them, the drawings are only used for illustrative explanations, and they only represent schematic diagrams rather than actual pictures, and should not be understood as limitations on the present invention. In order to better illustrate the embodiments of the present invention, some parts of the drawings may be omitted, enlarged or reduced, and do not represent the size of actual products. For those skilled in the art, it is understandable that some well-known structures and their descriptions in the drawings may be omitted.

[0083] The same or similar numbers in the drawings of the embodiments of the present invention correspond to the same or similar parts; in the description of the present invention, it should be understood that if the terms "upper", "lower", "left", "right", "front", "rear", etc. indicate the orientation or position relationship, they are based on the orientation or position relationship shown in the drawings, which is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operate in a specific orientation. Therefore, the terms describing the position relationship in the drawings are only used for illustrative purposes and cannot be understood as limiting the present invention. For ordinary technicians in this field, the specific meanings of the above terms can be understood according to specific circumstances.

[0084] The present invention is a dynamic visual SLAM method suitable for low-light scenes, and its flow chart is as follows: Figures 1-2 As shown. Specifically including the following steps:

[0085] Step 1: Use an RGB-D camera to obtain the RGB image of the scene. First, classify the image according to the brightness, and divide the image into normal brightness image and low-light image. If the input image is a low-light image, use a lightweight low-light image enhancement network IAT for low-light enhancement;

[0086] Step 1.1: During the training phase, in addition to the loss function L between the predicted results and the real images rgb In addition, an additional loss function L is introduced raw , this additional loss function is used to supervise the intermediate representation f(I i ) and the generated original RGB image I raw The difference between the total loss function L total is the weighted sum of the two losses, where λ is a parameter that balances the two losses and is set to 0.1 in the experiment. The total loss function L total The specific form is as follows:

[0087] L total =L rgb +lambda·L raw =L1(gt(f(Ii)),It)+λ·L1(f(Ii),I textraw )

[0088] L1 represents the loss function, which is used to calculate the pixel-level difference between two images; L rgb is the prediction result g t (f(I i )) and the real image I t The L1 loss between raw is the intermediate representation f(I i ) and the original RGB image I raw The L1 loss between

[0089] Step 1.2: Take the sRGB image captured under low light conditions as input, which is denoted as I i ∈RH×W×3, where H×W represents the size dimension and 3 represents the channel dimension ({r, g, b});

[0090] Step 1.3: Focus on estimating local components M and A in the local branch to correct the influence of illumination; first, increase the channel dimension through 3×3 convolution; then, pass the expanded channel to two independent branches stacked by pixel enhancement module (PEM) to reduce the number of parameters and computational cost; PEM first encodes the position information through 3×3 depth convolution, uses a combination of PWConv (partial widening convolution) and DWConv (deep separation convolution) to enhance local details, and finally, uses two 1×1 convolutions to enhance the representation respectively; in normalization, two learnable parameters (scale a and bias b) are used to learn how to adjust the features, which are learned before the channels are fused through the learnable matrix. In addition, Layer Scale is used to multiply the features by a small value k1 / k2 to help the model converge; after stacking 3 PEMs in each branch, the output features are connected to the input features by element-by-element addition. This skip connection helps to maintain the details of the original image. Finally, the channel dimension is reduced through 3×3 convolution, and the ReLU activation function is used to generate the local components M and A;

[0091] f(I i )=I i ·M+A

[0092] Among them, I i is the input image, M is the multiplication map, A is the addition map, f(I i ) is the image after local transformation;

[0093] Step 1.4: In the global part g of the IAT module, the ISP process is simplified into a series of transformations, starting with white balance (WB), which adjusts each color channel of the image through a 3×3 diagonal matrix [1, 3, 5, 32] to maintain the consistency of object color under different lighting conditions; then, the camera color matrix (CCM) W ccm The data is further converted from the camera’s internal color space cRGB to the sRGB color space [5, 16, 32]; finally, gamma correction is performed to match the nonlinear perception of brightness by the human visual system, which is achieved by applying an exponential function with an exponential parameter γ. All these steps are integrated in the global branch g t (·), it can be expressed by the following equation:

[0094]

[0095] Among them, W ci,cj It is a joint color transformation function composed of the white balance matrix and CCM, γ is the exponential value of gamma correction, and ε is the minimum value set to prevent numerical instability;

[0096] Step 1.5: Combine the local pixel-by-pixel component f and the global ISP component g to obtain the target illumination condition I t The enhanced image I t ∈RH×W×3;

[0097]

[0098] Among them, I i Represents the input sRGB image, that is, the original image to be enhanced; M represents the multiplication map, which is a matrix predicted by the model and is used to adjust each pixel value of the input image Ii to better adapt to the target lighting conditions; A represents the addition map, which is also predicted by the model and is used to further adjust the image pixel value; Wci,cj represents the 3×3 joint color transformation matrix, which takes into account white balance and color transformation and is used to adjust the color of the image in the global ISP branch; γ represents the gamma correction parameter, which is used to adjust the brightness of the image; ε represents an extremely small value to prevent numerical instability; ∑cj represents the summation of all color channels; max represents the maximum value function, which is used to ensure that all values ​​are limited to a reasonable range when performing color transformation;

[0099] Step 2: Perform ORB feature point calculation on the current frame RGB image and the previous frame RGB image acquired by the RGB-D camera to obtain a set of feature points with directional information. The process is as follows:

[0100] Step 2.1: Extract ORB feature points from the previous frame image and the current frame image, and count their number n. Only when the number n of two consecutive frames is greater than the given threshold T, the initialization operation is performed;

[0101] Step 2.2: Use the grayscale centroid method to calculate the main direction of the ORB feature point, and find the centroid position of the image block according to the image moment:

[0102]

[0103] In the formula, C is the image centroid, m is the moment of the defined image block, and its expression is:

[0104]

[0105] From the center of mass C and the geometric center O, we can get the direction vector The direction of the feature point is defined as:

[0106] θ=arctan(m 01 / m 10 )

[0107] After obtaining the ORB feature points with direction information, proceed to the next step of calculation;

[0108] Step 3: Classify the feature points extracted by the ORBSLAM3 system based on the improved target detection network to obtain dynamic feature points, static feature points and potential dynamic feature points;

[0109] Step 3.1: Input the enhanced image into the target detection network, such as Figure 3 As shown, the network receives an input image I∈R H×W×3 ;

[0110] Where I is the input image, H is the height of the image, W is the width of the image, and 3 is the number of color channels (red, green, blue);

[0111] Step 3.2: If Figure 4 As shown in the figure, the input features are sent to the Ghost module branch and the DFC attention mechanism branch. The Ghost module convolution operation generates a partial output feature map Y′, which is connected with other feature maps generated by simple linear transformation to obtain the final output feature map Y. The specific formula is as follows:

[0112] Y′=X*F 1×1 ,

[0113] Y=Concat(Y′,Y′*F dp )

[0114] Among them: F 1×1 is the point-by-point convolution; F dp is the depth convolution;

[0115] The attention map A generated by the DFC module in the FC layer is A={a 11 ,a 12 ,…,a HW}, the specific formula is as follows:

[0116]

[0117] in: represents element-by-element multiplication; F is the learnable weight in the fully connected layer;

[0118] The information obtained from the two branches of the attention graph is aggregated and then output. The specific formula is as follows:

[0119]

[0120] where the output O∈R H×W×C is the product of the outputs of the two branches, Sigmoid is a scaling function that normalizes the attention map A to the range (0, 1), and V() represents the Ghost module operation;

[0121] Step 3.3: The input feature map passes through a convolution layer, the number of output channels of this layer is C2 / 2, and then the depth-wise separable convolution (DWConv) is used to perform convolution operations on each channel of the input feature map independently. The feature map generated by splicing the outputs of the Conv and DWConv layers is shuffled to rearrange the feature channels, thereby improving the information flow between features and finally outputting a feature map with C2 channels. The feature fusion part first processes the input feature maps of different scales through the GSConv module, and then combines them with feature maps of other scales through upsampling and concatenation operations. The processed feature maps pass through the GSConv module again, and finally the VoV-GSCSP module is used to further extract and fuse features.

[0122] Step 3.4: Send the extracted feature map to the Dyhead detection head, and use the self-attention mechanism to unify the scale-aware attention, space-aware attention and task-aware attention to identify the objects in the image and predict their positions, and output the category and position information of the objects. The specific formula is as follows:

[0123] W(F)=π C (π S (π L (F)·F)·F)·F

[0124] Among them, F represents an input three-dimensional tensor L×S×C, π L (.), π s (.) and π C (.) are scale-aware attention module, space-aware attention module and task-aware attention module respectively;

[0125] Step 3.5: Predict the category of the image based on the target detection results, and put the feature points in the dynamic target anchor box, potential dynamic target anchor box and static target anchor box into different sets

[0126] Step 4: Detect and remove dynamic objects in the scene by combining the LK optical flow method, including the following steps:

[0127] Step 4.1: Assume that the grayscale of the image is regarded as a function of time. At time t, the grayscale of the ORB feature point located at the image coordinate (xy,) is expressed as I(x,y,t):

[0128] I(x,y,t)=I(x+dx,y+dy,t+dt)

[0129] Among them, t and t+dt are the times corresponding to adjacent image frames, and I(x,y,t) and I(x+dx,y+dy,t+dt) are the corresponding grayscales;

[0130] Based on the grayscale invariance assumption of the optical flow method, we get:

[0131]

[0132] In the formula, I xi is the grayscale gradient in the x direction at the i-th pixel in the window, I yi is the grayscale gradient in the y direction at the i-th pixel in the window, I ti is the gradient of the time at the i-th pixel in the window, u is the speed of the pixel in the window in the x direction, v is the speed of the pixel in the window in the y direction, and N is the total number of pixels contained in the window;

[0133] Using the least squares method to solve it, we get:

[0134]

[0135] but The superscript T represents transposition, and the superscript -1 represents the inverse of the matrix. The displacement of the feature point in the x direction is obtained according to u, and the displacement of the feature point in the y direction is obtained according to v. Then, the position of the feature point in the current captured image is obtained according to the displacement in the x direction and the displacement in the y direction.

[0136] Step 4.2: Use the LK optical flow method to calculate the optical flow vectors of the feature points in the static area set S and the potential area P, use the optical flow vectors of the feature points in the set S as the optical flow vectors of the static area, and calculate the average optical flow vector;

[0137]

[0138] Where N is the number of feature points, u k and v k are the horizontal and vertical components of the optical flow vector of the kth feature point, respectively. U is the horizontal coordinate of the pixel point, and V is the vertical coordinate of the pixel point.

[0139] The optical flow vector of the feature point in the set P is judged. If it is less than the set threshold, it means that the feature point is a static feature point and is moved into the static feature point set S;

[0140]

[0141] Where u and v represent the horizontal and vertical components of the optical flow vector of a feature point in the image (i.e., the displacement of the point between two consecutive frames of images), U and V represent the horizontal and vertical components of the average optical flow vector of the static part of the image, and l is a threshold used to determine whether the feature point is dynamic or static;

[0142] Step 4.3: The static feature points in the set S are retained for feature matching and camera pose estimation, and the remaining feature points are removed;

[0143] Step 5: Match all static feature points in the obtained ORB feature points between frames to obtain the best matching feature points, including:

[0144] Step 5.1: Randomly select 4 non-collinear feature points, calculate the homography matrix H and record it as model M, use model M to test all ORB feature points in the RGB image frame, and calculate the projection error between all ORB feature points in the image frame and model M; if the error is less than the preset threshold, add the inlier set I, and judge that the current inlier set element is greater than the preset optimal inlier set, then update the inlier set and the corresponding number of iterations k; if the maximum number of iterations is met, stop the iteration, and the obtained model is the optimal model, that is, the best inter-frame matching is achieved;

[0145] Step 5.2: After the camera pose estimation, the key frame is selected for the local mapping thread, the loop detection thread and the bundle adjustment for mapping processing; wherein the key frame is a frame selected from a series of local ordinary frames as a representative of the local frame, recording local information, and the local frame is a frame within the set distance range of the key frame; the best matching feature points are extracted from adjacent key frames, and the relative pose changes between the two frames and the corresponding three-dimensional map points are calculated;

[0146] Step 5.3: The selection of the key frame satisfies at least one of the following conditions: the number of frames defined by the preset maximum value Max has passed between the previous key frame; the local mapping thread is in an idle state, and the number of frames defined by the preset minimum value Min is ensured to be at least apart from the previous key frame; the number or proportion of static feature points added to the tracking thread at the current perspective is lower than the preset value.

[0147] Embodiment 1: Inputting the RGB image into the improved target detection network, obtaining the bounding box of the target object in the scene and the type of the target object; determining the bounding box where the dynamic / static object is located according to the correspondence between the preset type and the dynamic object / static object;

[0148] The specific implementation examples are as follows:

[0149] In the image preprocessing stage, the input low-light sRGB image I iFor classification, if it is a low-light image, IAT is used for enhancement; in the case of poor lighting scenes, L i Environment, scene L i The number of photons in the image is projected onto the camera, and then processed by the image signal processor G inside the camera to obtain the sRGB image I i ,IAT takes the image I obtained by photography under abnormal lighting i , learn the normal lighting condition L through the inverse mapping function F t The parameters (such as gamma value, white balance and related color matrix) obtained by photography under normal lighting conditions are corrected to obtain an image I that is as close as possible to photography under normal lighting conditions. t , which can be expressed as:

[0150] I t =G(F(I i ))

[0151] Wherein, f is the inverse mapping function, which is used to generate the multiplication map M and the addition map A;

[0152] In the feature extraction stage, after completing the image preprocessing and obtaining the enhanced image, the ORB image is sequentially subjected to multi-scale Gaussian blur processing and downsampling operations to form an image pyramid composed of multi-scale images, and FAST feature point extraction is performed on all layers of the image pyramid as ORB feature points, such as Figure 6 As shown;

[0153] In the target detection stage, the enhanced image is input into the target detection network. The Backbone feature extraction layer of the network adopts the GhostNetv2 network as the backbone network, which is composed of a stacked GhostV2 bottleneck structure. The Neck feature fusion layer adopts the Slim-Neck structure composed of GSConv and VoVGSCSP to fuse semantic features and position information at different levels, improve the network's detection effect on objects of different scales, and add the BiFormer attention mechanism to the Neck feature fusion layer to enhance the feature extraction capability. The Head part adopts DyHead to unify the scale-aware attention, space-aware attention and task-aware attention by using the self-attention mechanism. The dynamic routing mechanism is used to better integrate context information and identify multi-scale targets. The weights of different feature layers can also be dynamically adjusted, which is conducive to extracting multi-scale features. The corresponding Neck part performs convolution operations on feature maps of different sizes to output position coordinates, classification results and confidence to obtain the final detection results; according to the target detection results, the feature points in the dynamic target anchor box, potential dynamic target anchor box and static target anchor box are placed in different sets.

[0154] Embodiment 2: Using the improved target detection network to obtain all target object boundaries in the dynamic object boundary box, it is beneficial for the LK optical flow method to remove dynamic feature points in the dynamic feature point boundaries and potential dynamic feature point boundaries, such as Figure 5 As shown;

[0155] The specific implementation examples are as follows:

[0156] According to prior knowledge, targets are divided into dynamic targets and potential dynamic targets. Dynamic targets refer to those that move actively; potential dynamic targets refer to those that do not move actively but may move due to external factors.

[0157] The feature points in the SLAM system are divided into three categories: dynamic feature points, potential dynamic feature points and static feature points. The dynamic feature points are located in the dynamic target anchor frame, the potential dynamic feature points are located in the potential dynamic target anchor frame, and the rest are static feature points.

[0158] The improved target detection network is used to detect the target in the image frame, and the feature points in the detected dynamic target anchor frame are classified as a dynamic feature point set, the feature points in the potential dynamic target anchor frame are classified as a potential dynamic feature point set, and the remaining feature points are classified as a static feature point set; then the LK optical flow method is used to calculate the optical flow vectors of the feature points in the static feature point set and the potential dynamic feature point set, and the optical flow vectors of the feature points in the static feature point set are used as the optical flow vectors of the static area, and the average optical flow vector is calculated. For the feature points in the potential dynamic feature point set, determine whether its optical flow vector is less than the set threshold If it is less than the threshold, it is considered that these feature points are not affected by the dynamic target and can be regarded as static feature points, and they are moved into the static feature point set; the feature points retained in the static feature point set are used for feature matching and camera pose estimation, while other feature points are removed;

[0159] Embodiment 3: All static feature points in the obtained ORB feature points are matched between frames to obtain the best matching feature points; camera pose estimation is performed based on the RANSAC algorithm and the best matching feature points to obtain the camera motion results, thereby realizing an accurate visual SLAM system for dynamic scenes, such as Figure 7 As shown;

[0160] The specific implementation examples are as follows:

[0161] Based on the static feature points after the dynamic feature points are removed, the system performs feature point matching between frames. In the camera pose estimation stage, facing a pair of 2D points, the relationship between image coordinates can be directly obtained through the homography matrix:

[0162]

[0163] Among them, p1 is the feature point of the previous frame, p2 is the feature point matched in the next frame, P is the plane where the feature point is located, K is the known intrinsic parameter of the camera, and H is the homography matrix of the matching of the two feature points;

[0164] The RANSAC algorithm is used to calculate the basic matrix of camera transformation to better filter out false matches; the specific steps for solving the basic matrix are as follows: 1) Randomly select 4 groups from the matching point pairs to solve the basic matrix F; 2) Calculate the distance d from the remaining feature points to the corresponding epipolar line of the matrix F, and compare the distance with the pre-set threshold d n Compare, when d<d n When d>d n , determine that the point is an external point; record the number of internal points as n; 3) Repeat the above two steps and iterate N times, select the one with the largest number of internal points, and use the basic matrix obtained this time as the final basic matrix; after the camera pose estimation, select the key frame to input into the subsequent local mapping thread, loop detection thread and bundle adjustment for mapping processing. The selection of key frames depends on:

[0165] 1) A sufficient number of frames have passed between the previous key frame and the previous key frame, that is, greater than the maximum value Max preset by the system;

[0166] 2) The distance from the previous key frame is far enough, that is, at least the minimum number of frames preset by the system has passed, and the local mapping thread is idle;

[0167] 3) The number or proportion of feature points tracked at the current viewing angle is significantly reduced;

[0168] If all the above conditions are met, the system will insert a new keyframe and input it into the local mapping thread, loop detection thread and bundle adjustment thread for further processing; if any condition is not met, it will continue to wait and reselect the keyframe; in adjacent keyframes, enough paired key points can be extracted, through which the relative pose changes between the two frames and the corresponding three-dimensional map points can be calculated.

[0169] A person skilled in the art can understand that all or part of the steps in the above-mentioned embodiment method can be completed by instructing related hardware through a program. The program can be stored in a computer-readable storage medium. When the program is executed, the steps of the method can be implemented. The storage medium, such as ROM / RAM, a disk, an optical disk, etc.

[0170] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the purpose and scope of the technical solution, which should be included in the scope of the claims of the present invention.

Claims

1. A dynamic visual SLAM method suitable for low-light scenes, characterized by: The steps include: S1: Get the RGB image of the scene, first classify it according to the image brightness, and divide it into normal brightness image and low light image. If the input image is a low light image, use the low illumination image enhancement network IAT to perform low light enhancement; S2: Acquire color images and depth images in real time, and extract ORB feature points by homogenizing the acquired RGB images; S3: Using the improved lightweight target detection network, the targets are classified according to prior knowledge, and the feature points in the dynamic target anchor box, potential dynamic target anchor box and static target anchor box are put into different sets; S4: Using the LK optical flow method combined with the ORB feature detection technology and referring to the boundary information of potential dynamic feature points and actual dynamic feature points, those feature points with dynamic characteristics are removed from the identified dynamic object boundary box; S5: Perform inter-frame feature point matching on all static feature points in the obtained ORB feature points to obtain the best matching feature points, perform camera pose estimation based on the RANSAC algorithm and the best matching feature points to obtain the camera motion result.

2. The dynamic visual SLAM method suitable for low-light scenes according to claim 1, characterized in that: In step S1, an RGB-D camera is used to obtain an RGB image of the scene; low-light enhancement of the image by the IAT network specifically includes the following steps: The sRGB image captured under low light conditions is taken as input, which is denoted as I i ∈R H×W×3 , where H×W represents the size dimension and 3 represents the channel dimension {r, g, b}; In the local branch processing part of the IAT network, the input low-light sRGB image is first convolved 3×3 to expand the channel dimension, and then passed to two independent branches stacked by the pixel enhancement module PEM. Each PEM encodes the position information through deep convolution and uses the combined structure of partial widening convolution PWConv and deep separation convolution DWConv to enhance local details. Then the light normalization technology adjusts the scale and bias through two learnable parameters, and the skip connection connects the output features to the input features through element-by-element addition. Finally, the channel dimension is reduced through 3×3 convolution and the activation function is used to generate the local components M and A for correcting the influence of illumination. In the global ISP branch processing part of the IAT network, the lightweight encoder encodes high-dimensional features at low resolution by stacking two convolutional layers. Then the global prediction module GPM uses the global component query initialized to zero to decode and predict the parameters required for white balance and color matrix transformation. Finally, the color matrix and gamma value are output through the feedforward network FFN and the additional parameters with special initialization. After being processed by the IAT network, we finally get the target illumination condition L t The enhanced image I t ∈RH×W×3.

3. The dynamic visual SLAM method suitable for low-light scenes according to claim 1, characterized in that: The real-time extraction of ORB feature points from the RGB image in step S2 specifically includes: S21: performing multi-scale Gaussian blur processing and downsampling operations on the ORB image in sequence to form an image pyramid consisting of multi-scale images, and performing FAST feature point extraction on all layers of the image pyramid as ORB feature points; S22: defining a moment for the image block in the ORB image, finding its centroid through the moment, and connecting the geometric center and the centroid of the image block to obtain the ORB feature point direction vector.

4. The dynamic visual SLAM method suitable for low-light scenes according to claim 1, characterized in that: In step S2, the main direction of the ORB feature point is calculated using the grayscale centroid method, and the centroid position of the image block is found according to the image moment: In the formula, C is the image centroid, m is the moment of the defined image block, and its expression is: From the center of mass C and the geometric center O, we get the direction vector The direction of the feature point is defined as: θ=arctan(m 01 / m 10 ) After obtaining the ORB feature points with direction information, proceed to the next step of calculation.

5. The dynamic visual SLAM method suitable for low-light scenes according to claim 1, characterized in that: The improved lightweight target detection network described in step S3 uses the GhostNetV2 bottleneck module to replace the backbone network part of YOLOv8n. When the step size is equal to 1, the input feature is first enhanced by the GhostNetV2 convolution, and then the number of channels is adjusted by the Ghost convolution to obtain the output feature; When the step size is equal to 2, the input feature is resized by the depthwise separable convolution Dwconv after the GhostNetV2 convolution, and then the output feature is obtained by another Ghost convolution. In the network feature fusion part, it is processed by the GSConv module, and then combined with feature maps of other scales through upsampling and splicing operations. The processed feature maps are passed through the GSConv module again, and finally the VoV-GSCSP module is used to further extract and fuse features; Finally, the features are passed to the DyHead classification head to map to the target category by combining the three attention mechanisms of scale, space and task. The model output is converted into a probability distribution after post-processing, and the category of unknown data is accurately predicted during evaluation and testing. The feature points in the dynamic target anchor box, potential dynamic target anchor box and static target anchor box are placed into different sets.

6. The dynamic visual SLAM method suitable for low-light scenes according to claim 5, characterized in that: Step S3 specifically includes the following steps: S31: Input the enhanced image into the target detection network. The network receives an input image I∈R H×W×3 ; Where I is the input image, H is the height of the image, W is the width of the image, and 3 is the number of color channels; S32: The input features are sent to the Ghost module branch and the DFC attention mechanism branch. The Ghost module convolution operation generates a partial output feature map Y′. Y′ is connected with other feature maps generated by simple linear transformation to obtain the final output feature map Y. The specific formula is as follows: Y′=X*F 1×1 , Y=Concat(Y′,Y′*F dp ) Among them: F 1×1 is the point-by-point convolution; F dp is the depth convolution; The attention map A generated by the DFC module in the FC layer is A={a 11 ,a 12 ,…,a HW }, the specific formula is as follows: in: represents element-by-element multiplication; F is the learnable weight in the fully connected layer; The information obtained from the two branches of the attention graph is aggregated and then output. The specific formula is as follows: where the output O∈R H×W×C is the product of the outputs of the two branches, Sigmoid is a scaling function that normalizes the attention map A to the range (0, 1), and V() represents the Ghost module operation; S33: The input feature map passes through a convolution layer, the number of output channels of this layer is C2 / 2, and then the depth-wise separable convolution DWConv performs convolution operation on each channel of the input feature map independently. The feature map generated by splicing the outputs of the Conv and DWConv layers is shuffled to rearrange the feature channels, and finally outputs a feature map with C2 channels. The feature fusion part first processes the input feature maps of different scales through the GSConv module, and then combines them with feature maps of other scales through upsampling and splicing operations. The processed feature map passes through the GSConv module again, and finally uses the VoV-GSCSP module to further extract and fuse features; S34: The extracted feature map is sent to the Dyhead detection head, which uses the self-attention mechanism to unify the scale-aware attention, space-aware attention and task-aware attention to identify the targets in the image and predict their positions, and outputs the category and position information of the targets. The specific formula is as follows: W(F)=π C (p S (p L (F)·F)·F)·F Among them, F represents an input three-dimensional tensor L×S×C, π L (.), π s (.) and π C (.) are scale-aware attention module, space-aware attention module and task-aware attention module respectively; S35: Predict the category of the image according to the target detection result, and put the feature points in the dynamic target anchor box, the potential dynamic target anchor box and the static target anchor box into different sets.

7. The dynamic visual SLAM method suitable for low-light scenes according to claim 1, characterized in that: Step S4, in which the dynamic objects in the scene are detected and removed by combining the LK optical flow method, comprises the following steps: S41: Assuming that the grayscale of the image is regarded as a function of time, at time t, the grayscale of the ORB feature point located at the image coordinate (xy,) is expressed as I(x,y,t): I(x,y,t)=I(x+dx,y+dy,t+dt) Among them, t and t+dt are the times corresponding to adjacent image frames, and I(x,y,t) and I(x+dx,y+dy,t+dt) are the corresponding grayscales; Based on the grayscale invariance assumption of the optical flow method, we get: i=1,...,N,N=n 2 In the formula, I xi is the grayscale gradient in the x direction at the i-th pixel in the window, I yi is the grayscale gradient in the y direction at the i-th pixel in the window, I ti is the gradient of the time at the ith pixel in the window, u is the speed of the pixel in the window in the x direction, v is the speed of the pixel in the window in the y direction, and N is the total number of pixels contained in the window; Using the least squares method to solve it, we get: but The superscript T represents transposition, and the superscript -1 represents the inverse of the matrix. The displacement of the feature point in the x direction is obtained according to u, and the displacement of the feature point in the y direction is obtained according to v. Then, the position of the feature point in the current captured image is obtained according to the displacement in the x direction and the displacement in the y direction. S42: using the LK optical flow method to calculate the optical flow vectors of the feature points in the static area set S and the potential area P, taking the optical flow vectors of the feature points in the set S as the optical flow vectors of the static area, and calculating the average optical flow vector; Where N is the number of feature points, u k and v k are the horizontal and vertical components of the optical flow vector of the kth feature point, respectively. U is the horizontal coordinate of the pixel, and V is the vertical coordinate of the pixel.

8. The dynamic visual SLAM method suitable for low-light scenes according to claim 7, characterized in that: In step S4, whether a feature point is a dynamic feature point is determined in the potential dynamic object boundary frame, and the formula is as follows: Where u and v are the velocity vectors of the pixel along the x-axis and y-axis respectively, and l is the threshold for judging whether the feature point is a dynamic feature point. If it is greater than the threshold, it is determined to be a dynamic feature point, otherwise it is a static feature point. The obtained static feature points are input into the tracking thread of ORB-SLAM3.

9. The dynamic visual SLAM method suitable for low-light scenes according to claim 1, characterized in that: In step S5, all static feature points in the obtained ORB feature points are matched between frames to obtain the best matching feature points, which specifically includes: S51: randomly extract 4 non-collinear feature points, calculate the homography matrix H and record it as model M, use model M to test all ORB feature points in the RGB image frame, calculate the projection error between all ORB feature points in the image frame and model M; if the error is less than a preset threshold, add the inlier set I, judge that the current inlier set element is greater than the preset optimal inlier set, then update the inlier set and the corresponding number of iterations k; if the maximum number of iterations is met, stop the iteration, and the obtained model is the optimal model, that is, the best inter-frame matching is achieved; S52: After the camera pose estimation, a key frame is selected for local mapping thread, loop detection thread and bundle adjustment for mapping processing; wherein the key frame is a frame selected from a series of local ordinary frames as a representative of the local frame, recording local information, and the local frame is a frame within the set distance range of the key frame; the best matching feature points are extracted from adjacent key frames, and the relative pose change between the two frames and the corresponding three-dimensional map points are calculated; The selection of the key frame satisfies at least one of the following conditions: the number of frames defined by the preset maximum value Max has passed between the previous key frame; the local mapping thread is in an idle state, and the number of frames defined by the preset minimum value Min is ensured to be at least separated from the previous key frame; the number or proportion of static feature points added to the tracking thread at the current perspective is lower than the preset value.

Citation Information

Cited By

  • Centralized collaborative SLAM map construction method and system

    CN118644433A

  • Lightweight track surface defect real-time detection method and device

    CN119313663A

  • Dynamic environment dense point cloud SLAM method and system based on YOLOv11 and ORB-SLAM3

    CN119540942A