SLAM (Simultaneous Localization and Mapping) method fusing points, lines and visual labels

Through the SLAM drawing construction method that integrates dots and lines and visual labels, the problem of insufficient accuracy and robustness of visual SLAM technology in low texture repeatability scenarios is solved, and higher precision drawing construction and more stable system performance are achieved.

CN118887353APending Publication Date: 2024-11-01TONGJI UNIV
View PDF 0 Cites 11 Cited by

Patent Information

Application Number
CN202410842365.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-27
Publication Date
2024-11-01

AI Technical Summary

Technical Problem

In scenarios with low texture and strong repeatability, traditional visual SLAM technology has low accuracy and robustness in feature extraction and matching, resulting in unstable performance of SLAM algorithms and loopback detection is prone to misdetection, affecting the system positioning accuracy.

Method used

A SLAM diagram building method that integrates dots and lines and visual labels is adopted. By extracting visual features and visual labels, combining the prior information of dots and lines reprojection error function and visual labels, camera pose tracking and loopback detection are carried out to construct joint semantics. Map, optimize map generation, improve SLAM accuracy and robustness.

Benefits of technology

The SLAM mapping accuracy and robustness in low texture repeatability scenarios are improved, the number of feature points and feature lines is enhanced, and the repetitive areas are detected using visual labels, which enhances the stability and positioning accuracy of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118887353A_ABST
    Figure CN118887353A_ABST
Patent Text Reader

Abstract

The invention relates to a point-line and visual label fused SLAM (Simultaneous Localization and Mapping) method, which comprises the following steps of: acquiring a picture shot by a binocular camera, preprocessing the picture, and extracting visual features and visual labels; solving the pose of the current frame, the extracted visual features and the world coordinates of the visual labels, and judging whether the current frame is a key frame or not through a key frame judgment strategy; according to the point-line reprojection error function, pose optimization is carried out, pose effectiveness is judged, and a proper tracking method is selected for pose tracking; calculating a BOW vector of the point-line feature, identifying a visual tag ID, and carrying out loopback detection and loopback optimization by using the BOW or the visual tag; and creating a joint semantic map of map points, lines, key frames and visual tags, removing redundant key frames, visual features and visual tags, and performing re-projection error optimization and coplanar constraint optimization in combination with a loopback detection result to complete map optimization. Compared with the prior art, the method has the advantages that the system robustness can be improved, and the mapping precision can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of visual SLAM technology, and in particular to a SLAM mapping method integrating points, lines and visual labels. Background Art

[0002] In order to achieve accurate positioning of vehicles, engineers will equip vehicles with various types of sensors, such as cameras, 3D laser radars, inertial measurement units (IMUs), etc. At the same time, different methods have been tried in the SLAM (Simultaneous Localization and Mapping) technical solution, such as laser SLAM, visual SLAM, and visual or laser SLAM methods integrated with IMUs. At present, most research and engineering projects choose visual SLAM solutions based on cost considerations. However, in some low-texture and repetitive structure scenes (tunnels, underground parking lots), the accuracy and robustness of traditional feature point methods in feature extraction and matching will be reduced: in low-texture scenes, the sparse feature points make the SLAM algorithm unstable in the initialization and tracking stages, making the overall instability; in repetitive scenes, loop detection based on point features is prone to false detection, thus affecting the positioning accuracy of the system. Summary of the invention

[0003] The purpose of the present invention is to provide a SLAM mapping method that integrates points, lines and visual labels to address the low robustness problem of current visual SLAM in low texture repeatability scenes, introduce point, line features and visual labels to achieve higher precision mapping.

[0004] The purpose of the present invention can be achieved by the following technical solutions:

[0005] A SLAM mapping method integrating points, lines and visual labels comprises the following steps:

[0006] Visual feature extraction: obtain photos taken by the binocular camera and perform preprocessing to extract visual features and visual labels. The visual features include line features and point features.

[0007] Camera pose tracking: solve the current frame pose, extracted visual features and world coordinates of visual labels, and determine whether the current frame is a key frame through the key frame judgment strategy, generate new data associations for the key frame and all observed visual labels and generated 3D point and line features and add them to the SLAM system map; optimize the pose according to the point and line reprojection error function and judge the pose validity, and select one of the three tracking methods based on the pose validity, including pose tracking based on the constant speed motion model, pose tracking based on BOW matching and pose tracking based on brute force matching, for pose tracking;

[0008] Loop detection: including loop detection based on the point-line bag-of-words model and loop detection based on visual tags. It calculates the BOW vector of point-line features and identifies the visual tag ID. It uses BOW or visual tags to perform loop detection, find closed-loop candidate frames, and perform loop optimization.

[0009] Map construction and optimization: Create a joint semantic map of map points, lines, keyframes, and visual labels, remove redundant keyframes, redundant visual features, and redundant visual labels, and combine loop detection results to perform reprojection error optimization and coplanar constraint optimization to complete map optimization.

[0010] Compared with the prior art, the present invention has the following beneficial effects:

[0011] (1) The present invention introduces line features with illumination invariance and viewing angle invariance to compensate for the sparsity and insufficiency of visual feature points in the scene, increases the extraction and matching of line features, constructs the point and line feature reprojection error function between frames, obtains the camera pose between frames, and realizes more accurate camera pose tracking.

[0012] (2) The present invention utilizes visual labels to provide prior information (such as position, scale, coplanar information, etc.), which can further increase the number of feature points and feature lines in the image, while improving the accuracy and generating a joint semantic map of feature points-feature lines-visual labels-key frames, and further optimize the generation of the overall map using the constraint relationship of points, lines and visual labels to improve the accuracy of SLAM and the robustness of the system.

[0013] (3) The visual tag introduced in the present invention can detect the ID itself, which is helpful for distinguishing repetitive areas. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] Figure 1 is a flow chart of the method of the present invention;

[0015] Figure 2 This is a flow chart of visual tag detection and recognition of the present invention;

[0016] Figure 3 This is a schematic diagram of the 3D rendering of a straight line of the present invention;

