## 2 Materials and Methods  
### System Overview  
As one of the most advanced visual SLAM methods available, ORB SLAM3 delivers satisfactory performance across various applications. Our method adopts ORB SLAM3 as the core framework, with several essential modifications. The overall flowchart of the method is shown in Figure 1. The modifications focus on two main aspects: (1) incorporating the principal direction information of feature points, which reflects their overall geometric distribution, into the error calculation function during pose estimation, thereby maintaining high localization accuracy even with a reduced number of ORB feature-extraction levels. As shown in the yellow dashed box labeled a; and (2) replacing the BOW-based loop-closure-detection method in ORB SLAM3 with our proposed loop-closure-detection method based on aggregation descriptors, which eliminates the need for a training process, improves application efficiency, and ensures both detection speed and accuracy, as shown in the yellow dashed boxes labeled b and c.  
Figure 1: The visual SLAM framework. The main contributions of our work are highlighted within the yellow dashed box. (**a**) Pose estimation incorporating principal direction information; (**b**) descriptor extraction; (**c**) similarity calculation and loop-closure detection.  
Specifically, we provided a detailed description of the modifications to illustrate our work. The process in Figures 2 and 3 serve as supplementary explanations of the detailed components from the visual framework shown in Figure 1. In Figure 2, the principal direction of the feature points in the current frame is calculated, and the feature points are projected onto this orientation. The points in the world coordinate system are similarly transformed into the pixel coordinate system and projected onto the principal direction. During the camera pose estimation, the projection error along the principal direction is minimized with the conventional reprojection error, resulting in improved estimation accuracy. ORB features exhibit a certain degree of robustness to image noise [3]. By ignoring variations in secondary directions, the primary direction information reduces the impact of local noise, thereby enhancing noise resistance. Consequently, this method is designed with scene generalization capabilities in mind, considering the operational efficiency of the system.  
Figure 3 shows the workflow of our proposed loop-closure-detection method. Firstly, the image is segmented, and grayscale and gradient features are extracted from each region to construct a feature matrix descriptor. Then, the matrix is aggregated and dimensionally reduced along both columns and rows (by summing) to obtain two types of aggregation feature descriptors, thereby enhancing the efficiency of subsequent filtering and storage. Loop-closure detection is then performed in two stages. The first stage aims to identify k candidate frames quickly, using only one aggregation feature descriptor and calculating the Manhattan distance, which is computationally simple. The second stage focuses on  
Figure 3: Loop-closure detection based on aggregation descriptors. The left side shows the aggregation feature descriptor extraction process, while the right side shows the loop-closure-detection process.  
Figure 2: Pose estimation incorporating principal direction information. The small rectangles represent feature points, and the straight lines with arrows represent the principal directions of the feature points.  
accurately identifying the final loop-closure frame by combining two aggregation feature descriptors and employing a more complex correlation coefficient calculation to measure similarity. This method also considers sensor generalization in its design. Based on global image information, the method is insensitive to input image types, such as fisheye and panoramic images, and does not require additional processing steps to accommodate these variations.