Computes the perspective transform (homography) that sends 4 source points onto 4 destination points, and applies it to arrays of x and y coordinates. Converts positions detected in a camera picture, for example by Video Detection Blob, into positions on the projection surface or the floor, or back: the camera-projector calibration of interactive installations.
Example: positions seen by a camera (left) converted into positions on the projected surface (right).
Give the four corners of the zone as the camera sees them in from x and from y, and the same corners on the surface in to x and to y, in the same order. With more than 4 pairs (up to 64), the module fits the best transform in the least-squares sense. Any unit works, from 0 to 1 or in pixels, as long as from x, from y, x in and y in use the same. The module has no video port and works on the patch thread, only when an input changes.
from x = [0, 1, 1, 0]
from y = [0, 0, 1, 1]
to x = [0.1, 0.9, 0.8, 0.2]
to y = [0.1, 0.2, 0.9, 0.8]
x in = [0, 1, 0.5, 0.25]
y in = [0, 0, 0.5, 0.75]
x out = [0.1, 0.9, 0.493, 0.335]
y out = [0.1, 0.2, 0.549, 0.684]
Bypasses the module processing when activated (ON).
x of the source points, an array of 4 to 64 values (default 0, 1, 1, 0: the corners of the unit square, top left, top right, bottom right and bottom left). The four point arrays are read up to the length of the shortest one.
y of the source points, in the same order as from x (default 0, 0, 1, 1).
x of the destination points, in the same order as from x (default 0, 1, 1, 0).
y of the destination points, in the same order (default 0, 0, 1, 1). With the default points, the transform is the identity.
When ON, applies the inverse transform, from the destination points back to the source points: for example from positions on the surface back to positions in the camera picture.
x of the points to transform, an array (empty by default).
y of the points to transform, an array (empty by default). The number of points transformed is the length of the shorter of x in and y in, at most 4096.
x of the transformed points, an array of at most 4096 values.
y of the transformed points, an array of at most 4096 values.
The 9 coefficients of the transform applied, row by row: h11, h12, h13, h21, h22, h23, h31, h32, h33, with h33 = 1. It is the inverse transform when inverse is ON, and the identity (1, 0, 0, 0, 1, 0, 0, 0, 1) when valid is OFF.
ON when the points define a transform. OFF when they cannot: fewer than 4 pairs, aligned points (for example three of the four corners on one line) or coincident points. The identity is then applied: x out and y out copy x in and y in.
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