# Improved Visual SLAM Algorithm Based on Dynamic Scenes
## 3 Method
### Feature Extraction and Matching Based on GCNv2 Network  
The ORB-SLAM2 system employs the ORB feature extraction method, which is used for feature extraction. First, the ORB method constructs an image pyramid by progressively downsampling the image, providing images at different scales. At each layer, the FAST algorithm, which is used to detect corner points, is applied, and non-maximum suppression is implemented to select the most prominent feature points. However, this algorithm, which performs poorly on low-contrast or complex background images, has its limitations. In contrast, GCNv2 can automatically learn more complex features through training, enabling it to effectively detect key points under various conditions.  
Then, ORB generates binary feature vectors with short descriptors for each feature point and assigns a direction to each point to achieve rotational invariance. Similarly, GCNv2 can produce descriptors in the same format as ORB, enabling it to fully replace ORB. Finally, the tracking thread of ORB-SLAM2 primarily relies on two tracking methods: the constant velocity motion model and reference keyframe tracking. However, the computational burden of brute-force matching in the constant velocity motion model is too high, affecting the overall real-time performance of the algorithm. Therefore, when integrating GCNv2 with ORB-SLAM2, the constant velocity motion model was disabled, and tracking was performed solely using the reference keyframe method, combined with the K-nearest neighbor (KNN) matcher [23] for feature point matching.  
As depicted in Figure 2, the GCNv2 network introduced a low-resolution generation strategy based on the GCN network. After multiple convolution and pooling operations, the resolution of the feature maps was significantly reduced, leading to an increase in the number of image channels, which captured more feature information and enhanced key point detection and descriptor generation. The low-resolution feature maps retained high-level features of the input image while substantially reducing computational load.  
Figure 1: Overview of the enhanced SLAM system. The framework of the algorithm comprises four threads: semantic segmentation, tracking, local mapping, and loop closing.  
GCNv2 produces two primary outputs: a probability map indicating key point confidence and a dense feature map for descriptors. The key point probability map is binary, with values between 0 and 1, which facilitates a binary classification task and enhances training outcomes. Moreover, a binary activation layer is included at the network's end to generate binary descriptors. The descriptors generated by GCNv2 are consistent in format with the binary feature vectors of ORB, both being 256-dimensional, allowing GCNv2 descriptors to be directly integrated into existing ORB-based VSLAM systems. Combined with SLAM, GCNv2 selects the highest-confidence key points from the key point confidence map and applies non-maximum suppression (NMS) to ensure an even spatial distribution of key points. The tracking frontend of SLAM uses the key points and descriptors generated by GCNv2 for frame-to-frame matching, retains ORB-SLAM2's pose graph optimization and bundle adjustment modules, and employs GCNv2-generated descriptors for loop detection and closed-loop optimization. The improved SLAM framework leveragesd GCNv2 key points for localization and mapping, which not only captured multi-level scene information but also reduced computational load, enhancing the adaptability and robustness of the SLAM system in various scenarios.