## 5 Implementation
### Recognition and Tracking Module
#### 5.3.4. Tracking
Regarding the other metrics, the obtained average processing time per frame was similar for all three configurations, between 0.024 and 0.046 s, being the blobs classification the filter that requires the most processing time. The maximum processing times per frame are in the range of 0.058 and 0.103 s. The complete average and maximum processing times for each stage are reported in Tables 2 and 3, respectively. An important result for the proposed system is that the average processing time is lower than 0.05 s for all cases. This value indicates that the proposed system allows processing in real-time a 20 FPS data source, which is twice the number of frames required for detecting pedestrian movements [43]. Execution time is not strongly linked to the resolution of the processed images. Image resolution only affects the first stage (background subtraction) and the second stage (transformation of the binary image to a set of blobs) of the Recognition and Tracking module. The third and subsequent stages use only the blobs and not the entire image. The two first stages have very low processing times compared with the following stages (one order the magnitude lower, as reported in Tables 2 and 3, so the impact of changing the resolution is not high). Regarding the goal of person counting, the differences were always below four for two of the best configurations and below five for the other. From a total of 795 frames, no differences were registered in 533 frames for the best configuration. The system was robust, as the worst configuration also had no differences for 433 frames. The aforementioned values of the person counting metric are rather good, especially taking into account that multiple occlusions occur in the videos. Results in Tables 4 and 5 highlight the accuracy of the proposed system. Table 4 reports the comparison of the number of blobs and number of trackings between the proposed system and ground truth (GT) in MOTChallenge. The obtained results suggest that the proposed system provides an accurate and robust method for recognition and tracking. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline \multirow{2}{*}{**Best Three Configurations**} & \multicolumn{3}{c}{**\# Blobs vs. GT**} & \multicolumn{3}{c}{**\# Trackings vs. GT**} \\ \cline{2-6}  & **Mean** & **Min.** & **Max.** & **Mean** & **Min.** & **Max.** \\ \hline M-MOTA & 0.67 & 0 & 4 & 0.43 & 0 & 3 \\ \hline M-Conteo & 0.67 & 0 & 4 & 0.33 & 0 & 3 \\ \hline M-MOTA-TC & 1.14 & 0 & 5 & 0.52 & 0 & 4 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Results of the differences in people counting for the experiments of the three best configurations. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Configuration** & **Background Subtraction** & **Blobs Detection** & **Blobs Classification** & **Tracking** & **Total** \\ \hline M-MOTA & 0.00357 & 0.00051 & 0.03894 & 0.00294 & 0.04595 \\ \hline M-Count & 0.00355 & 0.00053 & 0.03902 & 0.00296 & 0.04606 \\ \hline M-MOTA-TC & 0.00356 & 0.00049 & 0.01712 & 0.00265 & 0.02381 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Average execution time (in seconds) of the evaluation using the three best configurations. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Configuration** & **Background Subtraction** & **Blobs Detection** & **Blobs Classification** & **Tracking** & **Total** \\ \hline M-MOTA & 0.00552 & 0.00094 & 0.09065 & 0.00657 & 0.10369 \\ \hline M-Count & 0.00559 & 0.00080 & 0.08779 & 0.00562 & 0.09980 \\ \hline M-MOTA-TC & 0.00578 & 0.00091 & 0.04628 & 0.00556 & 0.05853 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Maximum execution time (in seconds) of the evaluation using the three best configurations. Sample results for the counting difference for people for each best configuration are presented in the histograms in Figure 4, compared with the baseline GT. Values for counting using the number of blobs (# blobs vs. GT) and using the number of trackings (# tracking vs. GT) are reported.