# 3D Positioning of Drones through Images
## 3 Methods
### UAV Image-Based Altitude Determination Method
m predicted coordinates (\(x_{ij}\), \(y_{ij}\)), \(j\) = 1, 2, \(\ldots\), \(m\), \(m\)\(\leq\) 12 (after eliminating outliers)  
Known accuracy probability p1 for each predicted coordinate (\(p_{j}\)) takes the RDS score of prediction accuracy for satellite images of different sizes)  
2. Construct the objective function:  
\[J=\sum_{i=1}^{4}\sum_{j=1}^{m}p_{j}\sqrt{\left(x_{i}-x_{ij}\right)^{2}+\left(y _{i}-y_{ij}\right)^{2}} \tag{1}\]  
The objective function sums the weighted deviations between multiple predicted coordinates for each vertex and the true coordinates (the unknowns to be solved). The physical meaning of minimizing \(J\) is as follows: Under the constraints of all predicted coordinates, find an optimal set of coordinates (\(x_{1}\), \(y_{1}\)), (\(x_{2}\), \(y_{2}\)), (\(x_{3}\), \(y_{3}\)), (\(x_{4}\), \(y_{4}\)) such that: These coordinates satisfy the square geometric constraints (implemented through constraint conditions). And the sum of the weighted deviations from the various predicted coordinates is minimized. 3. Construct constraint conditions \(C_{k}(x)\)\(k\) = 1, \(\ldots\), 8  
In our altitude prediction method, the ideal scenario is that the predicted coordinates from the cropped drone images of the top-left, bottom-left, top-right, and bottom-right  
Figure 9: Height calculation process.Taking the four vertices of the original drone image as the starting point, four images of \(3000\times 3000\) size were intercepted. corners are accurate and form a standard square for solving. Based on this condition, we construct geometric constraints for the predicted points. The distances between predicted points \((x_{i},y_{i})\) and the center point \((x_{c},y_{c})\) are equal \(C_{1}(x)-C_{4}(x)\). The distances between each pair of predicted points are equal \(C_{5}(x)-C_{8}(x)\). 4. Local SQP Iteration Steps  
1. Initial point \(X^{0}\), choose the average of the 12 predicted coordinates generated by each image after eliminating outliers. Set \(k=0\). 2. Update the Hesse matrix approximation \(H\), with \(H^{0}\) chosen as the identity matrix. The iteration method for \(H^{k}\) uses the DFP method:  
\[H^{k+1}=H^{k}+\frac{\Delta X^{k}\Big{[}\Delta X^{k}\Big{]}^{T}}{\big{[}\Delta q ^{k}\big{]}^{T}\Delta X^{k}}-\frac{H^{k}\Delta q^{k}\Big{[}\Delta q^{k}\Big{]}^ {T}H^{k}}{\big{[}\Delta q^{k}\big{]}^{T}H^{k}\Delta q^{k}} \tag{2}\]  
where \(\Delta X\) is the difference of each iteration of the target variable \(X\), and \(\Delta q\) is the difference in the gradient of each iteration. 3. Construct a QP sub-problem  
\[ \begin{array}{ll}\min\frac{1}{2}d^{T}Hd+g^{T}d\\ \text{s.t. }C_{i}\Big{(}X^{k}\Big{)}+\
abla C_{i}\Big{(}X^{k}\Big{)}^{T}d=0&i=1, \ldots,8\end{array}  \tag{3}\]  
where \(d\) is the search direction, and \(g\) is the gradient of the objective function at the current point \(X^{k}\). 4. Line search: Find step size \(\alpha\) such that \(X^{k+1}=X^{k}+\alpha\times\ d\) minimizes the objective function value while satisfying the constraints. 5. Update: \(X^{k+1}=X^{k}+\alpha\times\ d\)  
6. Check convergence condition: If the convergence condition is met (such as \(\mid\mid X^{k+1}\)  
\(-\)\(X^{k}\mid\mid<\epsilon\)1 or \(\mid\mid\)\(X^{k+1})\(-\)\(\mid\)\(X^{k}\)\(\mid<\epsilon\)2), stop; otherwise, return to step 2. In each iteration, we solve a QP subproblem to find a search direction that both reduces the objective function value and satisfies the constraints.