Monitoring social distancing became a global priority during the COVID-19 pandemic, yet implementing accurate automated systems using existing infrastructure remains a significant technical challenge. Most current computer vision tools for social distancing rely on homography-based localization, which requires a clear, unobstructed view of the ground plane to calculate distances. In environments where the floor is hidden by furniture, crowds, or architectural features, these systems often fail.
In this paper, researchers from the University of Bologna propose a novel framework that bypasses the need for ground-plane visibility. By combining deep-learning-based monocular depth estimation with a one-time smartphone calibration, the system transforms standard RGB surveillance cameras into metric-accurate 3D sensors.
The Scale Ambiguity Problem
Monocular depth estimation—predicting 3D structure from a single 2D image—is a powerful tool, but it inherently suffers from "scale ambiguity." While a deep learning model can determine that one person is twice as far away as another, it cannot inherently know if that distance represents 2 meters or 20 meters. To be useful for social distancing, these relative values must be converted into absolute metric units. Traditionally, this required expensive hardware like LiDAR or stereo cameras, which are rarely present in existing security setups.
Proposed Methodology
The authors' pipeline addresses the scale problem through a three-stage process:
- Metric Calibration: During installation, an operator uses a smartphone app (utilizing ARCore or similar SLAM-based frameworks) to capture a sparse 3D point cloud of the empty scene. Because smartphones utilize Inertial Measurement Units (IMUs) and visual-inertial odometry, these points possess real-world metric scale. These points are then mapped to the coordinate system of the fixed surveillance camera.
- Runtime Perception:
- Instance Segmentation: The system employs YolactEdge to identify and mask individuals within the frame.
- Depth Estimation: A pre-trained monocular depth model (such as MiDaS or DPT) generates a relative depth map of the scene.
- Depth Scaling and Distance Calculation: This is the core innovation. The system uses the metric points from the calibration phase to perform a linear regression against the relative values provided by the depth model. This process "scales" the entire depth map into actual meters. Finally, the system calculates the 3D distance between the centroids of detected individuals to identify distancing violations.
Experimental Results
To evaluate the system, the authors collected a custom dataset of 83 frames across indoor (classroom) and outdoor (driveway) settings. They used a Livox Mid-70 LiDAR sensor to provide high-accuracy ground-truth depth for validation.
- Accuracy: Using the DPT-Hybrid model, the system achieved an average error in interpersonal distance of only 23–33 cm.
- Risk Classification: The system proved highly effective at categorizing pairs as "Safe" (>2m), "Risky" (1-2m), or "Dangerous" (<1m), achieving F1 scores above 0.90 in outdoor environments.
- Computational Efficiency: On a modern GPU (Titan X), the system operates at approximately 9.4 FPS. It is also capable of running on low-power edge devices like the Nvidia Jetson Nano at 0.5 FPS, which is sufficient for non-critical monitoring.
Key Insights and Limitations
A primary advantage of this approach is its "floor-free" nature. By calculating distances between 3D centroids rather than points on the ground, the system remains robust in theaters, offices, or stadiums where furniture frequently occludes the floor. Furthermore, using a consumer smartphone as a bridge to solve the scale problem allows a standard $50 camera to approximate the performance of a much more expensive depth sensor.
However, the system does have limitations. It assumes a relatively static background; if the physical environment changes significantly (e.g., moving large furniture), the scaling accuracy may degrade. Additionally, the system's precision is ultimately capped by the quality of the underlying monocular depth model. Future work may involve incorporating temporal tracking, such as Kalman filters, to smooth distance estimates and better handle brief occlusions.
Summary updated