Monitoring Social Distancing With Single Image Depth Estimation

Alessio Mingozzi, Andrea Conti, Filippo Aleotti, Matteo Poggi, Stefano Mattoccia

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:

  1. 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.
  2. Runtime Perception:
  3. Instance Segmentation: The system employs YolactEdge to identify and mask individuals within the frame.
  4. Depth Estimation: A pre-trained monocular depth model (such as MiDaS or DPT) generates a relative depth map of the scene.
  5. 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

Abstract

The recent pandemic emergency raised many challenges regarding the countermeasures aimed at containing the virus spread, and constraining the minimum distance between people resulted in one of the most effective strategies. Thus, the implementation of autonomous systems capable of monitoring the so-called social distance gained much interest. In this paper, we aim to address this task leveraging a single RGB frame without additional depth sensors. In contrast to existing single-image alternatives failing when ground localization is not available, we rely on single image depth estimation to perceive the 3D structure of the observed scene and estimate the distance between people. During the setup phase, a straightforward calibration procedure, leveraging a scale-aware SLAM algorithm available even on consumer smartphones, allows us to address the scale ambiguity affecting single image depth estimation. We validate our approach through indoor and outdoor images employing a calibrated LiDAR + RGB camera asset. Experimental results highlight that our proposal enables sufficiently reliable estimation of the inter-personal distance to monitor social distancing effectively. This fact confirms that despite its intrinsic ambiguity, if appropriately driven single image depth estimation can be a viable alternative to other depth perception techniques, more expensive and not always feasible in practical applications. Our evaluation also highlights that our framework can run reasonably fast and comparably to competitors, even on pure CPU systems. Moreover, its practical deployment on low-power systems is around the corner.
BibTeX
@article{mingozzi2022monitoring,
  author = {Alessio Mingozzi and Andrea Conti and Filippo Aleotti and Matteo Poggi and Stefano Mattoccia},
  title = {{Monitoring Social Distancing With Single Image Depth Estimation}},
  journal = {IEEE Transactions on Emerging Topics in Computational Intelligence},
  year = {2022},
  url = {https://openreview.net/forum?id=tc2ayEt3JY},
}
Figure