This article is a deep-dive technical study (originally published in Chinese on zhichai.net) on optical flow–based navigation for robots and autonomous vehicles. Below is a structured summary of its key content.
Key points
1. Foundations
- Optical flow rests on the brightness constancy assumption, yielding the constraint equation
I_x u + I_y v + I_t = 0; a single equation with two unknowns creates the classic aperture problem, requiring additional constraints. - Dense vs. sparse flow: dense methods (Horn-Schunck, Farnebäck, FlowNet, RAFT) provide full-pixel motion fields but run at only 5–15 FPS on embedded CPUs; sparse pyramid Lucas-Kanade (with Shi-Tomasi corners) reaches ~120 FPS@640×480 on ARM Cortex-A72, at the cost of blind spots in textureless regions.
- Practical systems use hierarchical hybrid architectures: sparse flow for low-latency ego-motion, dense flow on demand for fine scene understanding.
- Deep learning methods (FlowNet → PWC-Net → RAFT) greatly improve accuracy but suffer from domain generalization gaps (e.g., PWC-Net's KITTI EPE drops from 10.35 to 2.16 after fine-tuning). NeuFlow (2023) achieves ~30 FPS real-time on Jetson Orin Nano with 10–80× speedup over RAFT and <5M parameters.
- Ego-motion estimation: flow decomposes into a depth-independent rotation component and a depth-inversely-proportional translation component; separating them is the core challenge. Focus of Expansion (FOE) localization plus IMU gyro compensation (reducing velocity error by 40–60%) enables decimeter-level optical-flow/inertial navigation.
- Depth inference: flow divergence (∇·v = 2T_z/Z) is rotation-invariant and suits qualitative obstacle ranking; motion parallax yields relative depth; stereo-flow fusion (e.g., Edge-FS, ~0.00134 s/frame) recovers absolute depth with ~35% lower velocity MSE.
- Time-to-Collision (TTC): τ = 1/(flow divergence), a scale-invariant safety metric requiring no absolute distance or velocity; used in potential-field avoidance and inspired by insect vision.
- Software: pyramid LK pipelines with forward-backward checking, RANSAC, SIMD/fixed-point optimization; STM32F4 microcontrollers achieve 10–15 Hz@320×240.
- Hardware: dedicated flow sensors (PX4FLOW: 6400 fps internal, <5 ms latency, <100 mW), FPGA IP cores, and edge AI chips (Jetson, Movidius).
- Multi-modal fusion: flow+IMU (±0.1 m/s velocity, <10 cm hover position std), flow+visual SLAM (60–90% accuracy gains in high-dynamic scenes), up to flow+LiDAR+RTK layers, requiring time synchronization, extrinsic calibration, and fault isolation.
- Real-time obstacle avoidance: regional flow asymmetry (bio-inspired balance law: ΔF→0 keeps equidistance, effective in corridors), feature clustering (DBSCAN/K-means) for dynamic object detection, and multi-dimensional confidence scoring (temporal, spatial, geometric, multi-source).
- Tiered response state machine: normal (>3 s TTC), caution (1–3 s), active avoidance (0.5–1 s), emergency braking (≤0.5 s); end-to-end latency optimized from 42–130 ms to 16–55 ms (~0.5 m reaction distance at 10 m/s).
- Motion planning: TTC-based repulsive potential fields
U_obs ∝ (1/τ − 1/τ_max)², lane-keeping attractive fields, sliding-mode control for robust command tracking; known weaknesses include local-minima traps (symmetric/U-shaped configurations) and degradation above ~15°/s angular or ~8 m/s@10 m translational speed, capping pure-flow solutions at <80 km/h. - Strength: semantic independence—detects any moving/near threat without pretrained detectors; transfers across ground robots, cars, multirotors, fixed-wing UAVs, and underwater vehicles; enables map-free reactive navigation (planetary exploration, disaster response, GPS-denied).
- Failure modes: textureless surfaces (plain walls, water, polished floors), repetitive textures (grilles, stripes → correspondence ambiguity), transparent/reflective materials (glass facades, mirrors), lighting extremes (night, glare), and weather (fog following Koschmieder scattering; snow; rain). Mitigations rely on multi-sensor fusion and conservative degradation rather than vision alone.
- Three generations of throughput: classical (<10 FPS) → optimized embedded (30–60 FPS) → learned/hardware co-designed (10–100+ FPS).
- Dedicated flow sensors are ~20× more energy-efficient per frame than software solutions; domain-specific accelerators are the projected path to mass consumer deployment.
- TTC accuracy of ±0.2–0.5 s (1σ) suffices for indoor/low-speed use; highway-grade (<0.1 s) requires radar or other ranging sensors.