Optical Flow
Estimates motion by comparing the input video against its previous frame, and outputs it as a flow field (FlowField). Per block, it takes the temporal difference and spatial gradient of luminance (weighted 0.299/0.587/0.114), derives the displacement with normal flow -It·∇I / |∇I|² (a one-tap version of Lucas-Kanade), and multiplies by 1/deltaTime to convert it into “UV displacement per second”.
- Block Size — A dropdown of Small8 / Medium16 (default) / Large32. The larger the block, the larger the motion it picks up, and the coarser the result
- Scale — A multiplier applied to the estimation result. Clamped to 0-8, default 1 (
currentScale)
To suppress outliers, the displacement per frame is clamped to a maximum of 2 blocks. Motion that is too fast hits this ceiling.
For one frame right after connecting and right after loading a project, it only builds the reference for comparison and does not estimate (the output is cleared).
The output resolution is 1/8 of the input, and the format is RGHalf. Fields are low-frequency, so this is kept light on the assumption that consumers read them with bilinear filtering.
Use Field Visualize to check the estimation result, and Motion Amount when you want the amount of motion as a single value.
Video
Input ports
| Port ID | Type |
|---|---|
In | RenderTexture |
Output ports
| Port ID | Type |
|---|---|
Flow | FlowFieldOutput |
Scriptable members
| Path | Type |
|---|---|
currentScale | float |
Synapse Apps (scripting)
await synapse.modules.create({ type: "OpticalFlow" }) 