## 3 Dynamic Object Identification and Tracking
### Object Tracking  
Once we have the cluster position in pixels, we use multi-object tracking with a Kalman filter to enhance the results of the location and velocity of dynamic objects. The design of the Kalman filter (KF) tracking module follows a structured process to estimate the state of tracked objects at each time step \(t\) and ensure consistent tracking over time [46]. Each tracking module is initialized using the KF model, which consists of prediction and update phases. In this framework, the state vector \(\mathbf{s}_{t}\) is defined by four components: position \((p_{x},p_{y})\) and velocity \((v_{x},v_{y})\), as described in Equation (8):  
\[\mathbf{s}_{t}= \begin{bmatrix}p_{x}&v_{x}&p_{y}&v_{y}\end{bmatrix} ^{\top} \tag{8}\]  
The Kalman filter model involves several matrices that represent different components of the system, as shown in Equation (9). These matrices are used to propagate the state of the system and its uncertainty over time. The system matrix \(\mathbf{A}\), which represents how the state evolves between time steps, is defined as follows:  
\[\mathbf{A}= \begin{bmatrix}1&\Delta t&0&0\\ 0&1&0&0\\ 0&0&1&\Delta t\\ 0&0&0&1\end{bmatrix} ,\quad\mathbf{B}= \begin{bmatrix}\frac{\Delta t^{2}}{2}\\ \Delta t\\ \frac{\Delta t^{2}}{2}\\ \Delta t\end{bmatrix} ,\quad\mathbf{H}= \begin{bmatrix}1&0&0&0\\ 0&0&1&0\end{bmatrix}  \tag{9}\]  
Here, \(\Delta t\) represents the time interval between measurements. The matrix \(\mathbf{B}\) represents the influence of control inputs (e.g., acceleration), while \(\mathbf{H}\) is the measurement matrix that maps the state to the measurements, and it has this form because, as shown in the bird's-eye view, only the X and Z axes of the initial state vector are relevant for analysis. The process noise covariance matrix \(\mathbf{Q}\) models the uncertainty in the system's dynamics, and the measurement noise covariance matrix \(\mathbf{R}\) models the uncertainty in the measurements. These are defined as:  
\[\mathbf{Q}= \begin{bmatrix}\frac{\Delta t^{4}}{4}&\frac{\Delta t^{3}}{2}&0&0\\ \frac{\Delta t^{3}}{2}&\Delta t^{2}&0&0\\ 0&0&\frac{\Delta t^{4}}{4}&\frac{\Delta t^{3}}{2}\\ 0&0&\frac{\Delta t^{3}}{2}&\Delta t^{2}\end{bmatrix} ,\quad\mathbf{R}=\sigma_{m}^ {2}\mathbf{I} \tag{10}\]  
Here, \(\sigma_{m}^{2}\) denotes the measurement noise variance, and \(\mathbf{I}\) is the identity matrix. The prediction step calculates the predicted state \(\mathbf{s}_{t|t-1}\) and its covariance \(\mathbf{P}_{t|t-1}\) as follows:  
\[\mathbf{s}_{t|t-1} =\mathbf{A}\mathbf{s}_{t-1}+\mathbf{B}\mathbf{u} \tag{11}\] \[\mathbf{P}_{t|t-1} =\mathbf{A}\mathbf{P}_{t-1}\mathbf{A}^{\top}+\mathbf{Q}\]  
The Kalman gain \(\mathbf{K}_{t}\) is calculated to optimize the update step:  
\[\mathbf{K}_{t}=\mathbf{P}_{t|t-1}\mathbf{H}^{\top}\Big{(}\mathbf{H}\mathbf{P} _{t|t-1}\mathbf{H}^{\top}+\mathbf{R}\Big{)}^{-1} \tag{12}\]  
The updated state estimate \(\mathbf{s}_{t}\) and its covariance \(\mathbf{P}_{t}\) are computed as:  
\[\mathbf{s}_{t} =\mathbf{s}_{t|t-1}+\mathbf{K}_{t}\Big{(}\mathbf{z}_{t}-\mathbf{ H}\mathbf{s}_{t|t-1}\Big{)} \tag{13}\] \[\mathbf{P}_{t} =(\mathbf{I}-\mathbf{K}_{t}\mathbf{H})\mathbf{P}_{t|t-1}\]  
To assign detected objects to existing tracks, the Hungarian algorithm is used to minimize the total assignment cost. Let \(\mathbf{C}\in\mathbb{R}^{n\times n}\) represent the cost matrix, where each element \(C_{ij}\) is the cost of assigning detection \(i\) to track \(j\). The goal is to find a permutation \(\pi\) that minimizes the total cost:  
\[\text{minimize }\sum_{i=1}^{n}C_{i,\pi(i)} \tag{14}\]  
In this case, the cost is defined as the Euclidean distance between the detected position and the predicted Kalman state. In Algorithm 2, \(C\) represents the list of detected object centers, while \(S\) denotes the corresponding state information for each object, including position \((x,y,z)\) and timestamp \(t\).