Calibrate

Utilizing up to 32 user-specified point pairs, Calibrate creates a 2D transformation to convert between pixel and real-world coordinate systems.

About Calibrate

The Calibrate function requires user-specified points, expressed in two different coordinate systems: The real-world physical coordinate system of the object, and the pixel coordinates of the object's image. To extract features from an image, Calibrate requires Vision Tools. The Calibrate function enters the location of the features as both real-world and pixel coordinates.

During the calibration phase, the function acquires an image that contains features with known locations in real-world coordinates. To locate and report features of an image in pixel coordinates, the function uses vision tools such as FindPatMaxPatterns or FindLine.

Note: The origin of the pixel coordinates is always the upper-left corner of the upper-left pixel.

In the next phase, Calibrate enters both the pixel and real-world coordinates as the Pixel Point and World Point parameters. For the Pixel Point coordinates, Calibrate uses Cell References to the X and Y values of the vision tool. For the World Point coordinates, Calibrate enters a numeric value. The function computes the 2D transformation between the pixel and real-world coordinates, producing a Calib structure that represents the transformation.

You can also use Calibrate for the following transformations:

  • Translation in two dimensions
  • Rotation about three axes
  • Scale in two dimensions
  • Perspective distortion
  • Parallelogramming or skewing
Note:

When using the Calibrate function, the physical and optical set-up (the lens, sensor and the physical relationship between the sensor and the scene) must be the same for both the calibration and run-time operation. If you alter any of these items, you have to recalibrate the system. It is recommended that you use the same sensor and lens for both calibration and processing the run-time images. The sensor and lens must also retain their original set-up and calibration settings. For example, altering the resolution or moving the sensor invalidates the computed 2D transformation that maps pixel to real-world coordinates.

Calibrate Inputs

Input Description

Pixel Point 0 to N

Specifies the pixel coordinates of a pixel-to-world association.

X

The image x-coordinate.

Y

The image y-coordinate.

World Point 0 to N

Specifies the real-world coordinates of a pixel-to-world association.

X

The x-axis coordinate, as a world value.

Y

The y-axis coordinate, as a world value.

Calibrate Outputs

Returns

A Calib data structure containing the coefficients that define the transformation between the two coordinate systems.