LearnGoldenTemplate Method

NI Vision for Visual Basic

LearnGoldenTemplate Method

Syntax

CWIMAQVision.LearnGoldenTemplate Template [, Offset] [, MaskImage]

Return Type

Long

On success, this method returns 0. On failure, this method returns a negative number.

Purpose

Creates a description of the golden template image you are going to compare against during the inspection stage. This description data is appended to the input template image.

Remarks

Use this method with U8 images.

Parameters

Template As CWIMAQImage

The golden template image that you want to compare against during inspection.The method appends inspection information to this image.

Offset As Variant

[Optional] A CWIMAQPoint that specifies the number of pixels the method shifts the origin of the template from the center of the template image.

MaskImage As Variant

[Optional] Learn Mask is an optional, 8-bit image of the same size as the template that specifies what regions and edges to ignore in the template. Use 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 property of CWIMAQInspectionOptions.

See Also

CWIMAQVision.CompareGoldenTemplate