# Satellite Video Moving Vehicle Detection and Tracking Based on Spatiotemporal Characteristics
## 3 Methods
### Inter-Frame Vehicle Association  
The moving vehicles in the satellite video occupied only a few pixels and had similar shapes, colors, and other features. This results in many false matches when matching vehicles between frames using only features such as appearance and color. Vehicle motion in satellite videos can be approximated as a two-dimensional planar motion; therefore, the two-dimensional position information of moving vehicles in satellite videos is more useful for describing inter-frame vehicle association. Based on the detection of moving vehicles, this study proposed a vehicle association method that uses a combination of the relative vehicle position and historical motion information. The moving vehicle is first defined as a vector with position and velocity using a Kalman filter. The covariance matrix infers the next frame state, that is, the trajectory position of the moving vehicle, from the current frame state of the target. The Kalman filter prediction equation is given in Equation (7):  
\[\left\{ \begin{aligned} \hat{\mathbf{x}}_{k}=\mathbf{A}\hat{\mathbf{x}}_{k-1}\\ \mathbf{P}_{k}=\mathbf{A}\mathbf{P}_{k-1}\mathbf{A}^{T}+\mathbf{Q}\end{aligned} \right. \tag{7}\]  
where \(\hat{\mathbf{x}}_{k}\) denotes the target kth frame state volume, \(\mathbf{A}\) is the state transfer matrix, \(\mathbf{P}\) is the state covariance matrix, and \(\mathbf{Q}\) is the process noise covariance matrix. After associating the next frame detection result, the target state is updated, and the update equation is shown in Equation (8):  
\[\left\{ \begin{aligned} \mathbf{K}_{k}=\mathbf{P}_{k}\mathbf{H}^{T}(\mathbf{H} \mathbf{P}_{k}\mathbf{H}^{T}+\mathbf{R})^{-1}\\ \hat{x}_{k}=\hat{x}_{k}+\mathbf{K}_{k}(z_{k}-\mathbf{H}\tilde{x}_{k})\\ \mathbf{P}_{k}=(\mathbf{I}-\mathbf{K}_{k}\mathbf{H})\mathbf{P}_{k}\end{aligned} \right. \tag{8}\]  
where \(z_{k}\) is the state-value observation vector, \(\mathbf{H}\) is the state-observation matrix, \(\mathbf{R}\) is the measurement noise covariance matrix, \(\mathbf{K}\) is the Kalman gain, and \(\mathbf{I}\) is the unit matrix. As the video contains multiple targets, data association is required to match the predicted results with the detection results of the next frame to enable vehicle tracking. For frame \(t+1\), \(m\) moving targets can be detected using the detection method described in Section 3.2, and the Kalman filter predicts the target position for frame \(t+1\) based on the tracking results for frame \(t\), yielding \(n\) predicted targets, to form a data correlation matrix as shown in Equation (9):  
\[\mathbf{C}= \begin{bmatrix}c_{11}&c_{12}&\cdots&c_{1n}\\ c_{21}&c_{22}&\cdots&c_{2n}\\ \vdots&\vdots&\ddots&\vdots\\ c_{m1}&c_{m2}&\cdots&c_{mn}\end{bmatrix} , \tag{9}\]  
where \(\mathbf{C}\) is the data association matrix and \(c_{mn}\) denotes the match between the \(m\)-th detection and \(n\)-th prediction frames. Finally, the Hungarian algorithm was used to obtain the optimal solution for the data association matrix to complete the inter-frame moving vehicle association. The degree of matching is a measure of the similarity of vehicles between frames; therefore, how well the degree of matching is constructed determines the success of the association of vehicles between frames. We fully considered the characteristics of the moving vehicles in the satellite video, integrated the features such as position and motion topology relationship, and proposed a matching degree construction method combining the intersection and merging ratio with the angular difference of motion direction. The IOU effectively describes the position relationship between the target detection and prediction frames, and the angular difference in direction of motion fully utilizes the historical position information of the target for its evaluation. As shown in Figure 5, when the green target prediction frame intersects the two detection frames with the same IOU, the effect of the wrong target can be effectively rejected using angles \(a_{1}\) and \(a_{2}\).