Houdini 22.0 Nodes Copernicus nodes

Lens Distort Copernicus node

Adds radial and tangential distortion to a layer based on OpenCV coefficients.

On this page
Since 21.0

This node distorts an input layer based on the OpenCV-defined intrinsic camera parameters for lens distortion.

Use the parameters in this node to add radial and tangential distortion to the layer. Radial distortion (k# parameters) turns straight lines into circular arcs, while tangential distortion (p# parameters) moves pixels as if they're tilting along an axis to create linear displacement. For example, use this node to create a wide zoom effect or mirror effect where the image bulges outwards.

Barrel distortion is performed by stretching out from the center of the image. The amount of stretch depends on how far from the center the pixel is. The relationship between distance to center and amount of stretch is controlled by the k parameters.

The first three k parameters are combined into a scaling coefficient which is multiplied by the radius.

The second three k parameters are combined into a scaling coefficient, and the radius is divided by this value. They thus act in the opposite direction of the first three.

Note barrel distortion is not simply invertible, so you cannot just move the k1-k3 parameters to k4-k6 to get the inverse operation.

Each group of three parameters is divided into low, mid and high order values. Low order operates across the image most uniformally. Higher orders will increasingly affect the edges of the image. Thus to correct distortion in the center, the low order values can be used, and to correct distortion at the edges, the higher orders.

Refer to OpenCV documentation for more details on each of the constants in the intrinsic camera parameters.

Parameters

Signature

The layer type that the source accepts.

See Signatures for more information.

Mask

The amount of the new value to mix in with the original value. Higher values mix in more of the new value. Lower values mix in less of the new value.

The default value is 1, which means this node uses only the new value. See Mask for more information.

Low Order Barrel (k1)

Positive values will produce a barrel distortion, and negative values will produce a pincushion distortion.

The k1 radial distortion constant in the intrinsic camera parameters defined by OpenCV.

Mid Order Barrel (k2)

Positive values will produce a barrel distortion, and negative values will produce a pincushion distortion.

The k2 radial distortion constant in the intrinsic camera parameters defined by OpenCV.

High Order Barrel (k3)

Positive values will produce a barrel distortion, and negative values will produce a pincushion distortion.

The k3 radial distortion constant in the intrinsic camera parameters defined by OpenCV.

Low Order Inverse (k4)

Negative values will produce a barrel distortion, and positive values will produce a pincushion distortion.

The k4 radial distortion constant in the intrinsic camera parameters defined by OpenCV.

Mid Order Inverse (k5)

Negative values will produce a barrel distortion, and positive values will produce a pincushion distortion.

The k5 radial distortion constant in the intrinsic camera parameters defined by OpenCV.

High Order Inverse (k6)

Negative values will produce a barrel distortion, and positive values will produce a pincushion distortion.

The k6 radial distortion constant in the intrinsic camera parameters defined by OpenCV.

Vertical Tilt (p1)

Positive values will give the effect that the top of the image plane is farther away than the bottom, and negative values will do the opposite.

The p1 tangential distortion constant in the intrinsic camera parameters defined by OpenCV.

Horizontal Tilt (p2)

Positive values will give the effect that the right side of the image plane is farther away than the left side, and negative values will do the opposite.

The p2 tangential distortion constant in the intrinsic camera parameters defined by OpenCV.

Center

The pivot point for the distortion.

Tip

Click and then click a location in the image to set the Center.

Scale

The amount to scale the distortion along the X and Y-axes.

Aspect

The ratio between the width and height. This value should match your lens’s aspect ratio. This is different from your input layer’s aspect ratio. The shape of the sensor behind a lens doesn’t affect the lens' distortion.

Inputs

source

The original layer to distort.

k1

An optional per-pixel scaling of the k1 coefficient.

k2

An optional per-pixel scaling of the k2 coefficient.

k3

An optional per-pixel scaling of the k3 coefficient.

k4

An optional per-pixel scaling of the k4 coefficient.

k5

An optional per-pixel scaling of the k5 coefficient.

k6

An optional per-pixel scaling of the k6 coefficient.

p1

An optional per-pixel scaling of the p1 coefficient.

p2

An optional per-pixel scaling of the p2 coefficient.

center

An optional per-pixel addition to the Center parameter. This isn’t a scaling factor.

scale

An optional per-pixel scaling of the Scale parameter.

mask

An optional per-pixel mask amount that’s scaled by the Mask parameter.

Outputs

distort

The distorted layer.

uv

The UV map that represents the distortion.

Copernicus nodes