O_VectorGenerator

O_VectorGenerator generates motion vector fields for each view in a stereo image. A motion vector field maps the location of a pixel on one frame to the location of the corresponding pixel in a neighbouring frame. It has the same dimensions as the image, but contains an (x,y) offset per pixel. These offsets show how to warp a neighbouring image onto the current image.

Inputs and Controls

Connection Type

Connection Name

Function

Input

Source

A stereo pair of images.

If disparity channels aren’t embedded in the images, you should also have an O_DisparityGenerator node upstream.

Mask

An optional mask that specifies areas to exclude from the motion calculation. You can use this input to prevent distortions at occlusions or to calculate motion for a background layer by ignoring all foreground elements.

Note that masks should exist in both views, and O_VectorGenerator treats the alpha values of 1 as foreground and blurs to the 0 value using nearby vectors to recreate object boundaries, rather than image data. When you create a mask using Roto or RotoPaint, you can use the feather control to extend the calculation. For example, the vector map may have a sharper transition at edges with a binary mask, but applying feather on the mask can help smooth the resulting image.

Control (UI)

Knob (Scripting)

Default Value

Function

O_VectorGenerator Tab

Local GPU

gpuName

N/A

Displays the GPU used for rendering when Use GPU if available is enabled. Local GPU displays Not available when:

Use CPU is selected as the GPU Device in the Preferences.

no suitable GPU was found on your system.

it was not possible to create a context for processing on the selected GPU, such as when there is not enough free memory available on the GPU.

You can select a different GPU Device, if available, by navigating to the Preferences and selecting an alternative from the GPU Device dropdown.

Note:  Selecting a different GPU requires you to restart Nuke before the change takes effect.

Use GPU if available

useGPUIfAvailable

enabled

When enabled, rendering occurs on the Local GPU specified, if available, rather than the CPU.

Note:  Enabling this option with no local GPU allows the script to run on the GPU whenever the script is opened on a machine that does have a GPU available.
You should also select this if you wish to render from the command line with the --gpu option.

See Nuke 14 Release Notes for more information on the GPUs Nuke supports.

Views to Use

viewPair

Dependent on Source

Sets the two views you want to use to calculate the motion vectors. These views will be mapped for the left and right eye.

Mask

maskWith

None

Sets areas in the image that you want to ignore when generating vectors. In the O_VectorGenerator controls, set Mask to the component you want to use as the mask. The following Mask settings are available:

None - use the entire image area.

Source Alpha - use the alpha channel of the Source clip as a mask.

Source Inverted Alpha - use the inverted alpha channel of the Source clip as a mask.

Mask Luminance - use the luminance of the Mask input as a mask.

Mask Inverted Luminance - use the inverted luminance of the Mask input as a mask.

Mask Alpha - use the alpha channel of the Mask input as a mask.

Mask Inverted Alpha - use the inverted alpha channel of the Mask input as a mask.

Vector Detail

vectorDetail

1

Adjusts the detail of the calculated motion vectors. Higher detail picks up finer movement, but takes longer to calculate.

Strength

strength

5

Sets the strength in matching pixels between frames. Higher values allow you to accurately match similar pixels in one image to another, concentrating on detail matching even if the resulting motion field is jagged. Lower values may miss local detail, but are less likely to provide you with the odd spurious vector, producing smoother results.

Often, it is necessary to trade one of these qualities off against the other. You may want to increase this value to force the images to match, for example, where fine details are missed, or decrease it to smooth out the motion vectors.

Consistency

consistency

1

Sets how heavily the forward and backward vectors are forced to match. Increase the Consistency to make the forward and backward vectors more similar to each other, but this may cause the vectors to match the image less.

Smoothness smoothness 1

Applies extra smoothing to the motion vector field as a post-process, after image matching. The higher the value, the smoother the result.