InspectEdgeForDefect
The InspectEdgeForDefect function is used to construct an edge model to perform advanced edge analysis on the edges or edge pairs returned by an InspectEdge function. This data is used to construct a best-fit line fit to compare found edges or edge pairs against, detecting defects and gaps, such as the distance from the line fit.
InspectEdgeForDefect Overview
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 InspectEdgeForDefect function. The edge model involves defining the following:
- The type of line fit - straight or circular.
- The type of edge - single or edge pair.
- 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.
- The tolerances for defects and/or gaps to be encountered.
Once the edge model has been established, the function will compare edge candidates against the edge model and report deviations from the model.
Example - Passing Straight Line Fit Edge
Example - Failing Straight Line Fit Edge
Example - Failing Circular Line Fit Edge
InspectEdgeForDefect Inputs
Parameter | Description | ||||||||||||||||||||||||||||||||||||||||
InspectEdge |
Specifies a reference to a spreadsheet cell that contains a valid Inspect data structure returned by an InspectEdge function. |
||||||||||||||||||||||||||||||||||||||||
Line Fit |
Specifies the type of line fit to be constructed out of the detected edges.
|
||||||||||||||||||||||||||||||||||||||||
Inspect Edge Pairs |
Specifies whether or not the function should detect edge pairs. Detected edge pairs will be labeled graphically within the image, with the first edge detected being 0, and the second edge being 1.
|
||||||||||||||||||||||||||||||||||||||||
Find Edge Direction |
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 region of interest (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.
|
||||||||||||||||||||||||||||||||||||||||
Edge: First |
Specifies the contrast transition of the first edge to be detected, as determined by the Find Edge Direction parameter.
|
||||||||||||||||||||||||||||||||||||||||
Edge: Second |
Specifies the contrast transition of the second edge to be detected, as determined by the Find Edge Direction parameter. Note: The Inspect Edge Pairs parameter must be On to enable this selection.
|
||||||||||||||||||||||||||||||||||||||||
Edge Scoring |
Specifies the edge scoring mode that will be used to determine whether or not an edge meets the established criteria.
|
||||||||||||||||||||||||||||||||||||||||
Advanced Line Fit |
Specifies how the function should construct the line fit.
|
||||||||||||||||||||||||||||||||||||||||
Max Number of Defects/Gaps |
Specifies the maximum number of defects and/or gaps the function should expect to detect (1 to 4096; default = 5). This value is applied to Defects and Gaps individually; e.g. when the setting is 5, the function expects to encounter a maximum of 5 Defects and 5 Gaps. This setting is used to construct the Vision Data Access Result Table in the spreadsheet. |
||||||||||||||||||||||||||||||||||||||||
Defects |
Specifies the parameters for determining defects in the edge from the line fit.
|
||||||||||||||||||||||||||||||||||||||||
Gaps |
Specifies the parameters for determining gaps in the edge.
|
||||||||||||||||||||||||||||||||||||||||
Caliper Index |
Specifies the Caliper to be displayed on the image (the Caliper will be outlined in green); default Caliper displayed is 0. |
||||||||||||||||||||||||||||||||||||||||
Show |
Specifies the display mode for the function's graphical overlays on top of the image.
|
InspectEdgeForDefect Outputs
Returns |
An Inspect data structure containing the detected defects, extremes and gaps, or #ERR if any of the input parameters are invalid. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Results |
When InspectEdgeForDefect is initially inserted into a cell, a results table is created in the spreadsheet, and the result table corresponds to the type of search being performed. Note: If the value
of the Max Number of Defects/Gaps parameter
is greater than zero, InspectEdgeForDefect will automatically insert a result table
containing a maximum of 10 entries
that correspond to the first 10 defects/gaps/edges/edge pairs in the 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.
The following InspectEdge Vision Data Access Functions are automatically inserted into the spreadsheet to create the InspectEdgeForDefect data structure result table, which is broken into four sections, Summary, Defects, Gaps and Extremes:
All of the formulas for the InspectEdgeForDefect conform to the following: Note:
If the Inspect Edge Pairs parameter is enabled, additional rows of data for Edge 1 will be automatically inserted into the spreadsheet. When enabled, an index of 0 will return information regarding Edge 0, and an index of 1 returns information regarding Edge 1. |