Contact Support

Generating Motion Vectors

The SmartVector node generates motion vectors for use in the VectorDistort node. You can connect a SmartVector node directly to the VectorDistort node or write motion vectors to the .exr format, which are then used to drive the VectorDistort node to reduce overheads later on.

To generate motion vectors:

1.   Read in your source sequence and then connect a SmartVector node to the Read node.
2.   Double-click the SmartVector node to open its Properties panel, if it's not already open.
3.   Set the maximum frame distance over which vectors are calculated. Sequences with rapid motion typically require values closer to 0, whereas sequences with slower motion typically require values closer to 6.

Distance is 2 to the power of frame distance. For example, a frame distance of 5 is 2^5=32, meaning that vectors are calculated up to a maximum of 32 frames away from the current frame.

Note:  This value is passed down the node tree to any subsequent VectorDistort nodes, limiting them to this value.

4.   Set the Vector Detail control to the required detail level. 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.

For example, if the area you're working on is relatively small, the default value of 0.3 might not capture movement properly. Try increasing the control to 1.0 to capture more detail.

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

5.   Set the Strength control to force pixel matching 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.

Note:   The default value works well for most sequences.

6.   If there is a lot of movement in the foreground, you might want to add a mask. See Masking Foreground Areas for more information.
7.   You can examine the vectors produced by connecting a Viewer to the SmartVector node and switching the channels control above the Viewer to smartvector_<value>. The channel labels depend on the frame distance control. For example:

frame distance = 5 creates 6 vector channels f01 to f32.

frame distance = 2 creates 3 vector channels f01 to f04.

8.   If you want to write the vectors to disk, click Export Write to automatically add a Write node to the script. The Write node's controls are set to channels > all and .exr output automatically.

Note:  You can only write motion vectors to the .exr format. Don't forget to add frame padding in the form of hashes or printf notation, depending on your Preferences > Behaviors > File Handling settings.

9.   Enter a file path in the Write node's controls and then click Render.

Note:  SmartVector does not currently output motion, forward, and backward channels by default. If you require these channels, add a VectorToMotion node after the SmartVector node. VectorToMotion converts the vectors to motion that can be used with VectorBlur to create motion blur, without using a VectorGenerator.

10.   Proceed to Adding Paint to the Source or Adding an Image to the Source.

Masking Foreground Areas

If your sequence is composed of a foreground object moving over a background, the motion estimation is likely to get confused at the edge between the two. To reduce artifacts, you can add a matte of the foreground region to the Matte input.

SmartVector's Matte input treats black as background and white as foreground. Gray areas are used to attenuate between background and foreground elements.

To apply a mask to the sequence:

1.   Add a Roto node downstream of the source.
2.   Draw a matte around the area you want to mark as foreground.

3.   Set the Matte Channel to Matte Alpha and then generate the motion vectors as described in Generating Motion Vectors.