Key frame optimization processing method for SLAM and storage medium
The method optimizes keyframe sequences in SLAM systems by preprocessing and merging vehicle trajectories, addressing data redundancy and noise interference, and enhancing trajectory continuity and topological relationships.
Patent Information
- Application Number
- CN202510342790.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-21
- Publication Date
- 2025-07-15
AI Technical Summary
In the existing visual SLAM system, the keyframe sequence has problems such as data redundancy and noise interference, discreteness and discontinuity, and missing topological relationships, resulting in inaccurate description of motion trajectory and distortion of topological structure.
By preprocessing the keyframe sequence, identifying vehicle motion trajectory, data fusion and topology simplification, the keyframe sequence is optimized, lightweight topological skeletons are generated, redundant data is eliminated, and key information is retained.
It realizes efficient structure of keyframe sequences, reduces memory resource usage, improves the accuracy and efficiency of path planning, and is suitable for low computing power scenarios.
Smart Images

Figure CN120318271A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of visual SLAM technology, and in particular, to a method for optimizing key frames for SLAM and a storage medium. Background Art
[0002] Currently, during the operation of a system based on visual SLAM (Simultaneous Localization and Mapping), the core output data includes two types: a key frame sequence and map points. Among them, the map points construct a sparse map through discretized three-dimensional feature coordinates. However, since they only represent local environmental features, it is difficult to directly support the requirements of global path planning. In contrast, the key frame sequence records the continuous pose information (such as position, rotation angle, etc.) of the camera during the SLAM process and theoretically can reflect the complete motion trajectory of the device. However, the original key frame sequence has the following technical bottlenecks:
[0003] (1) Data redundancy and noise interference: The key frame sequence contains a large number of redundant frames (such as repeated sampling in a static scene) and pose noise caused by sensor jitter and motion blur. Directly using it for path expression will cause trajectory distortion and topological structure distortion;
[0004] (2) Discreteness and non - continuity: Key frames are essentially discrete sampling points, and their sparse distribution cannot completely describe the continuity of the device's motion, especially in dynamic scenes such as turning, accelerating, and decelerating, where path breakpoints are likely to occur;
[0005] (3) Lack of topological relationship: Existing methods mostly rely on geometric trajectory fitting (such as polynomial interpolation, Bezier curve) to generate paths, but such methods cannot effectively express the feasible path network in the environment (such as fork connectivity, dynamic obstacle avoidance logic), which limits the intelligence of navigation decisions. Summary of the Invention
[0006] The present invention provides a method for optimizing key frames for SLAM and a storage medium, which solves the technical problem that the key frame sequence output by the existing visual SLAM cannot accurately represent the complete motion trajectory due to the characteristics of data redundancy and noise interference, discreteness and non - continuity, and lack of topological relationship.
[0007] To solve the above - mentioned technical problems, the present invention provides a method for optimizing key frames for SLAM, including:
[0008] Extracting the key frame sequence located by the SLAM system and pre - processing the key frame sequence;
[0009] Traverse the key frame sequence to identify the actual motion trajectory of the vehicle, and then perform data fusion on the repeated trajectories in the actual motion trajectory, merge the corresponding key frame sequences, and create corresponding trajectory nodes;
[0010] Identify each of the trajectory nodes on the topological map, perform clustering analysis and execute topological simplification to obtain the optimized target motion trajectory.
[0011] In a further embodiment, extract the key frame sequence located by the SLAM system, specifically:
[0012] Obtain the key frame sequence output by the SLAM system;
[0013] For the key frame sequence Perform cleaning to obtain the parameter p corresponding to the world coordinates therefrom i =[x, y, z] T ; where i represents the order of the key frame sequence, p i represents a vector, and x, y, z respectively represent the offsets of the corresponding coordinate axes, represents the set of real numbers, and N is a natural number.
[0014] In a further embodiment, preprocess the key frame sequence, specifically: perform convolution on the key frame sequence through a kernel function to obtain a new key frame sequence as follows:
[0015]
[0016] In the formula, P ′ is the key frame sequence after convolution, p i ′ is the parameter of the world coordinates corresponding to P ′ , and H(k) is the kernel function; the shape of the kernel function H(k) is where n represents the length of the kernel function, that is, the length of subsequent convolution, and 3 represents the weights of the offsets of the three coordinate axes.
[0017] In this solution, convolution smoothing is performed before screening the key frame sequence. On the one hand, it effectively reduces the noise in the sequence, making the screening of key frames more accurate; on the other hand, by pre-smoothing the motion trajectory, unnecessary calculations can be reduced in the subsequent key frame screening process, improving the overall processing efficiency.
[0018] In a further embodiment, traversing the key frame sequence to identify the actual motion trajectory of the vehicle includes:
[0019] Adopt a sliding window to traverse the key frame sequence, calculate the change vector of each pair of adjacent frames, and generate a corresponding vector set;
[0020] Based on the first and last two sets of the change vectors obtained from the vector set, determine whether the motion trajectory within the current sliding window is a turning trajectory. If so, obtain the entire key frame sequence corresponding to the turning trajectory; if not, proceed to the next step to create trajectory nodes.
[0021] In this solution, when the vehicle is in motion, the direction remains unchanged during straight-line driving and changes during curve driving. Therefore, by calculating the first and last two sets of the change vectors, it is possible to determine whether the motion trajectory within the current sliding window is a turning trajectory, and different scenarios can be used for trajectory optimization. By traversing the key frame sequence using a sliding window and retaining the temporal dependence between frames, continuous motion trajectories can be detected flexibly.
[0022] In a further implementation, obtaining the entire key frame sequence corresponding to the turning trajectory specifically involves:
[0023] Adjust the window size of the sliding window to store the key frame sequence of the entire turning trajectory, and restore the default window size of the sliding window until straight-line driving is detected again.
[0024] This solution sets a sliding window for trajectory recognition. When a turning trajectory is detected, the window size of the sliding window is adjusted flexibly to ensure that the continuous and complete turning trajectory is covered, providing accurate data support for subsequent trajectory optimization.
[0025] In a further implementation, data fusion is performed on the repeated trajectories in the actual motion trajectory, and the corresponding key frame sequences are merged and the corresponding trajectory nodes are created, including:
[0026] All the key frame sequences corresponding to the turning trajectory are used as repeated trajectories for data fusion, merged into a trajectory node of a topological map, and region merging is performed on the trajectory nodes within the preset area range to obtain the trajectory nodes after region merging;
[0027] Obtain the key frame sequences other than the turning trajectory, and create corresponding trajectory nodes for each key frame sequence.
[0028] This solution performs trajectory recognition and classification based on the key frame sequence, specifically processes turning / straight-line motion trajectories, uses turning detection and node screening algorithms to fuse and merge the data of repeated trajectories in the turning trajectory, performs topological simplification on the topological map, compresses the more than ten thousand frames of data or more than a thousand key frames of the original SLAM to more than a hundred high-information-entropy nodes (such as intersections, right-angle turning points), realizes the efficient structured purification of the key frame sequence, eliminates about 80% of the redundant straight-line motion data, forms a lightweight topological skeleton, significantly reduces the memory resource occupation of real-time path planning, and is applicable to low-computing-power scenarios such as in-vehicle embedded systems.
[0029] In a further embodiment, the fusion algorithm corresponding to data fusion is as follows:
[0030] Obtain all the key frame sequences of the turning trajectory, calculate the position offset direction from the first key frame sequence to the penultimate key frame sequence, traverse each change vector, determine the key frame sequence closest to the position offset direction as the target key frame, and create a corresponding trajectory node;
[0031] Alternatively, obtain all the key frame sequences corresponding to the turning trajectory, calculate the median value thereof to create a corresponding trajectory node;
[0032] Alternatively, obtain all the key frame sequences corresponding to the turning trajectory, calculate the average value thereof to create a corresponding trajectory node.
[0033] This solution is based on the key frame sequences on the turning trajectory, and sets multiple fusion algorithms, such as vector approximation fusion based on the position offset direction, median value fusion, and average value fusion. While retaining the data distribution characteristics to represent the trajectory trend, it can also ensure the stability of the data due to its insensitivity to outliers, thereby improving the accuracy of the fused trajectory.
[0034] In a further embodiment, perform region merging on the trajectory nodes within a preset region range, specifically:
[0035] Determine the newly created trajectory node as the node to be processed, determine the trajectory node that passed by most recently relative to the node to be processed as the node to be merged, calculate the relative distance between the node to be processed and the node to be merged, and judge whether it is greater than the preset distance threshold. If so, determine that the region merging condition is met and merge the node to be processed and the node to be merged to obtain the trajectory node after region merging; if not, retain the trajectory node corresponding to the node to be processed on the topological map;
[0036] Determine the trajectory node after executing the region merging logic as the pointing target, determine the trajectory node that passed by most recently relative to the pointing target as the basic target, and set the pointer of the basic target to point to the pointing target to form a graph structure.
[0037] This solution constructs a secondary screening mechanism based on node creation, and judges whether to merge the newly created trajectory node with the trajectory node that passed by most recently through the region merging condition, so as to filter out a large amount of duplicate or highly similar information generated by similar nodes, reduce data redundancy, and enhance the coherence of the vehicle motion trajectory.
[0038] In a further embodiment, identify each of the trajectory nodes on the topological map, perform clustering analysis and execute topological simplification, including:
[0039] Traverse each of the trajectory nodes on the topological map, and determine its node type according to the pointer directions on the trajectory nodes; the node types include one-way nodes and multi-way nodes. The one-way nodes include two connecting edges formed by the pointer directions, and the multi-way nodes include at least three connecting edges formed by the pointer directions;
[0040] When it is determined that the trajectory node is a one-way node, calculate the position offset directions on the two connecting edges on its two sides, and determine whether the trajectory node is on a straight line according to the two sets of position offset directions. If so, delete the current trajectory node; otherwise, retain the current trajectory node;
[0041] When it is determined that the trajectory node is a multi-way node, calculate the straight-line distances from other adjacent trajectory nodes, and determine whether it is within the neighborhood range. If so, perform node merging to generate a new trajectory node; otherwise, retain the current trajectory node.
[0042] This solution distinguishes between straight driving and turning driving on the actual driving trajectory. On the one hand, for one-way nodes on the topological map, calculate the two sets of position offset directions on the two connecting edges on its two sides to determine whether the secondary trajectory node is on a straight line, and then delete the redundant nodes that do not affect the overall straight-line trend. On the other hand, merge adjacent trajectory nodes within the neighborhood range on the curve, simplify the turning trajectory into fewer trajectory node connections, thereby reducing the redundant nodes left by complex terrains such as intersections, and realizing coarse-grained global path guidance.
[0043] The present invention also provides a storage medium, on which a computer program is stored, and the computer program is used to be executed by a processor to implement a key frame optimization processing method for SLAM as described above. Among them, the storage medium can be a magnetic disk, an optical disc, a read-only memory (ROM), or a random access memory (RAM), etc. Description of the Drawings
[0044] Figure 1 is a flowchart of a key frame optimization processing method for SLAM provided by an embodiment of the present invention. Detailed Embodiments
[0045] The following specifically illustrates the embodiments of the present invention in conjunction with the drawings. The given embodiments are only for illustrative purposes and should not be construed as limiting the present invention. The drawings are only for reference and illustration, and do not constitute a limitation on the scope of patent protection of the present invention, because many changes can be made to the present invention without departing from the spirit and scope of the present invention.
[0046] Embodiment 1
[0047] A key-frame optimization processing method for SLAM provided by an embodiment of the present invention is as follows Figure 1 As shown, in this embodiment, it includes steps S1 to S4:
[0048] S1. Extract the key-frame sequence located by the SLAM system, specifically:
[0049] Obtain the key-frame sequence output by the SLAM system;
[0050] For the key-frame sequence Perform cleaning, and obtain the parameter p of the corresponding world coordinates from it i =[x, y, z] T ; where i represents the order of the key-frame sequence, and p i represents a vector, and x, y, and z respectively represent the offsets of the corresponding coordinate axes, represents the set of real numbers, and N is a natural number.
[0051] S2. Preprocess the key-frame sequence, specifically: perform convolution on the key-frame sequence through a kernel function to obtain a new key-frame sequence, as follows:
[0052]
[0053] In the formula, P ′ is the key-frame sequence after convolution, and p i ′ is the parameter of the world coordinates corresponding to P ′ , and H(k) is the kernel function; the shape of the kernel function H(k) is where n represents the length of the kernel function, that is, the length of subsequent convolution, and 3 represents the weights of the offsets of the three coordinate axes. The kernel function H(k) can be selected as the most common Gaussian kernel function, or the mean or median can be used.
[0054] Generally, the use of a topological map allows for relatively large errors, but accurate positions are required. Therefore, in this embodiment, convolution smoothing is performed before screening the key-frame sequence. On the one hand, it effectively reduces the noise in the sequence, making the screening of key frames more accurate; on the other hand, by pre-smoothing the motion trajectory, unnecessary calculations can be reduced in the subsequent key-frame screening process, improving the overall processing efficiency.
[0055] S3. Traverse the key-frame sequence to identify the actual motion trajectory of the vehicle, and then perform data fusion on the repeated trajectories in the actual motion trajectory, merge the corresponding key-frame sequences, and create corresponding trajectory nodes, including:
[0056] S31. Traverse the key-frame sequence using a sliding window, calculate the change vector of each pair of adjacent frames, and generate a corresponding vector set;
[0057] S32. Determine whether the movement trajectory within the current sliding window is a turning trajectory according to the first and last groups of the variation vectors obtained from the vector set. If so, obtain all the key frame sequences corresponding to the turning trajectory. If not, proceed to the next step to create trajectory nodes.
[0058] Among them, obtaining all the key frame sequences corresponding to the turning trajectory is specifically as follows:
[0059] Adjust the window size of the sliding window to store the key frame sequences of the entire turning trajectory, and restore the default window size of the sliding window until going straight is detected again.
[0060] In this embodiment, a sliding window is set for trajectory recognition. When a turning trajectory is detected, the window size of the sliding window is flexibly adjusted to ensure that the continuous and complete turning trajectory is covered, providing accurate data support for subsequent trajectory optimization.
[0061] S33. Use all the key frame sequences corresponding to the turning trajectory as duplicate trajectories for data fusion, merge them into a trajectory node of a topological map, and perform region merging on the trajectory nodes within a preset area range to obtain the trajectory nodes after region merging;
[0062] In this embodiment, the fusion algorithms corresponding to data fusion include but are not limited to:
[0063] (1) Obtain all the key frame sequences of the turning trajectory, calculate the position offset direction from the first key frame sequence to the penultimate key frame sequence, traverse each variation vector, determine the key frame sequence closest to the position offset direction as the target key frame, and create a corresponding trajectory node.
[0064] Specifically, calculate the position offset direction from the first key frame to the penultimate key frame of the key frame sequence P stored in the turning stage (i.e., the entire turning trajectory) to obtain Then traverse each Δp i Select the key frame closest to it in direction as the target key frame for fusion.
[0065] (2) Obtain all the key frame sequences corresponding to the turning trajectory, calculate its median value to create a corresponding trajectory node;
[0066] (3) Obtain all the key frame sequences corresponding to the turning trajectory, calculate its average value to create a corresponding trajectory node.
[0067] Based on the key frame sequence on the turning trajectory, this embodiment sets multiple fusion algorithms, such as vector approximation fusion based on the position offset direction, median value fusion, and average value fusion. While retaining the data distribution characteristics to represent the trajectory trend, it can also ensure the data stability due to being insensitive to outliers, thereby improving the accuracy of the fused trajectory.
[0068] In this embodiment, region merging is performed on the trajectory nodes within the preset region range, specifically as follows:
[0069] Determine the newly created trajectory node as the node to be processed, determine the trajectory node that has passed by most recently relative to the node to be processed as the node to be merged, calculate the relative distance between the node to be processed and the node to be merged, and determine whether it is greater than the preset distance threshold. If so, it is determined that the region merging condition is satisfied, and the node to be processed and the node to be merged are merged to obtain the trajectory node after region merging; if not, the trajectory node corresponding to the node to be processed is retained on the topological map.
[0070] Determine the trajectory node after executing the region merging logic as the target, determine the trajectory node that has passed by most recently relative to the target as the basic target, and set the pointer of the basic target to point to the target to form a graph structure.
[0071] Among them, the specific region merging method is: perform a simple average on the data p1 of the current key frame and the data p of the nearest node. Assume that the point is passed by multiple times subsequently, then the weight of the first time will decrease exponentially; the preset distance threshold can be set according to actual requirements, such as 1m or 2m. j This embodiment constructs a secondary screening mechanism based on node creation, and determines whether to merge the newly created trajectory node with the trajectory node that has passed by most recently through the region merging condition, so as to filter out a large amount of duplicate or highly similar information generated by similar nodes, reduce data redundancy, and enhance the coherence of the vehicle movement trajectory.
[0072] S34. Obtain the key frame sequences other than the turning trajectory, and create corresponding trajectory nodes for each key frame sequence.
[0073] Among them, steps S31 to S33 are mainly for the preliminary fusion and merging of the key frame sequences in the turning trajectory. In step S34, the key frame sequences on the straight line are not processed first, but are optimized through step S4.
[0074]
[0075] This embodiment performs trajectory recognition and classification based on a key-frame sequence, specifically processes turning / straight-line motion trajectories, uses a turning detection and node screening algorithm to fuse and merge the data of repeated trajectories in the turning trajectory, performs topological simplification on the topological map, compresses the more than ten thousand frames of data or more than a thousand key frames of the original SLAM to more than a hundred high-information-entropy nodes (such as intersections and right-angle turning points), realizes the efficient structured purification of the key-frame sequence, eliminates about 80% of the redundant straight-line motion data, forms a lightweight topological skeleton, significantly reduces the memory resource occupancy of real-time path planning, and is applicable to low-computing-power scenarios such as vehicle-mounted embedded systems.
[0076] In this embodiment, when the vehicle is moving, the direction remains unchanged during straight-line driving and changes during curve driving. Therefore, by calculating the change vectors of the first and last groups, it is possible to determine whether the motion trajectory within the current sliding window is a turning trajectory, and different scenarios can be used for trajectory optimization. By traversing the key-frame sequence using a sliding window and retaining the temporal dependence between frames, continuous motion trajectories can be flexibly detected.
[0077] In this embodiment, the repeated trajectories in the key-frame sequence are merged. The specific working principle is as follows:
[0078] First step: Use a sliding window of size n to traverse the key-frame sequence, and calculate the change vector Δp between every two adjacent frames from the first frame to the (n - 1)-th frame in this window i = p i+1 - p i ;
[0079] Second step: Obtain the dot product of the change vectors of the first frame and the penultimate frame within this window through Δp1·Δp n-1 Set a comparison threshold T1 to determine whether the trajectory within this window has a slight turn (that is, whether the motion trajectory within the current sliding window is a turning trajectory).
[0080] Among them, the comparison threshold T1 is set according to the actual situation, generally in the range of 0.85 - 1, and the default value is 0.9. When the comparison threshold T1 is too high, a large number of straight-line nodes will appear, and such straight-line nodes are redundant items that need to be eliminated, otherwise it will affect the working efficiency of the driving plan. Therefore, when the dot product is less than the comparison threshold T1, it is determined that the trajectory within this window has a slight turn.
[0081] Third step: If a slight turn occurs, the value of n of the sliding window needs to be appropriately increased to store the key frames of the entire turning trajectory. When a straight line is detected again, the value of n of the sliding window is restored, and the key-frame sequence of the turning trajectory in the previous step is fused according to the following method to generate a node of the topological map.
[0082] Step 4: Region merging. Set a pointer to the most recently passed node for subsequent merging paths. That is, whenever a node is about to be created, it is detected whether it is near the most recently passed node. If so, the creation of this node is cancelled, and merging is performed according to the above fusion algorithm, and then the pointer to the most recent node is pointed to this node (i.e., the pointer to the basic target points to the pointed target). Otherwise, continue to create the node and continue with Step 3.
[0083] S4. Identify each of the above-mentioned trajectory nodes on the topological map, perform clustering analysis and execute topological simplification to obtain an optimized target motion trajectory, including:
[0084] Traverse each of the above-mentioned trajectory nodes on the topological map, and judge its node type according to the pointer pointing on the trajectory node; the node types include one-way nodes and multi-way nodes. The one-way nodes include two connecting edges formed by the pointer pointing, and the multi-way nodes include at least three connecting edges formed by the pointer pointing.
[0085] When it is judged that the trajectory node is a one-way node, calculate the position offset directions on the two connecting edges on its two sides and judge whether the trajectory node is on a straight line according to the two sets of position offset directions (Specifically, calculate the dot product of and compare it with the comparison threshold T1. If it is greater, it is judged to be on a straight line. If it is less, it is judged not to be on a straight line). If so, delete the current trajectory node. If not, retain the current trajectory node. When it is judged that the trajectory node is a multi-way node, calculate the straight-line distance to other adjacent trajectory nodes and judge whether it is within the neighborhood range. If so, perform node merging to generate a new trajectory node (for example, calculate the average value as the new node). If not, retain the current trajectory node.
[0086] Among them, nodes with more than 2 connecting edges are intersection points (such as T-shaped intersections and cross-shaped intersections). Usually, redundant nodes will still be left in the vicinity (within about 5m) in the above steps. Therefore, it is necessary to execute Step S4 to take the average value of the respective coordinate components of the points in this vicinity range as the new node to achieve node merging.
[0087] In this embodiment, straight-line driving and turning driving on the actual driving trajectory are distinguished. On the one hand, for one-way nodes on the topological map, calculate two sets of position offset directions on the two connecting edges on its two sides to judge whether this trajectory node is on a straight line, and then delete redundant nodes that do not affect the overall straight-line trend. On the other hand, merge adjacent trajectory nodes within the neighborhood range on the curve, simplify the turning trajectory into fewer trajectory node connections, so as to reduce the redundant nodes left by complex terrains such as intersections and achieve a coarse-grained global path guidance.
[0088] Embodiment 2
[0089] Embodiment 2
[0090] An embodiment of the present invention also provides a storage medium, on which a computer program is stored. The computer program is used to be executed by a processor to implement a key frame optimization processing method for SLAM as described in Embodiment 1 above. Among them, the storage medium can be a magnetic disk, an optical disc, a read-only memory (ROM), or a random access memory (RAM), etc.
[0091] In this embodiment, the beneficial effects of the embodiments of the present invention also include:
[0092] (1) Collaboratively construct a hybrid navigation system with a grid map
[0093] The topological map generated by the present invention serves as a complementary semantic layer for the grid / geometric map, providing coarse-grained global path guidance (such as "reach Parking Space B after two left turns from the entrance of Area A"), while the grid map is responsible for local obstacle avoidance and precise positioning. The combination of the two realizes "global-local" hierarchical planning, and theoretically the comprehensive efficiency of the system is increased by more than 30%.
[0094] (2) Optimize the dynamic adaptability of the parking lot scenario
[0095] For frequent temporary obstacles in the parking lot (such as moving vehicles and pedestrians), the topological map weakens the geometric details and strengthens the topological connection relationship. When the environment changes locally, only the states of adjacent nodes need to be updated, avoiding the delay problem of traditional SLAM global map reconstruction. Theoretically, the dynamic response speed is increased by 50%.
[0096] (3) Reduce the cumulative error impact of long-term navigation
[0097] By retaining the spatio-temporal correlation of key frames (such as the turning angle and temporal weight between nodes), in long-distance cross-floor navigation in the parking lot, the positioning drift of the geometric map is corrected using the topological connection relationship, improving the success rate of cross-region navigation (especially suitable for closed environments without GPS signals).
[0098] (4) Support scalable semantic interaction
[0099] Topological nodes can be bound to specific semantic labels in the parking lot (such as "charging pile area", "no-parking area"), providing rule constraints for path planning (such as preferentially choosing a short path to avoid the no-parking area), and being compatible with the hierarchical control requirements of the parking lot management system.
[0100] The above embodiments are preferred embodiments of the present invention, but the embodiments of the present invention are not limited to the above embodiments. Any other changes, modifications, substitutions, combinations, and simplifications made without departing from the spirit and principle of the present invention shall be equivalent replacement methods and are all included in the protection scope of the present invention.
Claims
1. A key-frame optimization processing method for SLAM, characterized in that, Including: Extracting the key frame sequence of the SLAM system positioning, and preprocessing the key frame sequence; Traversing the key frame sequence to identify the actual motion trajectory of the vehicle, then performing data fusion on the repeated trajectories in the actual motion trajectory, merging the corresponding key frame sequences and creating corresponding trajectory nodes; Identifying each of the trajectory nodes on the topological map, performing clustering analysis and executing topological simplification to obtain the optimized target motion trajectory.
2. The key frame optimization processing method for SLAM according to claim 1, characterized in that, Extracting the key frame sequence of the SLAM system positioning, specifically: Obtaining the key frame sequence output by the SLAM system; Clean the key frame sequence and obtain the parameter p corresponding to the world coordinates from it i = [x, y, z] T ; where i represents the order of the key frame sequence, and p i represents a vector, and x, y, and z respectively represent the offsets of the corresponding coordinate axes, represents the set of real numbers, and N is a natural number.
3. The key frame optimization processing method for SLAM according to claim 2, characterized in that Preprocessing the key frame sequence, specifically: convolving the key frame sequence through a kernel function to obtain a new key frame sequence as follows: Where P ′ is the key frame sequence after convolution, and p i ′ are the parameters corresponding to the world coordinates of P ′ , and H(k) is the kernel function; the shape of the kernel function H(k) is where n represents the length of the kernel function, that is, the length of subsequent convolution, and 3 represents the weight of the offset of the three coordinate axes.
4. A key frame optimization processing method for SLAM according to claim 1, characterized in that Traversing the key frame sequence to identify the actual motion trajectory of the vehicle, including: Using a sliding window to traverse the key frame sequence, calculating the change vector of each pair of adjacent frames, and generating a corresponding vector set; According to the first and last two groups of the change vectors obtained from the vector set, determining whether the motion trajectory within the current sliding window is a turning trajectory. If so, obtaining all the key frame sequences corresponding to the turning trajectory; if not, proceeding to the next step to create a trajectory node.
5. The key frame optimization processing method for SLAM according to claim 4, characterized in that, Obtaining all the key frame sequences corresponding to the turning trajectory, specifically: Adjusting the window size of the sliding window to store all the key frame sequences of the entire turning trajectory until a straight line is detected again, and then restoring the default window size of the sliding window.
6. The key frame optimization processing method for SLAM according to claim 5, characterized in that, Performing data fusion on the repeated trajectories in the actual motion trajectory, merging the corresponding key frame sequences and creating corresponding trajectory nodes, including: Taking all the key frame sequences corresponding to the turning trajectory as repeated trajectories for data fusion, merging them into a trajectory node of a topological map, and performing regional merging on the trajectory nodes within a preset area range to obtain the trajectory nodes after regional merging; Obtaining the key frame sequences other than the turning trajectory, and creating corresponding trajectory nodes for each of the key frame sequences.
7. A key frame optimization processing method for SLAM according to claim 4, characterized in that, The fusion algorithm corresponding to the data fusion is as follows: Obtaining all the key frame sequences of the turning trajectory, calculating the position offset direction from the first key frame sequence to the penultimate key frame sequence, traversing each change vector, determining the key frame sequence closest to the position offset direction as the target key frame, and creating a corresponding trajectory node; Alternatively, obtaining all the key frame sequences corresponding to the turning trajectory, calculating its median value to create a corresponding trajectory node; Alternatively, obtaining all the key frame sequences corresponding to the turning trajectory, calculating its average value to create a corresponding trajectory node.
8. The key frame optimization processing method for SLAM according to claim 6, characterized in that, Performing regional merging on the trajectory nodes within a preset area range, specifically: Determining the newly created trajectory node as the node to be processed, determining the trajectory node that passed by most recently relative to the node to be processed as the node to be merged, calculating the relative distance between the node to be processed and the node to be merged, determining whether it is greater than the preset distance threshold. If so, determining that the regional merging condition is met and merging the node to be processed and the node to be merged to obtain the trajectory node after regional merging; if not, retaining the trajectory node corresponding to the node to be processed on the topological map; Determine that the trajectory node after executing the region merging logic is the pointing target, determine the trajectory node that passed by closest to the pointing target as the base target, and set the pointer of the base target to point to the pointing target to form a graph structure.
9. A key frame optimization processing method for SLAM according to claim 8, characterized in that, Identify each of the trajectory nodes on the topological map, perform clustering analysis and execute topological simplification, including: Traverse each of the trajectory nodes on the topological map, and judge its node type according to the pointer pointing on the trajectory node; the node types include one-way nodes and multi-way nodes. The one-way nodes include two connecting edges formed by the pointer pointing, and the multi-way nodes include at least three connecting edges formed by the pointer pointing; When it is judged that the trajectory node is a one-way node, calculate the position offset directions on the connecting edges on both sides of it, and judge whether the trajectory node is on a straight line according to the two sets of position offset directions. If so, delete the current trajectory node, otherwise retain the current trajectory node; When it is judged that the trajectory node is a multi-way node, calculate the straight-line distance from other adjacent trajectory nodes, and judge whether it is within the neighborhood range. If so, perform node merging to generate a new trajectory node, otherwise retain the current trajectory node.
10. A storage medium having a computer program stored thereon, characterized in that: The computer program is used to be executed by a processor to implement a key frame optimization processing method for SLAM as described in claims 1-9.