[0017] Figure 4 A SLAM map composed of points, lines and visual labels in one embodiment;

[0018] Figure 5 A partial enlarged view of a SLAM map composed of points, lines and visual labels in an embodiment;

[0019] Figure 6 is the Plücker coordinates of the feature line in the world coordinate system and the visual label coordinate system DETAILED DESCRIPTION

[0020] The present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. This embodiment is implemented based on the technical solution of the present invention, and provides a detailed implementation method and specific operation process, but the protection scope of the present invention is not limited to the following embodiments.

[0021] Due to the scale uncertainty problem of the monocular camera, the images collected by the binocular camera are used as the input of the visual SLAM system designed in this paper. In order to further improve the stability of the visual SLAM based on point-line features and solve the problem of scale drift caused by the binocular visual SLAM system, visual labels are added on the basis of the point-line binocular visual SLAM system to further improve the robustness of the overall system. By introducing visual labels to construct the visual label-keyframe constraint relationship, the accuracy is improved while generating a joint semantic map of feature points-feature lines-visual labels-keyframes, and the constraint relationship of point-line-visual labels is further used to optimize the generation of the overall map. The visual SLAM framework designed by the present invention is referred to as Point-Line-Marker SLAM (PLM-SLAM), including a visual feature extraction module, a camera pose tracking module, a loop detection module, a map construction module and a map optimization module, such as Figure 1 As shown. Further explanation of the new content added to the framework:

[0022] 1. Each frame of the image input module is called a frame, which is a grayscale image after dedistortion and binocular stereo correction; the feature extraction module is mainly responsible for extracting feature points (Landmark), feature lines (LandmarkLine) and visual labels (Marker) in the Frame, and uses the extraction results as the input of the tracking module for subsequent matching and tracking, and also as the input of the triangulation method module for generating 3D points and 3D lines.

[0023] 2. The camera pose tracking module is mainly responsible for solving the pose of the current frame and the world coordinates of the extracted visual features (points and lines) and the world coordinates of the visual labels. It also uses a specific judgment strategy to determine whether the current frame is a key frame (KeyFrame), and then generates new data associations for the key frame and all the observed visual labels and generated 3D point and line features and adds them to the system map.

[0024] 3. The system not only includes Marker, Landmark, LandmarkLine and KeyFrame, but also includes the covisibility relationship (Covisibility) between KeyFrame and Marker, KeyFrame and Landmark and LandmarkLine, and uses Covisibility to establish the reprojection error constraint (Bundle Adjustment, BA).

[0025] 4. In addition to the above data association, a data association between Marker and LandmarkLine is further established. The LandmarkLine belonging to Marker is collectively referred to as MarkerLine in this embodiment. A coplanar constraint is established for the four MarkerLines belonging to each Marker.

[0026] 5. The BOW (bag-of-words) dictionary is a pre-computed dictionary that describes image features. It uses a k-ary tree data structure and can quickly index the feature descriptors contained in a given image frame and derive its category.

[0027] Specifically, this embodiment provides a SLAM mapping method that integrates points, lines, and visual labels, including the following steps:

[0028] S1, visual feature extraction: obtain the photos taken by the binocular camera and preprocess them to extract visual features (including line features, point features) and visual labels.

[0029] First, for the selection of feature points, this embodiment uses ORB (Oriented Fast and RotatedBRIEF) feature points. ORB feature points are based on the extraction of FAST (Feature from Accelerated Segment Test) corner points and the combination of BRIEF (Binary Robust Independent Elementary Feature) feature descriptors. It has good rotation invariance, high robustness and computational efficiency, and can find matching feature point pairs by calculating the "distance" between descriptors.

[0030] Secondly, regarding the selection of feature lines, this embodiment uses LSD (Line Segment Detector) as the feature line extraction algorithm, and selects LBD (Line Binary Descriptor) to generate its descriptor. Compared with other edge and line feature extraction algorithms, the LSD algorithm has higher computational efficiency and strong robustness to noise and transformation. As a descriptor of line features, LBD has the advantages of perspective invariance and less computing resources required for matching and storage, making it the most ideal descriptor for feature lines.

[0031] For the extraction of visual labels, such as Figure 2 As shown, the following steps are included:

[0032] a) Image preprocessing

[0033] In order to ensure the accuracy of segmentation, the visual label generally uses white as the background and black as its overall outline. First, the original input image needs to be grayscaled and the RGB three-channel image is converted into a single channel. This process can increase the texture features of the visual label, improve the accuracy of subsequent visual label contour extraction, and reduce the impact of noise. Secondly, the grayscale image is filtered to further remove noise and highlight the edge and corner features in the image. This embodiment uses the Sobel non-directional first-order differential edge detection operator for filtering to obtain a clearer binary image.

[0034] b) Contour extraction

[0035] After the image preprocessing to obtain the binary image with enhanced edge features, it is necessary to extract the contour of the visual label. This embodiment uses the Suzuki algorithm to extract the contour information of the visual label at the image level. Due to the influence of the camera perspective, the contour of the visual label in the image is not strictly a square, and the Douglas-Peucker algorithm is also needed to find the minimum enclosing contour similar to a square, and finally obtain the contour information of the visual label.

[0036] c) ID decoding

[0037] Before ID decoding, distortion removal is required. Secondly, the Otsu method is used to perform threshold segmentation on the obtained image, that is, the binary image is divided into grids, and the coding of "0" and "1" is assigned to each grid according to its grayscale value. After that, the decoded code is matched with a pre-defined dictionary containing all visual tag IDs for identification and error correction.

[0038] d) Corner refinement

[0039] This step is mainly to obtain the precise pixel coordinates of the corner points of the visual label. The straight line equation of the edge is fitted by linear regression of the visual label contour pixels, and the sub-pixel intersection is determined by calculating the intersection between the straight lines.

[0040] When the camera is initialized, the SLAM system will extract each feature using the above method and perform feature matching. The initialization process includes:

