# Clustering of Road Traffic Accidents as a Gestalt Problem
## 5 Discussion  
In addition to reporting the algorithm results, we discuss the introduced approach from the perspective of other relevant studies inspired by the Gestalt principles. The idea of applying human cognitive judgments reflecting the principles of visual Gestalt perception is not new. E.g., Ref. [29] introduces a clustering algorithm based on local \(k\)-dimensional neighbors of each point, allowing for an arbitrary number of clusters and arbitrary clusters shapes. However, their implicit conceptualization of proximity differs from the conceptualization adopted in our study. According to the conceptualization adopted in [29], the pattern of points given in Figure 6i contains three clusters: two large  
Figure 5: On the left: the maps showing road traffic accidents with injuries or death that occurred in the Municipality of Zvezdara during (**a**) 2021, (**c**) 2020, and (**e**) 2019. On the right: the corresponding map representations of the obtained clusters. The camera pole locations (March 2022) are represented for the purpose of completeness. (**a**) Traffic accidents, Zvezdara, 2021. (**b**) Selected clusters, Zvezdara, 2021. (**c**) Traffic accidents, Zvezdara, 2020. (**d**) Selected clusters, Zvezdara, 2020. (**e**) Traffic accidents, Zvezdara, 2019. (**f**) Selected clusters, Zvezdara, 2019. The maps were generated using the ArcMap component of the Esri’s ArcGIS suite ([[https://www.esri.com](https://www.esri.com)]([https://www.esri.com](https://www.esri.com))). clusters and one \"chain\" cluster between them. In our approach, the proximity of points (i.e., locations) is defined by means of transitive closure, so the same pattern contains only one cluster (cf. Figure 6 ii). More recently, two different approaches to saliency detection in digital images based on the Gestalt principles are proposed in [30; 31]. Particularly, related to the Gestalt principle of proximity, these approaches consider color distance between image regions and implicitly include the transitive closure. However, both approaches restrict the selected image regions only to neighbors of a currently salient image region. Even the image segmentation algorithm introduced in [18], on which we build in this contribution, includes a pairwise region comparison predicate. In our approach, this restriction is not present and we comment briefly on this. In [18], the difference between segments \(C_{i}\) and \(C_{j}\) is defined as the minimum weight edge connecting them, i.e.,  
\[Dif(C_{i},C_{j})= min \begin{array}{l}v_{i}\in C_{i},\\ v_{j}\in C_{j},\\ (v_{i},v_{j})\in E\end{array} w(v_{i},v_{j})\, \tag{17}\]  
where \(v_{i}\) and \(v_{j}\) are two neighboring pixels (i.e., \((v_{i},v_{j})\in E\)) belonging, respectively, to segments \(C_{i}\) and \(C_{j}\), and \(w(v_{i},v_{j})\) represents the color distance between \(v_{i}\) and \(v_{j}\). In our approach, we consider spatial distance between traffic accident locations, but define the distance between two clusters in the same manner. On the other hand, to detect evidence of a boundary between segments \(C_{i}\) and \(C_{j}\), the approach introduced in [18] assumes that their difference must be greater than their internal differences \(Int(C_{1})\) and \(Int(C_{2})\):  
\[Dif(C_{i},C_{j})>min\{Int(C_{i})+\tau(C_{i}),Int(C_{j})+\tau(C_{j})\}\, \tag{18}\]  
where threshold values are defined as inversely proportional to the size of a segment, i.e., \(\tau(C)\sim\frac{1}{|C|}\). We relax this condition in our approach: in order to detect evidence of a boundary between two clusters, their distance must be greater than a constant threshold value (cf. Equation (8) in Section 3.2). The justification for this decision is related to the domain of this study. In line with our aim to detect road segments of spatially prolonged traffic accident risk, we do not require stronger evidence for boundary of relatively smaller clusters (and, therefore, do not consider internal cluster differences).