A Practical Stereo Depth System for Smart Glasses

Jialiang Wang, Daniel Scharstein, Akash Bapat, Kevin Blackburn-Matzen, Matthew Yu, Jonathan Lehman, Suhib Alsisan, Yanghan Wang, Sam S. Tsai, Jan-Michael Frahm, Zijian He, Peter Vajda, Michael F. Cohen, Matt Uyttendaele

TL;DR

This paper introduces a production-ready, end-to-end stereo depth sensing system designed specifically for smart glasses and deployed on standard mobile CPUs. By combining a fast online rectification algorithm with an 8-bit quantized neural network and a graceful monocular fallback mechanism, the system delivers state-of-the-art depth accuracy in under a second—even when the glasses flex or heat up in real-world use.

What Problem Does This Paper Address?

Most deep-learning-based stereo depth models assume perfectly calibrated, pre-rectified input images and rely on heavy GPU compute. However, deploying stereo vision on consumer smart glasses introduces severe physical challenges:

  1. Mechanical Flexing: Glass frames bend and twist (often $>10^\circ$) depending on the user's head size.
  2. Thermal Drift: Internal component heat causes camera focal lengths to change dynamically over time.

These factors quickly destroy factory calibration, leading to vertical misalignment between the two cameras and breaking standard stereo matching algorithms. To make a practical system, the authors needed an approach that runs entirely on a mobile CPU (without relying on specific GPU accelerators), dynamically corrects calibration errors on the fly, and gracefully handles failures (e.g., if a camera lens is accidentally covered).

Methods

The authors developed a tightly integrated pipeline that splits work between the smart glasses (capture) and the user's smartphone (processing).

Figure 2. Overview of the depth system. The user captures a scene with smart glasses and saves the photo in their phone album. The HDR-bracketed right image is displayed in user’s photo album. On the phone, the user can choose to make 3D effects from photos they took. When the user chooses to do so, we utilize the “hidden” left image to estimate stereo depth. The left-right image pair first goes through several pre-processing steps and then an online stereo rectification process to align the epipolar scanlines. We then either use a stereo matching network or a monocular depth estimation network depending on the status of rectification to obtain a relative disparity map. The cropped disparity map and the image are then used to render novel views to generate 3D photographic effects.

Key technical components include:

  • Online Stereo Rectification: To correct calibration drift on a per-shot basis, the system extracts Harris corners and matches them using a hierarchical subpixel matcher. It solves a 4-parameter geometric model estimating relative rotation ($\Delta \omega$) and a relative scale/focal length correction ($\Delta f$).
  • Co-Designed Mono & Stereo Networks: The stereo network (Argos) and the fallback monocular network (Tiefenrausch) share the exact same encoder, middle layers, and decoder architecture. Argos simply appends a parameter-free cost volume layer to compute left-right feature similarities. If the online rectification step fails to find enough valid matches, the system seamlessly bypasses the cost volume and falls back to the monocular network.
  • Mobile Optimization: The networks utilize MobileNetV2-style inverted residual blocks and are quantized to 8-bit precision using Quantization-Aware Training (QAT). Crucially, the final output layer remains 32-bit to preserve sub-pixel resolution and prevent visual artifacts during 3D rendering.

Datasets

  • Synthetic Internal Stereo Dataset: To train the networks on diverse, photo-realistic data, the authors took an internal dataset of 4 million monocular images captured by iPhones. Using the embedded depth maps, they synthetically rendered a second stereo view matching the smart glasses' geometry, utilizing Layered Depth Image (LDI) inpainting to fill in occluded regions.
  • Academic Benchmarks: The system was evaluated using zero-shot transfer (no fine-tuning) on the Middlebury 2014 and ETH3D datasets to compare performance against heavy, state-of-the-art models.

Key Insights and Ideas

  • Focal Length Correction is Vital: Accounting for thermal expansion is critical. Adding the single relative scale parameter ($\Delta f$) to the online rectification model increased the calibration success rate from 77% to 85% on challenging real-world frames.
  • Architecture Sharing Enforces Consistency: Sharing weights and structures between the mono and stereo networks ensures that both models output structurally similar relative disparities (normalized from 0 to 1). This prevents jarring visual jumps if the system switches to the monocular fallback.
  • Augmentation Over Complexity: Instead of building complex, computationally heavy network layers to handle tricky optical phenomena like specular reflections, the authors simply augmented their training data with synthetic Gaussian specular highlights. This taught the network to ignore reflections and focus on the underlying surface depth.

Key Results

  • Desktop-Grade Accuracy on Mobile: Despite being quantized to 8-bit and optimized for mobile chips, Argos achieves zero-shot accuracy on par with massive, unquantized state-of-the-art models like RAFT-stereo and GA-Net.
Figure 1. (a) Overview. The user captures a stereo pair with smart glasses. The images are sent to the user’s phone for processing, including online rectification and fast disparity prediction via neural networks. The predicted disparity map is then used to generate visual effects by rendering novel views. (b) Zero-shot accuracy. Our stereo network, Argos, achieves high accuracy despite not being trained on these datasets, being quantized to 8 bits, and being significantly faster than SotA models such as RAFT-stereo [18], GA-Net [45] and LEA-Stereo [3].
  • Sub-Second Latency: When benchmarked on a six-year-old Samsung Galaxy S8 phone CPU, the online rectification takes 300–400ms, and the stereo network takes ~965ms, achieving the target of smooth, user-acceptable processing times.
  • High Reliability: In user testing, the online rectification succeeded on roughly 90% of images. The remaining 10% (mostly featureless indoor scenes) were successfully handled by the monocular fallback without crashing the user experience.

Limitations and Future Work

  • Benchmark vs. Real-World Trade-offs: Some design choices made for real-world robustness (like reflection augmentation) slightly degrade performance on pristine academic datasets like Middlebury, which lack complex real-world artifacts.
  • The Perceptual Metric Gap: The authors noted that standard stereo metrics (e.g., percentage of bad pixels) do not always correlate with human perception of 3D photo quality. For example, thin structures like fences result in low pixel-error counts but cause highly distracting, jarring artifacts in rendered 3D videos. Developing perceptually-driven loss functions remains an open area for future work.

Summary updated

BibTeX
@inproceedings{wang2022practical,
  author = {Jialiang Wang and Daniel Scharstein and Akash Bapat and Kevin Blackburn-Matzen and Matthew Yu and Jonathan Lehman and Suhib Alsisan and Yanghan Wang and Sam S. Tsai and Jan-Michael Frahm and Zijian He and Peter Vajda and Michael F. Cohen and Matt Uyttendaele},
  title = {{A Practical Stereo Depth System for Smart Glasses}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2022},
  url = {https://openreview.net/forum?id=1GVHQg45XZ},
}
Figure