[0041] 1) Feature point initialization: The present invention uses a binocular lens, and for the 3D conversion of feature points, the depth information can be obtained by using a binocular stereo vision method in a single frame.

[0042] 2) Initialization of feature lines: Planes are constructed by using the optical centers of the left and right cameras and the 2D feature lines extracted from their respective pixel planes. The spatial straight line equation is determined by the intersection of the two planes. Figure 3 shown.

[0043] 3) Initialization of visual labels: Infinitesimal Plane-Based Pose Estimation (IPPE) is used to calculate the pose change between the current frame and the visual label.

[0044] S2, camera pose tracking: solve the world coordinates of the current frame pose, extracted visual features and visual labels, and determine whether the current frame is a key frame through the key frame judgment strategy, generate new data associations for the key frame and all its observed visual labels and the generated 3D point and line features and add them to the SLAM system map; optimize the pose according to the point and line reprojection error function and judge the pose validity, and select one of the three tracking methods based on the constant speed motion model, the pose tracking based on BOW matching and the pose tracking based on brute force matching for pose tracking based on the pose validity.

[0045] (1) Key frame selection strategy based on multiple features

[0046] The selection of key frames in the SLAM system affects the accuracy of the overall system. The continuous visual information between key frames can help build a more accurate map, and it can be used to incrementally update the map, avoiding processing and storing all image frames, thereby increasing computing costs and wasting storage space. The matching between the new image frame and the key frame can update the map and optimize the camera posture, and the key frame will be used for subsequent closed-loop detection to correct the accumulated error and improve the robustness of the system. Only when some ordinary frames contain new information (LandMark, LandMark_Line, Marker) that does not yet exist in the SLAM system map or make posture tracking and optimization more stable and accurate, will it be considered to be upgraded to a key frame. In this embodiment, the selection strategy of the key frame is as follows:

[0047] 1. If the current frame F curr When a new visual label is observed, the current normal frame is set as the key frame KF curr , and add the frame and visual label to the map; according to the ambiguity of IPPE calculation, if the visual label is only observed once, its pose is not calculated but set to an invalid value. When the visual label can be observed in three consecutive frames, its pose is estimated unambiguously.

[0048] 2. If the current frame F curr When the observed visual label is saved in the map but its pose is invalid, set this frame as the keyframe KF curr , and add it to the observation sequence of the visual label. When the size of the sequence to be observed is greater than or equal to 3, the position and posture of the visual label are calculated and updated;

[0049] 3. If the current frame F curr If the number of observed close points is less than a preset threshold, it is set as a key frame, where the close point is a stereo key point with a depth value less than Baseline*40, where Baseline is the horizontal distance between the two optical centers of the binocular camera;

[0050] 4. If the current frame F curr With the reference key frame KF ref The number of jointly observed 3D map points is less than the number of individual observations of the reference keyframe τ p times, or the number of commonly observed 3D map lines is less than the number of individual observations of the reference keyframe τ l times, the current frame is set as the key frame, where τ p , τ l is the default value, the reference keyframe is all the keyframes of the map The key frame ω closest to the current frame is:

[0051]

[0052] Among them, d is the function of finding the Euclidean distance in three-dimensional space, f t is the current frame, f j For all keyframes in the map;

[0053] 5. If the current frame F curr The ID is greater than the preset threshold MaxID when the last keyframe was inserted Interval , a new keyframe is inserted.

[0054] The first two rules above determine whether to upgrade a normal frame to a key frame based on the state and observation of the visual tag. Rules 3 and 4 combine point and line features with the characteristics of the stereo camera to determine the conditions for upgrading the key frame.

[0055] (2) Optimizing the reprojection error function based on point and line poses

[0056] Before tracking the camera pose, we first introduce how to optimize the pose after tracking and determine the validity of the current frame pose. t Finally, it is necessary to determine whether the pose of the current frame is valid through optimization, that is, to optimize the current frame by minimizing the reprojection error using the LM algorithm.

[0057] The reprojection error function for point features is as follows:

[0058]

[0059] Among them, p i is the world coordinate of the 3D map point generated by the feature point of the previous frame during initialization or tracking, x i is the pixel coordinate of the corresponding 2D feature point in the current frame, π m is the projection model of the camera, γ ′ is the transformation matrix from the world coordinate system to the key frame coordinate system, and m is the total number of world map points seen by the current key frame.

[0060] The reprojection error function for line features is different from that for point features. If it is initialized by intercepting endpoints, the pixel error after reprojecting the 3D-2D matching line at the endpoints of the line segment can be minimized during optimization according to the reprojection error function of the point feature. However, in actual situations, the endpoints of the 3D map line after reprojection are not strictly matched to the matching 2D feature line, and the 2D feature line also needs to be intercepted. Because the camera moves too fast or the rotation angle is too large, the intercepted endpoints and the endpoints of the 3D map line will still not match each other, thus affecting the overall system accuracy. Therefore, further theoretical calculations are required for the coordinates of the intercepted endpoints. However, as the error accumulation drift caused by camera movement makes it difficult to determine whether the intercepted endpoints and the reprojected endpoints of the 3D line are strictly matched. Therefore, another method is used in this embodiment, that is, after the 3D map line is reprojected to the current frame image, the distances from its two endpoints to the corresponding 2D feature line are used to minimize the reprojection target and optimize the current frame pose. The specific formula is shown below

[0061]

[0062] Where R cw , t cwis the rotation matrix and translation vector from the world coordinate system to the camera coordinate system, {m w , d w} and {m c , d c} is the Plücker coordinate of the line in the world coordinate system and the current frame coordinate system, T cw is the transformation matrix from the visual coordinate system to the current frame coordinate system. Then we have:

[0063]

[0064] K L The projection matrix for a 3D line is:

[0065]

[0066] Among them, f x , f y , c x , c y Camera intrinsic coefficients.

[0067] So far, the reprojection error function of the 3D line to its 2D association is established:

[0068]

[0069] Where l is the coefficient of the equation of the line, x s , x e are the coordinates of the endpoints of the line.

