Pattern Matching

This tool is not supported on A and B revision Gocator 2100 and 2300 sensors that are not accelerated (either by a PC-based application or by GoMax). The tool is supported in emulator scenarios.

As of 6.1 SR1, LMI has made improvements to the Surface Pattern Matching tool. However, in order to benefit from these improvements, you must create a new model in the tool using the 6.1 SR1 firmware.

The Surface Pattern Matching tool locates parts and features by comparing 2D contours (on the XY plane) found in scan data to pattern models you have defined; note that the tool does not use height data in its algorithms. Models represent contour-based “golden parts” or “golden features.” (Models can be modified in the provided standalone model editor; for more information, see Pattern Editor.) For comparing full parts in 3D, use the Mesh Template Matching tool instead (see Template Matching); the Mesh Template Matching tool is only supported by G2 sensors.

The tool can process multiple occurrences of a part or feature in a frame of scan data. For each matching part or feature (called an instance), the tool returns an X and Y position and a rotation, which can be used to anchor other measurements. The tool also returns a point and a line geometric feature for each instance, which you can use in conjunction with Surface Transform tools to shift and rotate scan data to reliably position the target; this can be used as an improved way of performing the part matching that is available on the Model page. Finally, the tool returns a match quality that you can use as a general conformity measure for matching instances (for example, checking for dents in a target), as well as a count of located instances.

In order to create a template for a feature on a target, you typically need to enable the Use Region checkbox to limit the tool to the contours related to that feature. After that, when running the tool to find instances of the feature, you should either modify the region to limit it to areas of the target that might contain the feature you are looking for or disable Use Region so that the tool can locate instances of the feature in all of the scan data. You can also use the Use Region parameter when creating a template to limit it to a unique portion of an outer edge of a target.

Measurement Panel

For information on adding, managing, and removing tools and measurements, as well as detailed descriptions of settings common to most tools, see Tools Panel.

Note that when you use the geometric features with a Surface Transform tool to transform the scan data from frame to frame, you can often avoid the need to anchor other measurements, because the transforms ensure that any features you are interested are always in the same location. This can save considerable setup time and reduce the complexity of an application. For example, in the following frames of scan data, in which a PCB shifts from frame to frame, a Surface Pattern Matching tool successfully locates the entire PCB using its outer contours and the contours of various components on the PCB, as indicated by a dark blue outline. Note the “missing” data in the second and fourth frames, on the lower right and left edges, respectively: the tool still locates the PCB, despite the occlusions.

Four frames of scan data. Dark blue outline represents the matching template. The first frame was used to create the template.

When the tool’s Point and Line geometric features are passed to a Surface Transform tool, the transformed scan data ensures that, for example, the set of seven mid-sized capacitors above the main IC are always in the same location and orientation.

Transformed scan data of the four frames.

Other measurement tools can then be placed over the capacitors, without needing to anchor them. In the following image (the fourth frame, which was significantly shifted and rotated), a Surface Filter tool isolates the capacitors based on height. Subsequent tools can perform measurements on the isolated data to verify that all capacitors are present, are seated properly, and so on.

By adding multiple Surface Pattern Matching tools to a job and defining different templates for each, you can match multiple types of features or parts, for example, matching different parts moving on a conveyor.

Two copies of the Surface Pattern Matching tool matching parts using two different templates (one for the sockets, another for the capacitors). If used in conjunction with Part Detection, each part would be in an individual frame, matching templates as necessary.

Or you can match different types of features on a single target:

Rectangular surface mount components (two orientations) matching one template. Circular capacitors matching another template (matched orientations are arbitrary, because a circular contour is matched). In this case, intensity was used for template creation and matching.

Creating a Template

To create a template:

1. Scan a part that is typical (no damage, all features are present, etc.).
2. If you need to perform pattern matching on a feature on the part, enable Use Region and position the region over the feature.
3. In the Operation drop-down, choose Create.

The tool creates a model and saves it either to the PC (if the sensor is accelerated, to C:\GoTools\SurfacePatternMatching) or to the sensor.

After creating a template, configure the tool's parameters (see below) for use during production runs.

Measurements, Features, and Settings

Measurements
Measurement

Instance Count

Returns the number of parts or features matching the loaded template up to the value set in the Instance Count parameter.

X {n}

Y {n}

The X and Y position of the center of matched instance {n}.

Z Angle {n}

The angle of matched instance {n} relative to the sensor’s coordinate system.

Scale {n}

The scale of matched object {n} relative to the loaded template.

Match Quality {n}

Percentage of matched model contours for the selected object instance. Match quality ranges from 0 to 100, with 100 being the best quality. A value of 100 means 100% of the model contours were successfully matched to the actual contours detected in the scan data. Use the Minimum Match Quality parameter to set the minimum acceptable value.

