## 4 Experimental Results and Analysis
The curve change corresponds to the change of fitted area. When the area is over the threshold area it will stop alarm, until the pedestrian out of the camera field of views which can reduce misjudgment. We can clearly see that the rectangle loitering detection algorithm was accurate and stable throughout the fitting process. Figure 14 shows the detected result of ellipse loitering in different scenarios and the activity area fitting curve. Once it exceeds the time, it immediately alarms. From the results, the entire fitting process is continuous without interruption, so it has good robustness and real-time performance. \begin{table}
\begin{tabular}{c c} \hline \hline
**Dataset** & **Accuracy** \\ \hline PETS2007 & 97.3\% \\ Our collected & 99\% \\ \hline \hline \end{tabular}
\end{table} 
Table 1: The accuracy of target detection and tracking. Figure 12: Active area threshold area setting. Figure 14: The result of ellipse loitering. (**a-c**) The activity area fitting process from scenarios 1 to 2. (**d**) The area fitting curve results of ellipse loitering, the red line in the figure indicates the threshold of the area. Figure 13: The result of rectangle loitering. (**a**) The rectangle loitering detection results of scenario 1. (**b**) The rectangle loitering detection results of scenario 2. (**c**) The rectangle loitering detection results of scenario 3. (**d**) The area fitting curve results of rectangle loitering, the red line in the figure indicates the threshold of the area. Figure 15 shows the experimental results of the sector loitering detected in three different scenarios and activity area fitting. From these experimental results, it can be seen that the sector loitering detected can perfectly fitted the suspect's activity area for both indoor and outdoor. The whole process of sector fitting was very smooth and stable. In order to directly demonstrate the superiority of the algorithm presented in this paper, Table 2 shows the real experimental record and result analysis of this paper. Our collected dataset was accurately classified according to different scenarios. Each scenario has loitering and normal walking. Here, TP (True Positive) means the true loitering can be detected. TN (True Negative) means normal walking can be detected. FP (False Positive) is the normal behavior detected as abnormal. FN (False Negative) is loitering detected as normal. In the Table 2, P stands for precision (\(P=\frac{TP}{TP+FP}\)), R stands for recall rate (\(R=\frac{TP}{TP+FN}\)), and A stands for accuracy (\(A=\frac{TP+TN}{TP+TN+FP+FN}\)). \begin{table}
\begin{tabular}{c c c} \hline \hline
**Categories** & **Samples** &
\begin{tabular}{c} **Successful** \\ **Detection** \\ \end{tabular} \\ \hline
**Rectangle** & 30 & 29 \\
**Sector** & 30 & 28 \\
**Ellipse** & 30 & 30 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: The experimental results in our proposed method. Figure 15: The results of sector loitering. (**a**–**c**) The sector loitering detection results of video sequence under different scenarios from scenarios 1 to 3. (**d**) The area fitting curve results of sector loitering, the red line in the figure indicates the threshold of the area. Figure 16 shows the advantages and differences of the three algorithms. From the results, an unsuitable algorithm does not only consumes time but also fails to detect loitering correctly. Therefore, the detection of loitering should be achieved based on scene and motivation to choose the correct algorithm. Table 3 shows the results of the three algorithms applied to our collected dataset. Figure 17 shows the detected results of the PETS2007 dataset (S00, S01, S03, S05, and S08) based on our method. The experimental results show that our proposed algorithms can also be used to detect suspects in crowded scenarios. Our method was compared with the method of Nam 2015 [54]. Our method can detect loitering in videos from multiple angles, while Nam 2015 only detected loitering in a video from one angle where the number of pedestrians is small.