Height reverse perspective transformation for crowd counting

Xiaomei Zhao, Honggang Li, Zhan Zhao, Shuo LiFrontiers in Imaging 2023

Abstract

Crowd counting plays a critical role in the intelligent video surveillance of public areas. A significant challenge to this task is the perspective effect on human heads, which causes serious scale variations. Height reverse perspective transformation (HRPT) alleviates this problem by narrowing the height gap among human heads. It employs depth maps to calculate the rescaling factors of image rows, and then it performs image transformation accordingly. HRPT enlarges small human heads in far areas to make them more noticeable and shrinks large human heads in closer areas to reduce redundant information. Then, convolutional neural networks can be used for crowd counting. Experimental results show that HRPT successfully narrows the height gap among human heads and achieves state-of-the-art performance on a large crowd-counting RGB-D dataset.

The Challenge of Perspective

Crowd counting is a cornerstone of modern surveillance and public safety, but it faces a persistent nemesis: the perspective effect. In a typical surveillance shot, a person standing near the camera might appear ten times larger than someone standing fifty meters away.

This massive scale variation forces neural networks to be incredibly flexible, often requiring complex multi-scale architectures to recognize heads of all sizes. Furthermore, distant heads are often so small that their features are lost during the network's downsampling process, while nearby heads occupy a disproportionate amount of "pixel real estate" without providing extra useful information for the count.

Methods: Height Reverse Perspective Transformation

The authors propose Height Reverse Perspective Transformation (HRPT). Instead of building a more complex "perspective-aware" neural network, they fix the image itself before it ever reaches the model.

  1. Rescaling Factor Calculation: Using depth maps (either from RGB-D cameras or predicted from RGB images), the system calculates a specific rescaling factor for every row of pixels. The goal is to make the height of every human head in the scene approximately equal.
  2. Image Transformation: The image is mathematically "stretched" at the top (the far field) and "shrunken" at the bottom (the near field). This narrows the height gap between people at different distances.
  3. Plug-and-Play Integration: Because HRPT is a preprocessing step, it can be paired with any standard crowd-counting model. The authors tested it with architectures including CSRNet, DM-Count, and the transformer-based CLTR.
Comparison of original perspective (A) and HRPT-transformed image (B). Note how head heights are normalized from a range of 21-128 pixels down to 41-46 pixels.

Key Insights and Ideas

  • Data-Centric Approach: Most researchers try to solve scale variation by making the model smarter. This paper argues for a data-centric approach: normalize the data so the model doesn't have to work as hard.
  • Reducing Redundancy: A surprising insight is that shrinking the foreground is just as important as enlarging the background. Large foreground heads contain redundant information that can distract a network. Shrinking them allows the network to focus its attention on the denser, harder-to-count areas in the distance.
  • Preserving Features: By stretching the far-field areas, the system prevents the features of small heads from being "washed out" during the convolutional layers of the neural network.

Results and Performance

The addition of HRPT led to consistent performance gains across all tested models:

  • State-of-the-Art Performance: The combination of GL + HRPT achieved the best results on the ShanghaiTechRGBD dataset, reaching a Mean Absolute Error (MAE) of 3.70, outperforming previous specialized RGB-D counting methods.
  • Baseline Boost: For the CSRNet model, adding HRPT dropped the MAE from 5.11 to 3.76—a massive improvement for a model without any internal architectural changes.
  • RGB-Only Success: On the ShanghaiTech PartB dataset (where depth was estimated), the method achieved an MAE of 6.8, matching or beating other state-of-the-art "AutoScale" methods.

Limitations and Future Work

The most significant bottleneck is currently computational speed. The HRPT process is operated on the CPU and takes about 268ms per image, which is too slow for real-time high-fps surveillance. The authors plan to port the transformation logic to the GPU to enable real-time processing.

Additionally, the current model assumes a relatively flat ground plane. Future work involves developing more advanced transformation models that can handle non-flat terrains and more complex camera angles. While they successfully normalized head height, a similar attempt to normalize head width actually hurt performance by introducing too much image distortion, suggesting that height is the critical dimension for perspective correction.

Summary updated

BibTeX
@inproceedings{zhao2023height,
  author = {Xiaomei Zhao and Honggang Li and Zhan Zhao and Shuo Li},
  title = {{Height reverse perspective transformation for crowd counting}},
  booktitle = {Frontiers in Imaging},
  year = {2023},
  doi = {10.3389/fimag.2023.1271885},
}
Figure