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.

Download the patchRead in the manual

The Optical Flow node in Infinite, showing its inputs, controls and outputs.

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.

VideoOptical FlowDisplace

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.

ControlRange or optionsDefault
resolutionFull, Half, Quarter2
levels1 to 63
window1 to 64
iterations1 to 62
gain0 to 81
viewVectors, Colour0

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

More compositing nodes