Chapter 3
Structured Light Systems
Structured light systems achieve exceptional depth accuracy by projecting known patterns onto a scene and analyzing
how these patterns deform on surfaces. This technology powers Apple's Face ID and enables sub-millimeter precision
depth mapping for applications demanding the highest accuracy.
Fundamental Principles
Structured light 3D sensing operates on the principle of triangulation. A projector emits a known pattern of light
onto the scene, and a camera positioned at a fixed baseline distance from the projector captures the deformed
pattern. By comparing the captured pattern to the original projected pattern, the system can calculate the 3D
coordinates of each point through geometric triangulation.
The key insight is that points at different depths will cause the projected pattern to shift by different amounts
when viewed from the camera's perspective. Points closer to the sensor cause larger shifts (disparity), while
distant points cause smaller shifts. This relationship between disparity and depth follows a well-defined geometric
relationship that allows precise depth calculation.
Depth = (Baseline × Focal_Length) / Disparity
The accuracy of structured light systems depends critically on several factors: the precision of the projected
pattern, the resolution of the camera sensor, the accuracy of the calibration between projector and camera, and
the signal-to-noise ratio of the captured image. Industrial high-precision structured light scanners can achieve
depth accuracy better than 0.1mm at close range (under 1 meter).
Pattern Projection Techniques
Random Dot Patterns
Apple's Face ID TrueDepth system projects a pseudo-random pattern of over 30,000 infrared dots onto the user's
face. The randomness ensures that each small region of the pattern is unique, allowing unambiguous matching
between the projected and captured patterns. The dots are generated by a diffractive optical element (DOE) that
splits a single infrared laser beam into the dot array.
Random dot patterns provide several advantages: they work on surfaces of any texture or color, provide dense
depth sampling across the entire field of view, and are resistant to pattern aliasing issues that can affect
regular grid patterns. The main challenge is the computational complexity of matching 30,000+ dots in real-time,
which requires specialized hardware acceleration.
Coded Light Patterns
Some structured light systems use specially designed coded patterns where each local region of the pattern
contains a unique code that can be identified even in partial views. Gray code patterns, for example, use binary
encoded stripes where each position is uniquely identified by the sequence of light and dark stripes. Multiple
pattern projections with different spatial frequencies allow depth calculation with high accuracy and reduced
ambiguity.
The advantage of coded patterns is robust pattern identification even with occlusions or partial views. The
disadvantage is that multiple pattern projections may be required, which limits the achievable frame rate and
creates issues with moving scenes.
Single-Shot vs Multi-Shot
Single-shot techniques project one pattern and capture one image, enabling high frame rates suitable for
real-time applications like face tracking and gesture recognition. Multi-shot techniques project a sequence
of patterns, achieving higher accuracy at the cost of lower frame rates. The choice depends on whether the
application prioritizes speed or precision.
Apple Face ID TrueDepth System
The TrueDepth camera system represents the most widely deployed structured light implementation, deployed
widely across the iPhone and iPad product lines since its introduction in the iPhone X in 2017. Understanding its architecture
provides insight into practical structured light system design.
System Architecture
The TrueDepth system consists of several key components integrated into a compact module:
- Infrared Laser (VCSEL): A 940nm vertical cavity surface emitting laser that provides
the infrared illumination. The wavelength is chosen to be invisible to humans while providing good
sensitivity for silicon image sensors.
- Diffractive Optical Element (DOE): A nano-structured optical element that splits the
single laser beam into over 30,000 dots arranged in a pseudo-random pattern. The DOE is precisely
manufactured to create the exact pattern geometry needed for robust matching.
- Infrared Camera: A dedicated infrared camera sensor that captures the dot pattern
reflected from the user's face. The camera operates at 940nm with a dedicated infrared filter to block
visible light.
- Flood Illuminator: A separate infrared LED that provides uniform illumination for
traditional 2D face detection and low-light RGB image capture.
- Proximity Sensor: Detects when a user's face is nearby to activate the system.
- RGB Camera: Front-facing camera for traditional photos and video, positioned to align
with the IR camera field of view.
Depth Calculation Pipeline
When Face ID activates, the following sequence completes in a time too short for the user to notice:
- Pattern Projection: The VCSEL illuminates and the DOE projects the 30,000-dot pattern
onto the user's face.
- Image Capture: The infrared camera captures the deformed pattern, with exposure time
optimized for the infrared illumination intensity.
- Dot Detection: Specialized hardware (Apple states that the Neural Engine is used to
process Face ID data) detects the location of each dot in the captured image with sub-pixel precision.
- Pattern Matching: Each detected dot is matched to its corresponding dot in the reference
pattern, using local pattern geometry and global consistency constraints.
- Disparity Calculation: The shift between each dot's projected position and captured
position yields a disparity value.
- Depth Mapping: Using the calibrated baseline and focal length, disparities are converted
to depth values, creating a dense depth map.
- Face Processing: The depth map is processed to extract facial landmarks, create a
mathematical representation of face geometry, and compare against enrolled face data.
Security and Anti-Spoofing
According to figures published by Apple, Face ID has a false acceptance rate of approximately 1 in 1,000,000,
lower than the same company's fingerprint authentication (Touch ID, 1 in 50,000). Apple also notes that this
figure can differ for twins and for children under 13. The depth information is critical for anti-spoofing:
- 3D Liveness Detection: The system verifies that the face is three-dimensional, not a
flat photo or video. Even high-quality printed photos or displayed images fail because they lack depth
variation.
- Depth-Based Features: The authentication algorithm uses 3D facial geometry features
that are difficult to spoof, such as the precise shape of the nose, eye sockets, and facial contours.
- Attention Detection: The system verifies that the user's eyes are open and looking at
the device, requiring a living, attentive user.
- Secure Enclave Processing: All face data is processed within the device's Secure Enclave,
never leaving the device or being uploaded to cloud servers.
Calibration and Accuracy
Structured light systems require precise calibration to achieve high accuracy. Calibration determines the
geometric relationship between the projector and camera, including their positions, orientations, and optical
properties.
Calibration Procedure
Factory calibration typically involves these steps:
- Intrinsic Calibration: Determine the camera's focal length, principal point, and lens
distortion parameters by capturing images of a known calibration target (typically a checkerboard pattern)
at various positions and orientations.
- Projector Calibration: Characterize the projector's optical parameters, treating it
as an "inverse camera" that emits rather than captures light.
- Stereo Calibration: Determine the relative position and orientation (baseline) between
the camera and projector. This is the most critical parameter for depth accuracy.
- Nonlinearity Correction: Characterize and compensate for any nonlinearities in the
depth measurement, such as temperature dependencies or systematic errors at different ranges.
Sources of Error
Even with careful calibration, several factors can affect depth accuracy:
Common Error Sources
- Baseline Uncertainty: Manufacturing tolerances in the projector-camera spacing
directly affect depth accuracy. Because relative depth error equals relative baseline error
(δZ/Z = δb/b), a 10μm uncertainty in a 25mm baseline causes approximately 0.2mm depth error at
0.5m distance.
- Temperature Effects: Thermal expansion can change the baseline as the device
temperature varies. High-end systems use temperature sensors and compensation algorithms.
- Lens Distortion: Imperfect optics cause geometric distortion that must be corrected.
Residual distortion after correction contributes to depth errors.
- Pattern Deformation: Surface properties like albedo variations, specular reflections,
and subsurface scattering can affect pattern appearance and matching accuracy.
- Ambient Light: Background illumination adds noise to the captured pattern, reducing
signal-to-noise ratio and matching precision.
Performance Characteristics
| Parameter |
Typical Range |
Notes |
| Accuracy |
0.1-1mm @ 0.5m |
Depends on pattern density, baseline, and calibration quality |
| Operating Range |
0.2-2m |
Longer for room-scale products (e.g., Orbbec Astra) |
| Field of View |
60-120° |
Determined by DOE design |
| Depth Resolution |
640x480 to 1280x960 |
Dot density limits effective resolution |
| Frame Rate |
15-60 fps |
Lower for multi-shot methods |
| Latency |
30-100ms |
Depends on whether matching is hardware-accelerated |
This table summarizes representative ranges reflecting general trends; they are neither values set by the
standard nor published specifications of any particular product. Apple does not publish the depth accuracy,
resolution, or power consumption of the Face ID module. For reference, the WIA-SEMI-013 Phase 4 face
authentication application template specifies structured light or dToF, accuracy better than 1mm at
0.3-0.6m, at least 30 fps, and total latency under 100ms as its requirements.
Other Structured Light Systems
Intel RealSense SR300 (Discontinued)
Intel's RealSense SR300 series used coded light patterns with an IR laser projector and camera. Unlike passive
stereo systems, the projected pattern provided texture even on featureless surfaces, improving depth quality.
The system was used for close-range facial scanning and object recognition applications but was later
discontinued; the current RealSense lineup centers on the D400-series active stereo cameras covered in
Chapter 4.
Orbbec Astra
Orbbec's Astra series structured light sensors target robotics and industrial applications. The Astra Pro, for
example, combines RGB and depth cameras in a single unit, providing synchronized color and depth at VGA
resolution (640x480) and 30fps. The system works from 0.6-8 meters, a longer range than Face ID type systems,
making it suitable for room-scale environment sensing.
Microsoft Kinect
The original Xbox 360 Kinect (Kinect v1) used PrimeSense structured light technology (PrimeSense was acquired by
Apple in 2013). It projected a coded infrared pattern using a laser and DOE, achieving
depth sensing for full-body motion tracking. Despite being discontinued, it demonstrated the viability of
low-cost structured light for consumer applications.
Structured Light Pattern Types Comparison
| Pattern Type |
Characteristics |
Advantages |
Use Cases |
| Random Dots |
Pseudo-random array, 10k-30k points |
Dense coverage, texture independent |
Face ID, close-range scanning |
| Gray Code |
Binary encoded stripes, sequential |
High accuracy, unambiguous |
Industrial metrology, 3D scanning |
| Sinusoidal Patterns |
Phase-shifted sine waves, 3-4 patterns |
Sub-pixel accuracy, smooth surfaces |
Quality inspection, reverse engineering |
| Coded Patterns |
Spatial frequency modulation |
Single-shot capable, fast |
Real-time tracking, AR/VR |
Applications Beyond Face ID
3D Scanning and Modeling
Structured light provides the accuracy needed for high-quality 3D scanning of objects, faces, and bodies.
Applications include:
- Custom orthotic and prosthetic fabrication
- Dental impressions and crown fabrication
- Cultural heritage preservation (scanning artifacts, monuments)
- Reverse engineering and quality inspection
- Fashion and footwear (custom-fit clothing and shoes)
Augmented Reality
High-accuracy depth enables realistic AR occlusion, where virtual objects correctly appear behind real objects.
Face tracking for AR filters and effects (like Snapchat lenses) benefits from the detailed facial geometry
that structured light provides.
Gesture Recognition
The detailed hand geometry from structured light enables sophisticated gesture recognition, including individual
finger tracking. This enables touchless interfaces for medical devices, industrial controls, and accessibility
applications.
Design Considerations
When to Choose Structured Light:
- Applications requiring sub-millimeter depth accuracy
- Close-range operation (under 2 meters)
- Controlled lighting environments (indoor use)
- Detailed surface geometry capture (faces, hands, small objects)
- When accuracy is more important than range or sunlight operation
Limitations to Consider:
- Limited range compared to ToF (typically under 2m effective range)
- Ambient light sensitivity (sunlight can wash out projected pattern)
- Difficulty with transparent, highly reflective, or very dark surfaces
- Requires clear line of sight between projector, surface, and camera
- Occlusion issues when objects block the projected pattern
Future Directions
Structured light technology continues to evolve:
- Wavelength Diversity: Using multiple wavelengths (e.g., 850nm and 940nm) to improve
outdoor performance and reduce interference between multiple devices.
- Adaptive Patterns: Dynamically adjusting pattern density and shape based on scene content
to optimize accuracy and computation.
- Polarization Encoding: Adding polarization to the projected pattern to enable separation
from ambient light and specular reflections.
- Computational Methods: Using deep learning to improve pattern matching robustness and
handle challenging surface properties.
Summary
Key Takeaways:
- Triangulation: Depth = (Baseline × Focal_Length) / Disparity; closer points produce larger disparity.
- Pattern Design: Random dots suit single-shot, high-speed operation, while Gray code and sinusoidal phase shifting suit multi-shot, high-precision operation.
- TrueDepth Case Study: The system comprises a VCSEL, DOE, IR camera, and flood illuminator, and depth information is the key defense against flat-photo spoofing.
- Calibration Determines Accuracy: The projector must be calibrated as an inverse camera and the baseline determined precisely; relative depth error equals relative baseline error.
- Scope of Application: Strong for close-range, indoor, high-precision applications; weak in sunlight and at long range.
Review Questions
- In a structured light system with a 50mm baseline and a 600-pixel focal length, what depth corresponds to a disparity of 30 pixels?
- Explain how random dot patterns reduce ambiguity in correspondence matching.
- Compare single-shot and multi-shot methods, and state which you would use for tracking a moving face and for inspecting a stationary part.
- Distinguish the roles of the flood illuminator and the dot projector in the TrueDepth system.
- What does it mean to calibrate a projector as an "inverse camera"?
- Calculate the depth error at 1m caused by a 10μm baseline uncertainty with a 25mm baseline.
- Explain why structured light performance degrades in outdoor sunlight and how this can be mitigated.
- Among structured light, iToF, and active stereo, which is best suited for a dental scanner, and why?