LearnGeometricPattern Method

NI Vision for Visual Basic

LearnGeometricPattern Method

Syntax

CWIMAQVision.LearnGeometricPattern Template, Options [, MaskImage]

Return Type

Long

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

Purpose

Creates a description of the template image you are going to look for during the matching stage. This description data is appended to the input template image. During the matching step, the description data is extracted from the template image and used to search for the template image in the match image.

Remarks

Use this method with U8 images.

Parameters

Template As CWIMAQImage

The template image that you want to search for in the match image. The method appends geometric matching information to this image.

Options As CWIMAQLearnGeometricPatternOptions

The parameters the method uses for learning.

MaskImage As Variant

[Optional] An image, which is the same size as the template, that specifies where to search for edges in the template. Use the following values for the pixels of the mask image:

  • 0—The corresponding pixel in the template image is considered an edge only if it meets the conditions specified by CWIMAQLearnGeometricPatternOptions.CurveOptions. This value is the default.
  • 1—The corresponding pixel in the template image is never considered an edge.
  • 2—The corresponding pixel in the template image is always considered an edge.
  • 4—The corresponding pixel in the template image is not used for computing the correlation score.
  • See Also

    MatchGeometricPattern

    CWIMAQLearnGeometricPatternOptions