Camera pose solving method and device based on dynamic SLAM and storage medium
By combining instance segmentation and BEBLID descriptors, dynamic feature points are eliminated, and the Res2Net-YOLACT network is used to solve the camera pose of the visual SLAM system, which solves the problem of low accuracy of the visual SLAM system in dynamic environments and achieves a more efficient Pose solution and system stability.
Patent Information
- Application Number
- CN202410642089.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-23
- Publication Date
- 2024-08-23
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing visual SLAM system has low accuracy in solving camera poses in dynamic environments, and the deep learning model has high computational overhead, resulting in low real-time performance and inability to effectively process dynamic feature points, which in turn affects the positioning and tracking accuracy of the system.
By performing instance segmentation on the input image, the static area and the potential dynamic area are distinguished, and the actual dynamic area is determined based on the reference external staggered value, and the dynamic feature points are eliminated. The method of combining the BEBLID descriptor and the Res2Net-YOLACT network is used for feature extraction and segmentation. Finally, the EPnP algorithm is used to solve the camera pose.
It effectively improves the accuracy of camera pose solution and the robustness of the system, improves the accuracy of positioning and mapping in dynamic environments, reduces computational complexity, and enhances the real-time performance of the system.
Smart Images

Figure CN118537401A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of visual SLAM, and in particular to a camera posture solving method based on dynamic SLAM, a camera posture solving device based on dynamic SLAM and a storage medium. Background Art
[0002] Simultaneous Localization and Mapping (SLAM) refers to a new technology that allows robots to collect data from sensors in unknown environments and build real-time maps of the environment and perform positioning. Currently, mainstream SLAM technologies are divided into laser SLAM and visual SLAM. Considering the cost and R&D, visual SLAM has become the research focus in the SLAM field due to its low cost and low power consumption.
[0003] At present, visual SLAM technology has made some progress, but it still faces huge challenges. Existing visual SLAM algorithms usually assume that the external environment is static, ignoring the impact of dynamic objects in the real environment on the accuracy of map construction. In actual scenes, dynamic objects such as moving people and moving cars will cause problems such as feature point matching errors in the visual SLAM system, resulting in a decrease in the positioning accuracy of the system and tracking failure. Therefore, it is necessary to develop new algorithms to deal with SLAM problems in dynamic environments.
[0004] In the prior art, DS-SLAM is proposed based on ORB-SLAM2. It uses semantic segmentation SegNet and motion consistency detection to reduce the impact of dynamic environment on the system, improve positioning accuracy, and enhance the stability of map construction. However, the additional functional modules introduced increase the computational complexity of the system, thereby limiting the application of the algorithm. Detect-SLAM adds a DNN-based target detector to the ORB-SLAM2 system and adds three new threads: moving target elimination, object mapping, and SLAM enhanced detector. This algorithm can improve the accuracy of positioning and mapping in highly dynamic environments, but its performance is not as good as ORB-SLAM2 in static environments.
[0005] The above-mentioned deep learning-based visual SLAM systems often have the following problems. On the one hand, the current deep learning model has a large model calculation overhead, resulting in low detection real-time performance and cannot be well used in visual SLAM systems. On the other hand, when processing dynamic feature points, deep learning-based visual SLAM usually adopts a method of first judging and then eliminating. However, this strategy often leads to a reduction in the number of feature matches, which in turn causes tracking loss in the subsequent SLAM system.
[0006] Therefore, how to improve the accuracy of camera pose solution in dynamic SLAM has become a technical problem that needs to be solved urgently by technicians in this field. Summary of the invention
[0007] The present invention provides a camera posture solving method based on dynamic SLAM, a camera posture solving device based on dynamic SLAM and a storage medium, which solve the problem of low camera posture solving accuracy in dynamic SLAM existing in the related art.
[0008] As a first aspect of the present invention, a camera pose solving method based on dynamic SLAM is provided, which includes:
[0009] Extract feature points of the input image to obtain image feature points;
[0010] Performing instance segmentation on the input image to obtain a static region and a potential dynamic region, wherein the image feature points falling within the static region are static feature points, and the image feature points falling within the potential dynamic region are potential dynamic feature points;
[0011] Determine an actual dynamic region located in the potential dynamic region according to a difference between a baseline extrinsic parameter of the static region and a baseline extrinsic parameter of the potential dynamic region, wherein a potential dynamic feature point located in the actual dynamic region is an actual dynamic feature point;
[0012] Eliminating the actual dynamic feature points in the actual dynamic area, and solving the camera pose according to the static feature points in the static area and the non-actual dynamic feature points in the potential dynamic area to obtain the camera pose;
[0013] The feature point extraction of the input image is implemented by an ORB-SLAM2 algorithm based on a binary descriptor BEBLID.
[0014] Furthermore, performing instance segmentation on the input image to obtain a static region and a potential dynamic region includes:
[0015] Input the input image into the YOLACT network for instance segmentation to obtain multiple segmentation instances of different categories;
[0016] Each segmentation instance is marked according to its category to achieve the division of the static area and the potential dynamic area of the input image, wherein the static area includes multiple static segmentation instances, the potential dynamic area includes multiple potential dynamic instances, each static segmentation instance includes multiple static feature points, and each potential dynamic instance includes multiple potential dynamic feature points.
[0017] Furthermore, the YOLACT network includes a Res2Net backbone network, a feature pyramid, a prediction head branch, and a mask branch.
[0018] The Res2Net backbone network is used to extract multi-scale features from the input image to obtain a multi-scale feature map;
[0019] The feature pyramid is used to extract and fuse fine features of the multi-scale feature map to obtain a multi-scale fine feature map;
[0020] The mask branch is used to create a prototype mask for the multi-scale fine feature map;
[0021] The prediction head branch is used to perform category prediction on the multi-scale fine feature map, and combine the prototype mask to obtain multiple segmentation instances of different categories.
[0022] Furthermore, the prediction head branch is used to perform category prediction on the multi-scale fine feature map, including:
[0023] The prediction head branch is used to determine the prediction box, category confidence and mask coefficient of each category in the multi-scale fine feature map according to the CIoU_Loss loss function, and determine the category corresponding to the feature in the multi-scale fine feature map according to the prediction box and the category confidence.
[0024] Further, determining the actual dynamic area located in the potential dynamic area according to the difference between the baseline extrinsic parameter of the static area and the baseline extrinsic parameter of the potential dynamic area includes:
[0025] Determine the pose information of the camera coordinate system relative to the world coordinate system;
[0026] Calculating the reference extrinsic parameters of the static area and the reference extrinsic parameters of the potential dynamic area respectively according to the pose information of the camera coordinate system relative to the world coordinate system;
[0027] Calculate the difference matrix bi-norm between the reference extrinsic parameter of the static region and the reference extrinsic parameter of the potential dynamic region;
[0028] The second norm of the difference matrix is compared with a preset threshold to determine the actual dynamic area located in the potential dynamic area.
[0029] Further, the reference extrinsic parameters of the static area and the reference extrinsic parameters of the potential dynamic area are calculated respectively according to the pose information of the camera coordinate system relative to the world coordinate system, including:
[0030] Calculating a reference extrinsic parameter of a static area according to the pose information of the camera coordinate system relative to the world coordinate system;
[0031] Taking the baseline extrinsic parameter of the static area as a baseline, for each potential dynamic instance in the potential dynamic area, the baseline extrinsic parameter of the potential dynamic area is calculated according to the pose information of the camera coordinate system relative to the world coordinate system.
[0032] Further, comparing the second norm of the difference matrix with a preset threshold to determine the actual dynamic area located in the potential dynamic area includes:
[0033] For each potential dynamic instance in the potential dynamic area, determining whether the second norm of the difference matrix is greater than a preset threshold;
[0034] If the second norm of the difference matrix is greater than a preset threshold, determining that the current potential dynamic instance in the potential dynamic region is an actual dynamic instance;
[0035] The actual dynamic region is determined according to the judgment result of each potential dynamic instance in the potential dynamic region.
[0036] Furthermore, actual dynamic feature points in the actual dynamic area are eliminated, and camera pose is solved according to static feature points in the static area and non-actual dynamic feature points in the potential dynamic area to obtain the camera pose, including:
[0037] Mapping the static feature points in the static area and the non-actual dynamic feature points in the potential dynamic area to a three-dimensional space to obtain three-dimensional points corresponding to the static feature points and three-dimensional points corresponding to the non-actual dynamic feature points;
[0038] The camera pose is obtained by solving the EPnP algorithm based on the coordinate information of the three-dimensional points corresponding to the static feature points and the coordinate information of the three-dimensional points corresponding to the non-actual dynamic feature points.
[0039] As another aspect of the present invention, a camera pose solving device based on dynamic SLAM is provided, which is used to implement the camera pose solving method based on dynamic SLAM as described above, and includes:
[0040] A feature extraction module is used to extract feature points from an input image to obtain image feature points;
[0041] An instance segmentation module is used to perform instance segmentation on the input image to obtain a static region and a potential dynamic region, wherein the image feature points falling within the static region are static feature points, and the image feature points falling within the potential dynamic region are potential dynamic feature points;
[0042] a determination module, configured to determine an actual dynamic region located in the potential dynamic region according to a difference between a baseline extrinsic parameter of the static region and a baseline extrinsic parameter of the potential dynamic region, wherein a potential dynamic feature point located in the actual dynamic region is an actual dynamic feature point;
[0043] The pose solving module is used to eliminate the actual dynamic feature points in the actual dynamic area, and solve the camera pose according to the static feature points in the static area and the non-actual dynamic feature points in the potential dynamic area to obtain the camera pose.
[0044] As another aspect of the present invention, a storage medium is provided, which is used to store computer instructions. When the computer instructions are loaded and executed by a processor, the camera pose solution method based on dynamic SLAM as described above is implemented.
[0045] The camera pose solving method based on dynamic SLAM provided by the present invention performs instance segmentation on the input image to distinguish between static areas and potential dynamic areas, and eliminates the actual dynamic feature points of the actual dynamic areas in the potential dynamic areas. Finally, the camera pose is solved based on the static feature points in the static area and the non-actual dynamic feature points in the potential dynamic area. Since the dynamic feature points are eliminated, the accuracy of the camera pose solution can be effectively improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] The accompanying drawings are used to provide further understanding of the present invention and constitute a part of the specification. Together with the following specific embodiments, they are used to explain the present invention, but do not constitute a limitation of the present invention.
[0047] Figure 1 The present invention provides a flow chart of a method for solving camera pose based on dynamic SLAM.
[0048] Figure 2 This is a schematic diagram of the architecture of ORB-SLAM2 provided by the present invention.
[0049] Figure 3 The present invention provides Figure 2 The overall framework diagram of the algorithm for improving the RGB-D mode.
[0050] Figure 4 A schematic diagram of the BEBLID descriptor provided by the present invention.
[0051] Figure 5 A flow chart of performing instance segmentation on an input image provided by the present invention.
[0052] Figure 6 The framework diagram of the original YOLACT network provided by the present invention.
[0053] Figure 7 This is a schematic diagram of the segmentation results of a data set using the improved YOLACT provided by the present invention.
[0054] Figure 8The improved YOLACT provided by the present invention filters out dynamic mask feature points.
[0055] Fig. 9 A flow chart for determining an actual dynamic area located in a potential dynamic area provided by the present invention.
[0056] Fig.10 This is a PnP geometric structure diagram provided by the present invention.
[0057] Fig.11 A specific flow chart of the camera pose solution provided by the present invention.
[0058] Fig.12 This is a comparison chart of the BRIEF and BEBLID image matching results provided by the present invention.
[0059] Fig.13a This is a comparison chart of the estimated trajectory and the actual trajectory of the fr3 / walking_half sequence of the ORB-SLAM2 algorithm.
[0060] Fig.13b This is a comparison diagram of the estimated trajectory and the actual trajectory of the fr3 / walking_half sequence of the algorithm of the present invention.
[0061] Fig.14a Comparison chart of the estimated trajectory and the actual trajectory of the fr3 / walking_rpy sequence of the ORB-SLAM2 algorithm.
[0062] Fig.14b This is a comparison chart of the estimated trajectory and the actual trajectory of the fr3 / walking_rpy sequence of the algorithm of the present invention.
[0063] Fig.15a Comparison chart of the estimated trajectory and the actual trajectory of the fr3 / sitting_static sequence of the ORB-SLAM2 algorithm.
[0064] Fig.15b This is a comparison diagram of the estimated trajectory and the actual trajectory of the fr3 / sitting_static sequence of the algorithm of the present invention.
[0065] Fig.16a Comparison chart of the estimated trajectory and the actual trajectory of the fr3 / sitting_xyz sequence of the ORB-SLAM2 algorithm.
[0066] Fig.16b This is a comparison diagram of the estimated trajectory and the actual trajectory of the fr3 / sitting_xyz sequence of the algorithm of the present invention.
[0067] Fig.17 This is a visualization diagram of the loss function of the instance segmentation network training process provided by the present invention.
[0068] Fig.18 This is a diagram of the motion consistency detection effect provided by the present invention. DETAILED DESCRIPTION
[0069] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments may be combined with each other. The present invention will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0070] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiment of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiment of the present invention. Obviously, the described embodiment is only a part of the embodiment of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work should fall within the scope of protection of the present invention.
[0071] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so as to describe the embodiments of the present invention described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0072] In this embodiment, a camera pose solving method based on dynamic SLAM is provided. Figure 1 is a flow chart of a camera pose solving method based on dynamic SLAM according to an embodiment of the present invention, such as Figure 1 As shown, including:
[0073] S100, extracting feature points from an input image to obtain image feature points;
[0074] In the embodiment of the present invention, feature points are extracted from the input image to obtain image feature points. In order to prevent the final solution accuracy from being affected by the small number of feature points extracted, the feature points of the input image are extracted mainly through the ORB-SLAM2 algorithm in the embodiment of the present invention, and the traditional ORB descriptor BRIEF is replaced by the efficient enhanced binary descriptor BEBLID.
[0075] It should be noted that ORB-SLAM2 mainly consists of three threads: tracking, local mapping and closed-loop detection. Figure 2As shown in FIG. 1 , the algorithm can be operated in three modes: monocular, binocular and RGB-D. The embodiment of the present invention makes improvements in the RGB-D mode. The overall framework of the algorithm is as follows: Figure 3 shown.
[0076] BEBLID is specifically improved based on BELID (Boosted Efficient Image Descriptor). It uses the adaptive boost (AdaBoost) algorithm to extract sampled pixel blocks of different shapes in the feature point field, and then compares the grayscale average difference of different pixel blocks with the selected threshold to obtain a binary descriptor. The schematic diagram of the BEBLID descriptor is shown in the figure below. Figure 4 shown.
[0077] In the embodiment of the present invention, BEBLID performs parallel calculation on each descriptor in order to improve the descriptor calculation efficiency. The AdaBoost algorithm used by BEBLID minimizes the loss function as follows:
[0078] ,
[0079] in, Represents the system learning rate; Indicates The weight coefficient of a weak classifier is a training set consisting of a pair of image patches; Represents the training sample label; Indicates that the pair of image patches corresponds to the same image structure, Indicates corresponding to different image structures; Indicates weak classifiers, and based on a given threshold To judge the threshold, the formula is as follows:
[0080] .
[0081] It should be understood that the key to improving the computational efficiency of the BEBLID descriptor is The choice will It is defined as the average grayscale difference between pixels in two different image blocks:
[0082] ,
[0083] in, Represents pixel The gray value at Indicated in pixels Centered at The descriptor formula of the final response map is as follows:
[0084] ,
[0085] in, Indicates is a diagonal matrix of elements; Indicates Weak classifier The AdaBoost weight coefficient.
[0086] S200, performing instance segmentation on the input image to obtain a static region and a potential dynamic region, wherein the image feature points falling within the static region are static feature points, and the image feature points falling within the potential dynamic region are potential dynamic feature points;
[0087] In the embodiment of the present invention, instance segmentation is performed on the input image, that is, multiple instances in the input image are segmented to determine which instances are static and which instances are dynamic.
[0088] It should be noted that the instance in the embodiment of the present invention can specifically represent people and objects in the input image. For example, if the input image shows a person sitting next to a table in an indoor space, the indoor floor, wall, table, person, etc. in the input image are all instances of the input image. Static regions and potential dynamic regions can be determined by performing instance segmentation on the input image. It should be noted that the static region includes all static instances, and the image feature points located in the static region are static feature points, while the potential dynamic region includes all potential dynamic instances, and the image feature points located in the potential dynamic region are potential dynamic feature points.
[0089] It should be understood that both static feature points and potential dynamic feature points represent one-dimensional points, while instances and regions represent two-dimensional planes.
[0090] S300, determining an actual dynamic region located in the potential dynamic region according to a difference between a baseline extrinsic parameter of the static region and a baseline extrinsic parameter of the potential dynamic region, wherein a potential dynamic feature point located in the actual dynamic region is an actual dynamic feature point;
[0091] In an embodiment of the present invention, respective baseline extrinsic parameters are calculated based on the static area and potential dynamic area obtained above, and the actual dynamic area within the potential dynamic area is determined according to the difference between the two baseline extrinsic parameters, so that the actual dynamic feature points within the actual dynamic area can be determined.
[0092] It should be understood here that, for example, in the input image, since a person is sitting next to a table, the person is still at the current moment, but may stand up and walk at the next moment, the person instance is divided into the potential dynamic area as a potential dynamic instance. Here, the actual dynamic area in the potential dynamic area is further determined with the help of the difference in the baseline extrinsic parameters, so that the actual dynamic feature points can be eliminated in the subsequent camera pose solution, so as to improve the accuracy of the camera pose solution.
[0093] S400: Eliminate actual dynamic feature points in the actual dynamic area, and solve the camera pose according to the static feature points in the static area and the non-actual dynamic feature points in the potential dynamic area to obtain the camera pose.
[0094] In an embodiment of the present invention, the actual dynamic feature points in the actual dynamic area determined above are eliminated, and the camera pose is solved based on the non-actual dynamic feature points in the potential dynamic area and the static feature points in the static area.
[0095] The camera pose solving method based on dynamic SLAM provided by the present invention performs instance segmentation on the input image to distinguish between static areas and potential dynamic areas, and eliminates the actual dynamic feature points of the actual dynamic areas in the potential dynamic areas. Finally, the camera pose is solved based on the static feature points in the static area and the non-actual dynamic feature points in the potential dynamic area. Since the dynamic feature points are eliminated, the accuracy of the camera pose solution can be effectively improved.
[0096] In an embodiment of the present invention, instance segmentation is performed on the input image to obtain a static region and a potential dynamic region, such as Figure 5 As shown, including:
[0097] S210, inputting the input image into a YOLACT network for instance segmentation to obtain a plurality of segmentation instances of different categories;
[0098] In an embodiment of the present invention, the input image is input into the YOLACT network for instance segmentation. Specifically, the original YOLACT framework is as follows Figure 6 As shown, the YOLACT network uses the backbone network constructed by ResNet-101 to extract multi-scale feature maps from the input image (such as Figure 6 As shown in C2~C5), in order to speed up the network operation, YOLACT executes two branch tasks in parallel to process multi-scale feature maps, namely the mask branch (ProtoNet) and the prediction branch (prediction head). In order to evaluate the model's prediction regression performance for the bounding box position, YOLACT uses Smooth L1 as the bounding box regression loss function.
[0099] In order to improve the accuracy of the YOLACT segmentation network, the embodiment of the present invention adopts the Res2Net module to replace the backbone module in the original backbone network, so as to improve the multi-scale receptive field of the network. Considering that the ORB-SLAM2 algorithm has high real-time requirements, the embodiment of the present invention adopts Res2Net-50 with a scale of 4 as the FPN backbone network, which reduces the network depth while ensuring a sufficient number of semantic features and improves the real-time segmentation speed.
[0100] In an embodiment of the present invention, the YOLACT network includes a Res2Net backbone network, a feature pyramid, a prediction head branch, and a mask branch.
[0101] The Res2Net backbone network is used to extract multi-scale features from the input image to obtain a multi-scale feature map;
[0102] The feature pyramid is used to extract and fuse fine features of the multi-scale feature map to obtain a multi-scale fine feature map;
[0103] The mask branch is used to create a prototype mask for the multi-scale fine feature map;
[0104] The prediction head branch is used to perform category prediction on the multi-scale fine feature map, and combine with the prototype mask to obtain multiple segmentation instances of different categories.
[0105] It should be noted that the prediction head branch is used to perform category prediction on the multi-scale fine feature map, including:
[0106] The prediction head branch is used to determine the prediction box, category confidence and mask coefficient of each category in the multi-scale fine feature map according to the CIoU_Loss loss function, and determine the category corresponding to the feature in the multi-scale fine feature map according to the prediction box and the category confidence.
[0107] It should be understood that the original loss function Smooth L1 of the YOLACT network lacks the calculation of the intersection-over-union (IOU) and the minimum bounding rectangle, which makes it impossible to accurately measure the position of the prediction box. Therefore, in the embodiment of the present invention, CIoU_Loss is used to replace the original Smooth L1 loss function, and the calculation formula of the bounding box regression loss function CIoU_Loss is as follows:
[0108] ,
[0109] ,
[0110] ,
[0111] ,
[0112] in, Represents the prediction box Distance from the geometric center of the target frame; and Respectively represent the aspect ratio of the target box and the prediction box, and c represents the diagonal length of the minimum circumscribed rectangle of the prediction box and the target box. In the embodiment of the present invention, the CIoU_Loss loss function not only improves the bounding box regression performance, but also improves the positioning accuracy of the model, making the regression effect of the prediction box better, and accelerating the convergence speed of the model and the robustness for multi-scale target detection.
[0113] S220. Mark each segmentation instance according to its category to realize the division of the static area and the potential dynamic area of the input image, wherein the static area includes multiple static segmentation instances, the potential dynamic area includes multiple potential dynamic instances, each static segmentation instance includes multiple static feature points, and each potential dynamic instance includes multiple potential dynamic feature points.
[0114] In the embodiment of the present invention, the improved YOLACT network instance segmentation thread is run as a multithreaded thread together with the tracking thread of ORB-SLAM2. First, the 640*480 TUM-RGBD dataset image is input, and the segmentation result of the mask image is returned, such as Figure 7 The dynamic mask is segmented in the office environment of the TUM dataset. The segmentation effect is shown in Figure 8 shown.
[0115] It should be noted that, in the embodiment of the present invention, when performing instance segmentation on the input image, since the YOLACT network outputs a segmentation mask containing each instance, a visual display with instance masks can be achieved.
[0116] It should be understood that after the instance segmentation of the aforementioned improved YOLACT network, the feature points on the person as the prior target are basically within the mask. For the above method, there may be a situation where the feature points of static dynamic prior objects are eliminated, such as static people, while the feature points of non-dynamic prior objects in motion are retained, such as books that interact with people. Based on this, the moving object consistency detection method based on extrinsic difference values in the embodiment of the present invention further clarifies which of the potential dynamic feature points are actual dynamic feature points. By calculating the extrinsic difference values of the static background and the potential dynamic object, the motion properties of the potential dynamic object are further judged.
[0117] The YOLACT instance segmentation thread is added to the ORB-SLAM2 front end. After the image frame is input, the result with a priori dynamic mask is returned, which divides the image area into static area and potential dynamic area, which is conducive to further geometric processing.
[0118] Specifically, in the embodiment of the present invention, the actual dynamic area located in the potential dynamic area is determined according to the difference between the reference extrinsic parameter of the static area and the reference extrinsic parameter of the potential dynamic area, such as Fig. 9 As shown, including:
[0119] S310, determining the position and posture information of the camera coordinate system relative to the world coordinate system;
[0120] In the embodiment of the present invention, Fig.10 As shown, suppose the coordinates of the n points in the world coordinate system are P1, P2, ..., Pn and the corresponding pixel coordinates p1, p2, ... pn, as well as the camera internal parameter K, and solve the pose R,t of the camera coordinate system (OCXCYCZC) compared to the world coordinate system (OWXWYWZW). The calculation formula is:
[0121] .
[0122] First, the instance segmentation network is used to divide the video frame into static background and potential dynamic instances. and , use the PnP algorithm to calculate the static benchmark external parameters, the expression is ,in, and for and A set of static background feature points.
[0123] S320, respectively calculating the reference extrinsic parameters of the static area and the reference extrinsic parameters of the potential dynamic area according to the pose information of the camera coordinate system relative to the world coordinate system;
[0124] Specifically, the reference extrinsic parameters of the static area and the reference extrinsic parameters of the potential dynamic area are calculated respectively according to the pose information of the camera coordinate system relative to the world coordinate system, including:
[0125] Calculating a reference extrinsic parameter of a static area according to the pose information of the camera coordinate system relative to the world coordinate system;
[0126] Taking the baseline extrinsic parameter of the static area as a baseline, for each potential dynamic instance in the potential dynamic area, the baseline extrinsic parameter of the potential dynamic area is calculated according to the pose information of the camera coordinate system relative to the world coordinate system.
[0127] by As a benchmark, the potential dynamic instances of the current frame are determined. For each potential dynamic instance, its corresponding posture transformation matrix is calculated using the following formula: ,in, and for and Medium Example The set of feature points carried.
[0128] S330, calculating the difference matrix second norm between the reference extrinsic parameter of the static area and the reference extrinsic parameter of the potential dynamic area;
[0129] In getting and Then, by calculating the second norm of the difference matrix ,if Greater than the set threshold , then determine the potential instance is a dynamic example. The calculation formula of the difference matrix second norm is as follows:
[0130] .
[0131] S340: Compare the second norm of the difference matrix with a preset threshold to determine an actual dynamic area located in the potential dynamic area.
[0132] Specifically, comparing the second norm of the difference matrix with a preset threshold to determine the actual dynamic area located in the potential dynamic area includes:
[0133] For each potential dynamic instance in the potential dynamic area, determining whether the second norm of the difference matrix is greater than a preset threshold;
[0134] If the second norm of the difference matrix is greater than a preset threshold, determining that the current potential dynamic instance in the potential dynamic region is an actual dynamic instance;
[0135] The actual dynamic region is determined according to the judgment result of each potential dynamic instance in the potential dynamic region.
[0136] After completing the consistency detection of moving objects, the ORB feature points of the moving instance objects are filtered out, and the static ORB feature points are used to realize the pose calculation, so as to obtain stable and accurate camera extrinsics.
[0137] In the embodiment of the present invention, the actual dynamic feature points in the actual dynamic area are removed, and the camera pose is solved according to the static feature points in the static area and the non-actual dynamic feature points in the potential dynamic area to obtain the camera pose, such as Fig.11 As shown, including:
[0138] S410, mapping the static feature points in the static area and the non-actual dynamic feature points in the potential dynamic area to a three-dimensional space to obtain three-dimensional points corresponding to the static feature points and three-dimensional points corresponding to the non-actual dynamic feature points;
[0139] It should be understood that only the static ORB feature point set is retained in the image frame. , for each feature point , all have corresponding 3D coordinate points It should be noted that the static ORB feature point set here It includes static feature points in the static area and non-actual dynamic feature points in the potential dynamic area.
[0140] S420, obtaining the camera pose according to the coordinate information of the three-dimensional points corresponding to the static feature points and the coordinate information of the three-dimensional points corresponding to the non-actual dynamic feature points in combination with the EPnP algorithm.
[0141] In the embodiment of the present invention, the EPnP algorithm is used to solve the camera pose. First, control points are constructed, and all three-dimensional points are approximately represented by a set of control points. First, four control points are selected. These control points are required to be non-coplanar. The coordinates of the first control point are set to the centroid. The formula is as follows:
[0142] ,
[0143] Wherein, S represents the total number of static feature points in the static area and non-actual dynamic feature points in the potential dynamic area, Represents the 3D coordinate point. Then, by removing the centroid, we get the matrix:
[0144] ,
[0145] in, express The matrix of .
[0146] Through the matrix Perform SVD decomposition and get , so the remaining three control points can be expressed as:
[0147] ,
[0148] in, and express The corresponding eigenvalues and eigenvectors.
[0149] Then, all 3D points in the image are represented as linear combinations of these four control points:
[0150] ,
[0151] in, Indicates Three-dimensional points, Indicates control points, Represents the weight coefficient and represents the relationship between each 3D point and the control point.
[0152] Substituting the above three-dimensional points into the PnP basic equation, the coordinates of the image points can be expressed as the projection relationship of the control points on the image, generating a linear system of unknowns, the formula is as follows:
[0153] ,
[0154] in, represents the two-dimensional coordinates of the image point, Represents the projection relationship from camera coordinates to image coordinates, is the camera internal parameter, Represents the rotation matrix and translation vector to be solved.
[0155] The linear system can be expressed as:
[0156] ,
[0157] Among them, the matrix and vector is constructed from the relationship between image coordinates and control points, vector Contains the coordinates of the control points in the camera coordinate system. Since the system is a linear system, the rotation matrix can be obtained by performing SVD decomposition on the above formula and translation vectors .
[0158] In summary, the camera pose solving method based on dynamic SLAM provided by the embodiment of the present invention replaces the backbone network of traditional YOLACT from ResNet to Res2Net, so as to improve the multi-scale feature receptive field of the instance segmentation network, and introduces CIoU-loss in the bounding box loss function, so as to accelerate the model convergence speed and improve the model accuracy; in view of the problems of insufficient number and low quality of feature points that may appear in dynamic visual SLAM, the embodiment of the present invention adopts the BEBLID descriptor fused ORB feature extraction method to replace the feature extraction method in the original ORB-SLAM2, so as to improve the accuracy and efficiency of feature matching, and enhance the description ability and expressiveness of the image; in addition, in view of the problems of poor robustness and low precision of the current visual SLAM system in dynamic environment, the Res2Net-YOLACT instance segmentation network and the motion consistency detection algorithm based on external parameter difference value are integrated into the front end of the visual SLAM system to realize the effective elimination of moving objects between frames, and only retain the static background and static object feature points, and then adopt the BEBLID fused ORB feature extraction algorithm to perform feature matching to solve the camera pose, which effectively improves the accuracy of camera pose solution.
[0159] The implementation process and technical effects of the embodiments of the present invention are described below in conjunction with comparative experiments.
[0160] (1) Improve the YOLACT instance segmentation network
[0161] The instance segmentation network is trained using the COCO Minitrain dataset, which is a subset of the MS COCO (Microsoft Common Objects in COntext) dataset, containing about 25,000 images and all 80 categories of MS COCO. This training uses the Res2Net pre-trained weights to train the Res2Net-YOLACT network, with batch_size set to 24, 100k iterations, SGD as the training optimizer, initial momentum of 0.9, learning rate of 0.001, and weight decay coefficient of 0.0001. The loss function changes obtained during the training process using the visualization tool Tensorboard, as shown below: Fig.17 As shown, it can be observed that the prediction box, category, mask, and semantic loss all decrease steadily until the model converges.
[0162] The computational complexity of network models is generally evaluated by the number of parameters and floating-point operations (FLOPs). In a convolution operation, the formulas for the number of parameters and floating-point operations are as follows:
[0163] ,
[0164] ,
[0165] in, and Respectively represent the number of input and output channels of the feature map, represents the convolution kernel size, and Represents the size of the input feature map. The calculation of FOLPs depends on the activation function and bias. The embodiment of the present invention uses the Pytorch third-party library thop to calculate the parameter quantity and floating-point calculation quantity of the model. When improving the backbone network, the effective integration of feature maps of different channels in the same feature layer is achieved through multiple multi-scale feature fusions, so that the network increases the size and parameters of the model while extracting the semantic information of the image instance. In addition, the improvement of the bounding box regression loss function also leads to an increase in the computational load of the model to some extent. Comparing the parameter quantity and floating-point operation FLOPs quantization results before and after the improvement, as shown in Table 1, compared with the original YOLACT network, the network parameters, model size, and floating-point operation quantity are increased by 7.3%, 0.94%, and 7.5%.
[0166] Table 1 Comparison of parameters and computational complexity before and after improvement of YOLACT instance segmentation network
[0167] MSCOCO is a commonly used computer vision dataset for target detection, semantic segmentation, and instance segmentation tasks. The experiment of the present invention uses the COCO2017 instance segmentation dataset to conduct an instance segmentation algorithm comparison experiment, and the training results are shown in Table 2. It can be seen from Table 2 that the average accuracy of the improved Res2Net-YOLACT algorithm is improved compared with the original YOLACT algorithm. The algorithm mask mAP in the embodiment of the present invention is 2.98%, 0.64%, and 3.79% higher than FourierNet, PolarMask, and YOLACT, respectively, and the network has good generalization.
[0168] Table 2 Comparative experiments on different segmentation models of MS COCO dataset
[0169] (2) Motion consistency detection experiment
[0170] Fig.18 (a) in the figure shows the feature point extraction of a person in a static state in an image frame when only the instance segmentation network is used. It can be seen that the feature points on the static person are all removed and do not participate in the pose calculation. When the motion consistency detection algorithm and the instance segmentation network are combined and applied to the SLAM system at the same time, the feature points on the static person are effectively restored, such as Fig.18 As shown in (b) in , when a person moves, the feature points on the person can be removed again, such as Fig.18As shown in (c) and (d) in the figure, the feature points on the human body are the removed feature points. Therefore, the dynamic consistency detection algorithm based on PnP can better detect motion instances, remove dynamic ORB feature points, and improve the camera pose accuracy.
[0171] (3) BEBLID matching accuracy experiment
[0172] In order to verify the effect of BEBLID descriptor on improving the matching accuracy of the system, the embodiment of the present invention selects adjacent image frames in two groups of low-dynamic sequences fr3_sitting_static and fr3_sitting_rpy and two groups of high-dynamic sequences fr3_walking_half and fr3_walking_xyz in the public TUM dataset, calculates their BRIEF and BEBLID descriptors respectively, and compares the feature matching rate and calculation time. The TUM dataset is an indoor and outdoor image dataset collected by the Computer Vision Group of Ludwig Maximilian University, which includes 3D object reconstruction, SLAM and other technical evaluation and comparison.
[0173] The experiment of the present invention extracts 500 feature points from each image, and adopts a brute force matching method based on Hamming distance. The number of matching inliers is determined by the homography matrix, where the RANSAC threshold is set to 3, so as to calculate the correct matching rate, which is defined as the percentage of the number of inliers to the number of matching points. Table 3 shows the matching rate comparison results of BRIEF and BEBLID descriptors under the above four sequences. Compared with BRIEF descriptor, the average inlier rate of BEBLID descriptor is increased by 6.6% and 6.9% respectively. In addition, since BEBLID uses parallel calculation of each feature point descriptor, the average calculation efficiency is increased by 14.1% and 15.1% respectively.
[0174] Table 3 Comparison of image matching accuracy
[0175] The image matching results corresponding to Table 3 are as follows Fig.12 As shown in FIG. 1 , on the same image frame, the matching algorithm based on the BEBLID descriptor has more correctly matched feature points than the BRIEF descriptor, and achieves higher matching accuracy.
[0176] (4) SLAM system performance evaluation experiment
[0177] The SLAM system performance evaluation experiment mainly uses the absolute estimation error (ATE) as an indicator. This indicator intuitively reflects the accuracy of the camera motion trajectory by calculating the difference between the true value and the estimated value of the camera pose. The formula is shown below:
[0178] ,
[0179] in, represents the absolute trajectory error, Indicates the total number of frames, represents the estimated pose trajectory of the system, Represents the true pose trajectory. The experiment of the present invention uses the root mean square error (RMSE), standard deviation (STD) and mean to reflect the system performance. The root mean square error is the deviation between the true value and the predicted value. It is more sensitive to occasional errors and can better reflect the robustness of the system. The standard deviation is used to measure the degree of discreteness of the estimated trajectory compared to the true trajectory, which can better reflect the stability of the system.
[0180] The experiment of the present invention quantitatively compares the ORB-SLAM2 system with the system of the present invention in four groups of static scenes and four groups of dynamic scenes in the TUM dataset. The results are shown in Table 4. Each group of experiments was performed 3 times, and the average value was taken as the final result.
[0181] As shown in Table 4, the first four sequences are high dynamic scenes, and the last four are static scenes. As can be seen from Table 4, the algorithm of the present invention is compared with ORB-SLAM2 in dynamic scenes, and the system accuracy is greatly improved, with an average RMSE improvement of 97.2% and an average STD improvement of 96.9%, which fully demonstrates that the algorithm of the present invention can greatly improve the accuracy and robustness of the SLAM system in dynamic scenes. In static scenes, the algorithm of the present invention has outstanding performance compared with ORB-SLAM2, such as fr3 / sitting_half containing some motion scenes, and the algorithm of the present invention improves by more than 50%. In the fr3 / sitting _xyz sequence scene, due to the large rotation of the camera, the algorithm has mismatching or inaccurate segmentation, resulting in a decrease in accuracy. As for the two static scenes of fr3 / sitting_static and fr3 / sitting _rpy, since ORB-SLAM2 has used RANSAC to remove some external points, although the accuracy improvement is not obvious, it is still improved.
[0182] Table 4 Comparison of absolute trajectory errors between ORB-SLAM2 and the proposed algorithm
[0183] The experiment of the present invention selects the image sequences fr3 / walking_half, fr3 / walking_rpy, fr3 / sitting_static, and fr3 / sitting_xyz, and draws the comparison diagrams of the camera estimated trajectory and the real trajectory of ORB-SLAM2 and the algorithm of the present invention in dynamic scenes and static scenes, respectively. Fig.13a and Fig.13b , Fig.14a and Fig.14b , Fig.15a and Fig.15b as well as Fig.16a and Fig.16b shown.
[0184] In the above trajectory comparison diagram, Fig.13a and Fig.13b , Fig.14a and Fig.14b is the dynamic environment trajectory diagram, Fig.15a and Fig.15b as well as Fig.16a and Fig.16b It is a static environment trajectory diagram. It can be clearly observed from the figure that in a high dynamic environment, the pose estimated by the algorithm of the present invention is closer to the real trajectory than ORB-SLAM2. In a static environment, the trajectory estimation accuracy of the algorithm of the present invention is also comparable to that of ORB-SLAM2.
[0185] In order to verify the effectiveness of the algorithm proposed in the present invention, the algorithm of the present invention is compared with other dynamic SLAMs, including Dyna-SLAM based on semantic segmentation, DS-SLAM, dynamic SLAM system MR-SLAM based on optical flow method, and DRSO-SLAM based on semantics and optical flow. The comparison results are shown in Table 5. In the table, N (None) means that the data set has not been tested, and the bold part represents the best result. It can be seen from Table 5 that the pose estimation accuracy of the algorithm of the present invention is comparable to that of Dyna-SLAM in dynamic scenes, and is significantly better than DS-SLAM and MR-SLAM. In summary, the algorithm of the present invention can better solve the problem of static assumption failure of visual SLAM in dynamic scenes, thereby effectively improving the positioning accuracy and robustness of the system.
[0186] Table 5 Comparison of absolute trajectory errors of different SLAM systems
[0187] As another embodiment of the present invention, a camera pose solving device based on dynamic SLAM is provided, which is used to implement the camera pose solving method based on dynamic SLAM as described above, wherein: Fig.17 As shown, including:
[0188] The feature extraction module 100 is used to extract feature points from the input image to obtain image feature points;
[0189] An instance segmentation module 200 is used to perform instance segmentation on the input image to obtain a static region and a potential dynamic region, wherein the image feature points falling within the static region are static feature points, and the image feature points falling within the potential dynamic region are potential dynamic feature points;
[0190] A determination module 300, configured to determine an actual dynamic region located in the potential dynamic region according to a difference between a baseline extrinsic parameter of the static region and a baseline extrinsic parameter of the potential dynamic region, wherein a potential dynamic feature point located in the actual dynamic region is an actual dynamic feature point;
[0191] The pose solving module 400 is used to eliminate the actual dynamic feature points in the actual dynamic area, and solve the camera pose according to the static feature points in the static area and the non-actual dynamic feature points in the potential dynamic area to obtain the camera pose.
[0192] The camera pose solving device based on dynamic SLAM provided by the present invention performs instance segmentation on the input image to distinguish between static areas and potential dynamic areas, and eliminates the actual dynamic feature points of the actual dynamic area in the potential dynamic area. Finally, the camera pose is solved based on the static feature points in the static area and the non-actual dynamic feature points in the potential dynamic area. Since the dynamic feature points are eliminated, the accuracy of the camera pose solution can be effectively improved.
[0193] The specific working principle of the camera pose solving device based on dynamic SLAM of the present invention can be referred to the description of the camera pose solving method based on dynamic SLAM in the previous text, which will not be repeated here.
[0194] As another embodiment of the present invention, a storage medium is provided, which is used to store computer instructions. When the computer instructions are loaded and executed by a processor, the camera pose solution method based on dynamic SLAM as described above is implemented.
[0195] In an embodiment of the present invention, a non-transitory computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions can execute the camera pose solving method based on dynamic SLAM in any of the above method embodiments. The storage medium may be a disk, an optical disk, a read-only memory (ROM), a random access memory (RAM), a flash memory, a hard disk (HDD) or a solid-state drive (SSD), etc.; the storage medium may also include a combination of the above types of memories.
[0196] It is to be understood that the above embodiments are merely exemplary embodiments used to illustrate the principles of the present invention, but the present invention is not limited thereto. For those of ordinary skill in the art, various modifications and improvements can be made without departing from the spirit and essence of the present invention, and these modifications and improvements are also considered to be within the scope of protection of the present invention.
Claims
1. A camera pose solving method based on dynamic SLAM, characterized in that: include: Extract feature points of the input image to obtain image feature points; Performing instance segmentation on the input image to obtain a static region and a potential dynamic region, wherein the image feature points falling within the static region are static feature points, and the image feature points falling within the potential dynamic region are potential dynamic feature points; Determine an actual dynamic region located in the potential dynamic region according to a difference between a baseline extrinsic parameter of the static region and a baseline extrinsic parameter of the potential dynamic region, wherein a potential dynamic feature point located in the actual dynamic region is an actual dynamic feature point; Eliminating the actual dynamic feature points in the actual dynamic area, and solving the camera pose according to the static feature points in the static area and the non-actual dynamic feature points in the potential dynamic area to obtain the camera pose; The feature point extraction of the input image is implemented by an ORB-SLAM2 algorithm based on a binary descriptor BEBLID.
2. The camera pose solving method based on dynamic SLAM according to claim 1, characterized in that: Performing instance segmentation on the input image to obtain a static region and a potential dynamic region, including: Input the input image into the YOLACT network for instance segmentation to obtain multiple segmentation instances of different categories; Each segmentation instance is marked according to its category to achieve the division of the static area and the potential dynamic area of the input image, wherein the static area includes multiple static segmentation instances, the potential dynamic area includes multiple potential dynamic instances, each static segmentation instance includes multiple static feature points, and each potential dynamic instance includes multiple potential dynamic feature points.
3. The camera pose solving method based on dynamic SLAM according to claim 2, characterized in that: The YOLACT network includes a Res2Net backbone network, a feature pyramid, a prediction head branch, and a mask branch. The Res2Net backbone network is used to extract multi-scale features from the input image to obtain a multi-scale feature map; The feature pyramid is used to extract and fuse fine features of the multi-scale feature map to obtain a multi-scale fine feature map; The mask branch is used to create a prototype mask for the multi-scale fine feature map; The prediction head branch is used to perform category prediction on the multi-scale fine feature map, and combine with the prototype mask to obtain multiple segmentation instances of different categories.
4. The camera pose solving method based on dynamic SLAM according to claim 3, characterized in that: The prediction head branch is used to perform category prediction on the multi-scale fine feature map, including: The prediction head branch is used to determine the prediction box, category confidence and mask coefficient of each category in the multi-scale fine feature map according to the CIoU_Loss loss function, and determine the category corresponding to the feature in the multi-scale fine feature map according to the prediction box and the category confidence.
5. The camera pose solving method based on dynamic SLAM according to any one of claims 1 to 4, characterized in that: Determining an actual dynamic region located in the potential dynamic region according to a difference between a baseline extrinsic parameter of the static region and a baseline extrinsic parameter of the potential dynamic region includes: Determine the pose information of the camera coordinate system relative to the world coordinate system; Calculating the reference extrinsic parameters of the static area and the reference extrinsic parameters of the potential dynamic area respectively according to the pose information of the camera coordinate system relative to the world coordinate system; Calculate the difference matrix bi-norm between the reference extrinsic parameter of the static region and the reference extrinsic parameter of the potential dynamic region; The second norm of the difference matrix is compared with a preset threshold to determine the actual dynamic area located in the potential dynamic area.
6. The camera pose solving method based on dynamic SLAM according to claim 5, characterized in that: The base extrinsic parameters of the static area and the base extrinsic parameters of the potential dynamic area are calculated respectively according to the pose information of the camera coordinate system relative to the world coordinate system, including: Calculating a reference extrinsic parameter of a static area according to the pose information of the camera coordinate system relative to the world coordinate system; Taking the baseline extrinsic parameter of the static area as a baseline, for each potential dynamic instance in the potential dynamic area, the baseline extrinsic parameter of the potential dynamic area is calculated according to the pose information of the camera coordinate system relative to the world coordinate system.
7. The camera pose solving method based on dynamic SLAM according to claim 5, characterized in that: Comparing the second norm of the difference matrix with a preset threshold to determine the actual dynamic area located in the potential dynamic area includes: For each potential dynamic instance in the potential dynamic area, determining whether the second norm of the difference matrix is greater than a preset threshold; If the second norm of the difference matrix is greater than a preset threshold, determining that the current potential dynamic instance in the potential dynamic region is an actual dynamic instance; The actual dynamic region is determined according to the judgment result of each potential dynamic instance in the potential dynamic region.
8. The camera pose solving method based on dynamic SLAM according to any one of claims 1 to 4, characterized in that: Eliminating the actual dynamic feature points in the actual dynamic area, and solving the camera pose according to the static feature points in the static area and the non-actual dynamic feature points in the potential dynamic area to obtain the camera pose, including: Mapping the static feature points in the static area and the non-actual dynamic feature points in the potential dynamic area to a three-dimensional space to obtain three-dimensional points corresponding to the static feature points and three-dimensional points corresponding to the non-actual dynamic feature points; The camera pose is obtained by solving the EPnP algorithm based on the coordinate information of the three-dimensional points corresponding to the static feature points and the coordinate information of the three-dimensional points corresponding to the non-actual dynamic feature points.
9. A camera pose solving device based on dynamic SLAM, used to implement the camera pose solving method based on dynamic SLAM according to any one of claims 1 to 8, characterized in that: include: A feature extraction module is used to extract feature points from an input image to obtain image feature points; An instance segmentation module is used to perform instance segmentation on the input image to obtain a static region and a potential dynamic region, wherein the image feature points falling within the static region are static feature points, and the image feature points falling within the potential dynamic region are potential dynamic feature points; a determination module, configured to determine an actual dynamic region located in the potential dynamic region according to a difference between a baseline extrinsic parameter of the static region and a baseline extrinsic parameter of the potential dynamic region, wherein a potential dynamic feature point located in the actual dynamic region is an actual dynamic feature point; The pose solving module is used to eliminate the actual dynamic feature points in the actual dynamic area, and solve the camera pose according to the static feature points in the static area and the non-actual dynamic feature points in the potential dynamic area to obtain the camera pose.
10. A storage medium, characterized in that: Used to store computer instructions, when the computer instructions are loaded and executed by a processor, to implement the camera pose solution method based on dynamic SLAM as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Unmanned aerial vehicle image matching method for improving AKAZE features
CN115601574A
Lithium battery surface silk-screen printing image registration method and device
CN116071405A
Parking apron state supervision method based on YolactII segmentation algorithm
CN116453047A
Rapidly-performed image matching algorithm
CN116486118A
Dynamic SLAM method and device, computer equipment and storage medium
CN116645594A