[0070] Then determine whether the current optimized pose is valid: reproject the 3D map points and 3D map lines generated in the previous frame to the current frame, search for the corresponding matching 2D feature points and feature lines (with the minimum Hamming distance of the descriptor) within the preset range near the reprojected position, and then calculate and optimize the pose γ t , if the number of feature lines successfully matched in the current frame after reprojection is less than the set threshold Or the characteristic line is less than the set threshold The pose of the current frame is deemed invalid and needs to be recalculated.

[0071] (3) Posture tracking based on constant velocity motion model

[0072] The method based on the constant speed model is based on the assumption that the continuous image frames will not undergo sudden changes in posture. Assuming that the previous frame is tracked successfully, the current camera is in a state of uniform motion, that is, the camera's posture transformation from time t to time t-1 is the same as the camera's posture transformation from time t-1 to time t-2:

[0073] γ t,t-1 =γ t-1,t-2 (7)

[0074] Therefore, under the condition that the previous frame tracking is successful, its world pose γ t-1 is known, we can deduce:

[0075] γ t =γ t,t-1 γ t-1 =γ t-1,t-2 γ t-1 =γ t-1 ·(γ t-2 ) -1 γ t-1 (8)

[0076] γ t-1 ·(γ t-2 ) -1 This is the estimated constant speed of the camera. Get the current frame pose γ t Finally, it is necessary to determine whether the pose of the current frame is valid through optimization. That is, the LM algorithm is used to minimize the reprojection error to optimize the current frame. If the pose is invalid, the BOW matching-based method is used to recalculate the pose.

[0077] (4) Posture tracking based on BOW matching

[0078] The pose tracking method based on the constant speed motion model is applicable to most scenes, but its core is still that the camera is in an ideal motion state. In the actual shooting of the scene, there will be problems such as camera shake or the camera speed suddenly being too fast. The constant speed motion model will fail to estimate the pose. Therefore, the pose tracking method based on BOW matching is used to calculate the pose of the current frame. Each key frame is feature classified through a pre-trained dictionary. For the ordinary frame whose pose is to be estimated, the current frame is also feature classified through the dictionary, and then matched with the reference key frame, and the classified features are used to replace the original calculated descriptor. Compared with feature point descriptor matching, BOW-based feature matching is faster and compresses feature information. The time efficiency reaches O(logN) level by using the K-means++ clustering method and the N-ary tree storage method. If the matching result is greater than the set threshold, the pose of the current frame is set to the pose of the reference key frame, that is, γ t =γ t-1 , and then optimize the calculation and judge the validity of the pose. If the pose is invalid, the last brute force matching method is used for pose tracking.

[0079] (5) Posture tracking based on brute force matching

[0080] The pose tracking based on brute force matching is an algorithm used in extreme scenarios. It needs to calculate the essential matrix E and decompose the relative pose between the current frame and the reference key frame through E to obtain the world pose of the current frame. It also needs to use the matching of descriptors, but because the storage of descriptors is not a tree structure but an array, the time efficiency is O(N 2 ). The calculated current frame pose γ t The reprojection error function is also used for optimization. If the optimized pose is invalid, it means that tracking is lost.

[0081] S3, loop detection: calculate the BOW vector of point and line features, identify the visual tag ID, use BOW or visual tags to perform loop detection, find closed-loop candidate frames, and perform loop optimization.

[0082] This step includes loop detection based on the point-line bag-of-words model and loop detection based on visual labels.

[0083] (1) Loop closure detection based on the point-line bag-of-words model

[0084] Drawing on the classic visual SLAM framework, this embodiment adopts a BOW bag-of-words method for loop closure verification, and trains the bag-of-words belonging to line features in imitation of the bag-of-words model of point features, thereby expanding the classic SLAM loop detection method to a loop closure detection that integrates point and line features.

[0085] The loop detection method based on the bag-of-words model requires pre-loading the bag-of-words dictionary tree (point and line features have their own trained dictionary trees), and converts the point and line descriptors in the image into visual words belonging to the image features through the dictionary tree. The dictionary is trained in advance and contains all the words. The word statistics of the entire image are performed to obtain the bag-of-words vector, and then the distance between the vectors of the two frames is calculated to obtain the similarity between the current frame and the key frame.

[0086] To construct the dictionary tree, the K-means clustering algorithm is needed. Its purpose is to make the feature points in the image belong to a certain visual word after clustering, thereby converting simple feature matching into the problem of finding whether they belong to the same visual word.

[0087] The classified dictionary established by the above method is huge in number, which increases the time cost of calculating matching words to a certain extent. Therefore, it is necessary to express the dictionary in the form of a k-ary tree to reduce the time complexity.

[0088] The similarity between the current frame and the potential loop candidate frame is calculated by measuring the distance between the bag-of-words vectors. BOW vectors generally use term frequency-inverse document frequency (TF-IDF). TF and IDF represent the frequency of words in the image and dictionary, respectively.

[0089] Assume that the set of words detected in the image and the number of features belonging to the word is Γ={{w 1 ,c 1},{w 2 ,c 2},…,{w m ,c m}}, (m is the number of word types). Then the total number of words is word w i Corresponding TF i for:

[0090]

[0091] Assume that the total number of features in the dictionary is n, and w i The number is n i , then word w i Corresponding IDF i for:

[0092]

[0093] Thus, for word w i , the weight η can be calculated i :

[0094] η i =TF i *IDF i (11)

[0095] For all words in the u-th frame image, the word weight can be calculated and the BoW vector v is generated using the word weight u :

[0096] v u =[η 1 ,η 2 ,…,η m ] (12)

[0097] You can use L 1 Norm or cosine similarity calculation of two BOW vectors v u and v v , so as to make loop judgment.

