Skip to content

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.

Frequently asked questions

Yes, over textured ground and at low altitude. With a flow sensor and a rangefinder, the flight controller estimates horizontal velocity and holds position. Over featureless surfaces or in poor light the method becomes unreliable.

Optical flow measures angular motion of the image. The same motion can mean slow movement close to the ground or fast movement far from it. A height measurement resolves that ambiguity and turns flow into metres per second.

No. Optical flow measures how the image moves between frames, typically to get velocity. Visual odometry uses tracked features to estimate the camera's full motion in three dimensions. Optical flow is one of the building blocks that visual odometry can use.