Skip to content
AI360Xpert
Computer Vision
Visual explainer

Optical Flow

Estimating the apparent motion of objects across consecutive video frames.

Two consecutive frames capture motion.
Two consecutive frames capture motion.

When recording a video, consecutive frames capture the scene separated by a tiny fraction of a second. Objects that move in the physical world will shift their position slightly between frame t and frame t + 1.

Tracking the pixel shift yields a vector.
Tracking the pixel shift yields a vector.

Optical flow aims to measure this apparent motion. By finding where a pixel in the first frame has moved to in the second frame, we compute a motion vector (dx, dy).

The brightness of a pixel remains constant.
The brightness of a pixel remains constant.

The core assumption making this possible is brightness constancy: the assumption that an object's pixels keep the same intensity as they move from frame to frame.

Computing this for all pixels gives a flow field.
Computing this for all pixels gives a flow field.

When computed across the entire image, optical flow gives a dense vector field. This field reveals not only object movement, but also the camera's own motion (egomotion) through the 3D environment.