[0098] In PLM-SLAM, the loop closure verification steps are different from those in ORB-SLAM. First, the similarity scores of the current frame and all its covisibiliy sets are calculated, and the lowest score s is retained. min As the minimum shared word threshold, all keyframes with scores below the threshold are then removed and the keyframes that meet the criteria are retained as loop closure candidates. And calculate the similarity score between the current frame and all loop candidates. Based on the point and line dictionary trees described above, it is necessary to calculate the point-based BOW similarity score and the line-based BOW similarity score s p and l , different weight information is given to different scenes to obtain a more robust score:

[0099] s=α p s p +α l s l (13)

[0100] In the formula, α represents the weight of each natural feature, which needs to satisfy α p +α l =1. p The larger the weight of α, the more point features there are in the scene, and the more key frames that can observe its features, which is often a general indoor scene. l The larger the weight, the greater the proportion of natural features in the scene. Therefore, in low-texture scenes, due to the visual invariance and illumination invariance of line features, the weight of line features will be appropriately increased to enhance the robustness of loop detection.

[0101] Next, we need to perform consistency check on the loop candidate group. for further processing. The covisibility set of each frame in it constitutes a loop group. If the current frame has three or more consecutive frames with covisibility relationship with the key frame in the loop group, the key frame in the loop group will be identified as a loop key frame. This consistency check method can effectively reduce the possibility of false detection of loops and improve the accuracy and reliability of loop detection.

[0102] (2) Loop closure detection based on visual labels

[0103] Each visual tag has its own unique ID. If a visual tag with ID m is observed in the current frame, and the tag is saved in the previous map construction and has a valid pose, but the tag is not observed in the co-viewing relationship set of the current keyframe, it needs to be further identified through loop detection; index the keyframes that can observe the ID in the map as loop candidates, calculate the similarity scores between the current frame and all loop candidates, and perform loop detection.

[0104] (3) Loopback Optimization

[0105] In the PLM-SLAM system, the binocular lens can effectively estimate the depth of feature points and provide effective scale information. However, in reality, not all feature points meet the requirements of the near point. As the camera moves, the accumulated error will increase, and the binocular lens will also have the problem of scale drift. Because the scale of the visual label is fixed and unchanged, it can effectively keep the map at the real scale. Therefore, in the loop optimization part, the scale optimization will be added on the basis of the six-degree-of-freedom pose optimization. The Lie algebra used for the corresponding optimization is changed from se(3) to sim(3), and the corresponding similarity transformation is also changed to:

[0106]

[0107] Among them, κ is the similarity transformation group matrix, and s is the scaling factor.

[0108] Similar to the local map optimization described above, a global loop optimization of 3D map points, lines, visual labels, and keyframes based on sim(3) is constructed in the global map. According to the current frame pose and its relative pose transformation to the loop keyframe, the error equation e is constructed. loop , and finally achieve global optimization to eliminate the accumulated error. The specific Jacobian derivation will not be repeated one by one. In addition to the advantages of pose optimization to eliminate errors, loop optimization can also help improve the consistency and accuracy of the map, optimize the relative pose and natural features between loop keyframes and the location information of visual labels, improve the topological structure and geometry of the map, make the map more accurate and complete, and improve the stability of the overall visual SLAM system.

[0109] S4, map construction and optimization: Create a joint semantic map of map points, lines, keyframes, and visual labels, remove redundant keyframes, redundant visual features, and redundant visual labels, and combine the loop detection results to perform reprojection error optimization and coplanar constraint optimization to complete map optimization.

[0110] As keyframes are inserted during tracking, more keyframes, map points, map lines, and visual labels will be added to the map. However, the pose information of the new feature is calculated by matching the two frames before and after the camera moves. Under each tracking algorithm, only the pose of the current frame is optimized without updating the 3D features. As a result, during the movement of the system, there will be error drift, which will affect the accuracy and robustness of the overall system. Map construction requires constructing the connection between new features and keyframes and features when new features appear, so as to subsequently optimize the local map or the global map. This step makes full use of the Covisibility relationship and BA function to construct a reprojection error function for all features of the system and the keyframes that observe its features, and performs large-scale nonlinear optimization. The reprojection error of the pose is adjusted to the minimum in an iterative manner, thereby making full use of the observation information to maximize the elimination of the system's cumulative error.

[0111] (1) Joint semantic map of points, lines, visual labels and keyframes

[0112] In the PLM-SLAM system, a joint semantic map of points, lines, markers and key frames is constructed, and semantic information is given to some line segments (that is, to determine whether the line segment belongs to the marker and give it ID information). While transforming the reprojection errors of features and key frames during back-end optimization, coplanar constraints of line segments under the same marker are constructed to make the visual SLAM system more robust.

[0113] like Figure 4As shown in the figure, the red points represent 3D feature points in the local map, the purple lines represent 3D feature lines, the magenta boxes represent visual labels, the green represents key frames, and the lines between the green ones represent the covisibility relationship between the key frames. The covisibility relationship of the key frames includes the observation of the same feature point, feature line and marker, and the nonlinear optimization graph model is established through the constraints under the covisibility condition. The graph model constraints of the 3D map points are related to the reprojection pixel error of the 2D feature points they match; the graph model constraints of the 3D feature lines are related to the distance from the endpoint of the 2D feature line they match to the straight line, that is, the distance from the endpoint of the reprojection straight line to the 2D observation line is the minimum; the constraints of the markers are optimized with the semantic information of the label instance and the reprojection pixel error of the edge corners. In addition, the constraints of the MarkerLine and its subordinate markers are added, that is, there is a natural coplanar constraint relationship between the four MarkerLines belonging to the same marker. Through the tightly coupled constraint relationship, not only the constraints from the feature to the key frame are established, but also the constraints between the features are established, so that the visual SLAM can easily identify the surrounding environment and carry out the subsequent map optimization process. At the same time, when arranging markers, appropriate prior conditions can be met, such as the markers being in the same plane, which is called prior knowledge constraints. Prior knowledge constraints can make map construction more accurate, facilitate map recognition, and better eliminate scale drift and cumulative errors caused by long-term SLAM operation.

[0114] (2) Reprojection error optimization

