InspectEdgePosition
The InspectEdgePosition function is used to construct an edge model to perform advanced edge analysis on the edges returned by an InspectEdge function. This data is used determine the location of edges, identifying outlier edges, and optionally constructing a line fit.
After inserting the function into the spreadsheet, a reference must be made to an Inspect data structure output by an InspectEdge function. Once the reference to the InspectEdge function has been established, the edge model is created by configuring the parameters of the InspectEdgePosition function. The edge model involves defining the following:
- The type of line fit - straight or circular.
- The direction in which to detect edges.
- The type of edge transition - white to black or vice-versa.
- The edge scoring criteria that will be used to filter unwanted edges.
- The line fit criteria that will be used to filter unwanted edges from the line fit.
Once the edge model has been established, the function will compare edge candidates against the edge model and report deviations from the model.
InspectEdgePosition Inputs
Syntax: InspectEdgePosition(InspectEdge,Line Fit,Find Edge Direction,Edge: First,Edge Scoring.Score Threshold,Edge Scoring.Edge Rules,Edge Scoring.Contrast Upper Bound,Advanced Line Fit.Filter Outliers,Advanced Line Fit.Fit Distance Filter,Advanced Line Fit.Furthest Point Filter Distance,Advanced Line Fit.Fit Re-Score,Advanced Line Fit.Fit Re-Fit,Caliper Index,Show)
Parameter | Description | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Specifies a reference to a spreadsheet cell that contains a valid Inspect data structure returned by an InspectEdge function. | |||||||||||||||||||||||
Specifies the type of line fit to be constructed out of the detected edges.
|
|||||||||||||||||||||||
Specifies the direction in which the function will attempt to detect edges. Dark green arrows are added to graphically illustrate the direction in which the edge will be detected. Fit lines will be labeled graphically within the image, with the first fit line being labeled 0, and the second fit line being 1. Note: If the ROI of the referenced InspectEdge function is bent into a curve, the inspection will be relative to the curve’s center. When the Find Edge Direction parameter is set to Left-to-Right, it inspects towards the curve’s center, and when set to Right-to-Left, it inspects away from the curve’s center.
|
|||||||||||||||||||||||
Specifies the contrast transition of the first edge to be detected, as determined by the Find Edge Direction parameter.
|
|||||||||||||||||||||||
Specifies the edge scoring mode that will be used to determine whether or not an edge meets the established criteria.
|
|||||||||||||||||||||||
Specifies how the function should construct the line fit.
|
|||||||||||||||||||||||
Specifies the Caliper to be displayed on the image (the Caliper will be outlined in green); default Caliper displayed is 0. |
|||||||||||||||||||||||
Specifies the display mode for InspectEdgePosition graphical overlays on top of the image.
|
InspectEdgePosition Outputs
Returns |
An Inspect data structure containing the matching edges sorted by score, or #ERR if any of the input parameters are invalid. |
When InspectEdgePosition is initially inserted into a cell, a results table is created in the spreadsheet. |
InspectEdgePosition Vision Data Access Functions
The following Vision Data Access functions are automatically inserted into the spreadsheet to create the InspectEdgePosition data structure result table, which is broken into two sections, Furthest Points and Straight Line Fit:
Spreadsheet Name |
Function Name |
Description |
---|---|---|
Furthest Points | ||
Point 1/Point 2 | GetExtremePosPoints(Inspect, Side) | Returns the index of the Caliper whose edge is furthest from the line fit on either side (Near = 0 and Far = 1), or, if the Line Fit is set to None, returns the points nearest either edge of the Region. |
Row | GetEdgePosRow(Inspect, Caliper Index, Edge Index) | Returns the row coordinate of the specified Caliper's edge position. |
Col | GetEdgePosCol(Inspect, Caliper Index, Edge Index) | Returns the column coordinate of the specified Caliper's edge position. |
Straight Line Fit | ||
Row0/Row1 | GetFitEdgePosRow(Inspect, Point Index) | Returns the row coordinate of the specified point of the line fit. |
Col0/Col1 | GetFitEdgePosCol(Inspect, Point Index) | Returns the column coordinate of the specified point of the line fit. |
Center Row | GetFitEdgePosCenterRow(Inspect, Point Index) | Inserted when a Circle Line Fit is specified, returns the row coordinate of the center of the circle line fit. |
Center Col | GetFitEdgePosCenterCol(Inspect, Point Index) | Inserted when a Circle Line Fit is specified, returns the column coordinate of the center of the circle line fit. |
Radius | GetFitEdgePosRadius(Inspect, Point Index) | Inserted when a Circle Line Fit is specified, returns the distance from the center of the circle line fit. |
For more information, see InspectEdge.
All of the formulas for the InspectEdgePosition conform to the following:
- Inspect = An Inspect data structure output by an InspectEdgePosition function
- Caliper Index = 0 to N (the total number of Calipers is equal to the number of Calipers output by the InspectEdge function that the InspectEdgeForDefect function is referencing)
- Edge Pair Index = 0 or 1
- Edge Index = 0 to N
- Point Index = 0 to 1 (0 = Start and 1 = End)