
1.Center determination
As for the YOLO algorithm, it will output a box which is the boundary of a certain object along with the parameters(x,y,w,h). x=x coordinate of the lower left corner, y=y coordinate of the lower left corner, w=width of the box, h=height of the box
After getting the basic information about the box, the team can determine the center position c(x_c,y_c) which is necessary for distance calculation.
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
Fig1. Center determination and Distance Calculation
​
By using geometry knowledge, the team can get c(x+w*1/2, y+h*1/2). Just as it is shown in figure 1.
​
2.Distance Calculation
Horizontal Distance: in the real world, stores usually use the distance between two human feet as a measurement method. So the team should compute the horizontal distance to get a more accurate result. If the horizontal distance between two pedestrians is very big, they are likely to be away from each other.
Vertical Distance: the video can only record 2D movement. Horizontal distance may be meaningless if two pedestrians are in a line. Based on the principle of perspectives, the object closer to the camera appears bigger than the farther one. So the vertical distance between them indicates how far they are from each other.
​
​
​
​
​
​
​
​
​
​
​
​
Fig 2. Height difference in the camera picture
​
Surveillance video in fig 2 shows that even if the two pedestrians are about the same height, there is still a difference in the height in the picture. If the height gap(vertical distance) between them is high, they are very likely to be far from each other. To get vertical and horizontal distance, the team use coordinates in the frame shows in fig 2:
d_hor=|x2_c-x1_c|
d_ver=|y2_c-y1_c|
3. Risky Distance Definition:
In the video, due to the zooming problem, the distance between two people cannot be described by the actual size. To solve this problem, the team uses relative distance to measure the distance between two people. The starting point of the relative distance is the center point of each person's box. The relative distance is determined by the multiple of the larger of the two persons' width. And the team gives our definition of high risk, low risk and safe distance based on the experiment.
​
​
​
​
​
​
​
​
​
​
​
Fig 3. The relative distance
​
​
High risk: when the horizontal distance between two people is 1)less than twice the larger width of the two people, 2)the vertical distance is less than 0.2 times the larger height of the two
Low risk: when the horizontal distance between two people is 1)greater than 2 times and less than 4 times the larger width of the two people, 2) the vertical distance is greater than 0.2 times and lower than 0.4 times the greater height of the two.
The distance other than the above two cases is a safe distance.
To get the whole view of the video, the team counts on how many people are at different risk levels in every frame and their average risk level in every 10 seconds. There are 24 frames per second(FPS) in this video, so the team can get the average number of different risk levels in every 24*10 frame.

.png)

.png)