## 3 Proposed System
### Our Method
#### 3.2.1 Monitoring Physical Distancing Constraints  
The criterion used for detecting the violation of physical distancing constraints by non-compliant groups in our method was to detect the physical distance of less than 1 m. All CCTV cameras continuously monitored the environment within their respective fields of view (FoV) to detect non-compliant groups. The main components of this functional module are as follows. Localization of Detected Persons  
All CCTV cameras were mounted in such a way that they provided angled views of the ground plane. In order to accurately calculate the distance between the persons, we preferred the top view of the ground plane, which represents the exact location of persons' feet on ground. For this purpose, we converted the angled view to the top view by applying the homography matrix to the four reference points on the angled view from CCTV. These reference points were manually selected during camera calibration so that they could cover the maximum area of the FoV of the CCTV camera, as shown in Figure 4.  
Figure 4: CCTV camera calibration: Yellow markers represent (**a**) pixel coordinates in angled view; (**b**) Cartesian coordinates in top view. The conversions of these points were performed by using Equation (1). \[\left[ \begin{array}{c}x_{topView}\\ y_{topView}\end{array} \right]=H*\left[ \begin{array}{c}x_{angledView}\\ y_{angledView}\end{array} \right] \tag{1}\]  
In Equation (1), \(x_{angledView}\) and \(y_{angledView}\) indicate the pixel coordinates of one of the four reference points in the angled image view from the CCTV; \(x_{topView}\) and \(y_{topView}\) represent the same point after conversion to top view; and '\(H\)' represents the scaled \(3\times 3\) homography translation-matrix. To transform the angled view to the top view of any detected person, as shown in Equation (2), we used the middle point of the bottom corners' points of the bounding box yielded by the detection and tracking pipeline (Section 'Person Detection and Tracking') against that detected person. This middle point represented the feet of the detected person. \[\left[x_{topView}^{P(k)},y_{topView}^{P(k)}\right]=H*\left[x_{angledView}^{P( k)}\,x_{angledView}^{P(k)}\right] \tag{2}\]  
where \(\left[x_{angledView}^{P(k)}\,y_{angledView}^{P(k)}\right]\) represents the pixel coordinates of the feet of the detected person \(P(k)\) with a unique ID '\(k\)' in the angled image view from the CCTV, and \(\left[x_{topView}^{P(k)}\,y_{topView}^{P(k)}\right]\) represents the same point after conversion into top view. Distance Estimation and Search for Non-Compliant Groups  
After transforming the pixel coordinates of the detected persons into top view, we estimated the distance between each person. Here, we treated each transformed position as a node. The distance between two nodes was calculated using the formula of Euclidean distance. The pair-wise Euclidean distances between multiple persons are shown in Table 2.  
Then, a truth table was created based on this correlation matrix of Euclidean distances. Any connection or Euclidean distance less than one meter between the two nodes was denoted as _True_ (Table 3). A modified depth-first search algorithm [50,51] was used to find all paths between the nodes in the environment, with no repeated nodes. In an environment with only one path, the algorithm can find this path in '\(O(V+E)\)' time, where '\(V\)' and '\(E\)' represent the number of vertices and edges in the graph, respectively. However, there is a possibility of a very large number of paths in a graph, for instance, '\(O(\textit{ln})\)' in a graph of order '\(n\)'. In order to deal with this problem, the search on each path was terminated when it reached the threshold of group size '\(x_{c}\)', where '\(c\)' represents the number of nodes, i.e., persons, in the group. In our case, we considered '\(x_{c}=10\)' as a threshold value to stop searching. For each returned path, the average position of all the nodes in a group was considered as the