Working with STMaps

STMaps allow you to warp an image or sequence according to the pre-calculated distortion from a LensDistortion node, stored in the motion layer. The motion channels represent the absolute pixel positions of an image normalized between 0 and 1, which can then be used on another image to remove or add distortion without the warp estimation step. See Estimating Lens Distortion Using a Grid and Estimating and Removing Lens Distortion Using Lines for more information on warp estimation.

To remove distortion using the STMap node, do the following:

1.   Read in your sequence and add an STMap node downstream. Make sure the src input is connected to the sequence.
2.   Copy and paste the LensDistortion node containing the grid analysis with the Output > Mode control set to STMap,

OR

Read in the file containing the motion layer, if you wrote it out separately.

3.   Connect the stmap input to the source of the motion layer.

4.   Set the STMap UV channels control to the forward layer to remove the distortion.

You can now track, matchmove, composite, and so on in the undistorted space before redistorting the image.

5.   After the comp work is complete, you can warp the VFX work by applying the backward layer in the UV channels control using another STMap node.
6.   The final step is merging the warped VFX work back over the original image to create the comp.

The output from nodes placed before the second STMap node are distorted by the same warp as the sequence.

The undistorted plate and comp

The comp after redistortion