imaqLearnCalibrationGrid

NI Vision for LabWindows/CVI Function

imaqLearnCalibrationGrid

Usage

int imaqLearnCalibrationGrid(Image* image, const ROI* roi, const LearnCalibrationOptions* options, const GridDescriptor* grid, const CoordinateSystem* system, const RangeFloat* range, float* quality);

Purpose

Learns a calibration from an image of a grid of circles. The function attaches calibration information to the grid image, which you can then use with imaqCopyCalibrationInfo2() to calibrate an uncalibrated image. Refer to Chapter 6, Calibrating Images, of the NI Vision for LabWindows/CVI User Manual. for more information about creating a grid image.

Image Types Supported

IMAQ_IMAGE_U8, IMAQ_IMAGE_I16

Parameters

Name

Type

Description

image Image* The template used for calibrating your system. It should be an image of a grid of circles.
roi const ROI* Determines the region of the image that the function uses in the learning process. The function ignores all the circles in the grid that are outside the defined region when estimating the calibration transformation. To learn the entire image, set this parameter to NULL.
options const LearnCalibrationOptions* Describes how the function learns the calibration information.
grid const GridDescriptor* Contains scaling constants for the grid image that the function uses to learn the calibration.
system const CoordinateSystem* Defines the coordinate system for real world coordinates.
range const RangeFloat* The range of the grayscale the function uses to represent the circles in the grid image.
quality float* On return, the quality score of the learning process, which is a value between 0-1000. A quality of 1000 means that the function learned the feature points perfectly with the chosen algorithm. It does not necessarily reflect the absolute accuracy of the estimated calibration mapping, but instead reflects how well the calibration mapping adapts to the learned grid. Set this parameter to NULL if you do not need this information.

Return Value

Type

Description

int On success, this function returns a non-zero value. On failure, this function returns 0. To get extended error information, call imaqGetLastError().

Parameter Discussion

options—Set options to NULL to use the default options, as follows:

mode IMAQ_PERSPECTIVE
method IMAQ_SCALE_TO_PRESERVE_AREA
roi IMAQ_USER_ROI
learnMap FALSE
learnTable FALSE

grid—Set grid to NULL to use the following default scaling constants:

xStep 1
yStep 1
unit IMAQ_UNDEFINED

system—Set system to NULL to use the following default coordinate system:

origin {0, 0}
angle 0
axisOrientation IMAQ_INDIRECT

range—Set the range parameter to NULL to use the default range, as follows:

minValue 0
maxValue 180