# A Multi-Loop Vehicle-Counting Method under Gray Mode and RGB Mode
## 5 Discussion
### Discussion of Influencing Factors and Countermeasures
Therefore, the ability of a traditional ROI completely matching the lane is a little inadequate to deal with this situation. Additionally, this is one of the reasons that multiple loops were set on the road. As shown in Figure 21a, this is a vehicle driving right on the middle of \(Lane^{2}\) and \(Lane^{3}\). If only four traditional primary loops were set, the counting for this vehicle may be problematic. To be specific, with stricter thresholds, \(PLoop^{2}\) and \(PLoop^{3}\) are not activated and this vehicle is missed. If looser thresholds are set, the \(PLoop^{2}\) and \(PLoop^{3}\) are activated at the same time and this vehicle is counted repeatedly. However, with the multiple loops and counting strategy designed in this study, this vehicle is only counted once on \(Lane^{3}\), regardless of the strict threshold or the loose threshold, as shown in Table 19.  
The influence of lane number could be also reflected in the experimental results. As shown in Table 15, Video III, with only two lanes, achieved the highest accuracy. However, for Video V and Video VI, they only contain three lanes but the experimental results are not as good as Video I and Video II, which contain four lanes. One of the reasons is that Video I and Video II were shot on the highway with a simpler environment, but the setting of multiple loops also helped to greatly improve the accuracy of the experimental results. Moreover, in terms of where the lane is on the road, errors are more likely to occur in the median lane and its adjacent lanes. For example, errors all occurred in the two median lanes (\(Lane^{2}\) and \(Lane^{3}\)) in Video I (Table 9), while errors all occurred in its median lane (\(Lane^{2}\)) in Video VI (Table 14). Of course, this also has to do with the general tendency of drivers to drive in the median lane, which further increases the chance of errors. While in Video II, Video IV, and Video V, errors not only occurred in the median lane but also occurred in its adjacent lane. This is especially evident in Video V. As shown in Table 13, two errors occurred in \(Lane^{2}\) and three errors occurred in \(Lane^{3}\). This is mainly due to the phenomenon of vehicles driving side by side on different lanes affecting the vehicle count. Figure 21: Example of a vehicle driving right in the middle of \(Lane^{2}\) and \(Lane^{3}\). (**a**) Example frame under RGB mode. (**b**) Detection result set with primary loops. (**c**) Detection result set with secondary loops. \begin{table}
\begin{tabular}{c c c c c c c c c} \hline \hline  & \(PLoop^{1}\) & \(PLoop^{2}\) & \(PLoop^{3}\) & \(PLoop^{4}\) & \(Lane^{2}\) & \(Lane^{3}\) \\ \hline \hline Stricter & 0 & 0 & 0 & 0 & 0 & \(\times\) & \(\times\) \\ Looser & 0 & 1 & 1 & 0 & \(\checkmark\) & \(\checkmark\) \\ \hline \hline \end{tabular}
\end{table} 
Table 19: Example of a vehicle driving right in the middle of \(Lane^{2}\) and \(Lane^{3}\). At the same time, vehicles not only tend to drive in \(Lane^{2}\) but also tend to drive in \(Lane^{3}\), which is also a factor. This could be seen in the number of vehicles. As shown in Table 13, the number of vehicles that should be counted (\(True\)) in \(Lane^{2}\) is 123, while the \(True\) number in \(Lane^{2}\) is 116, which is also a reflection of the propensity of the driving behavior for drivers. Therefore, compared with the lanes on both sides of the road, the counting strategies proposed in Section 3.2.4 set for the middle lane are also more complex. * _Weather_ Weather mainly affects vehicle detection. A video shot in sunny weather is brighter in color. Therefore, the detection algorithm in RGB mode proposed in this study has better ability to repair vehicle holes. In addition, compared with a sunny day, a cloudy day contains more undesirable factors, such as changes in the lighting environment caused by the influence of clouds. As shown in Table 15, the three videos taken on sunny days (Video I, Video III, and Video V) have better performance overall than those taken on cloudy days (Video II, Video IV, and Video VI).