# Pose Measurement for Unmanned Aerial Vehicle Based on Rigid Skeleton
## 3 Research Methodology
### Tracking Stage  
After the initialization is complete, the algorithm enters the tracking stage. For the corresponding frame in each image sequence, the target position is located through detection (that is, obtained by the offline classifier model), online tracking and motion estimation [22]. In this stage, the detection algorithm is the ADAboost algorithm [23] with haar feature. The tracking algorithm which used is KCF [24] with hog feature. For the target in each image sequence, Kalman filtering [25] and the position and attitude of the target in the previous frame can be used to predict the current position of the target, and and the position of the motion estimation is represented as \(x_{k}=\left(a_{k},b_{k},w_{k},h_{k}\right)\), where \(a_{k},b_{k},w_{k},h_{k}\) denotes the column and row coordinates of the top left corner and the width and height of the motion estimation \(x_{k}\) respectively. Furthermore, an ROI (region of interest) is generated around the estimated position for subsequent local detection, which is three times the size of the width \(w_{k}\) and height \(h_{k}\). The offline classifier is used to detect the target, and \(\{x_{di}\}_{i=0}^{M}\) is the candidate found in the current frame. Each candidate area is \(x_{d}=\left(a_{d},b_{d},w_{d},h_{d}\right)\), where \(a_{d},b_{d},w_{d},h_{d}\) denotes the column and row coordinates of the top left corner and the width and height of the candidate \(x_{d}\) respectively. \(p_{d}\) is the center point of \(x_{d}\). Furthermore, the spatial center position \(p_{cen}(x_{cen},y_{cen},z_{cen})\) of the previous frame is calculated to be projected onto the image plane to obtain its coordinates \(p_{pcent}(u_{pcent},v_{pcent})\). The shape and position of the drogue do not mutate throughout the process. Therefore, the detection candidates which detected by detection algorithm close to the region given by the motion estimation have high confidence. The judgment of confidence of the detection candidate can be completed by the following:  
\[c_{d}=c_{ds}\cdot c_{dc}\cdot s \tag{1}\]  
and \(c_{ds}\) and \(c_{dc}\) are defined as  
\[c_{ds}=\frac{\min(w_{d}\cdot h_{d},w_{k}\cdot h_{k})}{\max(w_{d}\cdot h_{d},w_{ k}\cdot h_{k})} \tag{2}\]  
\[c_{dc}=f(p_{N}(a_{d},b_{d})) \tag{3}\]  
where \(p_{N}\sim\mathcal{N}\bigg{(}\left( \begin{array}{c}a_{k}\\ b_{k}\end{array} \right),\left( \begin{array}{c}\sigma^{2}&0\\ 0&\sigma^{2}\end{array} \right)\bigg{)}\), of which \(\sigma=\sqrt{w_{k}^{2}+h_{k}^{2}}\). The function \(f\) is used to remap the value of \(p_{N}\) within \(2\sigma\) of \(\left(a_{k},b_{k}\right)\) to the interval \(\left[0,1\right]\). \(s\) is also a normal distribution, which is given according to the distance from the center point \(p_{d}\) to the projected point \(p_{pcent}\), similar as \(c_{dc}\), here \(\sigma=\sqrt{\mu_{pcent}^{2}+v_{pcent}^{2}}\). If there are multiple candidates, the value with the highest confidence is selected as the detection result. Similarly, the confidence judgment formula for online tracking is as follows:  
\[c_{o}=c_{os}\cdot c_{oc}\cdot s \tag{4}\]The parameter definition is similar to that in the confidence of the detection candidate. For the positioning process of each frame, the target state can be defined as \(\{x,c\}\), where \(x\) is the target position and \(c\) is the confidence of the position. Given motion estimation \(x_{k}\), detection \(x_{d}\) and online tracking \(x_{o}\), the confidence evaluation function is as follows:  
\[\{x,c\}=\left\{ \begin{array}{cc}\{0,1\}&\quad\text{if }c_{d}<\theta_{1} \delta\kappa c_{o}<\theta_{2}\\ \{x_{d},c_{d}\}&\quad\text{if }c_{d}\geq\theta_{1}\delta\kappa c_{o}\geq\theta_{2} \delta\kappa c_{d}\geq c_{o}\|\text{ if }c_{d}\geq\theta_{1}\delta\kappa c_{o}<\theta_{2}\\ \{x_{o},c_{o}\}&\quad\text{if }c_{d}\geq\theta_{1}\delta\kappa c_{o}\geq\theta_{2} \delta\kappa c_{d}<c_{o}\|\text{ if }c_{d}<\theta_{1}\delta\kappa c_{o}\geq\theta_{2}\end{array} \right.