SmartVector

The SmartVector node writes motion vectors to the .exr format, which are then used to drive the VectorDistort or VectorCornerPin nodes as part of the Smart Vector toolset.

See VectorDistort and VectorCornerPin.

Inputs and Controls

Connection Type

Connection Name

Function

Inputs

Matte

An optional matte of the foreground, which may improve the motion estimation by reducing the dragging of pixels that can occur between foreground and background objects.

Source

The sequence from which to generate motion vectors.

Control (UI)

Knob (Scripting)

Default Value

Function

SmartVector 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 default blink 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, if available, by navigating to the Preferences and selecting an alternative from the default blink 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 Windows, Mac OS X and macOS, or Linux for more information on the GPUs Nuke supports.

Vector Detail

vectorDetailReg

0.3

Sets the vector quality. The default value of 0.3 is sufficient for sequences with low detail and movement, but you may want to increase the detail to improve the vector quality in some cases.

Note:  High detail vectors take longer to render, but can improve the results you get from the VectorDistort node.

Strength

strengthReg

1.5

Sets the strength in matching pixels between frames. Higher values allow you to accurately match similar pixels in one frame 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.

Note:  The default value works well for most sequences.

Matte Channel

matteChannel

None

Where to get the optional foreground mask to use when estimating motion:

None - do not use a matte.

Source Alpha - use the alpha of the Source input.

Source Inverted Alpha - use the inverted alpha of the Source input.

Matte Luminance - use the luminance of the Matte input.

Matte Inverted Luminance - use the inverted luminance of the Matte input.

Matte Alpha - use the alpha of the Matte input.

Matte Inverted Alpha - use the inverted alpha of the Matte input.

Output

output

Background

When Matte Channel is set to anything other than None, the Output control determines whether Foreground or Background vectors are passed down stream or written to file.

Inpaint Matte Region

inpainting

disabled

When enabled, any areas where vectors are absent are infilled using the nearest available vectors.

Note:  This control is only available when Matte Channel is set to one of the matte options, such as Matte Alpha.

Matte Dilation

matteDilation

50

Controls the amount of dilation applied to the matte before inpainting the matte region.

Note:  This control is only available when Inpaint Matte Region is enabled.

Export

Export Write

export_write

N/A

Click to automatically create a Write node with suitable .exr settings to contain the vector data.

Advanced

Flicker Compensation flickerCompensation disabled

When enabled, SmartVector takes into account variations in luminance and overall flickering, which can cause problems with your output. Examples of variable luminance include highlights on metal surfaces, like vehicle bodies, or bodies of water within a layer that reflect light in unpredictable ways.

Note:   Using Flicker Compensation increases rendering time.

Tolerances

Weight Red

weightRed

0.3

For efficiency, much of the motion estimation is done on luminance only - that is, using monochrome images. The tolerances allow you to tune the weight of each color channel when calculating the image luminance. These parameters rarely need tuning. However, you may, for example, wish to increase the Weight Red to allow the algorithm to concentrate on getting the motion of a primarily red object correct, at the cost of the rest of the items in a shot.

 

 

Weight Green

weightGreen

0.6

Weight Blue

weightBlue

0.1

Step-by-Step Guides

Generating Motion Vectors