# DALLoc: Deep-Learning Accelerated Visual Localization Based on Mesh Representation
## 5 Experimental Evaluation
### Methods and Metrics  
Training data preparation: The original SFM model of Aachen Day-Night contains too many database images to handle, and some 3D points have few 2D features in database images. We use the covisible graph to select the best covisible database images and 3D points to be the subset of the original SFM model for anchor extraction.  
We define the covisible graph from the Sfm reconstruction as \(((I_{1},I_{2}),P)\), a bipartite graph where two nodes correspond to two database images \((I_{1},I_{2})\), and the edge P corresponds to the number of 3D points that are covisible in both images. In our experiment,we select 200 image pairs from the visible graph whose covisible edge is greater than 150, and their covisible 3D points to a the simplified SFM model. Figure 5 compares the two Sfm models.  
We first evaluate the performance of our localization algorithm to fit different global features, local features, and feature matching strategies. we conducted experiments on learned and traditional local features (SuperPoint [42] and SIFT [43]) based on images extracted by NetVLAD. Then, the features can be matched by NN [37] or SuperGlue [38] method. We call them NV+SP+NN, NV+SP+SG, NV+SIFT+NN, and NV+SIFT+SG. Next, we evaluate a more efficient method that simultaneously computes local and global features using HF-Net [5] on our method, with the same matching strategy. We call them HF-Net+NN and HF-Net+SG. We set different numbers of anchors and RANSAC sampling times to show how the different MLP and RANSAC parameters could affect the efficiency and accuracy of the localization algorithm.  
Furthermore, we introduce the following metrics to evaluate the partial and global performances of the localization algorithm.  
* The overall accuracy of localization is defined by position and orientation error. The position error is defined as the Euclidean distance \(\left\|\mathbf{p}_{est}-\mathbf{p}_{gt}\right\|_{2}\) between the estimated pose \(\mathbf{p}_{est}\), and ground truth pose \(\mathbf{p}_{gt}\). The orientation error is the absolute degree error computed from the estimated and ground truth camera rotation matrices \(\mathbf{R}_{est}\), \(\mathbf{R}_{gt}\); we derived error \(\left|\mathbf{\zeta}\right|\) from \(2\cos\left|\mathbf{\zeta}\right|=\text{trace}({\mathbf{R}_{est}}^{-1}\mathbf{R}_{gt})-1\). Additionally, we calculate the percentage of query images localized within three error thresholds varying from high precision (0.25 m, 2\({}^{\circ}\)) to medium precision (0.5 m, 5\({}^{\circ}\)) to low precision (5 m, 10\({}^{\circ}\)).
* Matching time is the time used to establish 2D-3D matches of query and database images. This time includes time spent on image retrieval, extracting local features of query images, and matching these features to retrieved database image features.
* P3P time is the time used for P3P method as illustrated in Step 4; providing high quality 2D-3D matches can significantly reduce the time for this step.
* P3P points are the average 3D points that localize a query image. The less number of P3P points that are used to reach a certain level of quality of the 2D-3D matches built on these 3D points for localization, the better the algorithm performance.
* MLP time is the total time used for additional pose estimation combined with filtering 2D correspondence outliers. The reduction of time in our algorithm can be estimated by the decrease in P3P time plus additional time spent.  
Figure 5: Two different SFM model. (**a**) sparse SFM model. (**b**) Original SFM model.