TRANSFORMCOORDINATES function

Synopsis
This function returns a copy of a point object, fixture object, array of point objects, or an array of fixture objects, with its coordinates transformed from one coordinate system to another.
Remarks
Variations
TRANSFORMCOORDINATES(SourceCoordinates, TransformType, CalibratedImage)
Returns a copy of the SourceCoordinates parameter, with its coordinates transformed from pixel units to the absolute (calibrated) coordinate system, or vice versa.
Parameters
SourceCoordinates

Specifies the point object, the fixture object, the array of point objects, or the array of fixture objects, whose coordinates will be used to calculate the new coordinates.

Supported types: Point; Fixture; Point array; Fixture array.
TransformType

This parameter should be set to one of the following values:

Value Description
AbsoluteToPixel

Specifies that the SourceCoordinates parameter is in the absolute coordinate system, and this function will return coordinates in calibrated pixel units.

PixelToAbsolute

Specifies that the SourceCoordinates parameter is in calibrated pixel units, and this function will return coordinates in the absolute coordinate system.

Supported types: Constant.
CalibratedImage

Specifies the calibrated image that contains the coordinate system that the SourceCoordinates parameter is either in or will be returned in.

Supported types: Image.
Returns

The data type returned is the same data type used in the SourceCoordinates parameter.

Returned types: Point; Fixture; Point array; Fixture array.
Examples
1.

In the following example, the function returns a point object containing the coordinates of the center point of the field of view of the camera. The coordinates are in the absolute coordinate system.

TRANSFORMCOORDINATES(POINT(Camera.Image.SizeX/2, Camera.Image.SizeY/2), PixelToAbsolute, Camera.Image)
2.

In the following example, the function takes a point object with coordinates (8, 4) in the absolute coordinate system, and will then return a point object with the corresponding coordinates in pixel units (based on the calibration associated with Camera.Image).

TRANSFORMCOORDINATES(POINT(8, 4), AbsoluteToPixel, Camera.Image)
TRANSFORMCOORDINATES(SourceCoordinates, TransformType, Fixture)
Returns a copy of the SourceCoordinates parameter, with its coordinates transformed from a relative coordinate system (fixture) to the absolute coordinate system, or vice versa.
Parameters
SourceCoordinates

Specifies the point object, the fixture object, the array of point objects, or the array of fixture objects, whose coordinates will be used to calculate the new coordinates.

Supported types: Point; Fixture; Point array; Fixture array.
TransformType

This parameter should be set to one of the following values:

Value Description
AbsoluteToRelative

Specifies that the SourceCoordinates parameter is in the absolute coordinate system, and this function will return coordinates in the specified relative coordinate system.

RelativeToAbsolute

Specifies that the SourceCoordinates parameter is in the specified relative coordinate system, and this function will return coordinates in the absolute coordinate system.

Supported types: Constant.
Fixture

Specifies the fixture that contains the coordinate system that the SourceCoordinates parameter is either in or will be returned in.

Supported types: Fixture.
Returns

The data type returned is the same data type used in the SourceCoordinates parameter.

Returned types: Point; Fixture; Point array; Fixture array.
Examples
1.

In the following example, the function is passed a point object with coordinates (8, 4) in the absolute coordinate system. The function will then return a point object with coordinates translated to the relative coordinate system defined by the first blob found in the BlobAnalysis step.

TRANSFORMCOORDINATES(POINT(8, 4), AbsoluteToRelative, BlobAnalysis.BlobFound(1).Fixture)
2.

This example passes the function a point object with coordinates (1, 1), based on the relative coordinate system defined by the first blob found by the BlobAnalysis step. The function will then return a point object with coordinates (8, 4) in the absolute coordinate system.

TRANSFORMCOORDINATES(POINT(1, 1), RelativeToAbsolute, BlobAnalysis.BlobFound(1).Fixture)
TRANSFORMCOORDINATES(SourceCoordinates, TransformType, SourceCoordinateSystem, DestinationCoordinateSystem)
Returns a copy of the SourceCoordinates parameter, with its coordinates transformed from one relative coordinate system (fixture) to another.
Parameters
SourceCoordinates

Specifies the point object, the fixture object, the array of point objects, or the array of fixture objects, whose coordinates will be used to calculate the new coordinates.

Supported types: Point; Fixture; Point array; Fixture array.
TransformType

This parameter should be set to the following value:

Value Description
RelativeToRelative

Specifies that the SourceCoordinates parameter is in a relative coordinate system, and this function will return coordinates in a second relative coordinate system, which is specified in the DestinationCoordinateSystem parameter.

Supported types: Constant.
SourceCoordinateSystem

Specifies the fixture that contains the coordinate system that the SourceCoordinates parameter is in.

Supported types: Fixture.
DestinationCoordinateSystem

Specifies the fixture that contains the coordinate system that the SourceCoordinates parameter will be returned in.

Supported types: Fixture.
Returns

The data type returned is the same data type used in the SourceCoordinates parameter.

Returned types: Point; Fixture; Point array; Fixture array.
Examples
1.

In the following example, the function is passed a point object with coordinates (1, 1), based on the relative coordinate system defined by the first blob found by the BlobAnalysis step. The function will then return a point object with coordinates (6, 1), based on the relative coordinate system defined by the second blob found by the BlobAnalysis step.

TRANSFORMCOORDINATES(POINT(1, 1), RelativeToRelative, BlobAnalysis.BlobFound(1).Fixture, BlobAnalysis.BlobFound(2).Fixture)