CodingHomo: Bootstrapping Deep Homography With Video Coding

Yike Liu, Haipeng Li, Shuaicheng Liu, Bing Zeng

Abstract

Deep homography estimation is a fundamental task in computer vision, yet unsupervised methods often falter in challenging real-world conditions such as low light or dynamic scenes. We present CodingHomo, a novel framework that bootstraps homography estimation by leveraging the motion vectors (MVs) inherently available in compressed video bitstreams. By integrating these "free" geometric priors through specialized mask-guided fusion and refinement modules, CodingHomo achieves state-of-the-art performance and robust generalization across diverse environments.

Introduction

Estimating a homography—the 3x3 transformation matrix relating two perspective views of a planar surface—is critical for applications ranging from video stabilization to autonomous navigation. While deep learning has advanced this field, existing unsupervised approaches primarily rely on photometric loss. This dependency makes them vulnerable to lighting variations, sparse textures, and occlusions from dynamic foreground objects.

Traditional feature-based methods like SIFT similarly struggle under these adverse conditions. However, a significant portion of video data is stored in compressed formats (e.g., H.264/AVC) that already contain Motion Vectors (MVs). These MVs represent block-wise motion fields computed during encoding to minimize temporal redundancy. CodingHomo identifies these MVs as a valuable, pre-computed geometric prior that remains stable regardless of image quality or lighting.

Methodology

The CodingHomo framework integrates video coding metadata directly into a deep learning pipeline to enhance homography estimation.

MV Extraction and Processing

During the standard video decoding process, MVs and residual data are extracted from the bitstream. These block-based MVs are converted into a dense flow-like representation, providing an initial, albeit noisy, estimate of the geometric relationship between frames.

Mask-Guided Fusion (MGF)

A primary challenge in using MVs is that video encoders prioritize Rate-Distortion (RD) cost over physical motion accuracy. To address this, the Mask-Guided Fusion (MGF) module generates a "motion rejection mask." This mask identifies and filters out MVs that do not correspond to the dominant background plane, such as those chosen purely for bit-rate efficiency or those representing independent object motion.

The overall pipeline of CodingHomo, illustrating the integration of image features and motion vectors through mask-guided modules.

Hierarchical Estimation and Refinement

The architecture employs a coarse-to-fine approach. The Mask-Guided Homography Estimation (MGHE) module refines the transformation matrix across multiple scales. By applying masks to feature maps, the network effectively ignores "noise" from dynamic foreground elements, focusing its learning on the stable background geometry.

Enhanced Motion Mask (EMM)

For unsupervised training, the framework utilizes an Enhanced Motion Mask (EMM). This combines a feature-based "coplanarity-aware mask" with the MV-derived "motion rejection mask." This dual-masking strategy guides the loss function to concentrate on the dominant plane, significantly improving the model's ability to handle outliers.

Experimental Evaluation

The authors evaluated CodingHomo on two major benchmarks: CA-unsup, a large-scale dataset with 442k pairs covering low-light and low-texture scenes, and GHOF, which features extreme weather conditions like fog and snow.

Key Results

CodingHomo consistently outperformed existing state-of-the-art (SOTA) unsupervised methods, including HomoGAN and RealSH.

  • Accuracy: On the CA-unsup test set, CodingHomo achieved a Point Matching Error (PME) of 0.31, a notable improvement over the previous SOTA of 0.34.
  • Robustness: In challenging "Low Texture" environments, the method demonstrated a 17.14% error reduction. In "Low Light" scenes, it improved performance by 4.55%.
  • Generalization: Testing on the unseen GHOF dataset revealed a nearly 30% improvement in average PME (from 1.72 to 1.21), underscoring the value of the MV prior in adapting to novel, harsh environments.
Comparison of error heatmaps between the baseline HomoGAN and the proposed CodingHomo. The lower intensity in the red boxes indicates superior alignment by CodingHomo in dynamic scenes.

Discussion and Insights

The success of CodingHomo stems from the synergy between raw image features and compressed-domain motion priors. While raw pixels are sensitive to environmental noise, MVs provide a structural "bootstrap" that anchors the network's initial estimates. The "aha moment" of the research was recognizing the "RD-cost trap"—that MVs are optimized for compression, not geometry—and developing the MGF module to intelligently bridge this gap.

Conclusion and Future Work

CodingHomo demonstrates that video coding metadata is a powerful, underutilized resource for deep homography. While the method is currently constrained by the search ranges of standard encoders (typically 16 pixels), it sets a new benchmark for unsupervised estimation. Future research will explore adapting this framework to more advanced standards like HEVC and VVC, and addressing large-baseline displacements where current MV search ranges are insufficient.

Summary updated

BibTeX
@article{liu2024codinghomo,
  author = {Yike Liu and Haipeng Li and Shuaicheng Liu and Bing Zeng},
  title = {{CodingHomo: Bootstrapping Deep Homography With Video Coding}},
  journal = {IEEE Trans. Circuits Syst. Video Technol.},
  year = {2024},
}
Figure