This function allows you to transform coordinates specified in one coordinate system to their corresponding coordinates in another specified coordinate system.
Consider how, in the following image, the same point has 4 different sets of coordinates depending on the coordinate system (fixture) with which the coordinates are expressed. The examples presented below are based on this image:
Note that after using this function, to pass only the X- or Y-coordinate(s) to a step input or an expression, you will need to use additional functions to isolate the X- or Y- coordinate of the point(s). For more information on how to do this, see the Using TRANSFORMCOORDINATES and accessing individual coordinates subsection of the Transforming from one coordinate system to another section in Chapter 32: Fixturing.
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.
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. |
Specifies the calibrated image that contains the coordinate system that the SourceCoordinates parameter is either in or will be returned in.
The data type returned is the same data type used in the SourceCoordinates parameter.
| 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)
|
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.
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. |
Specifies the fixture that contains the coordinate system that the SourceCoordinates parameter is either in or will be returned in.
The data type returned is the same data type used in the SourceCoordinates parameter.
| 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)
|
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.
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. |
Specifies the fixture that contains the coordinate system that the SourceCoordinates parameter is in.
Specifies the fixture that contains the coordinate system that the SourceCoordinates parameter will be returned in.
The data type returned is the same data type used in the SourceCoordinates parameter.
| 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)
|