# TransformImage

TransformImage generates an Image data structure that accounts for distortion by using a Calib data structure produced by functions such as CalibratePoints or CalibrateGrid.

Note: This function Functions are tools that are available in Spreadsheet for processing and analyzing acquisitions or other results. You can add functions to your Spreadsheet job to create tool chains and produce results for specific applications. only outputs greyscale images.

## TransformImage Overview

TransformImage generates an Image data structure, using a CalibratePoints Calib data structure and the Image data structure being referenced by the ExtractCalibrationPoints function as arguments, that accounts for linear, non-linear and lens distortion to return an "undistorted" version of the image. This new output image has an internal 2D transformation and is based in real-world coordinates.

Despite the internal 2D transformation, the In-Sight vision tools that reference this image report results in pixel values. To get results in real-world coordinates, you must use the CalibrateImage function to create a new image that works in that space.

Note: The TransformImage training period, which takes place when the function is added to the spreadsheet, when the specified region is changed or when a job A job is a user-configured program in In-Sight 3D Spreadsheet consisting of functions and designed for specific applications. You can create and edit jobs using the In-Sight 3D Spreadsheet interface, and load them on a vision system for deployment in a live environment. with the function is loaded, can take as long as three seconds on an In-Sight vision system with a 640x480 resolution, and as long as 30 seconds on a vision system with a 1600x1200 resolution.

The dimension of 2D tools was 640x480. However, it has become 1430x1006 for 3D-A1000, and 2880x8000 for 3D-L4000. This way the max number of lines A1000 Series Vision Systems currently acquire is 1430 and L4000 Series Vision Systems acquire is 2880. The maximum width for A1000 In-Sight devices is 1006, and for L4000 In-Sight devices is 8000.

Inputs

The TransformImage function has the following syntax:

TransformImage(Image, Calibration, X, Y, Width, Height, ImageScale, ReferencePoint, Show)

See the table for a description of the available parameters.

Parameter | Description
Image | This parameter must reference a spreadsheet cell that contains an Image data structure. By default, this parameter references cell A1 . This parameter can also reference other Image data structures, such as those returned by the Image Vision Data Access functions or Coordinate Transforms Functions.
Calibration | This argument must reference a spreadsheet cell that contains a valid Calib data structure created by any Calibrate function.
Region | Also known as the Region of Interest (ROI), specifies the region of the image that undergoes analysis. Double-click on the Region parameter to create an Interactive Graphics Mode that you can transform and rotate. Select this parameter and press the Maximize Region button under Edit in the property sheet toolbar to automatically stretch the region to cover the entire image.
X | The X-offset of the origin, in fixture A fixture is a coordinate location on the image that keeps the tool in the place determined by the fixture. coordinates..
Y | The Y-offset of the origin, in fixture coordinates.
Width | The dimension along the Y-axis of the region.
Height | The dimension along the X-axis of the region.
Image Scale | Specifies the scale at which the transformed image is displayed. The minimum setting is 0.01, the maximum is 10.00 and the default setting is 1.000.
Reference Point | Specifies the origin reference point for the transformation.
0 = Image Center (default) | The reference point becomes the center of the image.
1 = Region Center | The reference point becomes the center of the ROI.
Show | Specifies the display mode for TransformImage graphics on the image.
0 = hide all | All graphics is hidden, except when the cell containing the TransformImage function is highlighted in the spreadsheet.
1 = result graphics only | The undistorted image is always displayed.
2 = input and result graphics | The input image region and undistorted image is always displayed.

Outputs

Returns | An Image data structure containing the processed image, or #ERR if any of the input parameters are invalid. Note: The contents of the processed image region in the Image data structure are not saved with the job. To get results in real-world coordinates, you must use the CalibrateImage function to create a new image that works in that space.