## 2 Materials and Methods
### Camera Pose Estimation and Target Detection  
In this research, in order perform the camera pose estimation and target detection, we selected the ArUco library proposed [PERSON] [11]. The library contains a set of ArUco markers which are represented by binary square fiducial markers with its own unique identifier that can be used for camera estimation (see Section 3.2). When the four corners of the ArUco marker are detected from the camera's point of view, the camera pose can be estimated. As the marker is planar, the transformation can be carried out by means of a homography function. The function returns the transformation as two vectors: one for the translation and the other one for the relative rotation. After the calculation of those vectors, the rotation matrix, R(\(\Psi\), \(\Theta\), \(\Phi\)), can be computed as shown in Equation (1), which indicates the rotation between the two reference frames. Rotations may also occur about an arbitrary axis--i.e., an axis other than the unit vectors representing the reference frame. In such cases, we need a way of determining the final orientation and the unique axis about which the point vector is rotated (often referred to as orientation kinematics). A rotation of a generic vector \(p\) about an arbitrary axis \(u\) through an angle \(\phi\) can be written as Equation (2), where \(\hat{u}\) is the skew-symmetric matrix representation of the vector \(u\) and is defined as Equation (3). Equation (2) is called [PERSON] rotation formula and has proved to be especially useful for our purpose, with the main reason being that by knowing the numerical values of the elements contained within the rotation matrix, it is possible to compute \(\hat{u}\) and \(\phi\) using Equations (4) and (5). \[R(\Psi,\Theta,\Phi)=\left[ \begin{array}{ccc}cos\Phi cos\Psi&sin\Phi sin\Theta cos \Psi-cos\Phi sin\Psi&cos\Phi sin\Theta cos\Psi+sin\Phi sin\Psi\\ cos\Theta sin\Psi&sin\Phi sin\Theta sin\Psi+cos\Phi cos\Psi&cos\Phi sin\Theta sin \Psi-sin\Phi cos\Psi\\ -sin\Theta&sin\Phi cos\Theta&cos\Phi cos\Theta\\ \end{array} \right] \tag{1}\]  
\[Rot(u,\phi)=Lcos\phi+uu^{T}(1-cos\phi)+\hat{u}sin\phi, \tag{2}\]  
\[\hat{u}=\left[ \begin{array}{ccc}0&-u_{3}&u_{2}\\ u_{3}&0&-u_{1}\\ -u_{2}&u_{1}&0\\ \end{array} \right] \tag{3}\]  
Figure 1: (**a**) Crazyflie 2.0 commercialized by Bitcraze AB; (**b**) the camera and transmitter module was mounted on top of the Crazyflie 2.0. \[\hat{u}=\frac{1}{2 sin\phi}\Big{(}R-R^{T}\Big{)} \tag{4}\]  
\[cos\phi=\frac{\tau-1}{2}, \tag{5}\]  
where \(\tau\) is the sum of the scalar values in the main diagonal of the rotation matrix, R: \(\tau=r_{11}+r_{22}+r_{33}\). In order to detect the ArUco markers, at first, in order to find the candidate corners of the markers, a local adaptive thresholding and extraction of contours is carried out. The adaptive thresholding is conducted by applying a window sliding (\(3\times 3\), \(5\times 5\), \(11\times 11\), etc.) and finding optimum greyscale window. Values that are below the calculated value will be black and those above are white. After obtaining the thresholded image, if the result is not similar to a square, then the candidate corner is not selected. After selecting the corners, the white and black elements in the inner binary matrix are extracted in order to validate them. This process is conducted using the homography matrix and [PERSON]'s method [11]. The resultant binary bits are then compared against all the available ArUco markers, so the respective marker is detected. Through the ArUco library, camera pose estimation and marker detection can be achieved. However, due to the possibility of camera occlusion, data losses, etc., the relative pose of the Crazyflie 2.0 cannot be conducted. In order to overcome such issues, we have proposed to implement a Kalman filter [12]. The Kalman filter is an optimal estimator based on a recursive algorithm for estimating the track of an object by means of the given measurements to keep the accuracy of the state estimation aiming to predict future states.