## 3 Methodology
### Data Association--Cost Matrix Matching  
In this work, eight cost matrix formulations (see Cost Matrix Matching in Figures 2 and 3) are proposed. As aforementioned, the data associations on the SORT, and also on the second stage of the Deep-SORT, are seen as a linear assignment problem represented by a cost matrix. Hence, the different approaches to formulate the cost matrices for the linear assignment problem with different bounding box metrics are presented. Intersection over union quantitatively represents the overlapping between objects' bounding boxes, which, indirectly, ends up representing other types of information such as Euclidean distances between two different bounding boxes and bounding boxes ratios. However, in MOT problems, such information can be useful to improve the data association since, between two consecutive frames, it is expected that an object has similar bounding box dimensions and a small displacement. Therefore, object tracking data association cost matrix formulations based on intersection over union, Euclidean distances, and bounding boxes ratio are proposed. Let us consider a bounding box represented by the image coordinates of its center (\(u_{BB}\),\(v_{BB}\)) and its height and width (\(h_{BB}\),\(v_{BB}\)), the detection set D (with N bounding boxes), and the prediction set P (with M bounding boxes). The following cost matrix formulations are proposed:  
1. Euclidean distance based cost matrix (\(D_{E}(D,P)\)): \[D_{E}(D,P)= \begin{bmatrix}d(D_{1},P_{1})&\ldots&d(D_{1},P_{M})\\ d(D_{2},P_{1})&\ldots&d(D_{2},P_{M})\\ \vdots&\ddots&\vdots\\ d(D_{N},P_{1})&\ldots&d(D_{N},P_{M})\end{bmatrix} \] (3) which represents the distance between bounding box central points normalized into half of the image dimension. To formulate the problem as a maximization problem, to be solved using the Hungarian algorithm, the distance is obtained by the difference between 1 and the normalized Euclidean distance, as follows: \[d(D_{i},P_{i})=1-\frac{\sqrt{(u_{D_{i}}-u_{P_{i}})^{2}+(v_{D_{i}}-v_{P_{i}})^ {2}}}{\frac{1}{2}\sqrt{h^{2}+w^{2}}}\] (4) where (\(h\),\(w\)) are the height and width of the input image, \(D_{i}\) is a bounding box from the detection set, and \(P_{i}\) is a bounding box from the prediction set. Figure 3: Overview of the object tracking Deep-SORT algorithm. Bounding box ratio based cost matrix (\(R(D,P)\))--implemented as a ratio between the product of each width and height:  
\[R(D,P)= \begin{bmatrix}r(D_{1},P_{1})&\ldots&r(D_{1},P_{M})\\ r(D_{2},P_{1})&\ldots&r(D_{2},P_{M})\\ \vdots&\ddots&\vdots\\ r(D_{N},P_{1})&\ldots&r(D_{N},P_{M})\end{bmatrix}  \tag{5}\]  
\[r(D_{i},P_{i})=min(\frac{w_{D_{i}}h_{D_{i}}}{w_{P_{i}}h_{P_{i}}},\frac{w_{P_{i} }h_{P_{i}}}{w_{D_{i}}h_{D_{i}}}) \tag{6}\]  
In addition, for boxes with similar shapes, this metric outcome with a value closer to 1 contrasts values close to 0 or much greater than 1 otherwise. For that reason, the minimum between the bounding box ratio and its inverse is applied, to get a value that is within the \([0,1]\) range. 3. SORT's IoU cost matrix combined with the Euclidean distance cost matrix: \[E_{D}^{IoU}(D,P)=IoU(D,P)\circ D_{E}(D,P)\] (7) where \(\circ\) represents the Hadamard product (element-wise product) between two matrices. 4. SORT's IoU cost matrix combined with the box ratio based cost matrix: \[R^{IoU}(D,P)=IoU(D,P)\circ R(D,P)\] (8)
5. Euclidean distance cost matrix combined with the box ratio based cost matrix: \[R^{D_{E}}(D,P)=D_{E}(D,P)\circ R(D,P)\] (9)
6. SORT's IoU cost matrix combined with the Euclidean distance cost matrix and the box ratio based cost matrix: \[M(D,P)=IoU(D,P)\circ D_{E}(D,P)\circ R(D,P)\] (10)
7. Element-wise average of every cost matrix (A(D, P)): \[A(D_{i},P_{i})=\frac{IoU(D_{i},D_{j})+D_{E}(D_{i},D_{j})+R(D_{i},D_{j})}{3}, \;i\in D,\;j\in P\] (11)
8.