## 3 Methods
### Integrated Matching Model Framework  
In the proposed framework, we have obtained an image pair consisting of the input image \(l_{q}\) and the matching image \(l_{k}\), and accurate correspondences between these images are essential for pose estimation. Correctly establishing these correspondences can significantly enhance the accuracy of visual localization. However, modern deep learning-based feature matching models often require considerable computational resources and extensive training time, which can be a limiting factor in real-time applications. To address this challenge, we have developed a feature matching algorithm based on an integrated model that strikes a balance between computational efficiency and matching accuracy. Figure 5 presents the feature matching algorithm framework. This algorithm combines two methods: the detector-based \"Superpoint+LightGlue [38]\" and the detector-free LoFTR. The \"Superpoint+LightGlue\" method detects local feature points and matches their descriptors to extract key features. It establishes precise correspondences between images. LoFTR, on the other hand, uses a deep learning model to learn global image features. This allows for more accurate dense matching, even with image deformations or changes in viewpoint. By combining both methods, we achieve more accurate correspondences across different scenes and environments. This enhances the accuracy and robustness of visual localization. Figure 4: Schematic diagram of the PNP. SuperGlue employs multilayer perceptrons (MLPs) to encode keypoint positions. However, this encoding method may result in the loss of positional information during inter-layer propagation, thereby reducing matching accuracy. Additionally, the algorithm is computationally intensive and memory-demanding. To overcome these limitations, LightGlue has been proposed as a more efficient feature matching method that significantly improves training complexity, computational efficiency, and resource utilization. We introduced a multi-scale transformation input method to improve image matching performance. The algorithm uses the original image resolution and applies transformations at different scales, such as scaling and blurring. This helps the algorithm capture finer details, especially in scenes with significant variations in scale or viewpoint. As a result, the matching process becomes more accurate and robust. By using multi-scale inputs, the algorithm matches features at various levels. This gives a more complete understanding of the image content and enhances the precision of the final pose estimation. Initially, multi-scale and multi-orientation transformations are applied by resizing both the input and reference images to three resolutions--400, 800, and 1600 pixels--and rotating them at various angles to generate diverse image pairs. In the first stage of feature matching, \"SuperPoint+LightGlue\" and LoFTR algorithms are employed to obtain an initial set of correspondences. The resulting feature matches are then analyzed using the DBSCAN clustering algorithm with adaptive parameter estimation to identify densely matched regions, which are subsequently extracted and defined as co-visibility regions. To further improve matching accuracy, these co-visibility regions are designated as Building Boxes and subjected to an additional refinement step. Within each Building Box, a second round of multi-scale feature matching is conducted using both LoFTR and \"SuperPoint+LightGlue\", yielding more precise matching results. Finally, correspondences from both matching stages are concatenated to form a comprehensive set. To eliminate outliers and retain only reliable matches, a geometry-consistency-based inlier selection method is employed for inlier filtering. This multi-stage, multi-scale matching pipeline enables the acquisition of highly accurate and dense image correspondences, thereby providing robust input for subsequent pose estimation. Figure 5: The Framework of The Integrated Feature Matching Model.