Geometric Matching

NI Vision Assistant

Geometric Matching

Performs template matching on grayscale images using Geometric Matching. Refer to the NI Vision Template Editor Help for information about the NI Vision Template Editor controls.

Main Tab

The following controls are available on the Main tab.

  • Step Name—Name to give the step.
  • Reposition Region of Interest—When enabled, the step dynamically repositions the region of interest based on a coordinate system you built in a previous step.
  • Reference Coordinate System—Coordinate system to which you want to link the region of interest.

Template Tab

The following controls are available on the Template tab.

  • Template Image—The image to use as the template.
  • Template Size
    • Width—Width of the template in pixels.
    • Height—Height of the template in pixels.
  • New Template—Launches the NI Vision Template Editor wizard, in which you can learn a template and save the result as a template image file.
  • Edit Template—Launches the NI Vision Template Editor wizard, in which you can modify a template and save the result as a template image file.
  • Load from File—Launches a dialog box in which you can browse to a template image file and specify that file as the search template.
    Note  When you load a template from file, the template can be any valid NI Vision template image file, such as a golden template. The Geometric Matching step prompts you to add geometric matching information to the file.
  • Template Path—Displays the location of the template image file.

Curve Settings Tab

The following controls are available on the Curve Settings tab.

  • Extraction Mode—Specifies how the algorithm identifies curves in the image.
    • Normal—Makes no assumptions about the uniformity of objects in the image or the image background.
    • Uniform Regions—Assumes that either the objects in the image or the image background consist of uniform pixel values. Use this mode to calculate the external curves of the objects with greater accuracy.
  • Edge Threshold—Specifies the minimum contrast an edge pixel must have to be considered part of a curve. This value can range from 0 to 255. The default value is 75.
  • Edge Filter Size—Specifies the kernel size to use for computing the edges in the image. The options are Normal and Fine. The default value is Normal.
  • Minimum Length—Specifies the length, in pixels, of the smallest curve you want to extract. The default value is 25.
  • Row Search Step Size—Specifies the distance, in the y direction, between the image rows that the algorithm inspects for curve seed points. Valid values range from 1 to 255. The default value is 15.
  • Column Search Step Size—Specifies the distance, in the x direction, between the image columns that the algorithm inspects for curve seed points. Valid values range from 1 to 255. The default value is 15.

Settings Tab

The following controls are available on the Settings tab.

  • Number of Matches to Find—Specifies the number of valid matches you expect the geometric matching function to return.
  • Minimum Score—Specifies the minimum score an instance of the template can have to be considered a valid match. This value can range from 0 to 1000, where a score of 1000 indicates a perfect match.
  • Subpixel Accuracy—When enabled, returns the match with subpixel accuracy.
  • Search for matches that are—Defines the match modes and ranges used to match the template.
    • Rotated—When enabled, this function searches for the template image in the angle range you specify with the Range control. When disabled, this function searches for the image regardless of shifting along the x-axis and y-axis. You may specify a second angle range if needed.
    • Scaled—When enabled, this function searches for a template image that may be scaled in the inspection image. Specify the percentage of scale to search for with the Range control.
    • Occluded—When enabled, this function searches for a template image that may be occluded in the inspection image. Specify the amount of occlusion to search for with the Range control. The units for the Range control are the percentage of the template image that is occluded.

Results

Displays the following information after searching the image for the template:

  • X Position—X-coordinate of each object that matches the template.
  • Y Position—Y-coordinates of each object that matches the template.
  • Angle—Rotation angle of each object that matches the template at the current match location. Angles are expressed in degrees.
  • Scale—The change in scale, expressed as a percentage, of the object found in the image relative to the template.
  • Occlusion %—The amount of occlusion, expressed as a percentage of the template curves, for each object that matches the template.
  • Score—Score of each valid match. Score values can range from 0 to 1000, where a score of 1000 indicates a perfect match.
  • Template Target Curve Score—Specifies how closely the curves in the template match the curves in the match region of the inspection image. Score values can range from 0 to 1000, where a score of 1000 indicates that all template curves have a corresponding curve in the match region of the inspection image.
  • Correlation Score—Specifies how closely a match matches the template using a correlation metric that compares the two regions as a function of their pixel values.