## 2 Theory
### The Unscented Kalman Filter  
Though the traditional mean shift algorithm possesses excellent real-time ability and accuracy under ideal situations, it cannot track targets with high speed because the algorithm starts searching the candidate target from its central point in the last frame within a small area. If the target moves outside the area within the time of one frame, the algorithm fails. To improve the real-time ability and the robustness of our proposed algorithm, giving it the ability to track objects moving at a high speed as well as to pinpoint the target under shielding effect, we introduced the unscented Kalman filter into our detection algorithm. Based on the unscented transformation (UT), shown in Figure 7, UKF abandons the traditional method of linearization of non-linear functions and adopts the framework of the Kalman filter,  
Figure 6: The process of the mean shift algorithm. which is shown in Figure 8. On the premise that the mean value and covariance of the random vectors remain unchanged, a set of Sigma sample points was selected, each of which goes through non-linear transformations. Then the mean and variance of the random vector through the non-linear transformation were estimated by the statistics of the transformed sample points, avoiding the error caused by linearization. The UKF algorithm has better stability than EKF because it no longer calculates the Jacobi matrix of non-linear equations. Also, UKF has a similar performance and smaller calculation cost compared with particle filter. An ordinary state space model can be divided into two parts: namely state transfer model and state observation model. The state of the tracking system is the state of the target, while the observation model is the sequence image. Given that the velocity of the target changes, we assume the acceleration a(k) is a random quantity, and a(k) satisfying the Gauss distribution \(\mathrm{a(k)}\propto\mathrm{N}(0,\sigma_{w}^{2})\). The target's state vector was set to be \(\mathrm{X(k)}=\left[\mathrm{x,y,\dot{x},\dot{y},c_{b}}\right]_{k}^{T}\), where (x, y) was the target's center point; \(\dot{x}\) and \(\dot{y}\) represent the velocity of the target at the x and y coordinate directions, respectively; and \(c_{b}\) was the ratio of the target's current area in the tracking window to its initial area. Observation variable \(\mathrm{y(k)}=\left[\mathrm{x_{c}(k),y_{c}(k)}\right]_{k}^{T}\) in which \(\mathrm{x_{c}(k)}\) and \(y_{c}(k)\) are observation values of the target. The state transition model and observation model are respectively computed by:  
\[\mathrm{X(k)}=\phi X(k-1)+\Gamma w_{k} \tag{23}\]  
\[\mathrm{y(k)}=\mathrm{X_{s}(k)}+\Xi v_{k} \tag{24}\]  
Figure 8: The process of unscented Kalman filter. Figure 7: The process of unscented transformation. where \(\phi=\left[1,0,t,0,0,0;0,1,0,t,0;0,0,1,0,0;0,0,0,1,0;0,0,0,1,0;0,0,0,0,\mathrm{a}_{ \mathrm{p}}\right];\Gamma=\left[\frac{t^{2}}{2},\frac{t^{2}}{2},t,t,0\right]^{ \mathrm{T}}\); \(\Sigma=[1,1]^{\mathrm{T}}\); \(\chi_{\mathrm{s}}(\mathrm{k})=[\mathrm{x}_{\mathrm{m}}(\mathrm{k}),\mathrm{y}_{ \mathrm{m}}(\mathrm{k})]^{\mathrm{T}}\) w\({}_{\mathrm{k}}\), and v\({}_{\mathrm{k}}\) represent the value of white Gaussian noise of the state transition model and observation model, respectively. t is the time interval of adjacent frames, which is one in our algorithm. \(\mathrm{a}_{\mathrm{p}}\) is the target's area factor, which is computed by the zeroth moment of the image in the tracking window. \((\mathrm{x}_{\mathrm{m}}(\mathrm{k}),\mathrm{y}_{\mathrm{m}}(\mathrm{k}))\) is the centroid of the LED obtained from the mean shift algorithm. Supposing that \((\mathrm{x}_{\mathrm{c}},\mathrm{y}_{\mathrm{c}})\) is the initial value of the LED's centroid, calculated by our LED-ID detection algorithm, \(\mathrm{X}(0)=\left[\mathrm{x}_{\mathrm{c}},\mathrm{y}_{\mathrm{c}},\mathrm{0 },\mathrm{0},\mathrm{1}\right]^{\mathrm{T}}\). The theory and formula of the unscented Kalman filter is shown below.