## 4 Improved DeepSORT Algorithm
### Improved KF Algorithm  
The core of the DeepSORT multi-object tracking algorithm is the use of recursive KF and frame-by-frame Hungarian data association. \((u,v)\) are set as the center coordinates of the bounding box, \(\gamma\) is the length-to-width ratio, the height is \(h\), and \(\dot{u},\dot{v},\dot{\gamma},\dot{h}\) represent the velocity information in the corresponding coordinate system of the image. To describe the state of motion, the trajectory processing and state estimation of the algorithm use these eight parameters \((u,v,\gamma,h,\dot{u},\dot{v},\dot{\gamma},\dot{h})\). DeepSORT predicts the motion state of the object by using a linear observation model and constant velocity model of standard KF. The predicted result is as follows:  
\[x=[u,v,\gamma,h,\dot{u},\dot{v},\dot{\gamma},\dot{h}]^{T} \tag{9}\]  
This attempts to estimate the length-to-width ratio of the frame rather than the width, which results in an inaccurate estimate of the width. Furthermore, the prediction box does not always fully include the vehicle in the real prediction process, as shown in Figure 9.  
Through the experimental results, this paper finds that the correctly predicted width can better match the vehicle and greatly improve the IOU in tracking matching. Therefore, this paper uses the width \(w\) to replace the length-to-width ratio \(\gamma\) in KF to obtain the overall prediction, and the prediction result are obtained as follows:  
\[x^{w}=[u,v,w,h,\dot{u},\dot{v},\dot{w},\dot{h}]^{T} \tag{10}\]After obtaining the result of \(x^{w}\), it is used as the prediction result of the tracker for the object trajectory, including coordinate information and speed information. In this work, a combination of minimum cosine distance and Mahalanobis distance is used to represent the correlation between the motion information contained in the Kalman prediction results and the detection results of moving objects. When the uncertainty of the target motion is low, Mahalanobis distance is used to correlate the motion information, as shown in Equation (11):  
\[d^{wM}(m,n)=(d_{n}-r_{m})^{T}\mathbf{C}_{m}{}^{-1}(d_{n}-r_{m}) \tag{11}\]  
where \(d_{n}\) is the \(n\) parameter of the first object detection box, matrix \(\mathbf{C}_{m}\) is the covariance between the average tracking position and the detection position, and \(r_{m}\) is the parameter of the object prediction box of the first tracker. \(k^{wM}\) is set as the specified threshold if the association of motion state is successful; otherwise, it is not successful, as shown in Formula (12):  
\[\left\{ \begin{aligned} d^{wM}(m,n)\leq k^{wM},success,\\ others,unsuccess.\end{aligned} \right. \tag{12}\]  
When the action camera is used, in order to reduce the probability of an ID switch, this work uses the minimum cosine distance to correlate the motion information, as shown in Equation (13):  
\[d^{wY}(m,n)=\min\left\{1-\mathbf{y}_{n}{}^{T}\mathbf{y}_{i}^{(m)}\Big{|} \mathbf{y}_{i}^{(m)}\in S_{m}\right\} \tag{13}\]  
where \(\mathbf{y}_{n}\) is the appearance description vector, \(\mathbf{y}_{i}\) is the corresponding vector of object detection after successful tracking, and \(S_{m}\) represents the set of all successful detection vectors. \(k^{wY}\) is set as the specified threshold. If \(d^{wY}(m,n)\leq k^{wY}\), the association succeeds; otherwise, it fails, as shown in Formula (14):  
\[\left\{ \begin{aligned} d^{wY}(m,n)\leq k^{wY},success,\\ others,unsuccess.\end{aligned} \right. \tag{14}\]  
As the uncertainty of the object motion increases, in order to capture the directionality and similarity of the data without considering the absolute size of the vector to improve the correlation effect, this work takes the fusion of the two metric distances as the final metric. The correlation result is shown in Formula (15):  
\[\left\{ \begin{aligned} R_{m,n}\in\left(k^{wM}\cap k^{wY} \right),success,\\ others,unsuccess.\end{aligned} \right. \tag{15}\]  
Figure 9: Vehicle prediction box. The weight is set as \(z\in[0,1]\); the joint distance is shown in Equation (16).