## 5 Implementation
### Recognition and Tracking Module
#### 5.3.4. Tracking
These results are representative of the behavior of the proposed system for other metrics and indicators. Histograms in Figure 4 indicate that the tree configurations have accurate values (differences near to zero). M-Count computed the best results (more than 500 frames with zero differences), M-MOTA is the second best and M-MOTA-TC computed the worst results. Values for counting using the number of blobs are accurate, but lower than using the number of tracking, for the three studied configurations. Table 5 reports the results of the metrics included in MOTChallenge for the three best configurations. _Recall_ corresponds to the percentage of persons detected (higher is better), _precision_ is the percentage of persons correctly detected (higher is better), _FAF_ measure the false alarms per frame (lower is better), _MT_, _PT_ and _ML_ are the number of ground truth trajectories that are tracked for at least 80 percent, between 20 and 80 percent, and less than 20 percent of its existence, respectively; _FP_ and _FN_ are false positives and negatives, respectively; _IDs_ counts the changes of identity; _FRA_ (for fragmentations) counts the interrupted or restarted trackings (lower is better); _MOTA_ was previously introduced; and _MOTP_ is the difference between the positions of the ground truth and correctly predicted positions (lower is better). The scalability of the Recognition and Tracking module was validated regarding the number of sources (videos) that it can handle and process simultaneously. The proposed architecture (described in Figure 1) is robust and scalable, being able to work concurrently with many sources thanks to its parallel/distributed design that considers many instances of the Recognition and Tracking module. Figure 4: Histogram of counting differences for people, for each best configuration. (**a**) Higher Multiple Object Tracking Accuracy (M-MOTA). (**b**) Lower average difference in the person counting (M-Count). (**c**) The one with lower average processing time per frame (M-MOTA-TC). \begin{table}
\begin{tabular}{c r r r r} \hline \hline  & & \multicolumn{3}{c}{**Best Three Configurations**} \\ \cline{3-5}  & & **M-MOTA** & **M-Count** & **M-MOTA-TC** \\ \hline \multirow{5}{*}{**MOTP**} & Recall & 78.6 & 78.9 & 75.3 \\  & Precision & 76.3 & 74.5 & 76.5 \\  & FAF & 1.31 & 1.44 & 1.24 \\ \cline{2-5}  & MT & 10 & 10 & 8 \\  & PT & 9 & 9 & 11 \\  & ML & 0 & 0 & 0 \\ \cline{2-5}  & FP & 1040 & 1148 & 986 \\  & FN & 910 & 898 & 1053 \\  & IDs & 63 & 55 & 58 \\  & FRA & 253 & 235 & 234 \\ \cline{2-5}  & MOTA & 52.7 & 50.7 & 50.8 \\  & MOTP & 64.2 & 64.1 & 64.3 \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Results of the Multiple Object Tracking (MOT) Challenge for the experiments of the three best configurations. Regarding the number of tracked objects (persons) in a single video, experiments were performed over sparse and medium-density scenes. However, the Recognition and Tracking module applies a parallel approach for blob classification, controlled by a specific parameter (PERSON_DETECTION_PARALLEL_MODE). Using this feature, the module is able to process many objects in the same scene and reducing the overall execution time in up to 20%. ### Pattern Detection Module

The validation of the Pattern Detection module was performed over a recorded video that is representative of the current reality for recognition, tracking, and detection in nowadays surveillance systems in smart cities, such as Montevideo. The recorded video has a duration of 2:51 min, a resolution of 800 \(\times\) 600 pixels and was recorded in natural light. In the video, nine people walk around and get in and out of the scene occasionally. Five events occur in the video, which can be detected by the four pre-loaded patterns in the proposed system: two agglomerations, two street robberies and one 90-degree turn. The Recognition and Tracking module was configured with the three best parameters values. No significant differences were found in the results between the executions that vary the configuration of the first module.