## 3 Methodology
### Visual Odometry  
The experiments were performed using a fixed-wing UAV flying with an altitude greater than 1000 m. Seven hundred photos were taken on a path of approximately 17.3 km. Figure 1 shows the real path obtained from the GPS. The goal of the flight plan is to be sufficiently long to ensure varying terrain elevation. Additionally, the plan includes intersections in the route to evaluate how the algorithm performs when revisiting areas it has previously encountered. It is assumed that the UAV enters into a GPS-denied zone at the start of the path in Figure 1. When the GPS signal is lost, the plane takes the first photo at (20\({}^{\circ}\)38\({}^{\prime}\)32.136\({}^{\prime\prime}\) N, 103\({}^{\circ}\)49\({}^{\prime}\)5.307\({}^{\prime\prime}\) W). The path ends at (20\({}^{\circ}\)38\({}^{\prime}\)30.6414\({}^{\prime\prime}\) N, 103\({}^{\circ}\)46\({}^{\prime}\)28.9374\({}^{\prime\prime}\) W) and Figure 2 shows both images. Figure 3 describes this stage of the algorithm. It starts when the UAV loses the GPS signal, and it begins to calculate the location estimation based on two consecutive images. First, features are extracted from both images using Oriented Fast (Features from Accelerated Segment Test) and Rotated Brief (Binary Robust Independent Elementary Features) (ORB) [44]. Although ORB is one of the worst descriptors in terms of scale invariance, we can assume that the scale does not change substantially between the two images, as the UAV will not change its altitude drastically during its operation. On the contrary, it is one of the algorithms that finds the largest number of keypoints and is also one of the fastest. That is why we chose ORB over the other options for this phase. An analysis of different descriptor algorithms can be found in [45]. The descriptors analyzed in this study include the following:  
* Oriented Fast and Rotated Brief (ORB) [44]. * Binary Robust Invariant Scalable Keypoints (BRISK) [46]. * KAZE Features (KAZE) [47]. * Accelerated KAZE (AKAZE) [48]. * Speeded-Up Robust Features (SURF) [49]. Figure 1: The blue path represents the Ground Truth measured by the GPS sensor. The path starts at the green marker and ends at the red marker, measuring approximately 18 km. We used Google Earth to visualize the data (Google Earth is a trademark of Google LLC). Figure 2: First and final photo. It is assumed that GPS signal is lost when the first photo is taken and it is not restored along the entire trajectory. Scale-Invariant Feature Transform (SIFT) [50]. The issue with detecting so many keypoints is the time it will take to establish correspondences between the images. To avoid processing all of them, we will only use matches with the shortest distance. This distance is the Hamming distance, a measure of the feature point similarity used to match binary descriptors, which we will denote by \(\rho\). The first step is to consider the first two consecutive images and extract the ORB features. We filter these matches to keep only the best ones. The best matches will be those whose similarity distance \(\rho\) between features is less than a threshold. This threshold will depend on the images and the descriptor algorithm used. The heuristic used for this process is as follows: a test is conducted by plotting the best 200 matches sorted by similarity \(\rho\), and the result is shown in Figure 4. This means that there are no matching errors among the best 200 matches. Figure 3: Flowchart of the visual odometry phase. The algorithm starts when the GPS signal is lost. The first step is to take two consecutive images and find correspondences between keypoints (represented with the red lines). Then, we calculate the displacement between the centroids of the point clouds (represented with the red dots) \(d^{(px)}\) in pixel units; these point clouds are the keypoints corresponding to the good matches. This displacement is converted to meters and added to the previous coordinate (in UTM).