# Transform coordinates

Transforms point coordinates to/from a coordinate frame. This tool is typically used to transform coordinates in the world coordinate system to coordinates aligned to a detected object, such as a blob or a geometric shape, and back.

Using the frame output of an object detector (e.g. Blob Geometry Analysis) as the frame input to this tool and passing world coordinates (such as blob centers) as the coordinates input converts the absolute world coordinates to coordinates that are relative to the corner of the detected object.

If the direction flag is set to FromFrame, the tool transforms points back to the world coordinate system. For example, using the size output of Blob Geometry Analysis as the coordinate input would yield the coordinates of the blob's bottom-right corner in the world coordinate system.

## Inputs

frame
A coordinate frame to/from which the coordinates are to be transformed. This can be either a single frame or a separate frame for each coordinate. In the latter case, the number of rows in this matrix must be four times that of coordinates.
coordinates
A matrix that contains the coordinates of the points to be transformed as rows. 2D and 3D coordinates are supported.
direction
The direction of the transformation.

## Outputs

coordinates
A matrix that contains the transformed coordinates. The size of this matrix is equal to that of the input coordinate matrix.

Transformation direction.

Enumerator
FromFrame

Transform coordinates from the input coordinate frame to world coordinates. This effectively calculates points * frame'.

ToFrame

Transform coordinates from world coordinates to the input coordinate frame. This effectively calculates points * inv(frame)'.