A dynamic visual SLAM method and device for temporal sparse reconstruction
Through temporal sparse reconstruction and moving instance segmentation technology, combined with optical flow and feature matching, it achieves efficient segmentation of semantic-less objects and accurate estimation of moving object trajectories in dynamic visual SLAM, solving the problem of low information accuracy in dynamic environments.
Patent Information
- Application Number
- CN202410725976.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-06
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2044-06-06
AI Technical Summary
Existing dynamic visual SLAM methods have poor segmentation results when dealing with dynamic environments, especially objects with no semantic information and small objects with few salient points, and fail to realize the motion trajectories of cameras and moving objects, static backgrounds and movements. The joint optimization of objects results in lower accuracy of moving object information.
The dynamic visual SLAM method for temporal sparse reconstruction is adopted, by acquiring the binocular image sequence of the dynamic scene, using motion instance segmentation and optical flow estimation, combined with point features and edge features, to construct a global map, and through a multi-motion factor graph optimization algorithm. Joint optimization to improve the absolute trajectory estimation accuracy of moving objects.
It achieves good segmentation results for objects without semantic information in complex dynamic scenes, improves the absolute trajectory estimation accuracy of moving objects, and solves four tasks (camera trajectory, moving object trajectory, static background mapping, and moving object reconstruction) The problem of low information accuracy.
Smart Images

