Match Pattern Configuration

NI Vision Builder

Check for Presence Locate Features Tab

How to Match Patterns

Template Editor

  1. Draw a region of interest around an area of the image for which you want to search in your inspection images. This region becomes the pattern matching template.
  2. Click Next to accept the template.
  3. Specify any areas of the template you want to ignore during pattern matching.
  4. Click Finish to learn the template image.

When you specify a template, the step automatically tries to find the template in the image. Template matches appear inside red rectangles in the image. The green rectangle indicates the region of interest in which the step searches for matches.

Main Tab

  1. In the Step Name control, enter a descriptive name for the step.
  2. Choose one of the following methods to specify the region of interest for the step:
    • Create a new region of interest.
      1. Select Constant from the Region of Interest listbox.
      2. Select a tool from the menu toolbar that matches the type of region of interest you want to specify.
      3. Draw a region of interest on the image.
    • Select a previously defined region of interest from the Region of Interest listbox.
  3. Verify that the Reposition Region of Interest option 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.

Note  This step can find rotated instances of the template without the assistance of a Set Coordinate System step.

Template Tab

By default, the center of the template is used as the focal point of the template. You can change the location of the focal point to any position in the template.

  1. Change the focal point of the template by dragging the green pointer in the template image or adjusting the Match Offset values.

Settings Tab

  1. Set up the search conditions for finding the template.
    1. Select the number of matches you expect in the image.
    2. Specify whether a match can be a rotated version of the template. You can restrict the amount of rotation you want to allow by specifying an acceptable angle range. You can also include the mirrored angle range by enabling the Mirror Angle control.
    3. Set the minimum score that a match must have to be valid. Refer to the Matches table in the Limits tab to determine this score. The table lists matches whose score is above the minimum score and the first match whose score is below the minimum score. You can use this table to choose a Minimum Score value that finds the number of matches you request but excludes unwanted matches.
    4. Adjust the Search Level control to choose the appropriate search strategy for your application. If the template is very distinctive and different from the rest of the image, choose a more coarse strategy. This is the fastest but least thorough search level. As the template information becomes less distinctive and more similar to the background, use a more thorough search level.

Limits Tab

  1. Set the minimum and/or maximum number of matches you expect to find.