Patterns

Each of the following functions references a Patterns data structure as the first parameter. Index (zero-based) determines which pattern is being indexed from the structure. For more information, see Pattern Match.

Function Description

GetAngle(Patterns, [Index])

Returns the angle value. This function works with the following functions: FindPatMaxRedLineColor, FindPatMaxRedLine, FindPatMaxPatterns, FindPatterns and SortPatterns.

GetClutter(Patterns, [Index])

Returns the clutter score. Clutter is features that are found that are not part of the trained pattern.

This function works with the following functions: FindPatMaxRedLineColor, FindPatMaxRedLine, and FindPatMaxPatterns.

GetCol(Patterns, [Index])

Returns the column value. This function works with the following functions: FindPatMaxRedLineColor, FindPatMaxRedLine, FindPatMaxPatterns, FindPatterns and SortPatterns.

GetColorScore(Patterns, [Index])

Returns the color score value (0 - 100). This function works only with the FindPatMaxRedLineColor function.

Note:

When the referenced TrainPatMaxRedLineColor's Match Colors parameter is set to No Matching, the GetColorScore function returns 100.000.

Match Colors Parameter Selection Behavior
0 = All Colors (default) Returns the computed score, assuming that the tool found a feature match.
1 = Selected Colors
2 = No Matching Returns 100.000 (the tool does not compute the color match score).

GetContrast(Patterns, [Index])

Returns the contrast value. This function works with the following functions: FindPatMaxRedLineColor, FindPatMaxRedLine, and FindPatMaxPatterns.

  • The contrast value for FindPatMaxRedLineColor and FindPatMaxRedLine are the relative measure of contrast change between features in the trained pattern versus match features in search image, in percentage. Therefore, if feature contrast is similar or high to pattern contrast, reported Contrast will be ~100. If the pattern contrast exceeds the feature contrast, the reported Contrast will be <100.
  • FindPatMaxPatterns contrast is the absolute image contrast of the search ROI, in greyscale level.

GetCoverage(Patterns, [Index])

Returns the coverage percentage. This function works with the following functions: FindPatMaxRedLineColor, FindPatMaxRedLine, and FindPatMaxPatterns.

GetErrorCode(Patterns, [Index])

Returns the error code for a pattern. This function works with the Pattern Match functions (TrainPatMaxRedLineColor, FindPatMaxRedLineColor, TrainPatMaxRedLine, FindPatMaxRedLine, TrainPatMaxPattern, FindPatMaxPatterns, FindPatterns and SortPatterns).

ClosedSee error codes and corresponding information strings

 

Error Code Corresponding Information String

00000008

Operation timeout was exceeded.

PatMax

Error Code Corresponding Information String

07010000

Pattern may contain too few match features.

07010001

Difficult to automatically set feature granularity; manually set Granularity.

07010100

Pattern may be less accurate than expected because the training image appears blurry.

07010102

The pattern results may be unstable because the coarse features have the same direction.

07010200

Execution time may increase because of numerous fine features; manually set Granularity.

07010101

Pattern may contain insufficient information to measure Angle or Scale reliably.

07020300 Result(s) discarded due to low contrast.
07020301 Result(s) discarded due to proximity to more accurate results.
07020302 Result(s) discarded due to excess clutter.
07020303 Trained pattern contains too few features for current parameter settings.

07030000

No error information.

PatMax RedLine (both Greyscale and Color)

Error Code Corresponding Information String

07020306

Greyscale input image not supported.

07020307

No match color trained.

07010100

The size of the referenced Color match mask image does not match the size of the input region.

07020308

Cannot train the input image.

07020309

Execution time may increase because of numerous fine features; manually set Granularity.

07020310 Cannot train a color pattern

GetFitError(Patterns, [Index])

Returns the fit error score. This function works only with the FindPatMaxPatterns function.

GetGranCoarse(Patterns)

Returns the coarse granularity value. This function works with the following functions: TrainPatMaxRedLineColor, TrainPatMaxRedLine, and TrainPatMaxPattern.

GetGranFine(Patterns)

Returns the fine granularity value. This function works with the following functions: TrainPatMaxRedLineColor, TrainPatMaxRedLine, and TrainPatMaxPattern.

GetInfoCode(Patterns, [Index])

Returns a diagnostic code for information strings. This function works with the following functions: TrainPatMaxPattern and FindPatMaxPatterns.

ClosedSee diagnostic codes and corresponding information strings

Note: The tool uses the GetInfoString function to insert information strings are inserted into the spreadsheet.

TrainPatMaxPattern

Diagnostic Code Corresponding Information String

07010000

Pattern may contain too few match features.

07010001

Difficult to automatically set feature granularity; manually set Granularity.

07010100

Pattern may be less accurate than expected because the training image appears blurry.

07010102

The pattern results may be unstable because the coarse features have the same direction.

07010200

Execution time may increase because of numerous fine features; manually set Granularity.

07010101

Pattern may contain insufficient information to measure Angle or Scale reliably.

07030000

No error information.

 

FindPatMaxPatterns

Diagnostic Code Corresponding Information String

07020300

[Value] result(s) discarded due to low contrast.

07020301

[Value] result(s) discarded due proximity to more accurate results.

07020302

[Value] result(s) discarded due to excess clutter.

07020303

Trained pattern contains too few features for current parameter settings.

GetInfoString(Patterns, [Index])

Returns the information string. This function works with the following functions: TrainPatMaxPattern and FindPatMaxPatterns.

GetNFound(Patterns)

Returns the number of pattern matches found. This function works with the following functions: FindPatMaxRedLineColor, FindPatMaxRedLine, FindPatMaxPatterns, FindPatterns and SortPatterns.

GetOutsideArea(Patterns, [Index])

Returns the proportion (on a scale of 0 to 1, where 0 equals completely within and 1 equals 100% outside) of the matching pattern's area found outside the search region. This function works only with the FindPatMaxPatterns function.

GetOutsideFeatures(Patterns, [Index])

Returns the proportion (on a scale of 0 to 1, where 0 equals completely within and 1 equals 100% outside) of the matching pattern's features found outside the search region. This function works only with the FindPatMaxPatterns function.

GetRow(Patterns, [Index])

Returns the row value. This function works with the following functions: FindPatMaxRedLineColor, FindPatMaxRedLine, FindPatMaxPatterns, FindPatterns and SortPatterns.

GetScale(Patterns, [Index])

Returns the size of the match (compared to the trained pattern) as a percentage. This function works with the following functions: FindPatMaxRedLineColor, FindPatMaxRedLine, FindPatMaxPatterns, FindPatterns and SortPatterns.

GetScaleX(Patterns, [Index])

Returns the size of the match in the X-direction (compared to the trained pattern) as a percentage. This function works only with the FindPatMaxPatterns function.

GetScaleY(Patterns, [Index])

Returns the size of the match in the Y-direction (compared to the trained pattern) as a percentage. This function works only with the FindPatMaxPatterns function.

GetScore(Patterns, [Index])

Returns the pattern response score value. This function works with the following functions: FindPatMaxRedLineColor, FindPatMaxRedLine, FindPatMaxPatterns, FindPatterns and SortPatterns.

GetTrained(Patterns)

Returns 1 if the tool successfully learned a pattern. Returns 0 if the tool cannot train a pattern from a Patterns structure. This function works with the following functions:  TrainPatMaxPattern, TrainPatMaxRedLine, TrainPatMaxRedLineColor and FindPatterns.