[0115] (21) Keyframe-feature point optimization: Whenever a new keyframe is inserted, the co-viewing information of the keyframe in the local map is updated, and the co-viewing keyframe set composed of the current frame is retrieved. To optimize the key frame pose and world coordinates of feature points in each part of the common view area when the camera moves, are all the common view keyframes in the map. The reprojection error is optimized by using the 3D map points in the local keyframes where they are observed, and the error equation is established as follows:

[0116]

[0117] where π is the projection matrix, KF j is a key frame, p i Represents a 3D map point, x i Represents the observation of the map point in the keyframe, that is, the pixel corresponding point.

[0118] (22) Keyframe-feature line optimization: Extract the common-view keyframe set of all local maps in the map The common view keyframe set and the 3D straight lines observed in the keyframes constitute a common view map. The 3D straight lines are represented by Plücker coordinates (m T ,d T ) T The reprojection error of a straight line is defined as the distance error between the endpoint of the 3D feature line and its corresponding 2D feature after the 3D feature line is projected into the key frame, and optimization is performed based on the distance error.

[0119] (23) Keyframe-visual label optimization: extract the common-view keyframe set under all local maps in the map The common view keyframe set and the visual labels observed in the keyframes constitute a common view map. The relative pose relationship between the keyframes and the visual labels is optimized by using the edge corner points of the visual labels to build the reprojection error in different keyframes. According to the above, the coordinates of the corner points of the visual labels in the visual label coordinate system to which they belong are first obtained, and then the visual label coordinate system γ obtained by the IPPE algorithm or the previous optimization is obtained. m The relative pose change of the world coordinate system is converted to the world reference system, and then the pose of the key frame in the world coordinate system is converted to the camera system to establish the reprojection error equation as shown below:

[0120]

[0121] where π is the projection matrix, KF j is a key frame, m i Represents the corner point of the visual label, x i Represents the observation of the corner point in the keyframe.

[0122] (3) Coplanarity Constraint Optimization

[0123] (31) Feature line-visual label optimization:

[0124] Each MarkerLine is assigned three attributes: 1. Whether the 2D feature line belongs to a visual label; 2. The ID of the visual label to which the 2D feature line belongs; 3. The sequence of the 2D feature line under the visual label. Under the conditions of the three attributes, find all the local visual label sets in the local map Traverse the collection and find the MarkerLine under each visual label through attribute 2, and add the binary edge of the visual label and MarkerLine in the graph optimization. For the generated 3D MarkerLine, the relative pose transformation from the world coordinate system to the coordinate system of the visual label is performed to obtain the Plücker coordinates of the 3D straight line in the visual label coordinate system. Then use attribute 3 to obtain the sequence of each straight line and optimize them according to the sequence.

[0125] according to Figure 5As shown in the figure, the magenta box is the visual label extracted and realized by the algorithm in the ArUco library, and the purple line segment is the generated spatial 3D line without semantic information. It can be seen that the visual SLAM system can extract the edges of the visual label and effectively generate the spatial line, but the line only reflects the structural characteristics of the visual label, but does not have semantic information. In addition, these lines are irregularly arranged due to the accumulated errors and triangulation errors during the camera movement, and are not completely valid map features in map construction. It is necessary to add the coplanar constraint optimization of the feature line in the visual label coordinate system.

[0126] Figure 6 The Plücker expression of a spatial line in world coordinates and visual label coordinates is shown. The red color in the figure is MarkerLine. In the visual label coordinate system, the conversion of the Plücker coordinates of the MarkerLine from the visual coordinate system to the camera coordinate system is: Take MarkerLine(seq3) as an example. Should be x M Axis direction parallel, Should be with z M The axes are parallel, so the following relationship holds:

[0127]

[0128] Therefore is a unit vector parallel to the x-axis, is a unit vector parallel to the z-axis, so The first two terms of should be constrained to be 0, The last two terms of should be constrained to 0, so as to realize the constraint of the line to the visual coordinate plane. The derivation of the Jacobian matrix in nonlinear optimization is not repeated here. For MarkerLine (seq1 and seq3), formula (18) is used for optimization, while for MarkerLine (seq2 and seq4), it is only necessary to let It only needs to be parallel to the unit vector of the y-axis. By constraining each MarkerLine to be parallel to the coordinate axis in the visual coordinate system, the parallel and vertical constraints between different MarkerLines can be optimized indirectly, making the semantic information clearer and the map construction more accurate.

[0129] (32) Optimization of visual label prior knowledge: For all visual labels in the same plane, the map is further optimized using prior information. Their relative position changes only rotate around the z-axis. The rotation matrix around the z-axis is known to be:

[0130]

[0131] For the coplanar constraint, the relative pose change between tags is only a translation on the xoy plane or a rotation around the z-axis when the z-axis coordinates are equal. Let the pose of the i-th world tag in the same plane be The pose of the jth visual label is Its relative position In order to meet the requirements of formula (19), some components of its posture transformation matrix should be 0, so the following constraint equation can be established:

[0132]

[0133] Among them, T i,j is the relative transformation matrix between two visual labels, and θ is the rotation angle.

[0134] Making full use of prior knowledge and adding constraints can more effectively improve mapping accuracy and enhance the overall robustness of visual SLAM.

[0135] (4) Redundant features and keyframe removal

[0136] In the process of tracking and mapping by the visual SLAM system, new features and key frames will be gradually generated and saved in the map. When performing global optimization, as the common view relationship becomes increasingly dense, the burden on the backend optimization and loop detection modules will increase, affecting the real-time performance of the system. Therefore, it is necessary to remove redundant features and key frames.

[0137] For key frames, a set of all key frames that can observe visual labels is selected according to the visual labels, and the three key frames with the farthest distance are selected and regarded as non-removable key frames. For the remaining key frames, when more than 90% of the same 3D map points and more than 40% of the same 3D map lines are observed together, they are considered redundant key frames and are removed from the system map.

[0138] For visual labels, since the number of visual labels is much smaller than the number of feature points and feature lines, and their poses require more than three key frames to be estimated, their relative pose transformation is relatively accurate, so visual labels are not set as redundant features.

