HomePerception & Optical IllusionsOptical Flow Visualizer

🧪 Optical Flow Visualizer

Interactive Lucas-Kanade optical flow: a synthetic video texture (dots, checkerboard or bars) drives real gradient-based motion estimation, with a Shi-Tomasi confidence test exposing the classic aperture problem in real time.

Perception & Optical Illusions2DModerate60 FPS
optical-flow ↗ Open standalone

This simulation runs real Lucas–Kanade optical flow, not an animated diagram of it. A synthetic video feed — dots, a checkerboard or vertical bars, panning, rotating, zooming or carrying a single moving object — is rendered to a hidden canvas every frame. From that raw pixel buffer the engine computes image gradients and solves the Lucas–Kanade structure-tensor equation at a grid of sample points to recover a local velocity vector, then runs the Shi–Tomasi eigenvalue test that real KLT trackers use to flag points where the aperture problem makes the estimate unreliable. Switch patterns and motion modes to see textbook cases side by side: solid features track cleanly, bare edges expose the aperture problem, rotation and zoom produce the swirling and radiating flow fields used for ego-motion and time-to-collision estimation, and the moving-object mode isolates motion from a static background — the same building block behind video stabilization, action recognition and autonomous-driving perception stacks.

⚙ Under the hood

This simulation visualizes optical flow, revealing the motion patterns within a video. It demonstrates how algorithms analyze consecutive frames to determine the direction and magnitude of movement.

Optical Flow

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)