## 3 Methodology
### Multi- Pedestrian Tracking  
The tracking algorithm is a multi-target tracking method based on detection results. The tracking method can be divided into two parts. Firstly, a motion model is built for the detected target, and new tracklets are built for new targets. The second part is the data association algorithm, which matches the target detected in each frame with the existing tracklets by the cost function to achieve the purpose of detection. The overall flow of the tracking algorithm is shown in Figure 5.  
In the tracking algorithm, the linear motion model is chosen as the motion model of the tracklet. The model is based on Kalman filtering algorithm, and the target state is expressed as  
Figure 4: The deformation of the bounding box of a single target without (**left**) and with (**right**) shape adjusting. Figure 5: Overall flow of the tracking algorithm. Figure 3: Detection result with soft-NMS (left) and NMS (right). The bounding box for the person in yellow is not miss deleted as redundant detection with soft-NMS. \([u,v,s,r,u^{\prime},v^{\prime},s^{\prime}]^{T}\). Where \((u,v)\) is the coordinate of the center position of the bounding box, and \((s,r)\) are the scale and aspect ratio of the bounding box respectively. \((u^{\prime},v^{\prime})\) is the speed of the target in horizontal and vertical directions, \(s^{\prime}\) represents the changing rate of the scale of the target. Since the aspect ratio of the bounding box is adjusted before, it is assumed that the aspect ratio of the target does not change here. Data association algorithm uses Hungarian algorithm to match existing tracklets and detection results in current frame. The cost function is divided into three parts: IOU limit, scale changing limit and standardized distance. It is required that the IOU of the tracklet's state and the detection result is larger than a certain threshold, and the scale change is lower than a certain threshold, otherwise the tracklet and the detection result will not match each other. Scale changes are described by the following formula:  
\[D_{scale}=min(\frac{max(w_{1},w_{2})}{min(w_{1},w_{2})},\frac{max(h_{1},h_{2})} {min(h_{1},h_{2})})-1 \tag{2}\]  
where \(w_{1}\) and \(h_{1}\) are the width and height of the detection result respectively, \(w_{2}\) and \(h_{2}\) are the width and height of the tracklet state respectively. On the basis of these two limitations, the matching degree between a detection result and a tracklet is mainly described by standardized distance. The standardized distance standardizes the pixel distance between the detector and the tracklet by the minimum width and height of them, which can effectively reduce the difference caused by the depth of field between the pixel distance and the actual distance. The standardized distance is shown as follows:  
\[D_{sp}=\sqrt{(\frac{x_{1}-x_{2}}{min(w_{1},w_{2})})^{2}+(\frac{y_{1}-y_{2}}{ min(h_{1},h_{2})})^{2})} \tag{3}\]  
where \((x_{1},y_{1})\) is the coordinate of the detection result, \((x_{2},y_{2})\) is the coordinate of the tracklet state. For the successfully matched tracklets and detections, the status of the tracklets are updated by the positions of the detections. In this case, the state of the tracklet, including position, scale, velocity and scale change rate, is the optimal estimate obtained by Kalman filter. Unmatched detectors are candidates for new targets and candidate tracklets for them are established. If these candidate tracklets match detection results in consecutive multiple frames, they will be used as new tracklets for targets newly appear in these frames. Motion models established by detection results in the first frame of the image sequence are used as new tracklets immediately for the initialization of the sequence. The unmatched tracklet outputs the predicted results directly. In this case, the tracking state is completely determined by the prediction matrix, and the predicted tracklet moves in a straight line with a uniform speed decided by the state variables.