# Visual-Inertial Method for Localizing Aerial Vehicles in GNSS-Denied Environments
## 2 Materials and Methods  
In the pinhole camera model, every 3D world point P (expressed by world coordinates \(X_{P}\), \(Y_{P}\), \(Z_{P}\)) is represented by the intersection between the image plane and the camera ray line that connects the optical center with the point. As proposed in [20], it is possible to assume an initial state where \(\theta_{X}=\theta_{Y}=\theta_{Z}=0\) with the origin of the local coordinate system in the camera center. The center point of the image plane c has image coordinates equal to \(\mu_{0}\) and \(\
u_{0}\), but considering the local system described above, the coordinates (\(x_{c}\), \(y_{c}\), \(z_{c}\)) of this point would be as follows:  
\[c=(f,0,0) \tag{1}\]  
where f is the focal length expressed in pixels, but it can be converted to distance units by knowing the pixel Pitch. Let us now consider a generic point \(p\) in the image plane of coordinates \(\mu_{p}\) and \(\
u_{p}\). The coordinates \((x_{p},y_{p},z_{p})\) of this point in the local system can be retrieved as follows:  
\[p=\left(f,\ \left(\mu_{0}-\mu_{p}\right),\ \left(\
u_{0}-\
u_{p}\right)\right) \tag{2}\]  
At this point, the position of the point \(p\) in the local coordinate systems should be defined, after the rotations defined by Euler angles. As shown in Figure 1a, the \(\theta_{x}\) (Yaw angle) is always equal to zero. Therefore, both the position of point \(p\) and the orientation of the image plane, along with the center \(c\), remain unaltered. The rotation of the coordinates of the point \(p\) due to Pitch (\(\theta_{y}\)) can be then calculated using \(R_{y}\) (see Figure 1a and [22]). The coordinates of the point \(p^{\prime}\) after rotation due to the Pitch (\(x^{\prime}_{p},y^{\prime}_{p},z^{\prime}_{p}\)) can be then defined as follows:  
\[ \begin{bmatrix}x^{\prime}_{p}\\ y^{\prime}_{p}\\ z^{\prime}_{p}\end{bmatrix} = \begin{bmatrix}\cos\left(\theta_{y}\right)&0&\sin \left(\theta_{y}\right)\\ 0&1&0\\ -\sin\left(\theta_{y}\right)&0&\cos\left(\theta_{y}\right)\end{bmatrix} \begin{bmatrix}x_{p}\\ y_{p}\\ z_{p}\end{bmatrix}  \tag{3}\]  
Similarly, it is possible to retrieve the coordinates of the image center \(c^{\prime}\) after Pitch rotation (\(x^{\prime}_{c},y^{\prime}_{c},z^{\prime}_{c}\)). Figure 1: The camera is in an initial state comparable to the inertial frame ((\(\theta_{x}=\theta_{y}=\theta_{x}=0\)) (**a**). The camera axes are depicted by black arrows. The point \(O_{R}\) serves as both the camera center and the origin for the local coordinate systems defined in this model. The focal length of the camera, denoted by \(f\), aligns along the X-axis. The image center is represented by \(c\), while \(p\) symbolizes any arbitrary point within the image plane. In this proposed model, the Yaw angle (\(\theta_{x}\)) consistently remains at zero, signifying no rotation within the system. Rotation around the Y-axes, known as the Pitch (\(\theta_{y}\)), results in the state illustrated in (**b**). For Roll (\(\theta_{x}\)) rotation, it occurs around the axes defined by \(O\)-\(c^{\prime}\), leading to the state depicted in (**c**). (Source: [20] with modifications). We can now apply the rotation due to Roll angle (\(\theta_{\rm x}\)) to finally determine the position of the point \(p^{\prime\prime}\) in the defined local coordinate system after the necessary camera rotations. Nevertheless, in this scenario, directly applying the matrix Rx (as described in Equation (4)) to the coordinates of point \(p^{\prime}\) is not viable due to the misalignment of the axis undergoing Roll rotation (\(\rm O_{R}\)-\(\rm c^{\prime}\)) with the axis of the local coordinate system (see Figure 1c). In this case, it is necessary to apply a rotation along the axis \(\rm O_{R}\)-\(\rm c^{\prime}\) using the following sequence of rotations T (see [20] for further details):  
\[[T_{\rm O-\rm c^{\prime}}]=[R_{\rm x}]^{-1}[R_{y}]^{-1}[R_{Roll}][R_{y}][R_{x}] \tag{4}\]  
The coordinates of the point \(p^{\prime\prime}\) are therefore given as follows:  
\[