Skip to content
AI360Xpert
Beta

Time-of-Flight Sensing

Light crosses a room in nanoseconds; timing it gives distance directly. Time-of-flight sensors strobe invisible light and clock its return, painting per-pixel depth.

A 20 nanosecond round trip means 3 meters out, and a quarter-cycle phase shift at 20 megahertz means 1.88 meters
A 20 nanosecond round trip means 3 meters out, and a quarter-cycle phase shift at 20 megahertz means 1.88 meters

Why Does This Exist?

Triangulation needs texture: stereo fails on blank walls, structured light washes out in sun, and both degrade with distance. Yet robots, phones, and cars need dense depth on exactly those blank, bright, far surfaces. Geometry from images alone cannot oblige.

Time-of-flight (ToF) stops inferring depth and measures it: strobe the scene with invisible near-infrared, clock each pixel's return, convert delay to distance. One chip, no baseline, full-frame depth at video rate. The ray-direction sibling is light field imaging; the triangulation sibling is stereo vision.

The one idea you need first. Direct ToF times pulses: d=c Δt/2d = c\,\Delta t / 2 (halved for the round trip). Indirect ToF strobes continuously at frequency ff and reads the returned phase shift φ\varphi: d=c φ/(4πf)d = c\,\varphi / (4\pi f). Direct reaches far with single-photon detectors; indirect is cheap silicon that wraps past its unambiguous range.

Think of It Like This

Shouting in a canyon

Stand at a canyon rim and shout: the echo returns after a delay that is distance made audible — half a second, about eighty-five meters of rock. Nobody triangulates the cliff face or studies its texture; the round trip is the measurement, and fog changes nothing about the arithmetic.

ToF shouts with light billions of times per second per pixel. Each pixel is an ear with a stopwatch; the scene's depth map is canyon walls rendered in echo delays. Multipath (echoes of echoes) confuses it exactly the way canyon echoes confuse shouters — the analogy's failure mode transfers too.

How It Actually Works

Direct systems (LiDAR, phone SPAD arrays) fire picosecond pulses and histogram photon arrivals per pixel; the peak bin is the range. Indirect systems modulate an LED or laser at megahertz rates and sample the return at four phase quadrants, computing φ\varphi from the samples — cheap CMOS, ambiguous past c/(2f)c/(2f) (about 7.57.5 m at 2020 MHz). Both calibrate for temperature drift, ambient suppression (sunlight is broadband competition), and per-pixel offsets. Fusion with RGB paints color onto measured depth.

Range, resolution, and sunlight form the iron triangle: extending one costs the others.

Worked example

Direct: round trip Δt=20\Delta t = 20 ns. d=3×108×20×10−9/2=6.0/2=3.0d = 3 \times 10^8 \times 20 \times 10^{-9} / 2 = 6.0 / 2 = 3.0 m. A 11 ns timing error moves the answer 0.150.15 m — picosecond electronics earn their keep.

Indirect: modulation f=20f = 20 MHz, measured phase φ=π/2\varphi = \pi/2 (quarter cycle). d=3×108×(π/2)/(4π×20×106)=4.712×108/2.513×108≈1.875d = 3 \times 10^8 \times (\pi/2) / (4\pi \times 20 \times 10^6) = 4.712 \times 10^8 / 2.513 \times 10^8 \approx 1.875 m. Same scene, no stopwatch — the phase fraction carries the distance.

Code

The point of this snippet is the conversion: nanoseconds and phase fractions become meters in two lines each.

import math
C = 3.0e8  # m/s, exact enough for cameras

def direct_tof(dt_s: float) -> float:    return C * dt_s / 2.0  # halved: light travels both ways

def indirect_tof(phase_rad: float, freq_hz: float) -> float:    return C * phase_rad / (4.0 * math.pi * freq_hz)

print(direct_tof(20e-9))  # -> 3.0print(round(indirect_tof(math.pi / 2, 20e6), 3))  # -> 1.875

Watch Out For

Multipath corners that invent distances

Light bouncing wall-to-wall arrives late, and the pixel averages all paths into one phantom range between the surfaces. Corners, mirrors, and translucent objects report distances no surface occupies — confident, dense, wrong.

Treat corner ranges as suspect: multi-frequency unwrapping and multipath-robust sampling reduce the ghosts, but geometry near concavities needs explicit handling. Validate depth at corners, not just open walls.

Sunlight that swamps the strobe

Outdoor ambient infrared dwarfs milliwatt strobes: the return drowns in solar shot noise and range collapses to noise past a few meters. Indoor specs quoted without sunlight mislead every outdoor deployment.

Derate for sun: demand outdoor range curves, add optical bandpass filtering, and prefer direct ToF with high peak power for daylight. A depth camera specced in a dark lab is a different instrument outdoors.

The Quick Version

  • ToF measures depth from light travel time: pulses timed directly, or phase shifts read indirectly.
  • The worked fixture gives 3.03.0 m for a 2020 ns round trip and 1.8751.875 m for a quarter-cycle at 2020 MHz.
  • No baseline, no texture needed: blank sunlit walls resolve where stereo surrenders.
  • Corners multipath into phantom ranges; treat concave geometry as suspect until handled.
  • Sunlight swamps weak strobes, so demand outdoor curves and derate lab specs.