How Time-of-Flight Depth Sensing Works in AR
By AR Compare Team ·
A time-of-flight sensor measures how far away things are by sending out invisible infrared light and working out how long it takes to bounce back. Every pixel on its chip gets its own distance, so a single shot gives a depth map of the whole scene. AR headsets use these sensors to track hands, map rooms and hide virtual objects behind real ones, because they give depth instantly, even when the device is still. Most do not time the light directly. They flash it in a steady wave and measure how far out of step the returning wave is.
This explainer is based on Texas Instruments’ introduction to time-of-flight cameras, Microsoft’s documentation for the Azure Kinect depth camera, and Microsoft’s HoloLens Research Mode page. For headsets built for this kind of work, see AR headsets for work.
The basic idea
Texas Instruments describes a time-of-flight camera in 3 parts:
- A light source, usually a small laser or LED, shining near-infrared light at about 850 nanometers, which your eyes cannot see.
- An image sensor tuned to the same light, which collects what bounces back.
- Electronics that turn the delay between sending and receiving into a distance for each pixel.
Light from the scene reaching the sensor has 2 parts: the reflection of the sensor’s own light, which carries the distance, and ambient light, which does not. More ambient light means a noisier measurement.
Why not just use a stopwatch?
Light is so fast that direct timing is very hard. Texas Instruments gives the number: to measure depth to 1 millimeter by timing a pulse, the electronics would need to resolve about 6.6 picoseconds, which it calls nearly impossible in silicon at room temperature.
So there are 2 common methods.
Pulsed. The light flashes once, briefly. Each pixel collects the returning light in 2 time windows, 1 in step with the flash and 1 just after. The farther away the surface, the more of the reflection lands in the late window. The ratio between the 2 gives the distance.
Continuous wave. The light is switched on and off in a steady rhythm. Each pixel samples the returning light 4 times per measurement, a quarter-cycle apart, and works out how far the returning rhythm has shifted. That shift, called the phase, converts directly to distance. Texas Instruments notes this method cancels out a lot of the error from ambient light and from how reflective a surface is. Microsoft’s Azure Kinect uses this approach, which it calls amplitude modulated continuous wave.
Range and the wrap-around problem
A phase shift repeats every full cycle. A surface 1 cycle farther away gives the same reading as a near one. Texas Instruments calls the distance where this happens the ambiguity distance, and it is the maximum range the sensor can measure at that frequency.
That creates a trade:
- Higher frequency gives better accuracy but a shorter range.
- Lower frequency gives longer range but less accuracy.
Texas Instruments says advanced sensors mix 2 or more frequencies. Each wraps at a different distance, and the true distance is where they agree, which extends range without giving up accuracy.
HoloLens 2 shows the trade in practice. Microsoft’s Research Mode page says its depth camera runs in 2 modes: a fast close-range mode at 45 frames per second used for hand tracking, which wraps beyond 1 meter, and a slow long-range mode at 1 to 5 frames per second used to map the room.
From distances to a 3D model
Because every pixel gets a distance, the output is a depth map. Texas Instruments gives an example: a 320 by 240 sensor gives a depth map of 320 by 240 points. Those points can be placed in 3D as a point cloud, joined into a surface mesh, and coloured with a regular camera image.
In AR this feeds:
- Hand tracking, since hands are close and move fast. See how hand tracking works.
- Room mapping, for placing content on walls and tables. See how plane detection works.
- Occlusion, hiding virtual objects behind real ones. Google’s ARCore merges time-of-flight data with camera-based depth where a device has a sensor. See how AR occlusion works.
Where time-of-flight struggles
Microsoft’s Azure Kinect documentation lists when it throws pixels away:
- Too much light back, which saturates the pixel and loses the phase.
- Too little light back, from dark or distant surfaces.
- Light from more than 1 surface, called multi-path interference. Microsoft says this is common in corners, where light bounces off one wall onto the other, and at the edges of objects, where a pixel sees both foreground and background.
- Fast motion, which adds more invalid pixels around edges.
Sunlight is the other challenge, because the sensor sees it as extra ambient light. Microsoft says the Azure Kinect’s global shutter, which captures every pixel at once, improves performance in sunlight.
Time-of-flight in glasses you can buy
Glasses that only show a screen do not need a depth sensor, because they never map the room. If you want hands-free control or apps that interact with your room, check whether the device lists a depth sensor, and compare 3DoF and 6DoF glasses.
For related terms, see the SLAM and hand tracking glossary entries.
More buying guides: AR glasses for developers and enterprise AR glasses.
Frequently asked questions
What is a time-of-flight sensor?
A camera that measures how far away things are by sending out invisible infrared light and timing how long it takes to bounce back. It produces a depth map, an image where each pixel holds a distance.
How can a sensor time something as fast as light?
Most do not time it directly. Texas Instruments explains that timing a pulse accurately enough for millimeter depth is nearly impossible in silicon, so many sensors pulse the light in a wave and measure how far the returning wave has shifted.
Why do AR headsets use time-of-flight sensors?
To sense depth quickly without needing the user to move. Microsoft's HoloLens 2 used its depth camera in a fast close-range mode for hand tracking and a slower long-range mode for mapping the room.
Does sunlight affect time-of-flight sensors?
It can. The sensor sees sunlight as well as its own infrared, and Texas Instruments notes strong ambient light lowers the signal-to-noise ratio. Microsoft says the Azure Kinect's global shutter helps in sunlight.
What are the weak spots of time-of-flight?
Corners and object edges, where light bounces off more than 1 surface, surfaces that send back too much or too little infrared, and a maximum range set by the modulation frequency.