SortPatterns
Sorts patterns by their position in the image. For each pattern in the input Patterns data structure, SortPatterns computes the position of the pattern's response relative to the specified image fixture coordinate system. Patterns are sorted by one of the following:
- X-coordinate
- Y-coordinate
- Angle
- Angle distance
- Distance
The sorted patterns are returned as a new Patterns data structure.
SortPatterns Inputs
Syntax: SortPatterns(Patterns,Number to Sort,Sort By,Fixture.Row,Fixture.Column,Fixture.Theta,Sort Tolerance,Show)
Parameter | Description | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
This argument must reference a spreadsheet cell that contains a valid Patterns data structure returned by either the FindPatMaxPatterns or FindPatterns function. For more information, see FindPatMaxPatterns or FindPatterns. |
|||||||||||||||
Specifies the maximum number (1 to 255; default = 1) of patterns to sort. |
|||||||||||||||
Specifies the sorting method.
|
|||||||||||||||
Defines the referenced pattern relative to a Fixture input or the output of a Vision Tool function's image coordinate system. Setting the referenced pattern relative to a Fixture ensures that if the Fixture is rotated or translated, the referenced pattern is rotated or translated in relation to the Fixture. For more information, see Fixture. The default setting is (0,0,0), the top leftmost corner of the image.
|
|||||||||||||||
Specifies the size percentage (1% to 500%; default = 50%) of the trained pattern height a found pattern must be to be included in the group of patterns when sorting by either Grid X or Grid Y. Note: This parameter is only used when the Sort By parameter is set to either Grid X or Grid Y.
|
|||||||||||||||
Specifies the display mode for SortPatterns graphics on the image.
|
SortPatterns Outputs
Returns |
A Patterns data structure containing the sorted pattern response points, or #ERR if any of the input parameters are invalid. |
Results |
When SortPatterns is initially inserted into a cell, a result table is created in the spreadsheet. Note: If the value
of the Number
to Sort parameter
is greater than zero, SortPatternsautomatically inserts a result table containing a maximum
of 10 entries that correspond to the first 10 patterns in the Patterns data structure. If you wish to display more entries, you
can expand the table by copying the last row and pasting additional rows
at the end. Make sure to increment the index number of any newly-pasted
row so that the proper pattern is indexed.
|
SortPatterns Vision Data Access Functions
The following Vision Data Access functions are automatically inserted into the spreadsheet to create the result table. For more information, see Patterns.
Row |
GetRow(Patterns, Index) |
The row coordinate of the pattern position. |
Col |
GetCol(Patterns, Index) |
The column coordinate of the pattern position. |
Angle |
GetAngle(Patterns, Index) |
The orientation of the pattern position. |
Scale |
GetScale(Patterns, Index) |
The percent size of the original model. |
Score |
GetScore(Patterns, Index) |
The pattern response score. |