Perspective Plane Program Induction From a Single Image

Yikai Li, Jiayuan Mao, Xiuming Zhang, William T. Freeman, Joshua B. Tenenbaum, Jiajun Wu

Abstract We present Perspective Plane Program Induction (P3I), a neuro-symbolic framework designed to infer the geometric structure of images containing repeating patterns under perspective distortion. By jointly optimizing for camera pose and symbolic program representation, P3I reconstructs 3D-aware representations from single 2D images. Our approach significantly outperforms existing geometric and deep learning baselines in camera pose estimation and pattern detection, enabling advanced downstream applications such as perspective-aware inpainting.

Introduction

Humans possess an innate ability to perceive the 3D structure and regular patterns of a scene, even when viewed from extreme angles. For instance, a person can easily understand the grid layout of a tiled floor in a distorted photograph. However, this "inverse graphics" task remains a significant challenge for computer vision. Traditional geometric methods rely heavily on explicit cues like straight lines or vanishing points, which are often absent in organic or complex scenes. Conversely, deep learning approaches frequently struggle with generalization and require vast amounts of annotated data.

The fundamental difficulty lies in the interdependent nature of the problem: identifying a regular pattern requires correcting for perspective distortion, while accurate perspective correction often depends on understanding the underlying pattern.

Methods: Neuro-Symbolic Program Induction

P3I addresses this "chicken and egg" problem through a neuro-symbolic approach that induces a program written in a Domain-Specific Language (DSL). The pipeline consists of four primary stages:

  1. Feature Extraction: A pre-trained AlexNet generates a robust feature map, ensuring the system is resilient to lighting variations.
  2. Inverse Perspective Mapping: The system applies candidate camera poses to "unwarp" the feature map into a fronto-parallel view.
  3. Program Induction: The framework searches for a symbolic program (e.g., a 2D lattice or circular arrangement) that best characterizes the unwarped features.
  4. Joint Inference and Optimization: The core innovation is a shift-and-compare loss. If the camera pose is accurate, shifting the unwarped image by the pattern's period results in high feature similarity. The system employs a hybrid optimization strategy, using grid search for coarse parameters and gradient descent for fine-tuning.
Figure 1: The P3I framework jointly infers camera pose and repeating patterns to generate a symbolic Perspective Plane Program, outperforming non-perspective-aware and purely learning-based methods.

Key Insights

The success of P3I stems from the synergy between pose estimation and regularity detection. By treating regularity as a primary cue for pose, the model can operate in environments where traditional vanishing points are missing. Furthermore, by representing the scene as a symbolic program (e.g., for i in range(4): draw(...)), the model achieves a holistic understanding of the scene's structure, which is far more versatile for image editing than simple pixel-level coordinates.

Results and Evaluation

The authors introduced the Nearly-Regular Patterns with Perspective (NRPP) dataset, comprising 64 high-quality images with significant perspective distortion, to evaluate the model.

  • Camera Pose Estimation: P3I achieved a mean error of 4.54 degrees, a substantial improvement over PlaneNet (23.75°) and AutoRectify (30.54°).
  • Pattern Detection: The model significantly outperformed the state-of-the-art Regularity Structure Detection (RPD) algorithm, which typically fails under perspective distortion.
  • Downstream Applications: The framework enables "Perspective-Aware Inpainting." By understanding the 3D grid, P3I can fill missing image regions with objects of the correct size and orientation, surpassing the capabilities of standard tools like Photoshop’s Content-Aware Fill.

Conclusion and Future Work

P3I demonstrates the power of combining neural feature extraction with symbolic program induction for 3D scene understanding. While currently limited to single-plane assumptions and simplified camera models, future work aims to extend the DSL to encompass multi-plane scenes and complex 3D structures, potentially integrating with advanced neural rendering techniques.

Summary updated

BibTeX
@inproceedings{li2020perspective,
  author = {Yikai Li and Jiayuan Mao and Xiuming Zhang and William T. Freeman and Joshua B. Tenenbaum and Jiajun Wu},
  title = {{Perspective Plane Program Induction From a Single Image}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2020},
  doi = {10.1109/cvpr42600.2020.00449},
}
Figure