PairEdges

Sorts arrays of edges into arrays of edge pairs. PairEdges scans an Edges data structure for edge pairs that fall within the specified tolerance. Edges belonging to a pair are ordered consecutively, such that the first edge of a pair is on an even index number and the second edge of a pair is on an odd index number.

PairEdges Inputs

Syntax: PairEdges(Edges,Number of Pairs,Edge: First,Edge: Second,Edge Dist: Min,Edge Dist: Max,Intermediate Edges.Min B2W,Intermediate Edges.Max B2W,Intermediate Edges.Min W2B,Intermediate Edges.Max W2B,Show)

Parameter Description

Edges

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

Note: The PairEdges function cannot reference the Edges data structure returned by the Caliper function.

Number of Pairs

Specifies the maximum number of pairs to be reported. (0 to 80; default = 1)

Edge: First

Specifies the polarity of the first edge in a pair. PairEdges will only report edge pairs whose first edge has the specified polarity.

0 = black-to-white

1 = white-to-black (default)

2 = either

Edge: Second

Specifies the polarity of the second edge in a pair. PairEdges will only report edge pairs whose second edge has the specified polarity.

0 = black-to-white (default)

1 = white-to-black

2 = either

Edge Dist: Min

Specifies the minimum arc distance (0 to 1920; default = 0) between edges in a pair. PairEdges will only report edge pairs that are more than Edge Dist: Min distance apart.

Edge Dist: Max

Specifies the maximum arc distance (0 to 1920; default = 50) between edges in a pair. PairEdges will only report edge pairs that are less than Edge Dist: Max distance apart.

Intermediate Edges

Specifies the expected number and polarity of edges that fall between the end points of an edge pair. PairEdges will only report edge pairs with an expected number of intermediate edges.

Min B2W

Specifies the minimum number of black-to-white edges expected between the end points of an edge pair. (0 to 320; default = 0)

Max B2W

Specifies the maximum number of black-to-white edges expected between the end points of an edge pair. (0 to 320; default = 0)

Min W2B

Specifies the minimum number of white-to-black edges expected between the end points of an edge pair. (0 to 320; default = 0)

Max W2B

Specifies the maximum number of white-to-black edges expected between the end points of an edge pair. (0 to 320; default = 0)

Show

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

0 = hide all (default)

All graphics will be hidden, except when the cell containing the PairEdges function is the active cell in the spreadsheet.

1 = result graphics only

The line edges will be displayed at all times.

PairEdges Outputs

Returns

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

Results

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

PairEdges Vision Data Access Functions

The following Vision Data Access functions are automatically inserted into the spreadsheet to create the result table:

NumPairs

GetNFound(Edges)

The number of edge pairs found.

MinDist

PairMinDistance(Edges)

The minimum distance between paired edges.

MaxDist

PairMaxDistance(Edges)

The maximum distance between paired edges.

MeanDist

PairMeanDistance(Edges)

The mean distance between paired edges.

SDevDist

PairSDevDistance(Edges)

The standard deviation of the distance between paired edges.

Additional data elements can be accessed using the following Vision Data Access functions:

Angle

GetAngle(Edges, Index)

The angle of the specified edge.

Row0

GetRow(Edges, Edge Index, 0)

The row coordinate of the first endpoint for the specified edge.

Col0

GetCol(Edges, Edge Index, 0)

The column coordinate of the first endpoint for the specified edge.

Row1

GetRow(Edges, Edge Index, 1)

The row coordinate of the second endpoint for the specified edge.

Col1

GetCol(Edges, Edge Index, 1)

The column coordinate of the second endpoint for the specified edge.

Score

GetScore(Edges, Edge Index)

The edge contrast score for the specified edge.

For more information, see Edge or Edges.