Table Of Contents

Match Pattern (G Dataflow)

Last Modified: October 26, 2017

Searches for a pattern, or template image, in an inspection image.

Run the Learn Pattern node before this node to configure the template image for the matching phase.

connector_pane_image
datatype_icon

algorithm

Pattern matching algorithm used to learn the template information.

Selecting All learns the template using all of the algorithms.

Name Value Description
All 0

Uses all of the algorithms, one after the other.

Low Discrepancy Sampling 1

Uses a low discrepancy sampling algorithm. This algorithm extracts the most significant information to represent an image. If your template contains large regions of similar grayscale information, a wide aspect ratio, or is very small, use one of the pyramidal matching algorithms instead.

Grayscale Value Pyramid 2

Uses a grayscale value pyramid algorithm. This algorithm uses normalized gray values as features, and is useful when the template does not contain structured information, but has intricate textures for dense edges.

Gradients Pyramid 3

Uses a gradient pyramid algorithm. This algorithm uses filtered edge pixels as features. This algorithm is more resistant to occlusion and intensity changes compared to the grayscale value pyramid, and is often being faster because of a smaller amount of data. However, the strength and reliability of edges reduces at very low resolutions this method requires the user to sometimes work at higher resolutions compared to the gray value method.

datatype_icon

image in

Reference to the inspection image in which you want to search for the template image.

datatype_icon

template image

Reference to the template for which you want to search during the matching phase.

The template image is an output of the Learn Pattern node.

datatype_icon

ROI descriptor

Region of the inspection image in which to perform pattern matching.

This region must be a single rectangle or rotated rectangle contour. By default, the node uses the entire inspection image for matching.

datatype_icon

Global Rectangle

Coordinates of the bounding rectangle.

datatype_icon

Contours

Individual shapes that define an ROI.

datatype_icon

ID

Object specifying if contour is the external or internal edge of an ROI.

datatype_icon

Type

Shape type of the contour.

datatype_icon

Coordinates

Relative position of the contour.

datatype_icon

parameters

Parameters used to control the matching process.

datatype_icon

number of matches requested

Number of valid matches expected.

datatype_icon

minimum match score

Smallest score a match can have to be considered valid.

The data range for a match is between 0 and 1000.

datatype_icon

Angle Ranges

Array of angle ranges, where each range specifies how much to rotate the template in the inspection image.

datatype_icon

Start Angle

Starting angle of the template.

datatype_icon

End Angle

Ending angle of the template.

datatype_icon

error in

Error conditions that occur before this node runs.

The node responds to this input according to standard error behavior.

Standard Error Behavior

Many nodes provide an error in input and an error out output so that the node can respond to and communicate errors that occur while code is running. The value of error in specifies whether an error occurred before the node runs. Most nodes respond to values of error in in a standard, predictable way.

error in does not contain an error error in contains an error
If no error occurred before the node runs, the node begins execution normally.

If no error occurs while the node runs, it returns no error. If an error does occur while the node runs, it returns that error information as error out.

If an error occurred before the node runs, the node does not execute. Instead, it returns the error in value as error out.

Default: No error

datatype_icon

advanced options

Algorithm-related options to use during the learning phase.

datatype_icon

Item

Option to use during the matching phase.

Name Value Description
LD Sampling - Minimum Contrast 0

Specifies the minimum expected difference between the maximum pixel value and the minimum pixel value in the inspection image.

LD Sampling - Enable Subpixel Accuracy 1

Determines whether to return the match results with subpixel accuracy. Set this option to 1 to enable subpixel accuracy. The default value is 0, which disables subpixel accuracy.

LD Sampling - Search Strategy 2

Specifies the aggressiveness of the search strategy available during the matching phase. Three types of search strategies are available. The default is 2.

  1. Conservative—Extracts template information for conservative matching only.
  2. Balanced—Extracts template information for balanced and conservative matching.
  3. Aggressive—Extracts template information for aggressive, balanced, and conservative matching.
LD Sampling - Subpixel Iterations 3

Specifies the maximum number of incremental improvements used to refine matches using subpixel information. The minimum value for this option is 20.

LD Sampling - Subpixel Tolerance 4

Specifies the maximum amount of change, in pixels, between consecutive incremental improvements in the match position before the node stops refining the match position. The default value is 0, which specifies that the node should always use a number of refinements equal to Subpixel Iterations. If you provide values for both Subpixel Iterations and Subpixel Tolerence, the node refines the match for, at most, Subpixel Iterations but may stop early if Subpixel Tolerence is satisfied.

LD Sampling - Initial Match List Length 5

Specifies the maximum size of the match list. The match list contains the regions in the inspection image that have the highest probability of containing a match. The minimum value for this option is 5. The default value is 200.

LD Sampling - Match List Reduction Factor 6

Specifies the reduction of the match list as matches are refined. The default is 5.

LD Sampling - Initial Step Size 7

Specifies the number of template pixels that you want to include in a sample for the initial phase of matching. The default is 0, which allows the algorithm to compute the Initial Sample Size. For optimal speed, the node coerces sizes that are less than 240 to an integer multiple of 12 and coerces sizes greater than 240 to an integer multiple of 60.

LD Sampling - Intermediate Angular Accuracy 8

Sets the angle accuracy, in degrees, to use during the final phase of the matching. The default is 1 degree. Use subpixel accuracy to achieve angle accuracy less than the default. This value must be no greater than the value for Initial Angular Accuracy. The node coerces the angle to the largest integer smaller than it that evenly divides 360. This option is not used in conjunction with the aggressive search strategy.

Pyramid - Max Pyramid Level 100

