Perspective Fields for Single Image Camera Calibration

Linyi Jin, Jianming Zhang, Yannick Hold-Geoffroy, Oliver Wang, Kevin Blackburn-Matzen, Matthew Sticha, David F. Fouhey

Abstract

Traditional single-image camera calibration relies on global parameters that often fail when images are cropped or edited. We present Perspective Fields, a dense, per-pixel representation of image geometry. By predicting local "Up-vectors" and "Latitude" values for every pixel, our method achieves state-of-the-art calibration accuracy on "in-the-wild" images and introduces a metric for perspective consistency that finally aligns with human intuition.

Introduction: The Fragility of Global Calibration

Most camera calibration tools rely on the pinhole camera model with a centered principal point. However, this assumption is frequently violated in real-world scenarios. Cropping a photo for better composition or using specialized tilt-shift lenses shifts the principal point away from the center. Traditional models then face a mathematical contradiction: they can either correctly represent the horizon or the vertical lines of buildings, but not both simultaneously. This makes standard calibration brittle when applied to edited or warped images found on the web.

Comparison of traditional calibration vs. Perspective Fields. (B) and (C) show how standard models fail to align both the horizon and vertical 'Up' vectors simultaneously on cropped images, while (D) succeeds using the proposed representation.

Methodology: Moving from Global to Local

To address these limitations, we propose moving away from global numbers toward a dense, local representation called Perspective Fields.

The Representation

For every pixel in an image, our model predicts two key geometric properties:

  1. Up-vector: The 2D direction in the image corresponding to the 3D "up" direction (opposite of gravity).
  2. Latitude: The angle between the incoming light ray for that pixel and the horizontal ground plane.

Architecture

We utilize PerspectiveNet, a transformer-based semantic segmentation network (SegFormer), to predict these dense fields. This pixel-to-pixel approach is naturally translation-equivariant; if the camera moves, the local perspective properties shift predictably, making the model inherently robust to cropping. For applications requiring traditional parameters like Field of View (FoV) or Roll, a secondary network called ParamNet integrates these local fields into global camera values.

Learning from Objects

To handle images of isolated objects (like product photos with white backgrounds), we employed a teacher-student distillation method. A "teacher" network trained on full scenes teaches a "student" network to estimate perspective based solely on an object's shape and texture, allowing the model to generalize beyond architectural scenes.

Evaluation and Results

Our model was trained and evaluated on diverse datasets including 360Cities (panoramas), Stanford2D3D, and TartanAir to ensure broad generalization.

Robustness to Cropping

On cropped images, Perspective Fields reduced pitch estimation error by 40% compared to previous state-of-the-art methods like CTRL-C. Because the representation is local, cropping a portion of the image does not invalidate the predicted perspective for the remaining pixels, whereas a global principal point would shift entirely.

Human-Centric Metrics

We introduced the Average Perspective Field Discrepancy (APFD) to measure perspective consistency. Unlike standard geometric errors (like degrees of pitch), APFD correlates strongly with human perception. In user studies, APFD achieved a 0.87 Pearson correlation with human judgments of perspective "correctness," significantly higher than traditional metrics.

Conclusion

Perspective Fields offer a robust alternative to global camera calibration, particularly for edited or non-standard images. By shifting to a dense, local representation, we achieve higher accuracy and a metric that finally reflects human visual intuition. Future work will explore expanding this model to handle extreme lens distortions and integrating it into automated image editing tools for AR object placement.

Summary updated

BibTeX
@inproceedings{jin2022perspective,
  author = {Linyi Jin and Jianming Zhang and Yannick Hold-Geoffroy and Oliver Wang and Kevin Blackburn-Matzen and Matthew Sticha and David F. Fouhey},
  title = {{Perspective Fields for Single Image Camera Calibration}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2022},
}
Figure