[0139] For a visual feature, if more than five keyframes are added after it is first added to the map, and the number of keyframes in which this feature can be observed is less than the set threshold (set to 3 for point features and 2 for line features), it means that the feature is an outlier and is removed from the system.

[0140] The present invention proposes a PLM-SLAM framework combining multiple natural features with visual tags. The extraction, matching and initialization process of visual features under a binocular camera, the tracking and keyframe optimization scheme of multi-feature primitives, the construction of a joint semantic map combined with visual tags, and the backend optimization and loop optimization algorithm are introduced in detail. The SLAM framework combining multiple features with visual tags can increase the diversity of features and structures in the map, making the map construction for different types of scenes more robust. Point features are suitable for areas with rich textures, line features are a supplement to point features in low-texture scenes and are suitable for scenes with obvious edge structures, and visual tags can clearly identify the position and posture of the camera in the scene. The three improve the consistency of the map during map construction, and the constraint relationships of multiple visual features complement each other to help correct errors and drifts in the map construction process. By identifying visual tags, semantic annotations can be added to specific locations or objects in the map, and the prior optimization algorithm of feature lines and visual tags is added to make the map more understandable and usable. The simultaneous use of point features, line features and visual labels can increase the robustness of the SLAM system. When a certain type of feature cannot provide reliable constraints in certain circumstances, other types of features can make up for the lack of constraints, thereby improving the stability and reliability of the overall system.

[0141] The preferred specific embodiments of the present invention are described in detail above. It should be understood that a person skilled in the art can make many modifications and changes based on the concept of the present invention without creative work. Therefore, any technical solution that can be obtained by a person skilled in the art through logical analysis, reasoning, or limited experiments based on the concept of the present invention on the basis of the prior art should be within the scope of protection determined by the claims.

Claims

1. A SLAM mapping method integrating points, lines and visual labels, characterized in that: The following steps are involved: Visual feature extraction: obtain photos taken by the binocular camera and perform preprocessing to extract visual features and visual labels. The visual features include line features and point features. Camera pose tracking: solve the current frame pose, extracted visual features and world coordinates of visual labels, and determine whether the current frame is a key frame through the key frame judgment strategy, generate new data associations for the key frame and all observed visual labels and generated 3D point and line features and add them to the SLAM system map; According to the point-line reprojection error function, the pose is optimized and the pose validity is judged. Based on the pose validity, one of the three tracking methods, pose tracking based on the constant speed motion model, pose tracking based on BOW matching, and pose tracking based on brute force matching, is selected for pose tracking; Loop detection: including loop detection based on the point-line bag-of-words model and loop detection based on visual tags. It calculates the BOW vector of point-line features and identifies the visual tag ID. It uses BOW or visual tags to perform loop detection, find closed-loop candidate frames, and perform loop optimization. Map construction and optimization: Create a joint semantic map of map points, lines, keyframes, and visual labels, remove redundant keyframes, redundant visual features, and redundant visual labels, and combine loop detection results to perform reprojection error optimization and coplanar constraint optimization to complete map optimization.

2. A SLAM mapping method integrating points, lines and visual labels according to claim 1, characterized in that: The extraction of visual features and visual labels is specifically as follows: extracting ORB feature points of an image as point features based on a FAST corner detection algorithm and a BRIEF feature descriptor; extracting feature lines based on an LSD algorithm, and using LBD to generate its descriptor to obtain line features; performing image preprocessing, contour extraction, ID decoding, and corner refinement on the image in sequence to extract visual labels.

3. A SLAM mapping method integrating points, lines and visual labels according to claim 1, characterized in that: The key frame judgment strategy includes:

1. If the current frame F curr When a new visual label is observed, the current normal frame is set as the key frame KF curr , and add the frame and visual label to the map; 2. If the current frame F curr When the observed visual label is saved in the map but its pose is invalid, set this frame as the keyframe KF curr , and add it to the observation sequence of the visual label. When the size of the sequence to be observed is greater than or equal to the preset threshold, the position and posture of the visual label are calculated and updated; 3. If the current frame F curr If the number of observed close points is less than a preset threshold, it is set as a key frame, where the close point is a stereo key point with a depth value less than Baseline*40, where Baseline is the horizontal distance between the two optical centers of the binocular camera; 4. If the current frame F curr With the reference key frame KF ref The number of jointly observed 3D map points is less than the number of individual observations of the reference keyframe τ p times, or the number of commonly observed 3D map lines is less than the number of individual observations of the reference keyframe τ l times, the current frame is set as the key frame, where τ p , τ l is the default value, the reference keyframe is all the keyframes of the map The key frame ω closest to the current frame is: Among them, d is the function of finding the Euclidean distance in three-dimensional space, f t is the current frame, f j For all keyframes in the map; 5. If the current frame F curr The ID is greater than the preset threshold MaxID when the last keyframe was inserted Interval , a new keyframe is inserted.

4. The SLAM mapping method of claim 1, wherein: The pose optimization according to the point-line reprojection error function is specifically as follows: For point features, the reprojection error function of the point features is defined as follows: Among them, p i is the world coordinate of the 3D map point generated by the feature point of the previous frame during initialization or tracking, x i is the pixel coordinate of the corresponding 2D feature point in the current frame, π m is the projection model of the camera, γ ′ is the transformation matrix from the world coordinate system to the key frame coordinate system, and m is the total number of world map points seen by the current key frame; For line features, after reprojecting the 3D map line to the current frame image, the distances from its two endpoints to the corresponding 2D feature line are used to minimize the reprojection target and optimize the current frame pose. The specific formula is as follows: Where R cw , t cw is the rotation matrix and translation vector from the world coordinate system to the camera coordinate system, where {m w , d w } and {m c , d c } is the Plücker coordinate of the line in the world coordinate system and the current frame coordinate system, T cw It is the transformation matrix from the visual coordinate system to the current frame coordinate system; And then: K L The projection matrix for a 3D line is: Among them, f x , f y , c x , c y Camera intrinsic coefficients; So far, the reprojection error function of the 3D line to its 2D association is established: Where l is the coefficient of the equation of the line, x s , x e are the coordinates of the endpoints of the line.