Specifies the pyramid level at which the coarse-to-fine matching begins. The higher this value the faster the matching will be. Thus, setting this to 0 will lead to a very large match time. All values higher than the maximum allowed pyramid level, or automatically computed during learning the template, are coerced to the maximum allowed level. The default value is set to the optimal pyramid level, or automatically computed during learning the template. Note that setting this value lower than the Max Pyramid Level to Store Data, used in learning the template, is not allowed, as the required data for coarse matching will be missing. The Get Template Information node can be used to obtain the various pyramid levels used while learning the template and this parameter can then be set accordingly.

Pyramid - Minimum Contrast 102

Specifies the minimum contrast to consider the image region for matching. Any image region lower than minimum contrast will be skipped for matching, which improves performance.

Pyramid - Enable Subpixel Accuracy 103

Determines whether to return the match results with subpixel accuracy. Set this option to 1 to enable subpixel accuracy. The default value is 0, which disables subpixel accuracy.

Pyramid - Subpixel Iterations 104

Specifies the maximum number of incremental improvements used to refine matches using subpixel information. The minimum value for this option is 20.

Pyramid - Subpixel Tolerance 105

Specifies the maximum amount of change, in pixels, between consecutive incremental improvements in the match position before the node stops refining the match position. The default value is 0, which specifies that the node should always use a number of refinements equal to Subpixel Iterations. If you provide values for both Subpixel Iterations and Subpixel Tolerance, the node refines the match for, at most, Subpixel Iterations but may stop early if Subpixel Tolerance is satisfied.

Pyramid - Initial Match List Length 106

Specifies the maximum size of the match list. The match list contains the regions in the inspection image that have the highest probability of containing a match. The minimum value for this option is 5. The default value is 200 for shift matching, and 300 for rotation matching.

Pyramid - Match List Reduction Factor 107

Specifies the reduction of the match list as matches are refined. The default value is 1, which results in no reduction.

Pyramid - Intermediate Angular Accuracy 108

Specifies the angular accuracy used for initial coarse matching when rotation is present. The default value is 6 degrees. Setting this value too high creates the risk of losing out matches.

Pyramid - Process Border Matches 109

Specifies whether to search for partial (border matches) or not. Note that the border could either be the image border or the border of the supplied ROI region. Turning this parameter on increases the match time, especially for larger templates. The default value is TRUE.

Pyramid - Min Match Separation Distance 111

Specifies the minimum separation distance, in pixels, between the origins of two matches that have unique positions. The node does not return matches that have the same position and angle. The default value is 20.

Pyramid - Min Match Separation Angle 112

Specifies the minimum angular difference, in degrees, between two matches that have unique angles. The node does not return matches that have the same position, scale, and angle. The default value is 10.

Pyramid - Max Match Overlap 113

Specifies the maximum amount of overlap, expressed as a percentage, allowed between the bounding rectangles of two matches. The default value is 20.

Pyramid -Max Cache in MB 114

Specifies the maximum cache size to use while matching for rotation. The cache is used to control the size of the template data in memory while matching. Cases where successive search images are expected to have matches which are either at same angle or at angles belonging to a small set of recurring values will see maximum cache utilization and speed-ups. The default value is 5 Megabytes.

Pyramid - Clear Cache 115

Specifies whether or not to flush the cache after every match. Turning this ON will take away the caching benefits seen for successive match images having matches at the same angle or at recurring angles. The default value is OFF.

Enable Defect Map 200

Specifies whether or not to calculate the defect map between the template and match image. The default value is OFF.

datatype_icon

Value

Value of the option you want to use during the learning phase.

datatype_icon

image out

Reference to the source image.

datatype_icon

matches (pixel)

Array of match clusters, in pixel coordinates.

datatype_icon

Position

Point-coordinate cluster corresponding to the center of the template.

datatype_icon

Angle

Rotation angle of the template in the source image at the current match location.

datatype_icon

Scale

Change in percentage size of the matched template from the original template.

This parameter is not used for pattern matching and is always set to 1.

datatype_icon

Score

Match results ranked on a scale of 0 to 1000, where 0 equals no match and 1000 equals a perfect match.

datatype_icon

Bounding Box

Array of points that define the boundary of the template pattern in the image.

Connect this array directly to the Overlay Multiple Lines node to overlay the location of a match on the image.

datatype_icon

matches (real-world)

Array of match clusters, in real-world coordinates.

datatype_icon

Position

Point-coordinate cluster corresponding to the center of the template.

datatype_icon

Angle

Rotation angle of the template in the source image at the current match location.

datatype_icon

Scale

Change in percentage size of the matched template from the original template.

This parameter is not used for pattern matching and is always set to 1.

datatype_icon

Score

Match results ranked on a scale of 0 to 1000, where 0 equals no match and 1000 equals a perfect match.

datatype_icon

Bounding Box

Array of points that define the boundary of the template pattern in the image.

Connect this array directly to the Overlay Multiple Lines node to overlay the location of a match on the image.

datatype_icon

number of matches

Number of template matches found in the inspection image based on the input settings.

datatype_icon

error out

Error information.

The node produces this output according to standard error behavior.

Standard Error Behavior

Many nodes provide an error in input and an error out output so that the node can respond to and communicate errors that occur while code is running. The value of error in specifies whether an error occurred before the node runs. Most nodes respond to values of error in in a standard, predictable way.

error in does not contain an error error in contains an error
If no error occurred before the node runs, the node begins execution normally.

If no error occurs while the node runs, it returns no error. If an error does occur while the node runs, it returns that error information as error out.

If an error occurred before the node runs, the node does not execute. Instead, it returns the error in value as error out.

Where This Node Can Run:

Desktop OS: Windows

FPGA: Not supported

Web Server: Not supported in VIs that run in a web application


Recently Viewed Topics