imaqLearnGoldenTemplate

NI Vision for LabWindows/CVI Function

imaqLearnGoldenTemplate

Usage

int imaqLearnGoldenTemplate(Image* goldenTemplate, PointFloat originOffset, const Image* mask);

Purpose

Prepares an image for use in imaqCompareGoldenTemplate().

Image Types Supported

IMAQ_IMAGE_U8

Parameters

Name

Type

Description

goldenTemplate Image* The golden template to learn for inspection.
originOffset PointFloat Specifies the number of pixels the function shifts the origin of the template from the center of the template image. Set this parameter to IMAQ_NO_OFFSET to use the center of the template image as the origin of the template.
mask const Image* An optional, 8-bit image of the same size as the template that specifies what regions and edges to ignore in the template.

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

mask—Use one or more of the following pixel values when constructing the mask:

0–Maintains the default behavior.

1–The corresponding pixel in the template image should always be ignored.

2–The corresponding pixel in the template image is an edge and should be dilated according to the edgeThicknessToIgnore element of the options parameter of imaqCompareGoldenTemplate().