# Train Calib Checkerboard Corrector

The TrainCalibCheckerboardCorrector block holds a VisionPro CogCalibCheckerboardTool. When executed, this block runs checkerboard calibration on input image and outputs the corrected image as well as feature graphics.

The input image here must be image from one of the following calibration plates:

- StandardRectangles
- DataMatrix
- DataMatrixWithGridPitch
- DotGridAxes

## General Information

Class name: TrainCalibCheckerboardCorrector

Namespace: Cognex.Designer.AlignPlus.Calibration

Assembly: Cognex.Designer.AlignPlus.Calibration.dll

## Inputs

Item | Type | Description
--- | --- | ---
Checkerboard Image | ICogImage | An image of the calibration target
Command Args | CommandArgs | Command for current task

## Outputs

Item | Type | Description
--- | --- | ---
Corrected Checkerboard Image | ICogImage | After training, the result of running image correction on the checkerboard image.
Extracted Features | ICogRecord | Features graphics extracted by CogCalibCheckerboardTool.

Here is an example of input raw image and its corrected image:

- Input image:

- Output image with graphics:

Note: In alignment application, it is not recommended to install camera at such a tilted angle which cause big perspective distortion in raw image as this will reduce the alignment accuracy.

## Properties

These properties are described below in different groups:

- Calibration Origin Adjustment

  Name | Type | Description
  --- | --- | ---
  Corrected Pixel X Axis Alignment Source | Cognex.VisionPro.CalibFix. CogCalibCheckerboardAdjustmentSpaceConstants | Get/set the Corrected Pixel X Axis Alignment Source. Plate(RawCalibred): during correction the image pixels will be rotated such that in the corrected image, the Home2D X-axis is oriented in the same direction as the corrected image X-axis (# space). Raw(Uncalibred): there is no effect during image correction. Any additional rotation specified by the CorrectedPixelRotation property will be applied after this X-axis alignment is complete. If this property is changed, this corrector will become untrained.
  Corrected Pixel Match Handedness Source | Cognex.VisionPro.CalibFix. CogCalibCheckerboardAdjustmentSpaceConstants | Specifies whether the output handedness is the same in Raw2D space(Uncalibrated space), or in Plate2D space(RawCalibrated space).
  Corrected Pixel Rotation(degrees) | Double | Get/set the rotation, in degrees, of the corrected image. This property allows you to rotate the image during correction. See the VisionPro CogCalibCheckboardTool.Calibration.OwnedWarpParams.WarpRotation property. If this property is changed, this corrector will become untrained.
  Corrected Pixel Handedness Swap | Boolean | Get/set the handedness of the corrected space. If this property is changed, this corrector will become untrained.

- Feature Extraction

  Name | Type | Description
  --- | --- | ---
  Calibration Plate Grid Spacing X | Double | Gets/sets the physical units of grid pitch along the x-axis of the raw calibrated space (see the Calibration and Fixturing section of VisionPro documentation). It is the distance between any two adjacent checker vertices whenever the line joining them is parallel to the x axis of calibration plate.
  Calibration Plate Grid Spacing Y | Double | Gets/sets the physical units of grid pitch along the y-axis of the raw calibrated space (see the Calibration and Fixturing section of VisionPro documentation). It is the distance between any two adjacent checker vertices whenever the line joining them is parallel to the y axis of calibration plate.
  Feature Finder | Cognex.VisionPro.CalibFix.CogCalibCheckerboardFeatureFinderConstants | Gets/Sets the algorithm used to find vertices on the calibration plate (refer to the CogCalibCheckerboardFeatureFinderConstants documentation in the VisionPro documentation).
  Fiducial Type | Cognex.VisionPro.CalibFix.CogCalibCheckerboardFiducialConstants | Gets/Sets the style of fiducial mark present on the calibration plate (refer to the CogCalibCheckerboardFiducialConstants documentation in the VisionPro documentation).

- Parameters

  Name | Type | Description
  --- | --- | ---
  Is Trained | Boolean | Get if this corrector block is currently trained.
  Computation Mode | Cognex.VisionPro.CalibFix.CogCalibFixComputationModeConstants | Gets/Sets the modes for computing calibration and fixturing transformations (refer to the CogCalibFixComputationModeConstants documentation in the VisionPro documentation).
  DOFs to Compute | Cognex.VisionPro.CalibFix.CogCalibCheckerboardDOFConstants | This enumeration specifies which degrees of freedom will be allowed when computing the best-fit linear transformation between the uncalibrated points and the raw calibrated points. It is used only when the ComputationMode is linear.
  PlateHandednessFlipped | Boolean | Specifies the handedness of the calibrated space. False: the calibrated space will have the same handedness as the raw (unadjusted) calibrated space. True: it will have the opposite handedness.

- Warping

  Name | Type | Description
  --- | --- | ---
  Use Destination Rectangle | Boolean | Get/set a boolean indicating if the "DestinationRectangle" properties will be used during training. The destination rectangle specifies which pixels will be present in the corrected image. The "DestinationRectangle" properties are in '.' space. See the VisionPro CogCalibCheckerboardTool.Calibration.OwnedWarpParams.WarpDestinationRectangle property. If UseDestinationRectangle is false (or not connected), all of the pixels in the corrected image will be output. Changes to this or any of the "DestinationRectangle" properties will cause this corrector to become untrained.
  Destination Rectangle X | Double | Get/set the X origin of the destination rectangle. See the UseDestinationRectangle property.
  Destination Rectangle Y | Double | Get/set the Y origin of the destination rectangle. See the UseDestinationRectangle property.
  Destination Rectangle Width | Double | Get/set the width of the destination rectangle. See the UseDestinationRectangle property.
  Destination Rectangle Height | Double | Get/set the height of the destination rectangle. See the UseDestinationRectangle property.
  Corrected Pixel Scaling | Double | Get/set an additional scaling factor to be applied during correction. See the VisionPro CogCalibCheckerboardTool.Calibration.OwnedWarpParams.WarpScaling property. If this property is changed, this corrector will become untrained.
  Max Error In Pixels | Double | Get/set the maximum error allowed during image correction, measured in pixels of the training image. See the VisionPro CogCalibCheckerboardTool.Calibration.OwnedWarpParams.WarpMaxErrorInPixels property.

## Methods

Void Uncalibrate()

Untrains this image corrector. This function has no effect if the corrector is already untrained.