Figure CN118314162B
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of visual positioning and mapping technology, and in particular relates to a dynamic visual SLAM method and device for temporal sparse reconstruction. Background Art
[0002] Visual SLAM, or visual simultaneous localization and mapping, only requires a camera to locate the robot and map the environment in three dimensions. It is easy to install and low-cost, and has always been a hot topic in the field of computer vision and robotics. Conventional visual SLAM methods are based on the assumption of static scenes. When there are more significant dynamic objects in the scene, the camera pose estimation and environmental mapping errors are large. In a dynamic environment, the current common solution is to first segment the moving objects and completely eliminate them as outliers, so as to achieve the purpose of positioning the robot and mapping the static environment. However, the information of moving objects in dynamic scenes is not useless. In order to simultaneously obtain the motion and geometric information of moving objects, dynamic visual SLAM research only uses the motion of the camera to simultaneously obtain the static background three-dimensional map, the three-dimensional model of each dynamic object, and the absolute motion trajectory of the camera and each dynamic object.
[0003] According to the different motion segmentation methods used, the existing dynamic visual SLAM methods are mainly divided into methods based on semantic information and methods based on geometric motion segmentation. The methods based on semantic information are too dependent on semantic priors, and it is difficult to achieve the expected results for some objects without specific semantic labels; although the methods based on geometric motion segmentation are not limited to moving objects with specific semantic labels, geometric motion segmentation often has poor effects on scenes with poor texture features and small objects with fewer salient points, and it is difficult to deal with degenerate motion, has poor applicability to complex scenes, and has low computational efficiency. At the same time, most dynamic visual SLAM methods do not consider the overall optimization of the motion trajectory of the camera and moving objects, the static background, and the structural point representation corresponding to each moving object (referred to as the joint optimization of the four tasks), resulting in low accuracy of the output moving object information. Summary of the invention
[0004] The disclosed embodiment proposes a dynamic visual SLAM solution based on motion instance segmentation to solve the problem that the existing dynamic visual SLAM solution has poor segmentation effect on objects without semantic information or small objects with fewer salient points, and the accuracy of moving object information is low due to the inability to achieve joint optimization of the four tasks.
[0005] A first aspect of the embodiments of the present disclosure provides a dynamic visual SLAM method for temporal sparse reconstruction, comprising:
[0006] Acquire a continuous binocular image sequence of a dynamic scene, acquire mapping parameters of each frame of a left-view image, and acquire motion instances of the image based on motion instance segmentation, and assemble the mapping parameters and the motion instances at corresponding moments into a frame of mapping data, wherein the mapping parameters at least include a depth map, an optical flow estimation result, and structural features of the left-view image, and the structural features include point features and edge features;
[0007] In adjacent frames in a frame sequence consisting of a plurality of consecutive frames of the mapping data, determining a correspondence between the structural features based on the mapping parameters, determining key points in the structural features, associating the moving objects in the adjacent frames based on the motion instances and the key points, and determining the positions and poses of the camera and the moving object respectively using the motion instances and the key points;
[0008] In a sub-frame sequence including a preset number of frames in the frame sequence, a preset number of key frames are extracted based on optical flow estimation results and structural features of each of the frames, a local map corresponding to the sub-frame sequence is generated based on the postures of the camera and moving objects, the static background and the key points of each moving object in the key frames, and a global map corresponding to the frame sequence is generated by fusing each of the local maps.
[0009] In some embodiments, after generating a global map corresponding to the frame sequence, the method further includes:
[0010] Jointly optimizing the global map based on a preset error factor set, wherein the error factor set includes at least a reprojection error of static background points, a reprojection error of moving object points, a camera pose estimation observation error, a moving object uniform motion error, and a uniform speed error of moving object points; and / or
[0011] After generating the local map corresponding to the subframe sequence, the method further includes:
[0012] The local map is jointly optimized based on the preset error factor set.
[0013] In some embodiments, acquiring the motion instance of each frame of the left-view image based on the motion instance segmentation comprises:
[0014] Acquire a first left-view image of the moving object at a target moment and a second left-view image at an adjacent moment, and extract multi-scale first feature maps of the first left-view image and the second left-view image respectively based on an image feature extraction neural network, wherein the low-resolution first feature map is obtained by downsampling the high-resolution first feature map of the adjacent scale with a step size of 2;
[0015] Based on the feature pyramid model, the first feature map of each current scale of the image is fused with the first feature map of the adjacent scale to obtain the second feature map of the current scale of the image, and the second feature maps of all scales of the image constitute the second feature map of the image;
[0016] Based on the second feature map of the image, a third feature map of the first left-view image is generated after the timing information is introduced. The third feature map of the first left-view image is subjected to motion instance segmentation based on the target detection and instance segmentation algorithm. The obtained motion object instance segmentation result is the motion instance of the first left-view image.
[0017] In some embodiments, obtaining the mapping parameters of each left-view image frame includes:
[0018] Taking the binocular image at the target moment as input, the CUDA application version of the semi-global matching algorithm is used to perform binocular depth estimation to obtain the depth map of the left view image at the target moment;
[0019] Taking two adjacent frames of left-view images as input, an optical flow estimation result of the left-view image at the target moment is obtained based on an optical flow estimation network, wherein the optical flow estimation network adopts the liteflownet2 method;
[0020] Taking the left view image at the target moment as input, a FAST feature extractor is used to detect a sparse corner feature set of the image to output point features of the image;
[0021] The left view image at the target moment is taken as input and the edge features of the image are detected and output using a Canny edge detector.
[0022] In some embodiments, determining the correspondence between the structural features based on the mapping parameters includes:
[0023] For a feature point in the current frame, the optical flow estimation result of the corresponding pixel position is used to obtain the matching feature point of the feature point in the adjacent frame;
[0024] For a first edge feature in a current frame, an effective depth of the edge feature is searched from a depth map of the current frame, an edge pixel set with a valid depth is reprojected from the current frame to an adjacent frame, a second edge feature corresponding to the first edge feature in the adjacent frame is obtained, and a Euclidean distance to each pixel position of the second edge feature is calculated at each pixel position of the first edge feature, and alignment of edge features of the current frame with those of the adjacent frame is achieved based on minimizing the Euclidean distance.
[0025] In some embodiments, associating the moving objects in adjacent frames based on the motion instance and the key point comprises:
[0026] Calculating the intersection-and-union ratios of a plurality of first motion instances in the current frame and a plurality of second motion instances in adjacent frames respectively, and matching the first motion instance and the second motion instance whose intersection-and-union ratios are the largest and not less than a preset threshold;
[0027] Key points of the moving object are associated with key points of the moving object from a local map, wherein the local map is generated based on a subsequence of a continuous sequence of binocular images of the dynamic scene.
[0028] In some embodiments, associating the key points of the moving object with the key points of the moving object from the local map comprises:
[0029] If the speed of the moving object in the local map is known, predict the movement of the moving object, and reproject the predicted three-dimensional key points of the moving object to the current frame and match them with the closest landmark points in the current frame;
[0030] If the speed of the moving object in the local map is unknown or the landmark points of the current frame fail to match the predicted three-dimensional key points of the moving object, the three-dimensional key points are assigned to the moving instance with the largest overlap in adjacent frames.
[0031] In some embodiments, the determining the positions of the camera and the moving object respectively using the motion instance and the key point comprises:
[0032] Obtaining an edge distance error of a static background edge feature and a reprojection error from a 3D static point to a 2D plane point, and determining the position and posture of the camera from the current moment to the reference moment by jointly minimizing the edge distance error and the reprojection error;
[0033] The motion instance of each moving object is used to determine the edge features and point features belonging to the moving object, the edge distance error of the moving object from the current moment to the reference moment is determined based on the edge features and the reprojection error is determined based on the point features, and the position and posture of the moving object from the current moment to the reference moment is determined by jointly minimizing the edge distance error and the reprojection error.
[0034] In some embodiments, in a subframe sequence including a preset number of frames in the frame sequence, extracting a preset number of key frames based on the optical flow estimation results and structural features of each of the frames includes:
[0035] Taking the initial frame as a key frame, calculating the mean square optical flow generated by the current frame and the last key frame due to the change of viewing angle or occlusion, and when the mean square optical flow meets the first preset condition or the structural feature of the current frame meets the second preset condition, taking the current frame as the first key frame associated with the camera motion;
[0036] Determining the tracking quality of the current frame based on the overlapping histogram between frames, and when the tracking quality meets a preset condition, using the current frame as a second key frame associated with the moving object;
[0037] An optimized frame set is composed of the key frames. When the number of the key frames in the optimized frame set is not higher than a first preset threshold, the first key frame or the second key frame is added to the optimized frame set. When the number of the key frames in the optimized frame set is higher than a second preset threshold, before each key frame is added, one key frame is removed from the optimized frame set based on a preset strategy.
[0038] A second aspect of the embodiments of the present disclosure provides a dynamic visual SLAM device for temporal sparse reconstruction, comprising:
[0039] A data acquisition module is used to acquire a continuous binocular image sequence of a dynamic scene, acquire mapping parameters of each frame of a left-view image, and acquire motion instances of the image based on motion instance segmentation, and assemble the mapping parameters and the motion instances at corresponding moments into a frame of mapping data, wherein the mapping parameters at least include a depth map of the left-view image, an optical flow estimation result, and structural features, wherein the structural features include point features and edge features;
[0040] A tracking module, configured to determine, in adjacent frames in a frame sequence consisting of a plurality of consecutive frames of the mapping data, a correspondence between the structural features based on the mapping parameters, determine key points in the structural features, associate the moving objects in the adjacent frames based on the motion instances and the key points, and determine the positions and poses of the camera and the moving object respectively using the motion instances and the key points;
[0041] A mapping module is used to extract a preset number of key frames from a sub-frame sequence containing a preset number of frames in the frame sequence based on the optical flow estimation results and structural features of each of the frames, generate a local map corresponding to the sub-frame sequence based on the posture of the camera and the moving object, the static background and the key points of each moving object in the key frames, and fuse the local maps to generate a global map corresponding to the frame sequence.
[0042] In summary, the dynamic visual SLAM method and the dynamic visual SLAM device for temporal sparse reconstruction provided by the embodiments of the present invention segment the motion instances of moving objects through a class-agnostic motion instance segmentation network, and still have a good segmentation effect for objects without semantic information in complex dynamic scenes; and through a multi-motion estimation method that combines point features, edge features and optical flow information, to a certain extent solves the problem of scarce key points of moving objects caused by the small image area, and improves the accuracy of absolute trajectory estimation of moving objects; finally, by constructing an error equation including four tasks of camera trajectory estimation, moving object trajectory estimation, static background mapping and moving object reconstruction, the problem of low accuracy of moving object information caused by the lack of joint optimization of the four tasks is solved. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] The features and advantages of the present disclosure will be more clearly understood by referring to the accompanying drawings, which are schematic and should not be construed as limiting the present disclosure in any way. In the accompanying drawings:
[0044] Figure 1 is a schematic diagram of a computer system to which the present disclosure is applicable;
[0045] Figure 2 is a schematic diagram of generating a global map based on a binocular image sequence according to some embodiments disclosed herein;
[0046] Figure 3 is a flow chart of a dynamic visual SLAM method for temporal sparse reconstruction according to some embodiments of the present disclosure;
[0047] Figure 4 is a schematic diagram of obtaining motion instances of a current frame image using a class-agnostic motion instance segmentation method in some embodiments of the present disclosure;
[0048] Figure 5 is a schematic diagram of a multi-motion factor graph according to some embodiments of the present disclosure;
[0049] Figure 6 It is a schematic diagram of a dynamic visual SLAM device for temporal sparse reconstruction according to some embodiments of the present disclosure. DETAILED DESCRIPTION
[0050] In the detailed description below, many specific details of the present disclosure are set forth by way of example in order to provide a thorough understanding of the relevant disclosure. However, it will be apparent to one of ordinary skill in the art that the present disclosure can be implemented without these details. It should be understood that the use of the terms "system," "device," "unit," and / or "module" in the present disclosure is a method for distinguishing different parts, elements, parts, or assemblies at different levels in a sequential arrangement. However, these terms may be replaced by other expressions if other expressions can achieve the same purpose.
[0051] It should be understood that when a device, unit or module is referred to as being "on," "connected to," or "coupled to" another device, unit or module, it may be directly on, connected to, coupled to, or communicating with other devices, units or modules, or there may be intermediate devices, units or modules, unless the context clearly indicates an exception. For example, the term "and / or" as used in this disclosure includes any and all combinations of one or more of the relevant listed items.
[0052] The terms used in this disclosure are only for describing specific embodiments and are not intended to limit the scope of this disclosure. As shown in the specification and claims of this disclosure, unless the context clearly indicates an exception, the words "one", "a kind" and / or "the" do not specifically refer to the singular, but may also include the plural. Generally speaking, the terms "include" and "comprise" only indicate the inclusion of clearly identified features, wholes, steps, operations, elements and / or components, and such expressions do not constitute an exclusive list, and other features, wholes, steps, operations, elements and / or components may also be included.
[0053] These and other features and characteristics, methods of operation, functions of related elements of the structure, combinations of parts, and economies of manufacture of the present disclosure may be better understood with reference to the following description and drawings, which form a part of the specification. However, it is to be clearly understood that the drawings are for illustration and description purposes only and are not intended to limit the scope of protection of the present disclosure. It is to be understood that the drawings are not drawn to scale.
[0054] Various structural diagrams are used in this disclosure to illustrate various variations of the embodiments of the present disclosure. It should be understood that the above or below structures are not intended to limit the present disclosure. The scope of protection of the present disclosure shall be subject to the claims.
[0055] Figure 1 Schematic diagram of a computer system to which the present disclosure is applicable. Figure 1In the system shown, the SLAM server is data-connected to the image acquisition device, and the SLAM server generates a global map of the motion scene based on a continuous sequence of binocular images of the motion scene acquired by the image acquisition device.
[0056] SLAM (simultaneous localization and mapping) refers to simultaneous positioning and mapping. The SLAM server can be any of a stand-alone, cluster or distributed server. Figure 2 FIG. 1 is a schematic diagram of generating a global map based on a binocular image sequence according to some embodiments of the present disclosure. Figure 2 As shown, the SLAM server includes a data processing module for acquiring mapping data based on a binocular image sequence, a tracking thread for determining the position and posture of a camera and a moving object based on the mapping data, and a mapping thread for generating a global map based on the position and posture and key points. The tracking thread and the mapping thread are processed in parallel.
[0057] The image acquisition device has binoculars, and can simultaneously obtain the left view image and the right view image of a frame and determine the depth information of the frame accordingly. The image acquisition device can be a camera, a still camera, a monitoring device, or a camera built into other devices. The continuous binocular image sequence can also be a video clip of the motion scene.
[0058] Figure 3 is a flow chart of a dynamic visual SLAM method for temporal sparse reconstruction according to some embodiments of the present disclosure. In some embodiments, the dynamic visual SLAM method for temporal sparse reconstruction is composed of Figure 1 The SLAM server in the system shown in the figure executes the dynamic visual SLAM method for temporal sparse reconstruction, comprising the following steps:
[0059] S310, obtaining a continuous binocular image sequence of a dynamic scene, obtaining mapping parameters of each frame of a left-view image, and obtaining motion instances of the image based on motion instance segmentation, assembling the mapping parameters and the motion instances at corresponding moments into a frame of mapping data, wherein the mapping parameters at least include a depth map, an optical flow estimation result, and structural features of the left-view image, and the structural features include point features and edge features.
[0060] Specifically, Figure 2As shown in the figure, the first step is data acquisition and processing. The RGB binocular image sequence is used as input. After correction and dedistortion, the image sequence is first input into the data processing module. The data processing module uses GPU and CPU parallel computing to calculate more complex tasks in the GPU. The tasks in the GPU and CPU are all calculated in parallel. Therefore, the time for processing each frame of data is the time of the longest task, so as to avoid that too long data processing time will greatly affect the operation efficiency of the system. The tasks calculated in the GPU include: obtaining the depth map through binocular depth estimation. The binocular depth estimation uses the CUDA application version of the SGM (SemiGlobalMatching) method; using a class-agnostic motion instance segmentation method to obtain the motion instance of the current frame image; using the optical flow estimation network to obtain the optical flow result. The optical flow estimation uses the liteflownet2 method. This method has a fast processing speed and occupies less memory. It can use adjacent frame images as input to quickly provide dense optical flow estimation results; the tasks calculated in the CPU include point feature and edge feature extraction of the current frame. The point feature uses the FAST feature extractor to detect the sparse corner feature set, and the edge feature uses the Canny edge detector. The binocular depth estimation takes the binocular image at the current moment as input and outputs the depth map of the left view image at the current moment; the moving object instance segmentation and optical flow estimation network takes the two adjacent frames of the left view image as input, and outputs the segmentation and optical flow estimation results of the left view image at the current moment; the point feature and edge feature extraction takes the left view image at the current moment as input, and outputs the feature extraction results of the left view image at the current moment. When all five tasks of the image are processed, the results of one frame of data processing will be output together. Due to the use of parallel computing, the data processing process can be calculated simultaneously with the subsequent tracking and mapping threads, which can greatly reduce the computing time of the entire system during actual operation.
[0061] Figure 4 FIG. 1 is a schematic diagram of obtaining motion instances of a current frame image using a class-agnostic motion instance segmentation method in some embodiments of the present disclosure. Figure 4 As shown, the method includes:
[0062] First, the image features of two frames of left-view images at adjacent moments of the motion scene are extracted based on the image feature extraction neural network to generate a multi-scale first feature map. Then, a feature pyramid model is used to identify the multi-scale features in the image and the first feature map of each current scale is fused with the first feature map of the adjacent scale to obtain the second feature map of the current scale of the image.
[0063] If the second feature maps at time t and time t+1 after fusion are and , then the time t+1 The five-layer feature map is input as the input feature map into a convolutional long short-term memory structure (ConvLSTM structure), and the five-layer feature map is output to introduce the timing information. Then, the time t As input feature map, As hidden layer feature maps, they are input into a ConvLSTM structure, and the feature map at time t after the introduction of five layers of time series information is output. Finally, the feature map at time t after the introduction of five layers of time series information is input into the target detection and instance segmentation algorithm for motion instance segmentation, and the instance segmentation result of the moving object in the image at time t is output.
[0064] The present invention uses a class-agnostic motion instance segmentation network to segment motion instances of moving objects, and still has good segmentation effects for objects without semantic information in complex dynamic scenes.
[0065] S320, in adjacent frames in a frame sequence consisting of a plurality of consecutive frames of the mapping data, determining a correspondence between the structural features based on the mapping parameters, determining key points in the structural features, associating the moving objects in the adjacent frames based on the motion instances and the key points, and determining the poses of the camera and the moving object, respectively, using the motion instances and the key points.
[0066] like Figure 2 As shown, this step is processed by the tracking thread, and the calculated results are input into the mapping thread. In the present disclosure, feature point matching is implemented using the results of optical flow estimation. Specifically, for a feature point in the current frame, the optical flow result of its corresponding pixel position is used to obtain its matching feature point in the adjacent frame. Edge feature alignment uses the edge pixel set with effective depth to be reprojected from the current frame to the reference frame, and the distance transform (DT) is used to calculate the Euclidean distance to the nearest edge at each pixel position, and the edge features of the two frames are aligned by minimizing the Euclidean distance. Among them, the effective depth is obtained by searching and judging the pixel value of the edge feature in the depth map.
[0067] When performing feature point matching and edge feature alignment, abnormal pixels that cannot be matched or aligned are removed, and the remaining pixels are the key points of static background and moving objects.
[0068] When tracking fast-moving moving object points in image space, the combination of camera motion and object motion will produce a large displacement in image space; at the same time, large movement will cause large visual changes of objects in the image, which also increases the difficulty of matching. The present disclosure achieves a more robust effect by performing association at the instance level and the key point level respectively.
[0069] At the instance level, the present disclosure matches motion instances between adjacent frames by calculating the intersection over union (IoU, which refers to the ratio of the intersection area of two regions to the union area). Two motion instances located in adjacent frames with the largest IoU and not less than a preset threshold are matched.
[0070] At the keypoint level, the moving object keypoints are associated with the moving object keypoints from the local map in two different ways:
[0071] 1. If the speed of the object in the map is known, the motion of the object is predicted using the assumption of uniform motion between frames, the predicted 3D key points are reprojected into the current frame, and the key points of the object are matched with the nearest landmark points, thereby assigning the key points of the object to the key points of the object in the map;
[0072] 2. If the object’s velocity is not initialized or not enough matches are found in 1, brute force matching is used in consecutive frames to assign these keypoints to the most overlapping motion instances.
[0073] Because the current key points are associated with objects in the map rather than objects in the previous frame, mutual occlusion of objects can be handled to a certain extent.
[0074] For camera motion estimation, the present invention utilizes edge features and feature points belonging only to the static background by jointly minimizing the edge distance error. and the reprojection error from 3D static points to 2D planar points , to estimate the current time To reference time Relative motion of the camera .
[0075] The edge distance error is obtained by aligning the nearest edge after reprojection, and the edge distance residual is obtained by DT transformation at the reprojected pixel position. , and the edge distance error is calculated :
[0076]
[0077] in, Represents the reference frame DT transformation, is the pixel position of an edge in the current frame, for The depth value at the position, Is a transformation function, which means using relative transformation Calculate the current frame Reprojection into the reference frame, is the set of edge pixels with valid depth in the current frame, is a Huber weight function used to reduce the impact of large residuals. Since edge detection often varies between frames, if If the value is greater than the set threshold, a potential outlier is deleted.
[0078] For point features, the reprojection error from 3D static points to 2D planar points The calculation formula is as follows:
[0079]
[0080] in, represents the reprojection distance residual, Indicates that the 3D points of the static background The projection function to the 2D pixel position of the reference frame, for The observed pixel coordinates in the reference frame, is the static 3D point set in the current frame, where It is a weight function used to reduce the impact of large residuals.
[0081] Therefore, the optimization process of combining edge features and point features is performed using the following formula:
[0082]
[0083] in, is the relative motion to be optimized, The present disclosure uses an iteratively re-weighted Levenberg-Marquardt optimization method to minimize formula (3.1) in a coarse-to-fine manner, that is, at the beginning of the optimization, the optimization is initialized according to the constant motion assumption and starts with a value close to the minimum.
[0084] For moving objects, the edge features and point features belonging to each moving object are determined using the motion instance of the moving object. Using the features belonging to the object, the motion of the object is estimated by jointly minimizing the edge distance error and the reprojection error. Current moment To reference time Edge distance error for:
[0085]
[0086] in, Indicates moving objects In the reference frame DT transformation, For moving objects Relative transformation centered on the self, For the current frame The pixel position of a certain edge of the moving instance of the moving object in for The depth value at the position, Is a transformation function, which means using relative transformation The current frame Reproject into the reference frame, is the edge pixel set with effective depth in the motion instance of the moving object in the current frame, is a Huber weight function.
[0087] For moving objects , current moment To reference time Point feature reprojection error for:
[0088] in, Indicates moving objects The reprojection distance residual of is the 3D point belonging to the moving object The projection function to the 2D pixel position of the reference frame, for In the reference frame The observed pixel coordinates in For the current frame The 3D point set of the moving object in is the Huber weight function.
[0089] Therefore, the moving object The optimization process of joint edge features and point features in pose estimation is performed using the following formula:
[0090]
[0091] in, is the relative motion to be optimized, is the balancing factor.
[0092] The present invention adopts a multi-motion estimation method combining point features and edge features, utilizes edge features and optical flow information to increase the number of target points in a moving object occupying a smaller image area, and realizes robust estimation of the absolute motion trajectory of the camera and each moving object.
[0093] S330, in which the frame sequence includes a sub-frame sequence of a preset number of frames, extract a preset number of key frames based on the optical flow estimation results and structural features of each of the frames, generate a local map corresponding to the sub-frame sequence based on the postures of the camera and the moving objects, the static background and the key points of each moving object in the key frames, and fuse the local maps to generate a global map corresponding to the frame sequence.
[0094] like Figure 2 As shown, this step is performed by the mapping thread. The present disclosure only processes the selected key frames to maintain a key frame set with a controllable number and a distribution as even as possible in the global map; at the same time, a key frame management strategy that takes into account the camera motion and the quality of moving object tracking is designed, which is more suitable for key frame maintenance of dynamic visual SLAM methods.
[0095] The present invention initially acquires a large number of key frames, about 5-15 key frames per second, and then sparses the key frame set by marginalizing redundant key frames. For camera motion tracking, the present invention determines whether to create a key frame by calculating the following three measures:
[0096] In order to consider the change of perspective to create a new key frame, the mean square optical flow from the last key frame to the latest frame is calculated. , using edge feature points and feature points Reprojection and Perform calculations.
[0097]
[0098] Camera translation results in occluded and unoccluded areas, even if It may be smaller, and the occlusion problem also requires more keyframes to handle, measured by the mean square optical flow without rotation, using reprojection that only considers translation without rotation and Perform calculations.
[0099]
[0100] Calculate the number of edge feature points and feature points whose reprojection is greater than the distance threshold , and the number of points less than the distance threshold .
[0101] Using the calculated measure, a new keyframe is created when one of the following conditions is met:
[0102]
[0103] When creating key frames for tracking moving objects, we consider the situation where an object has a large number of features but few points are tracked in the current frame. At the same time, we consider that the relative speed and amplitude of moving objects are sometimes large, which can easily lead to tracking failures. Therefore, we need to have a sufficient number of key frames with reasonable distribution to ensure the position accuracy of the moving object. Therefore, this patent also determines whether to insert a new key frame by evaluating the tracking quality of the moving object. The tracking quality measurement is obtained using the overlapping histogram between frames. The edge features and feature points in the frame are reprojected into the current frame, and the number of reprojections is counted at each pixel to generate a count map , the value range of each pixel position in the count map is from 0 to , a value of 0 means no pixel is reprojected to that location, and a value of Indicates that the pixels in the previous frame have been reprojected to this position. This is calculated by calculating the edge feature points and feature point pixel positions in the current frame. , to generate a size of Overlapping histogram of , for each pixel belonging to an edge feature point or feature point , overlapping histogram for:
[0104]
[0105] Therefore, when Large value and non-overlapping quantity A small value indicates good tracking quality. The weighted summation of the overlapped reprojections is used in this paper. Less than the number of non-overlapping , inserts a new keyframe to add keyframes through the motion of the moving object.
[0106] Since edge features usually contain many edge pixels, each keyframe in the optimized frame set has a large amount of feature information. Optimizing all edges of each keyframe in the set increases the difficulty of implementing real-time operations in the CPU. This patent reduces the amount of calculation by maintaining active edges and active feature points and limiting the number of keyframes in the optimized frame set. Previously, this patent would remove an old keyframe by keyframe marginalization, and the keyframe marginalization was performed through the following strategy:
[0107] 1. If the number of visible points of a keyframe in the nearest keyframe is less than the total number of points in the keyframe multiplied by 5%, the keyframe is marginalized.
[0108] 2. If no keyframe satisfies the conditions in 1., marginalize a keyframe by maximizing the distance score of the keyframe set except the two closest keyframes. The distance score function is used to keep the keyframe set evenly distributed in 3D space, so that more keyframes are close to the closest keyframe. The distance score is calculated by the following formula:
[0109]
[0110] in, Is a keyframe and The Euclidean distance between is a small constant.
[0111] When the set of active variables is too large, in order to prevent an active variable set that is actually difficult to handle, the present disclosure uses Schur complement to marginalize the old variables. Marginalization removes any variables that affect Matrix sparse pattern entries. Whenever a keyframe is marginalized, the marginalization operation first marginalizes all its active edges and active feature points, and marginalizes all edge features and feature points that have not been observed in the last two keyframes. Finally, all its observed edge features and feature points are completely deleted from the system.
[0112] The present disclosure uses a fixed-size local optimization frame set to construct a local map. The local optimization frame set contains the most recent Frame information, is the window size. Multi-motion factor graph optimization is performed within a set of local optimized frames, which optimizes the camera position, object pose, static background key points, and moving object key points, and then updates them to the global map.
[0113] The result of local map optimization consists of camera pose, moving object pose, static background key points and key points of each object, and is saved in a global map, which is built using all previous frames and continuously updated with the processing of each new frame. After all input frames are processed, the designed multi-motion factor graph is used for global consistent optimization, and the optimization result is used as the output of the whole system.
[0114] The multi-motion factor graph optimization method used in the present invention establishes an error term model that takes four tasks into consideration, and jointly optimizes the motion of the camera and each moving object, as well as the static background map and the moving object structure representation. Taking into account the computational efficiency requirements, a dense model is not used in static background mapping and moving object structure modeling. Instead, a sparse representation method of key points is used to construct a sparse map of the static background and a sparse structural point representation of the moving object. This helps to improve the computational efficiency of the overall system, especially in large outdoor scenes, where the efficiency advantage of sparse representation of key points is more obvious than that of dense representation. Considering the multi-motion factor graph of moving objects such as Figure 5 As shown in the figure, this joint optimization problem contains five types of error terms: reprojection error of static background points, reprojection error of moving object points, camera pose estimation observation error, uniform motion error of moving objects, and uniform speed error of moving object points. The specific calculation process of these five error terms is as follows:
[0115] For The moment position is For a camera with static background points, the reprojection error is:
[0116]
[0117] in, 3D static map point The coordinates of The reprojection function is to project the 3D point in the camera coordinate system to the pixel coordinate system. for exist The observed pixel coordinates at time.
[0118] for Moving objects at all times , the reprojection error of the moving object point is expressed as:
[0119]
[0120] in, For Moving objects The self-centered posture For moving objects Moving object point The coordinates of for exist The two reprojection errors can jointly optimize the poses of the camera and different moving objects, as well as the positions of the corresponding 3D points.
[0121] The camera pose estimation observation error is used to constrain the relative transformation between frames and minimize the change between camera motions in consecutive time steps, defined as:
[0122]
[0123] In order to make the moving object's trajectory smooth, the present disclosure assumes that the moving object moves at a uniform speed in continuous time observation. exist The linear velocity and angular velocity of the engraving are expressed as and , the uniform motion error of a moving object is defined as:
[0124]
[0125] The uniform velocity error of the moving object point is used to couple the moving object velocity with the moving object posture and its corresponding 3D point. These observations are combined to establish the error term. The uniform velocity error of the moving object point is defined as:
[0126]
[0127] in, It is a moving object In continuous observation and Time interval The pose transformation done in By moving objects exist The linear velocity and angular velocity at the moment are calculated. yes The exponential mapping of: .
[0128] Therefore, the designed bundle adjustment problem for multi-motion factor graph optimization is defined as shown in formula (3.3), which contains five error terms. In the optimization frame set, the camera pose at each moment and a set of map points it observes, as well as the pose of each moving object and its corresponding moving object point are jointly optimized.
[0129]
[0130] in, Represents the set of frames to be optimized, For Frame The set of observed map points, express A collection of moving objects at a moment in time, Indicates moving objects The set of object points, represents the optimized parameters, represents the robust Huber kernel function used to reduce the weights corresponding to outliers, The covariance matrix is shown in Figure 2. The situations are respectively Carve the map points observed by the camera and object points The scale of the other three error terms is It is related to the time interval between two consecutive observations of a moving object. Therefore, the longer the time interval, the greater the uncertainty of the uniform motion assumption.
[0131] The present disclosure uses a multi-motion factor graph optimization framework to jointly optimize four tasks, namely, the motion of the camera and each moving object, as well as the static background map and the structural representation of the moving object, to obtain globally consistent high-precision results.
[0132] Figure 6 Schematic diagram of a dynamic visual SLAM device for temporal sparse reconstruction according to some embodiments of the present disclosure. Figure 6 As shown, the dynamic visual SLAM device 600 for temporal sparse reconstruction includes a data acquisition module 610, a tracking module 620 and a mapping module 630. The dynamic visual SLAM function for temporal sparse reconstruction can be Figure 1 The SLAM server in the system shown executes.
[0133] The data acquisition module 610 is used to acquire a continuous binocular image sequence of a dynamic scene, acquire mapping parameters of each frame of the left-view image, and acquire motion instances of the image based on motion instance segmentation, and assemble the mapping parameters and the motion instances at the corresponding moment into a frame of mapping data, wherein the mapping parameters at least include a depth map, an optical flow estimation result, and structural features of the left-view image, and the structural features include point features and edge features;
[0134] A tracking module 620 is used to determine the correspondence between the structural features in adjacent frames in a frame sequence consisting of a plurality of consecutive frames of the mapping data based on the mapping parameters, determine key points in the structural features, associate the moving objects in the adjacent frames based on the motion instances and the key points, and determine the positions and poses of the camera and the moving object respectively using the motion instances and the key points;
[0135] A mapping module 630 is used to extract a preset number of key frames from a sub-frame sequence including a preset number of frames in the frame sequence based on the optical flow estimation results and structural features of each of the frames, generate a local map corresponding to the sub-frame sequence based on the postures of the camera and moving objects, the static background and the key points of each moving object in the key frames, and fuse the local maps to generate a global map corresponding to the frame sequence.
[0136] In summary, the dynamic visual SLAM method and the dynamic visual SLAM device for temporal sparse reconstruction provided by the embodiments of the present invention segment the motion instances of moving objects through a class-agnostic motion instance segmentation network, and still have a good segmentation effect for objects without semantic information in complex dynamic scenes; and through a multi-motion estimation method that combines point features, edge features and optical flow information, it solves the problem of scarce key points of moving objects due to the small image area occupied by moving objects to a certain extent, and improves the accuracy of absolute trajectory estimation of moving objects; finally, by constructing an error equation including four tasks of camera trajectory estimation, moving object trajectory estimation, static background mapping and moving object reconstruction, the problem of low accuracy of moving object information caused by the lack of joint optimization of the four tasks is solved.
[0137] It should be understood that the above specific embodiments of the present disclosure are only used to illustrate or explain the principles of the present disclosure, and do not constitute a limitation of the present disclosure. Therefore, any modifications, equivalent substitutions, improvements, etc. made without departing from the spirit and scope of the present disclosure should be included in the protection scope of the present disclosure. In addition, the claims attached to the present disclosure are intended to cover all changes and modifications that fall within the scope and boundaries of the attached claims, or the equivalent forms of such scope and boundaries.
Claims
1. A dynamic visual SLAM method for temporal sparse reconstruction, It is characterized in that include: Acquire a continuous binocular image sequence of a dynamic scene, acquire mapping parameters of each frame of a left-view image, and acquire motion instances of the image based on motion instance segmentation, and assemble the mapping parameters and the motion instances at corresponding moments into a frame of mapping data, wherein the mapping parameters at least include a depth map, an optical flow estimation result, and structural features of the left-view image, and the structural features include point features and edge features; In adjacent frames in a frame sequence consisting of a plurality of consecutive frames of the mapping data, determining a correspondence between the structural features based on the mapping parameters, determining key points in the structural features, associating the moving objects in the adjacent frames based on the motion instances and the key points, and determining the positions and poses of the camera and the moving object respectively using the motion instances and the key points; In the frame sequence including a sub-frame sequence of a preset number of frames, a preset number of key frames are extracted based on the optical flow estimation results and structural features of each of the frames, a local map corresponding to the sub-frame sequence is generated based on the posture of the camera and the moving object, the static background and the key points of each moving object in the key frames, and each of the local maps is fused to generate a global map corresponding to the frame sequence; wherein, The acquisition of mapping parameters for each left-view image frame includes: Taking the binocular image at the target moment as input, the CUDA application version of the semi-global matching algorithm is used to perform binocular depth estimation to obtain the depth map of the left view image at the target moment; Taking two adjacent frames of left-view images as input, an optical flow estimation result of the left-view image at the target moment is obtained based on an optical flow estimation network, wherein the optical flow estimation network adopts the liteflownet2 method; Taking the left view image at the target moment as input, a FAST feature extractor is used to detect a sparse corner feature set of the image to output point features of the image; Using the left view image at the target moment as input, using a Canny edge detector to detect and output edge features of the image; The acquiring the motion instance of the image based on motion instance segmentation comprises: Acquire a first left-view image of the moving object at a target moment and a second left-view image at an adjacent moment, and extract multi-scale first feature maps of the first left-view image and the second left-view image respectively based on an image feature extraction neural network, wherein the low-resolution first feature map is obtained by downsampling the high-resolution first feature map of the adjacent scale with a step size of 2; Based on the feature pyramid model, the first feature map of each current scale of the image is fused with the first feature map of the adjacent scale to obtain the second feature map of the current scale of the image, and the second feature maps of all scales of the image constitute the second feature map of the image; Based on the second feature map of the image, a third feature map of the first left-view image is generated after the timing information is introduced. The third feature map of the first left-view image is subjected to motion instance segmentation based on the target detection and instance segmentation algorithm. The obtained motion object instance segmentation result is the motion instance of the first left-view image.
2. The method according to claim 1, It is characterized in that After generating the global map corresponding to the frame sequence, the method further includes: Jointly optimizing the global map based on a preset error factor set, wherein the error factor set includes at least a reprojection error of static background points, a reprojection error of moving object points, a camera pose estimation observation error, a moving object uniform motion error, and a uniform speed error of moving object points; and / or After generating the local map corresponding to the subframe sequence, the method further includes: The local map is jointly optimized based on the preset error factor set.
3. The method according to claim 1, It is characterized in that The determining the corresponding relationship of the structural features based on the mapping parameters includes: For a feature point in the current frame, the optical flow estimation result of the corresponding pixel position is used to obtain the matching feature point of the feature point in the adjacent frame; For a first edge feature in a current frame, an effective depth of the edge feature is searched from a depth map of the current frame, an edge pixel set with a valid depth is reprojected from the current frame to an adjacent frame, a second edge feature corresponding to the first edge feature in the adjacent frame is obtained, and a Euclidean distance to each pixel position of the second edge feature is calculated at each pixel position of the first edge feature, and alignment of edge features of the current frame with those of the adjacent frame is achieved based on minimizing the Euclidean distance.
4. The method according to claim 1, It is characterized in that The associating the moving objects in adjacent frames based on the motion instance and the key point comprises: Calculating the intersection-and-union ratios of a plurality of first motion instances in the current frame and a plurality of second motion instances in adjacent frames respectively, and matching the first motion instance and the second motion instance whose intersection-and-union ratios are the largest and not less than a preset threshold; Key points of the moving object are associated with key points of the moving object from a local map, wherein the local map is generated based on a subsequence of a continuous sequence of binocular images of the dynamic scene.
5. The method according to claim 4, It is characterized in that The associating the key points of the moving object with the key points of the moving object from the local map comprises: If the speed of the moving object in the local map is known, predict the movement of the moving object, and reproject the predicted three-dimensional key points of the moving object to the current frame and match them with the closest landmark points in the current frame; If the speed of the moving object in the local map is unknown or the landmark points of the current frame fail to match the predicted three-dimensional key points of the moving object, the three-dimensional key points are assigned to the moving instance with the largest overlap in adjacent frames.
6. The method according to claim 1, It is characterized in that The method of using the motion instance and the key point to respectively determine the position and posture of the camera and the moving object comprises: Obtaining an edge distance error of a static background edge feature and a reprojection error from a 3D static point to a 2D plane point, and determining the position and posture of the camera from the current moment to the reference moment by jointly minimizing the edge distance error and the reprojection error; The motion instance of each moving object is used to determine the edge features and point features belonging to the moving object, the edge distance error of the moving object from the current moment to the reference moment is determined based on the edge features and the reprojection error is determined based on the point features, and the position and posture of the moving object from the current moment to the reference moment is determined by jointly minimizing the edge distance error and the reprojection error.
7. The method according to claim 1, It is characterized in that In the subframe sequence including the preset number of frames in the frame sequence, extracting the preset number of key frames based on the optical flow estimation results and structural features of each of the frames comprises: Taking the initial frame as a key frame, calculating the mean square optical flow generated by the current frame and the last key frame due to the change of viewing angle or occlusion, and when the mean square optical flow meets the first preset condition or the structural feature of the current frame meets the second preset condition, taking the current frame as the first key frame associated with the camera motion; Determining the tracking quality of the current frame based on the overlapping histogram between frames, and when the tracking quality meets a preset condition, using the current frame as a second key frame associated with the moving object; An optimized frame set is composed of the key frames. When the number of the key frames in the optimized frame set is not higher than a first preset threshold, the first key frame or the second key frame is added to the optimized frame set. When the number of the key frames in the optimized frame set is higher than a second preset threshold, before each key frame is added, one key frame is removed from the optimized frame set based on a preset strategy.
8. A dynamic visual SLAM device for temporal sparse reconstruction. It is characterized in that include: A data acquisition module is used to acquire a continuous binocular image sequence of a dynamic scene, acquire mapping parameters of each frame of a left-view image, and acquire motion instances of the image based on motion instance segmentation, and assemble the mapping parameters and the motion instances at corresponding moments into a frame of mapping data, wherein the mapping parameters at least include a depth map of the left-view image, an optical flow estimation result, and structural features, wherein the structural features include point features and edge features; A tracking module, configured to determine, in adjacent frames in a frame sequence consisting of a plurality of consecutive frames of the mapping data, a correspondence between the structural features based on the mapping parameters, determine key points in the structural features, associate the moving objects in the adjacent frames based on the motion instances and the key points, and determine the positions and poses of the camera and the moving object respectively using the motion instances and the key points; A mapping module is used to extract a preset number of key frames from a sub-frame sequence containing a preset number of frames in the frame sequence based on the optical flow estimation results and structural features of each of the frames, generate a local map corresponding to the sub-frame sequence based on the posture of the camera and the moving object, the static background and the key points of each moving object in the key frames, and fuse each of the local maps to generate a global map corresponding to the frame sequence; wherein, The acquisition of mapping parameters for each left-view image frame includes: Taking the binocular image at the target moment as input, the CUDA application version of the semi-global matching algorithm is used to perform binocular depth estimation to obtain the depth map of the left view image at the target moment; Taking two adjacent frames of left-view images as input, an optical flow estimation result of the left-view image at the target moment is obtained based on an optical flow estimation network, wherein the optical flow estimation network adopts the liteflownet2 method; Taking the left view image at the target moment as input, a FAST feature extractor is used to detect a sparse corner feature set of the image to output point features of the image; Using the left view image at the target moment as input, using a Canny edge detector to detect and output edge features of the image; The acquiring the motion instance of the image based on motion instance segmentation comprises: Acquire a first left-view image of the moving object at a target moment and a second left-view image at an adjacent moment, and extract multi-scale first feature maps of the first left-view image and the second left-view image respectively based on an image feature extraction neural network, wherein the low-resolution first feature map is obtained by downsampling the high-resolution first feature map of the adjacent scale with a step size of 2; Based on the feature pyramid model, the first feature map of each current scale of the image is fused with the first feature map of the adjacent scale to obtain the second feature map of the current scale of the image, and the second feature maps of all scales of the image constitute the second feature map of the image; Based on the second feature map of the image, a third feature map of the first left-view image is generated after the timing information is introduced. The third feature map of the first left-view image is subjected to motion instance segmentation based on the target detection and instance segmentation algorithm. The obtained motion object instance segmentation result is the motion instance of the first left-view image.
Citation Information
Patent Citations
A three-dimensional wire frame structure method and system fusing a binocular camera and IMU positioning
CN109166149A
Large-scale equipment structure surface detection path planning method based on ORB-SLAM
CN113808169A
