CornerPin node

pluginIcon

This documentation is for version 1.0 of CornerPin (net.sf.openfx.CornerPinPlugin).

Description

Allows an image to fit another in translation, rotation and scale.

The resulting transform is a translation if 1 point is enabled, a similarity if 2 are enabled, an affine transform if 3 are enabled, and a homography if they are all enabled.

An effect where an image transitions from a full-frame image to an image placed on a billboard or a screen, or a crash zoom effect, can be obtained by combining the Transform and CornerPin effects and using the Amount parameter on both effects.

Apply a CornerPin followed by a Transform effect (the order is important) and visualize the output superimposed on the target image. While leaving the value of the Amount parameter at 1, tune the Transform parameters (including Scale and Skew) so that the transformed image is as close as possible to the desired target location.

Then, adjust the ‘to’ points of the CornerPin effect (which should be affected by the Transform) so that the warped image perfectly matches the desired target location. Link the Amount parameter of the Transform and CornerPin effects.

Finally, by animating the Amount parameter of both effects from 0 to 1, the image goes progressively, and with minimal deformations, from full-frame to the target location, creating the desired effect (motion blur can be added on the Transform node, too).

Note that if only the CornerPin effect is used instead of combining CornerPin and Transform, the position of the CornerPin points is linearly interpolated between their ‘from’ position and their ‘to’ position, which may result in unrealistic image motion, where the image shrinks and expands, especially when the image rotates.

This plugin concatenates transforms.

See also: https://web.archive.org/web/20220627032200/http://www.opticalenquiry.com/nuke/index.php?title=CornerPin

Inputs

Input

Description

Optional

Source

No

Controls

Parameter / script name

Type

Default

Function

to1 / to1

Double

x: 0 y: 0

enable1 / enable1

Boolean

On

Enables the point on the left.

to2 / to2

Double

x: 1 y: 0

enable2 / enable2

Boolean

On

Enables the point on the left.

to3 / to3

Double

x: 1 y: 1

enable3 / enable3

Boolean

On

Enables the point on the left.

to4 / to4

Double

x: 0 y: 1

enable4 / enable4

Boolean

On

Enables the point on the left.

Copy “From” / copyFrom

Button

Copy the contents (including animation) of the “from” points to the “to” points.

Copy “From” (Single) / copyFromSingle

Button

Copy the current values of the “from” points to the “to” points.

from1 / from1

Double

x: 0 y: 0

from2 / from2

Double

x: 1 y: 0

from3 / from3

Double

x: 1 y: 1

from4 / from4

Double

x: 0 y: 1

Set to input rod / setToInputRod

Button

Copy the values from the source region of definition into the “from” points.

Copy “To” / copyTo

Button

Copy the contents (including animation) of the “to” points to the “from” points.

Copy “To” (Single) / copyToSingle

Button

Copy the current values of the “to” points to the “from” points.

Amount / transformAmount

Double

1

Amount of transform to apply (excluding the extra matrix, which is always applied). 0 means the transform is identity, 1 means to apply the full transform. Intermediate transforms are computed by linear interpolation between the ‘from’ and the ‘to’ points. See the plugin description on how to use the amount parameter for a crash zoom effect.

Extra Matrix / transform

Double

x: 1 y: 0 z: 0 x: 0 y: 1 z: 0 x: 0 y: 0 z: 1

Overlay Points / overlayPoints

Choice

To

Whether to display the “from” or the “to” points in the overlay
To (to): Display the “to” points.
From (from): Display the “from” points.

Interactive Update / interactive

Boolean

Off

If checked, update the parameter values during interaction with the image viewer, else update the values when pen is released.

HiDPI / hidpi

Boolean

Off

Should be checked when the display area is High-DPI (a.k.a Retina). Draws OpenGL overlays twice larger.

Invert / invert

Boolean

Off

Invert the transform.

Filter / filter

Choice

Cubic

Filtering algorithm - some filters may produce values outside of the initial range (*) or modify the values even if there is no movement (+).
Impulse (impulse): (nearest neighbor / box) Use original values.
Box (box): Integrate the source image over the bounding box of the back-transformed pixel.
Bilinear (bilinear): (tent / triangle) Bilinear interpolation between original values.
Cubic (cubic): (cubic spline) Some smoothing.
Keys (keys): (Catmull-Rom / Hermite spline) Some smoothing, plus minor sharpening (*).
Simon (simon): Some smoothing, plus medium sharpening (*).
Rifman (rifman): Some smoothing, plus significant sharpening (*).
Mitchell (mitchell): Some smoothing, plus blurring to hide pixelation (*)(+).
Parzen (parzen): (cubic B-spline) Greatest smoothing of all filters (+).
Notch (notch): Flat smoothing (which tends to hide moire’ patterns) (+).

Clamp / clamp

Boolean

Off

Clamp filter output within the original range - useful to avoid negative values in mattes

Black outside / black_outside

Boolean

On

Fill the area outside the source image with black

Motion Blur / motionBlur

Double

0

Quality of motion blur rendering. 0 disables motion blur, 1 is a good value. Increasing this slows down rendering.

Directional Blur Mode / directionalBlur

Boolean

Off

Motion blur is computed from the original image to the transformed image, each parameter being interpolated linearly. The motionBlur parameter must be set to a nonzero value, and the blackOutside parameter may have an important effect on the result.

Shutter / shutter

Double

0.5

Controls how long (in frames) the shutter should remain open.

Shutter Offset / shutterOffset

Choice

Start

Controls when the shutter should be open/closed. Ignored if there is no motion blur (i.e. shutter=0 or motionBlur=0).
Centered (centered): Centers the shutter around the frame (from t-shutter/2 to t+shutter/2)
Start (start): Open the shutter at the frame (from t to t+shutter)
End (end): Close the shutter at the frame (from t-shutter to t)
Custom (custom): Open the shutter at t+shuttercustomoffset (from t+shuttercustomoffset to t+shuttercustomoffset+shutter)

Custom Offset / shutterCustomOffset

Double

0

When custom is selected, the shutter is open at current time plus this offset (in frames). Ignored if there is no motion blur (i.e. shutter=0 or motionBlur=0).