# 3D Positioning of Drones through Images
## 3 Methods
### UAV Image-Based Altitude Determination Method  
When a UAV is in flight with its camera pointing vertically downward and the focal length unchanged, as shown in Figure 8, there is a relationship between the camera's field of view and the flight altitude. By determining the actual area of a certain region in the UAV image, the actual flight altitude can be calculated. This study used the DJI Phantom 4 Pro drone for image capture. The specific camera parameters are FOV 84\({}^{\circ}\), 8.8 mm/24 mm (35 mm format equivalent), f/2.8-f/11 with autofocus. When capturing images, the camera uses the minimum focal length (minimum magnification), with a vertical downward view, and a 4:3 aspect ratio. According to official DJI data, under 4:3 aspect ratio conditions, the actual shooting area at 100 m altitude is 15,542.7 m\({}^{2}\), and at 500 m altitude, it is 388,567.9 m\({}^{2}\). From this, we can deduce that the photo shooting area has a linear relationship with the square of the flight altitude, with \(S\):\(H^{2}=S_{1}\):\(H^{2}_{1}=1.55427\):1. Given this known ratio between the photo shooting area and the square of the flight altitude, we can obtain the coordinates of four points in the original image through our model, calculate the area of the square formed by these 4 points, and thus calculate the flight altitude. Figure 9 shows the altitude calculation process. After a drone captures an image, it is cropped into four smaller images. These are separately input into the model to calculate the position of each small image's center point, thus obtaining the coordinates of the small image centers. We then calculate the area of the small square block in the drone image on the right side of Figure 9, restore the overall image area, and finally calculate the flight altitude through the ratio. During the process of image cropping-model processing-coordinate generation, due to the cropping of the image, the perspective shifts, differing from the vertical downward view during training. The resulting predicted coordinate accuracy makes it difficult to achieve the precision of standalone testing. To address this, we will introduce the image cropping-model processing-coordinate generation process and the corresponding optimization process using Sequential Quadratic Programming (SQP). Figure 8: Drone shooting range and height. S: area, H: height. In the dataset Section 2.3, we introduced the composition of the training and test sets. In the test set, one UAV image corresponds to 12 satellite images of different scales, all containing the UAV image but with the UAV image at different positions within the satellite images (Figure 3). Through the model, 12 latitude and longitude predictions are generated, with different localization accuracies for satellite images of different scales. In our proposed altitude calculation method, we aim to calculate the area of the drone's shooting region as accurately as possible, and then obtain the drone's flight altitude through a linear relationship. We transform this problem into how to optimize the solution for the area of the small square block in the drone image on the right side of Figure 9. Under the vertical perspective of the drone, the positioning accuracy can generally achieve an RDS75 score. Therefore, we consider the coordinates of the image center as accurate values, and view the predicted latitude and longitude coordinates of the cropped drone images from the top-left, bottom-left, top-right, and bottom-right corners as objects to be optimized. The optimization process uses Sequential Quadratic Programming (SQP). 1. Initialization  
- Drone image center point coordinates (\(x_{c}\), \(y_{c}\))  
- Values to be solved for the cropped drone images from top-left, bottom-left, top-right, and bottom-right corners: (\(x_{1}\), \(y_{1}\)), (\(x_{2}\), \(y_{2}\)), (\(x_{3}\), \(y_{3}\)), (\(x_{4}\), \(y_{4}\)). - Cropped drone images \(i\) (\(i\) = 1, 2, 3, 4) from top-left, bottom-left, top-right, and bottom-right corners.