Features
Type Description

Point

A point representing the center of the region used when creating a template and the template’s default reference point. (Note that the reference point of a template can be changed in the model editor.)

Line

A line parallel to the X axis passing through the Point feature.

For more information on geometric features, see Geometric Features.

Parameters
Parameter Description

Source

The sensor, or combination of sensors, that provides data for the tool's measurements. For more information, see Source.

Use Region

Determines whether the tool uses a user-defined region to search for matching instances, or, when first creating a template, whether the tool limits establishing template contours to the data in the ROI.

Use Intensity

Determines whether the tool uses intensity instead of heightmap data to locate instances or create templates.

Instance Count

The maximum number of instances the tool will locate.

Nominal Scale Enabled

If enabled, displays the Nominal Scale setting and the tool uses the user-defined nominal scale. Otherwise, the tool displays Minimum Scale and Maximum Scale settings and uses the user-defined range. (See below.)

Nominal Scale

The scale factor the tool requires to recognize an instance.

Displayed when Nominal Scale Enabled is enabled.

Minimum Scale

Maximum Scale

The maximum and minimum scale factors allowed for the tool to recognize an instance, respectively.

Displayed when Nominal Scale Enabled is disabled.

Nominal Angle Enabled

If enabled, displays the Nominal Angle setting and the tool uses the user-defined nominal angle. Otherwise, the tool displays Minimum Angle and Maximum Angle settings and uses the user-defined range. (See below.)

Nominal Angle

The angle the tool requires to recognize an instance.

Displayed when Nominal Angle Enabled is enabled.

Minimum Angle

Maximum Angle

The maximum and minimum angles allowed for the tool to recognize an instance, respectively.

Displayed when Nominal Angle Enabled is disabled.

Minimum Match Quality

Minimum percentage of template contours that must match in the scan data for the tool to consider the object instance as valid.

Show Details

Chooses what information the tool displays over the scan data. One of the following:

  • Center only: Displays the location of the center of instances and the orientation of the instance.

  • Center and All Edges: Displays center-related information (see above) and the edges of the instance that match the contours of the loaded template, as well as the edges of the instance that don't match the template.

  • Center and Matched Edges: Displays center-related information (see above) and the edges of the instance that match the contours of the loaded template.

File

A drop-down containing the currently available templates.

Operation

The operation to perform on the currently selected template in the File drop-down. One of the following:

Normal: The default value after having performed another operation.

Create: Creates a new template based on the current frame of scan data. Limited to the region if Use Region is enabled.

Load: Loads the currently selected template.

Save: Saves contour data to the currently selected template, overwriting its contour data.

Delete: Deletes the currently selected template.

Refresh: Refreshes the list of templates. This is useful if you have renamed a template (using the Pattern Editor or manually in the client PC's file system).

Advanced

Displays the following additional advanced parameters.

Recognition Level

The "effort" the tool will expend on recognizing an instance in scan data. Ranges from Fast to Accurate (that is, there is a trade-off between accuracy and speed). Only used during pattern matching (and not during pattern template creation).

Positioning Level

How accurately the tool determines the position of the instance. Ranges from Fast to Accurate. Only used during pattern matching (and not during pattern template creation).

Add Border

Considers a drop to NULL, outside the region, as an edge. Use this when performing part detection or when there is no data around the part. If there is nothing in the region, then there will be nothing in the template either.

Match Tolerance Mode

The tolerance the tool uses when attempting to match contours in the scan data to the loaded template; this is the maximum distance between the contours in the template and in the scan data. Either Pattern-based (a looser tolerance, the default), Resolution-based (a tighter tolerance), or Manual. Typically, the Pattern-based option should produce a better match quality. However, if you are getting too many false matches, try setting the mode to Resolution-based or set the value manually. The tolerances calculated from the pattern-based and resolution-based modes are displayed in the mode drop-down.

Note that the resolution-based mode results in a much tighter tolerance with high resolution scan data.

Filters

The filters that are applied to measurement values before they are output. For more information, see Filters.

Decision

The Max and Min settings define the range that determines whether the measurement tool sends a pass or fail decision to the output. For more information, see Decisions.

Anchoring
Anchor Description

X, Y, or Z

Lets you choose the X, Y, or Z measurement of another tool to use as a positional anchor for this tool.

Z angle

Lets you choose the Z Angle measurement of another tool to use as an angle anchor for this tool.

A measurement must be enabled in the other tool for it to be available as an anchor. The anchor measurement should also be properly configured before using it as an anchor.

For more information on anchoring, see Measurement Anchoring.