## 3 ALS-KF Based Visual Object Tracking Algorithm
### Noise Covariance Estimation Using ALS  
An important part of the Kalman filter is the estimation of the noise covariance matrices \(Q\) (process noise covariance) and \(R\) (measurement noise covariance). The accuracy of these estimates significantly affects the filter's performance. In this work, we use the ALS method to estimate \(Q\) and \(R\). The ALS method is based on the autocovariance of the innovation sequence (also known as the difference between the actual measurement and the predicted measurement based on the predicted state) from the Kalman filter. The ALS method computes the autocovariance of this sequence and formulates a least-squares problem to solve for Q and R. By continuously updating the noise covariance estimates, the ALS method allows the Kalman filter to adapt to changes in the system dynamics and measurement noise, resulting in improved tracking accuracy. The adaptive Kalman filter (AKF) with the autocovariance least square estimation (ALS) algorithm, termed AKF-ALS algorithm is outlined in Algorithm 1. ```
1:Initialize:\(\hat{x}_{0},P_{0},F,H,Q,R\)
2:for\(k=1,2,\dots\) until convergence do
3:Prediction:
4:\(\hat{x}_{k|k-1}=F\hat{x}_{k-1|k-1}\)
5:\(P_{k|k-1}=F{P_{k-1|k-1}}F^{\text{T}}+Q\)
6:Update:
7:\(e_{k}=z_{k}-H\hat{x}_{k|k-1}\)
8:\(K_{k}=P_{k|k-1}H^{\text{T}}(HP_{k|k-1}H^{\text{T}}+R)^{-1}\)
9:\(\hat{x}_{k|k}=\hat{x}_{k|k-1}+K_{k}e_{k}\)
10:\(P_{kk}=(I-K_{k}H)P_{k|k-1}\)
11:if\(k\geq\tau+N\)then
12:Estimate\(Q\),\(R\) via ALS:
13: Compute \(\hat{c}_{e,0},\hat{c}_{e,1},\dots,\hat{c}_{e,N-1}\) in Equation (13)
14: Stack \(\hat{c}_{e,0},\hat{c}_{e,1},\dots,\hat{c}_{e,N-1}\) into \(\hat{b}\)
15: Compute \(\mathcal{A}\) using Equation (10)
16: Solve for \(\hat{\theta}\) using Equation (12)
17: Unstack \(\hat{\theta}\) into \(Q\) and \(\hat{R}\)
18:endif
19:endfor
```  
**Algorithm 1** AKF-ALS  
The algorithm includes the following procedures. 1. Initialize the state estimate \(\hat{x}_{0}\), the state covariance matrix \(P_{0}\), the system matrices \(F\) and \(H\), the Kalman gain matrix \(K\), the window sizes \(N\) and \(\tau\), and the noise covariance matrices \(Q\) and \(R\). 2. The main loop of the algorithm iterates until the ALS method has converged. At each iteration, The state estimate and covariance matrix are updated recursively using the observed measurement \(z_{k}\), the measurement model defined by \(H\), and the noise covariance matrix \(R\). 3. After a sufficient number of iterations \(k\) exceeds \(\tau+N\), the ALS method can be applied to estimate the noise covariance matrices. We compute the autocovariance of the innovations, stack them into a vector \(\hat{b}\), and compute the matrix \(\mathcal{A}\) as per the provided equations. A least-squares problem is then solved to get an estimate \(\hat{\theta}\), which we then unstack into the individual matrices \(\hat{Q}\) and \(\hat{R}\). Process model owing to its computational simplicity and efficiency, which is essential for adherence to real-time tracking constraints. The LTI model's predictive strength in capturing linear motion makes it particularly suitable for VOT scenarios, and its compatibility with Kalman filtering allows for optimal tracking in systems characterized by Gaussian noise and linear dynamics. Concurrently, our measurement model is robustly designed to withstand VOT-specific challenges such as occlusions and dynamic appearance changes, employing autocovariance least square estimation (ALS) to dynamically adapt to the non-stationary noise statistics typical of real-world environments. This adaptability is augmented by an adaptive background subtraction pre-processing step that effectively differentiates the target from its backdrop, thus enhancing measurement accuracy and, by extension, the reliability of object tracking. The computation complexity of the proposed AKF-ALS algorithm is derived to show the real-time performance in Theorem 1.