You are here: User Guide > NukeX > Working with Lens Distortion

Working with Lens Distortion

Nuke's LensDistortion node allows you to distort or undistort an image according to a radial distortion model.

Quick Start

Here's a quick overview of the workflow:

1.   Read in an input sequence, connect it to a Lens Distortion node (Transform > LensDistortion), and connect the output to a Viewer.
2.   To apply lens distortion to the input manually, change the parameters on the LensDistortion tab. Turn on Undistort to invert the current distortion. For more information, see Adjusting LensDistortion Parameters.
3.   To estimate the lens distortion on the input, you have three options. Each one of these calculates the distortion present and set the values in the LensDistortion tab.

Image Analysis: use this option to estimate the distortion automatically without the help of grids or lines. Image analysis tracks features through the sequence and finds the distortion model that best describes the way the same 3D structure is projected onto different parts of the image. For more information, see Calculating Lens Distortion Automatically.

Grid Analysis: use this option to estimate the distortion from a checkerboard or thin line grid, for greater accuracy. For more information, see Analyzing Distortion Using a Grid.

Line Analysis: use this option to estimate the distortion from lines drawn along features in the input that are known to be straight. For more information, see Analyzing Distortion Using Lines.

4.   If you want, you can also calculate the lens distortion on one image and apply that distortion to another image with the help of an STMap node. For more information, see Calculating the Distortion on One Image and Applying it to Another.
5.   You can use the estimated lens distortion values on the LensDistortion tab to distort an image on a Card. For more information, see Applying Lens Distortion to a Card Node.

NOTE:  When using a ScanlineRender node downstream from a LensDistortion node, by default, the ScanlineRender node does not pull pixels from outside the frame and you may end up with parts of the image missing.

To fix this, you can use the overscan slider in the ScanlineRender controls to set the maximum additional pixels to render beyond the left/right and top/bottom of the frame. For more information on the ScanlineRender node and the overscan control, see To Render Pixels Beyond the Edges of the Frame.

 

Calculating Lens Distortion Automatically

Analyzing Distortion Using a Grid

Analyzing Distortion Using Lines

Adjusting LensDistortion Parameters

Calculating the Distortion on One Image and Applying it to Another

Applying Lens Distortion to a Card Node