CompareGoldenTemplate Method

NI Vision for Visual Basic

CompareGoldenTemplate Method

Syntax

CWIMAQVision.CompareGoldenTemplate InspectionImage, Template, Alignment [, Options ] [, BrightDefects] [, DarkDefects]

Return Type

Long

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

Purpose

Compares a template image to an inspection image at a specified alignment.

Remarks

Use one of the following methods of configuring the template image you want to use with this method:

  1. Load a previously saved template image that you created using the NI Vision Template Editor using CWIMAQVision.ReadImageAndVisionInfo.
  2. Note  To use the NI Vision Template Editor to configure a template image, click Start»All Programs»National Instruments»Vision»Template Editor.

  3. Use the LearnGoldenTemplate method to learn the golden template image.
  4. Use this method with U8 images.

    Parameters

    InspectionImage As CWIMAQImage

    The image to inspect.

    Template As CWIMAQImage

    The golden template to compare against the inspection image.

    Alignment As CWIMAQInspectionAlignment

    The location within the inspection image where the template image is located.

    Options As CWIMAQInspectionOptions

    [Optional] A CWIMAQInspectionOptions object that specifies the options to use for comparison.

    BrightDefects As Variant

    [Optional] A reference to the destination Image for bright defects, or both kinds of defects if the same image is also passed to DarkDefects.

    DarkDefects As Variant

    [Optional] A reference to the destination Image for dark defects.

    See Also

    CWIMAQVision.LearnGoldenTemplate