SortEdges

Sorts arrays of edges by the specified criteria. For more information, see Edge.

SortEdges Inputs

Syntax: SortEdges (Edges,Number to Sort,Sort By,Show)

   

Edges

A reference to a spreadsheet cell containing an Edges data structure. The Edges data structure must consist of multiple straight-line edges.

Number to Sort

Specifies the number of edges to sort (0 to 160; default = 2).

Sort By

Specifies the method by which the edges are sorted.

0 = best score

Sort by order of descending contrast scores.

1 = first-to-last (default)

Sort by the original scan direction.

2 = B2W by score, W2B by score

Sort first by polarity, then by score.

3 = B2W first-to-last, W2B first-to-last

Sort first by polarity, then by original scan order.

4 = last-to-first

Sort by reverse scan order.

Show

Specifies the display mode for SortEdges graphical overlays on top of the image.

0 = hide all (default)

All graphics will be hidden, except when the cell containing the SortEdges function is the active cell in the spreadsheet. For more information, see Active Cell.

1 = result graphics only

The line edges will be displayed at all times.

SortEdges Outputs

Returns

An Edges data structure containing sorted edges, or #ERR if any of the input parameters are invalid.

Results

When SortEdges is initially inserted into a cell, a result table is created in the spreadsheet.

SortEdges 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 Edges

Angle

GetAngle(Edges, Index)

The angle of the specified edge.

Row0

GetRow(Edges, Edge Index, 0)

The row coordinate of the first endpoint.

Col0

GetCol(Edges, Edge Index, 0)

The column coordinate of the first endpoint.

Row1

GetRow(Edges, Edge Index, 1)

The row coordinate of the second endpoint.

Col1

GetCol(Edges, Edge Index, 1)

The column coordinate of the second endpoint.

Score

GetScore(Edges, Edge Index)

The edge contrast score.