Search for Defects Using Golden Template Comparison

NI Vision Assistant

Search for Defects Using Golden Template Comparison

Main Tab

  1. In the Step Name control, enter a descriptive name for the step.
  2. Define the golden template to compare to the inspection image using one of the following methods:
    • To create a new golden template, complete the following steps:
      1. Click New Template to launch the NI Vision Template editor.
      2. Complete the steps in the NI Vision Template Editor to create a golden template. Refer to the NI Vision Template Editor Help for specific instructions about how to define a golden template.
      3. Click Finish to validate the new template.
      4. In the Save Template As dialog box, browse to the location where you want to save the template file, enter a File Name, and click OK.
    • To use an existing image as the golden template, complete the following steps:
      1. Click Load from File.
      2. Browse to the image you want to use as the golden template.
      3. Click Open.

      If the image you selected is not a valid golden template file, complete the following steps to create a golden template based on the image you selected:

      1. Click Yes to launch the NI Vision Template Editor.
      2. Adjust the Edge Threshold value until only the edges you want to exclude during the golden template comparison remain.
      3. Click OK.
      4. In the Save Template As dialog box, browse to the location where you want to save the template file, enter a File Name, and click OK.
Tip  Click Edit Template to launch the NI Vision Template Editor and modify the currently selected golden template.

Alignment Tab

  1. If necessary, adjust the position of the region of interest to correspond with the area of the image you want to search for defects.

    For rough alignment of the region of interest within the inspection image, use the mouse to adjust the center of the position of the region of interest. For fine adjustments in the position of the region of interest, use the arrow keys or the Center X, Center Y, and Angle controls. The size of the region of interest cannot be adjusted because the size of the region of interest is based on the size of the specified golden template.

  2. Verify that the Reposition Region of Interest checkbox is enabled if you want to link the region of interest specified in this step to a previously defined coordinate system.

    Link the region of interest to a coordinate system if the position of the object under inspection changes from image to image, and you need to adjust the position of the region of interest to match the new location of the object.

  3. Specify a Scale value to apply to the golden template if the area in the image you want to compare to the golden template is larger or smaller than the golden template image.
  4. Select the type of Alignment Correction you want to use to when the golden template is applied to the image.

Settings Tab

  1. Specify the type of defects to detect using the Look For control.
  2. Use the Intensity, Ignore Edges, and Edge Thickness controls to adjust for variations in lighting and minor differences along the edges of the image that you want to ignore.
  3. Use the Threshold Defect Image, Bright Level, and Dark Level controls to set the threshold limits for defects in the image.
  4. Click OK to save this step to the script.
Tip  Use the Display button to show only the defects in the image or show the defects as an overlay on the original image. The green defects represent pixels in the inspection image that are brighter than the corresponding pixels in the golden template image. The red defects represent pixels in the inspection image that are darker than the corresponding pixels in the golden template image.