Lens Distortion

Used to compute the lens distortion from a shot capturing a grid specific to a camera and lens. Once solved, the distortion solution can be used to undistort footage captured with that camera/lens combination.

Properties

Lens Distortion Tab

Lens Type

Align selection with the lens used in the shot: Spherical or Anamorphic

Mode

Using this node with either Undistort and Redistort can resolve lens distortion in footage that used this same camera and lens combination. However, note that the STMap method is much more efficient since it generates Forward and Backward layers that can be read by the STMap node to perform the same undistort and redistort operations.

When set to STMap, note the additional layers generated and available for viewing in the Viewer: motion, forward, and backward.

Analysis Tab

Grid Detect: Press Detect to have the node detect the grid lines in the shot.

Settings

These allow for editing the detection process if the initial detect resulted in misalignments or other errors.

The default settings tend to be sufficient for a good detection and solve, but there are instance where some settings may need modifications due to feature spacing, numbers, and linking.

Number of Features

If parts of grid are not identified with features, then there many need to be more features noted in this parameter. If detection shows evidence of features floating in empty space, this could indicate too many features in this parameter.

Patch Size

Test values if detection shows evidence of features floating in empty space.

Feature Separation

This parameter value should reflect the size of the grid squares.

Feature Linking: Angle Threshold

Values that are too high for this parameter may exhibit inadequate linking between features. However, test values in this parameter when using highly spherical lenses, such as a fisheye. The curvature may warrant unique angle thresholds to detect the lens distortion.

Editing and Drawing

The following options are available in the Properties panel and in the Viewer, on the left toolbar.

Select All, Select Features, Select Lines

Add Features, Remove Features, Add Lines

Features can be deleted by selecting them and pressing the Delete key.

When drawing lines and connecting features, press Enter to complete a line and to start a new line.

Once the Detect has generated the grid, adjust the features and lines to resolve any discrepancies that the Detect process may not have captured or done well.

Of particular note is to clean up features around the frame boundary since that is where a significant amount of distortion is noticeable.

To help with clarity in recognizing features and links in Viewer, decrease gain (top left slider in Viewer) to have grid features and link appear more prominent for editing.

The results of this editing will be used to perform the Solve.

Solve

With a satisfactory detect result and edit, press 'Solve' to compute the lens distortion. The result should be a solved lens distortion with a grid of green features in the Viewer signifying a good solution.

Show

By default, All is enabled to show shot content, grid features, and grid links. Set to None to hide all grid content.

Toolset

Once the Solve is complete, document the camera and lens in the Node tab.

Save this Lens Distortion as a Toolset so that it can be accessible for other projects using this camera/lens combination.

Footage

Undistort

To use this solved Lens Distortion node with incoming footage, simply use the Lens Distortion node and set its Source input to the plate that is intended to be undistorted.

Verify that the LensDistortion Tab: Mode is set to Undistort.

Redistort

Once edits have been made to the undistorted footage and comp is ready to have the lens distortion reapplied, copy the same Lens Distortion node and set its Source to the incoming data stream.

Verify that the LensDistortion Tab: Mode is set to Redistort.

Note that the Lens Distortion process added a bounding box to the shot, so the Redistort process will retain that larger bounding box, so a Reformat may be needed to crop depending on whatever other edits are planned.