Compositing node
Optical Flow
How far each part of the picture moved since the last frame, as a vector per pixel (red and green carry x and y, blue is speed). Pyramidal Lucas-Kanade on the GPU. View Colour shows direction as hue and speed as brightness.

What it does
Optical Flow is a compositing node: it layers, masks and routes pictures. It takes picture in and gives picture out.
Try it
Displace a second picture along the motion of a video.
Inputs and outputs
Inputs
- picture image
Outputs
- picture out
Controls
Every control with a range can be driven by a modulator, a note, an audio level or a sketch.
| Control | Range or options | Default |
|---|---|---|
| resolution | Full, Half, Quarter | 2 |
| levels | 1 to 6 | 3 |
| window | 1 to 6 | 4 |
| iterations | 1 to 6 | 2 |
| gain | 0 to 8 | 1 |
| view | Vectors, Colour | 0 |
Example patch
This patch wires Optical Flow to what it needs and shows the result. Download it, then use File, Open in Infinite, or read it here: it is plain text.
infinite-patch 1
rev 2
# Optical Flow: a starting patch for the Optical Flow node
node 1 Compositing Optical Flow
id node
pos 520 300
end
node 2 Source Ramp
id in0
pos 0 300
end
node 3 Utility Output
id out
pos 1080 300
end
cable node 0 in0
cable out 0 node