5. The SLAM mapping method of integrating points, lines and visual labels according to claim 1, characterized in that: The method for determining the validity of the pose is as follows: reprojecting the 3D map points and 3D map lines generated in the previous frame to the current frame, searching for the corresponding matching 2D feature points and feature lines within a preset range near the reprojected position, and calculating the pose γ according to the calculated and optimized pose γ. t , if the number of feature lines successfully matched in the current frame after reprojection is less than the set threshold Or the characteristic line is less than the set threshold The pose of the current frame is deemed invalid and needs to be recalculated.

6. A SLAM mapping method integrating points, lines and visual labels according to claim 1, characterized in that: The posture tracking is performed by selecting one of the three tracking methods based on the posture validity, namely, posture tracking based on the constant speed motion model, posture tracking based on BOW matching, and posture tracking based on brute force matching. Specifically, the posture tracking is: First, the pose tracking method based on the constant speed motion model is used to obtain the current frame pose γ t Finally, the pose is optimized according to the point-line reprojection error function and the validity of the pose is judged. If the pose is invalid, the BOW matching-based method is used to recalculate the pose. The pose is optimized according to the point-line reprojection error function and the validity of the pose is judged. If the pose calculated by the BOW matching method is also invalid, the brute force matching-based method is used for pose tracking.

7. The SLAM mapping method of claim 1, wherein: The loop detection based on the point-line bag-of-words model includes the following steps: Offline construction of the bag-of-words model for points and lines: Load the bag-of-words dictionary tree for points and lines respectively, and convert the point and line descriptors in the image into visual words belonging to the image features through the dictionary tree. The dictionary is trained in advance and contains all the words. The word statistics of the entire image are performed to obtain the bag-of-words vector; Calculate the similarity score between the current frame and all its co-viewing relationship sets, and retain the lowest score as the minimum shared word threshold; All key frames with scores lower than the minimum shared word threshold are eliminated, and qualified key frames are retained as loop candidates. The similarity scores between the current frame and all loop candidates are calculated. Based on the point and line dictionary trees in the bag-of-words model, the point-based BOW similarity score and the line-based BOW similarity score are calculated. Different weight information is assigned to them according to different scenes to obtain the final score. The co-viewing relationship set of each frame in the loop candidate constitutes a loop group. If there are three or more consecutive frames with co-viewing relationship between the current frame and the key frame in the loop group, the key frame in the loop group is identified as a loop key frame.

8. The SLAM mapping method of claim 1, wherein: The loop detection based on visual tags is as follows: each visual tag has its own unique ID. If a visual tag with ID m is observed in the current frame, and the tag is saved in the previous map construction and has a valid posture, but the tag is not observed in the common view relationship set of the current key frame, further identification is required through loop detection; the key frame in which the ID can be observed is indexed in the map as a loop candidate, and the similarity score between the current frame and all loop candidates is calculated to perform loop detection.

9. The SLAM mapping method of claim 1, wherein: The removal of redundant keyframes, redundant visual features and redundant visual labels is specifically as follows: For keyframes, select all keyframes that can observe visual labels according to visual labels, select the three keyframes with the farthest distance and regard them as non-removable keyframes. For the remaining keyframes, if more than 90% of the same 3D map points and more than 40% of the same 3D map lines are observed together, they are considered redundant keyframes and removed from the system map; For visual features and visual labels, visual labels are not set as redundant features. For visual features, if more than a preset number of keyframes are added after they are first added to the map, and the number of keyframes in which this feature can be observed is less than the set threshold, it means that the feature is an outlier and is removed from the system.

10. A SLAM mapping method integrating points, lines and visual labels according to claim 1, characterized in that: The reprojection error optimization comprises: Keyframe-feature point optimization: Whenever a new keyframe is inserted, the common view information of the keyframe in the local map is updated, and the common view keyframe set composed of the current frame is taken out to optimize the keyframe pose and the world coordinates of the feature points in each part of the common view area when the camera moves. The reprojection error is established in the observed local keyframe using the 3D map point for optimization; Keyframe-feature line optimization: Take out the common view keyframe set under all local maps in the map. The common view keyframe set and the 3D straight line observed in the keyframe constitute a common view map. The reprojection error of the straight line is defined as the distance error between the 3D feature line and the endpoint of its corresponding 2D feature after being projected into the keyframe. Optimization is performed based on the distance error. Keyframe-visual label optimization: Take out the common view keyframe set under all local maps in the map. The common view keyframe set and the visual labels observed in the keyframes constitute a common view map. The reprojection error of the visual label edge corner points in different keyframes is used to optimize the relative position relationship between the keyframes and the visual labels. The reprojection error is: where π is the projection matrix, KF j is a key frame, m i Represents the corner point of the visual label, x i Represents the observation of corner points in key frames; Feature line-visual label optimization: convert the Plücker coordinates of the spatial straight line belonging to the visual label from the world coordinate system to the visual label coordinate system, determine the sequence of each straight line in the visual label coordinate system, and optimize each line according to the sequence; Optimization of visual label prior knowledge: For all visual labels in the same plane, the map is further optimized using prior information. The relative position change only rotates around the z-axis. The rotation matrix around the z-axis is known to be: Therefore, the following constraint equation is established: Among them, T i,j is the relative transformation matrix between two visual labels, and θ is the rotation angle.

Citation Information

Cited By

  • Binocular vision positioning method and system in weak light environment based on deep learning enhancement

    CN120318479A

  • Binocular vision positioning method and system in weak light environment based on deep learning enhancement

    CN120318479B

  • Dynamic visual positioning mapping method and system based on multi-space information

    CN120689536A

  • A dynamic visual positioning mapping method and system based on multi-space information

    CN120689536B

  • Visual identification positioning method, device and equipment of robot

    CN120760699A