## 3 Methods
### Integrated Matching Model Framework
Cluster stability is quantified by Equation (7). \[S_{\text{cluster}}=\sum_{p\in\text{cluster}}{(\lambda_{\text{p}}-\lambda_{ \text{birth}})}, \tag{7}\]  
where \(\lambda\) denotes the reciprocal of the mutual reachability distance between data points; \(\lambda_{\text{birth}}\) represents the density threshold at which the cluster initially splits; and \(\lambda_{\text{p}}\) corresponds to the density threshold at which a sample exits the cluster. The formula quantifies the cumulative \"survival\" time of each sample within a cluster, thereby serving as an indirect measure of the cluster's stability. Greater stability indicates that the cluster consistently maintains its characteristics across multiple scales, rendering it more representative and interpretable. After configuring all experimental parameters, clustering results were employed to eliminate outliers from the initial set of matched points, producing a refined matched point set denoted as _Stage1_. These clusters are typically concentrated within corresponding regions of the two images, which are defined here as co-visible areas. Such co-visible regions generally contain abundant local feature information. To generate additional matched point pairs, the overall co-visible region was extracted via bounding box cropping and treated as an independent image. This region was then reprocessed through the feature matching module for a second matching iteration, yielding an additional matched point set, _Stage2_. Subsequently, _Stage2_ was concatenated with _Stage1_ to form the combined set _StageAll_. Given that this combined set may still include mismatches and duplicate pairs, further refinement is necessary to obtain a higher-quality final matching set. To effectively remove mismatched pairs from the coarse matching set, robust inlier selection algorithms are commonly employed. This study utilizes a geometry-consistency-based inlier selection method to filter inliers satisfying geometric constraints from the matched points, thereby enhancing the accuracy and robustness of subsequent relocalization modules. The core principle involves constructing a cost function based on epipolar geometry constraints, integrating an error model with maximum consensus search, and iteratively optimizing the fundamental matrix model that best fits the distribution of point pairs to identify the inlier set. The fundamental matrix describes the geometric relationship between two different viewpoints and encodes the epipolar constraint between image pairs resulting from the projection of a 3D point onto two image planes. Suppose a 3D point \(P\) projects onto a pair of corresponding points \((p_{1},p_{2})\) in two images, where \(p_{1}\) lies in image \(I_{1}\) and \(p_{2}\) lies in image \(I_{2}\). These points must satisfy the epipolar geometric relationship defined by the fundamental matrix. As shown in Figure 7, satisfying the epipolar constraint. This condition can be expressed as:  
\[{p_{2}}^{\text{T}}F{p_{1}}=0, \tag{8}\]  
where \(F\) is the fundamental matrix, which has rank 2. Due to the inevitable presence of mismatches in the _StageAll_ set, directly estimating the fundamental matrix using all point pairs is highly vulnerable to outliers, which can lead to inaccurate model estimation. To enhance the robustness of the fitting process, this study employs a robust estimation method based on the principle of consensus sampling. Specifically, the improved RANSAC variant MAGSAC++ [39] is adopted as the model estimation algorithm. Built upon the traditional RANSAC framework, MAGSAC++ introduces multiple enhancements in statistical modeling and scoring mechanisms, significantly improving its resilience to incorrect correspondences. The estimation begins by randomly selecting a minimal sample set--typically eight point pairs--from the set of matches. The eight-point algorithm is then applied to estimate a candidate fundamental matrix.