What is optical flow? How drones use it to hold position
Published:
Optical flow is the apparent motion of the scene between consecutive camera images. By measuring how fast the ground appears to slide past, and knowing the height above it, a drone can estimate its horizontal velocity. That is why small optical flow sensors are a common way to hold position indoors or wherever GPS is unavailable.
What optical flow measures
When a camera moves over a textured surface, every point in the image shifts slightly from one frame to the next. Optical flow algorithms estimate that shift, either for a set of tracked points or for the whole image.
For a downward-facing camera, the shift is mainly caused by horizontal motion. Flow on its own is an angle per unit time, not a distance; converting it to metres per second requires the distance to the ground.
How drones use optical flow
A typical setup combines a small downward-facing flow sensor with a distance sensor:
- The flow sensor reports how the image moves between frames.
- A rangefinder, such as a small lidar or time-of-flight sensor, measures height above the ground.
- Gyroscope data from the IMU removes the part of the flow caused by the drone tilting rather than moving.
- The flight controller fuses the resulting velocity with the IMU to hold position or fly at a set speed.
Optical flow vs visual odometry
Optical flow and visual odometry both use camera motion, but at different levels. Optical flow sensors usually give a velocity from a single downward view and integrate it to estimate position, so they drift over time. Visual odometry tracks features in three dimensions to estimate full camera motion, and visual-inertial odometry (VIO) adds the IMU for scale and robustness.
In practice optical flow is often the simplest solution for low-altitude hover and indoor flight, while VO and VIO suit larger areas and longer flights.
Visual odometry (VO) vs VIO: what's the difference? →Limitations
Optical flow depends on what the camera can see:
- Plain, textureless surfaces such as smooth floors, water or snow give little to track.
- Low light reduces image quality and flow accuracy.
- The height measurement limits the useful altitude range; errors in height scale directly into velocity errors.
- Like any velocity-based method, integrating flow into position accumulates drift.