Corrects or applies the radial and tangential distortion of a lens, with the Brown-Conrady model of OpenCV camera calibrations. Straightens the picture of a wide-angle camera before detection or mapping, or pre-distorts content for a short-throw lens or a curved surface.
Example: distort with k1 -0.35 on a checkerboard (top), undistort with k1 -0.25 and zoom 0.9 on a wide-angle camera (bottom).
The defaults show a barrel lens. With every coefficient at 0 and zoom at 1, the module copies its input. A change of the model (mode, the coefficients, the centre, the focal lengths or zoom) rebuilds the distortion map, which takes about 1 ms for a 4K picture: these values can be modulated at every frame, for example by an LFO.
Bypasses the module processing when activated (ON).
Video input flow(s).
Video output flow(s).
Total time used for the calculation of the module.
Direction of the model (default distort).
A module in distort followed by a module in undistort with the same values gives the picture back, apart from the corners lost by the first one.
First radial coefficient, the r^2 term, from -1 to 1 (default -0.25). In distort mode a negative value gives a barrel (lines bowed outwards, background in the corners) and a positive value a pincushion. In undistort mode it is the other way round: a negative value, usual for a wide-angle camera, gives a pincushion look and keeps the frame filled, a positive value a barrel look with background corners. Typed or wired values beyond the fader are accepted, up to 100 in absolute value: a strong barrel never folds back into a mirrored ghost picture, the picture beyond the limit radius is scaled evenly behind a hard circular edge.
Second radial coefficient, the r^4 term, from -1 to 1 (default 0). Acts mostly on the outer part of the picture. Values beyond the fader are accepted.
Third radial coefficient, the r^6 term, from -1 to 1 (default 0). Acts on the far corners; often 0 in calibrations of ordinary lenses. Values beyond the fader are accepted.
First tangential coefficient, from -0.1 to 0.1 (default 0): the distortion of a lens tilted vertically, which makes the picture asymmetric from top to bottom. Values beyond the fader are accepted.
Second tangential coefficient, from -0.1 to 0.1 (default 0): the distortion of a lens tilted horizontally, which makes the picture asymmetric from left to right. Values beyond the fader are accepted.
Horizontal position of the optical centre: cx divided by the width of the picture, from 0 to 1 (default 0.5, the middle).
Vertical position of the optical centre: cy divided by the height of the picture, from 0 to 1 (default 0.5, the middle).
Focal length fx divided by the width of the picture, from 0.1 to 4 on a logarithmic fader (default 1). The coefficients act on distances measured in focal lengths: a longer focal weakens the effect of the same coefficients. Values beyond the fader are accepted. An OpenCV calibration converts as follows:
camera = 1920 x 1080, fx = 1000, fy = 1000, cx = 960, cy = 540
focal x = 1000 / 1920 = 0.521
focal y = 1000 / 1920 = 0.521
center x = 960 / 1920 = 0.5
center y = 540 / 1080 = 0.5
k1, k2, k3, p1, p2 = the values of the calibration
Focal length fy divided by the width of the picture too (not by its height), from 0.1 to 4 on a logarithmic fader (default 1): equal to focal x for square pixels. Values beyond the fader are accepted.
Scale of the output around the optical centre, from 0.25 to 4 on a logarithmic fader (default 1). Above 1 it enlarges the picture and hides the background corners of a barrel: for example undistort with k1 0.3 shows black corners at zoom 1 and none at zoom 1.15. Below 1 it shrinks the picture: after an undistort with a negative k1, the whole source shows inside curved borders.
What the output shows where the model reads outside the picture (default background).
Colour shown outside the picture when outside is background (default opaque black, $FF000000). A transparent colour gives a picture with alpha: the corners are transparent.
How the picture is read between its pixels (default bilinear).
Button. Opens the manual page of the selected object (or of its parent module for a control) in the web browser. If no page exists for this object, an error is traced in the trace panel.
For more details about information/help creation, see create-help-file.
Free multi-line text attached to the module, saved with the patch. When it is not empty, it is shown as the hint of the module (mouse over the module header in the patch) in place of the default module hint, even when the module hints are disabled.
visible only in god mode, see setup-panel-tab-expert.
Read-only, not saved. Current private numeric ID of the object, used internally to identify it (for example as the target of a bind ID).
Read-only, not saved. Private ID used to store and recall the values of this control in presets.
Button. Generates a new unique ID, original ID and preset ID for the object. Use it if you experience difficulties in Polyphonic mode or if two objects share the same ID. Preset values and binds referring to the old IDs are lost.
Read-only, not saved. Absolute address of the object in the Usine objects tree, built from the workspace root. This is the address to use to reach the object from scripts, the objects panel or remote messages. Only shown for objects that are registered in the objects list. See objects-address.
Read-only, not saved. Address of the object relative to the current patch, valid inside that patch only. See objects-address.
Free user-defined address for the object (empty by default). When set, the object is also registered in the objects tree under this name, so it can be reached independently of its position in the workspace (the value is also reported in the mouse-over and mouse-down chunks). Changing it rebuilds the objects list. Only available on objects that support a user address. See objects-address.
version 7.0.250921
Edit All Pages