InspectEdgeWidth

The InspectEdgeWidth function is used to construct an edge model to perform advanced edge analysis on the edge pairs returned by an InspectEdge function. This data is used to detect edge pairs and analyze the distance between them.

InspectEdgeWidth 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 InspectEdgeWidth function. The edge model involves defining the following:

  • 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.
  • The tolerances for width variances, defects and/or gaps to be encountered.
  • The tolerances for position variances, if detecting a bead path.

Once the edge model has been established, the function will compare edge candidates against the edge model and report deviations from the model.

Note: The InspectEdgeWidth function can be used in conjunction with an InspectEdgeTrainBeadPath and an InspectEdge function to determine width and position errors related to a bead path. The InspectEdgeWidth function's InspectEdge parameter must reference the Inspect data structure output by the InspectEdge function, which references the InspectEdgeTrainBeadPath function.

InspectEdgeWidth Inputs

Parameter Description

InspectEdge

Specifies a reference to a spreadsheet cell that contains a valid Inspect data structure returned by an InspectEdge function.

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.

0 = Left-to-Right

The function will attempt to detect edges from the left of the ROI to the right.

Example

1 = Right-to-Left

The function will attempt to detect edges from the right of the ROI to the left.

Example

3 = Center Outward (default)

The function will attempt to detect edges from the center of the ROI to the upper and lower bounds of the ROI (the order of the found edges will be in the opposite direction of the "X" arrow on the ROI).

Example

2 = Outside In

The function will attempt to detect edges from the upper and lower bounds of the ROI to the center of the ROI (the order of the found edges will be in the opposite direction of the "X" arrow on the ROI).

Example

Edge: First

Specifies the contrast transition of the first edge to be detected, as determined by the Find Edge Direction parameter.

1 = Black-to-White

The edge transitions from black pixels to white pixels.

2 = White-to-Black (default)

The edge transitions from white pixels to black pixels.

3 = Either

The edge can transition from either black-to-white, or white-to-black, and the function will determine the proper transition. Specifying the transition improves the performance of the function.

Edge: Second

Specifies the contrast transition of the second edge to be detected, as determined by the Find Edge Direction parameter.

1 = Black-to-White (default)

The edge transitions from black pixels to white pixels.

2 = White-to-Black

The edge transitions from white pixels to black pixels.

3 = Either

The edge can transition from either black-to-white, or white-to-black, and the function will determine the proper transition. Specifying the transition improves the performance of the function.

Edge Scoring

Specifies the edge scoring mode that will be used to determine whether or not an edge meets the established criteria.

Score Threshold

Specifies a scoring threshold to filter out edges with scores (1 to 100; default = 10) lower than this value.

Edge Rules

Specifies the type of edge that is most important when calculating the score.

1 = First

The first edge detected receives the highest consideration.

2 = Strongest

The edge with the strongest contrast transition receives the highest consideration.

3 = First Strongest

The first edge detected, with the strongest transition, receives the highest consideration.

4 = Edge Pair Size

The edge pair detected with the size closest to the Pair Size parameter receives the highest consideration.

5 = First Edge Pair Size

The first edge pair detected with the size closest to the Pair Size parameter receives the highest consideration.

6 = Strongest Edge Pair Size

The edge pair detected with the strongest transition and the size closest to the Pair Size parameter receives the highest consideration.

7 = First Strongest Edge Pair Size
(default)

The first edge pair, with the strongest transition and the size closest to the Pair Size parameter, receives the highest consideration.

Contrast Upper Bound

Specifies the upper limit of the edge contrast transition (2 to 255; default = 255) to be considered an edge; edges with an edge contrast transition above this value will have the same highest score.

Note: The Edge Rules parameter must be set to either Strongest, First Strongest, Strongest Edge Pair Size or First Strongest Edge Pair Size to enable this parameter.

Pair Size

Specifies the edge pair size at which the highest score is achieved (valid range is 1 to 3 times the In-Sight vision system's image width; default = 5). When this parameter is enabled, edge pairs detected above or below this value are scored proportionally to this value. For example, if the Pair Size is set to 10, and two edge pair candidates are detected, one with a value of 8 and another with 14, the edge pair with a value of 8 would be selected because it is closer to the limit than the second edge pair.

Note: The Edge Rules parameter must be set to either Strongest, First Strongest, Strongest Edge Pair Size or First Strongest Edge Pair Size to enable this parameter.

Advanced Filter

Specifies how the function should construct the line fit.

Re-Score

Specifies that the edges will be re-scored to select edges which are closer to the line fit.

0 = Off (default)

The function will not re-score the edges to account for outliers.

1 = On

The function will re-score the edges to account for outlier edges in its calculation.

Line Fit

Specifies the type of line fit to be constructed out of the detected edges.

1 = Straight Line Fit

The function will create a straight line fit from the detected edges.

2 = Circle Line Fit

The function will create a circular line fit from the detected edges.

3 = Auto Fit (default)

The function automatically creates either a straight line or circular fit, based on the referenced Region.

Filter Outliers

Specifies that the function will remove points from the Fit Line that are further than the distance specified in the Fit Distance Filter parameter.

0 = Off (default)

The function will not account for outlier edges.

1 = On

The function will account for outlier edges in its calculation.

Fit Distance Filter

Specifies the distance, in pixels (valid ranges are 1 to 3 times the In-Sight vision system's image width; default = 2), from which an edge must be from the original Fit Line to be utilized in a re-fit calculation. This setting is useful in helping to prevent defects from affecting the line fit. Filter Outliers must be On to enable this setting.

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.

Min Width

Specifies that any width distance, in pixels, between detected edge pairs less than this value is a defect. Valid ranges are 0.001 to 3 times the In-Sight vision system's image width; default is 3 pixels.

Max Width

Specifies that any width distance, in pixels, between detected edge pairs greater than this value is a defect. Valid ranges are 0.001 to 3 times the In-Sight vision system's image width; default is 3 times the vision system's image width.

Note: If this value is less than the Min Width parameter, the function will result in a #ERR.

Size Enabled

Specifies whether or not the function will account for size defects. Size defects account for width deviations along the length of the detected edge pairs.

Note: When Size Enabled and Area Enabled are both On, only defects which fail both conditions will be displayed.

0 = Off

The function will not account for size defects.

1 = On (default)

The function will account for size defects, based on the Min Size and Max Size parameter settings.

Min Size Specifies the minimum defect size, in pixels; continuous deviations from the line fit which are less than this value are not considered defects. Valid ranges are 0.001 to 3 times the In-Sight vision system's image width; default is 3 pixels.
Max Size Specifies the maximum defect size, in pixels; continuous deviations from the line fit which are greater than this value are not considered defects. Valid ranges are 0.001 to 3 times the In-Sight vision system's image width; default is 3 times the vision system's width.
Area Enabled

Specifies whether or not the function will account for area defects. Area defects account for the length along the line fit and how far the defective edge is from the line fit.

Note: When Size Enabled and Area Enabled are both On, only defects which fail both conditions will be displayed.

0 = Off

The function will not account for area defects.

1 = On (default)

The function will account for area defects, based on the Min Area and Max Area parameter settings.

Min Area Specifies the minimum area defect, in pixels (valid range is from 0.001 to 100000; default = 10); an area less than this value is not considered a defect.
Max Area Specifies the maximum area defect, in pixels (valid range is from 0.001 to 1000000; default = 1000000); an area greater than this value is not considered a defect.
Sort Criteria

Specifies how the detected defects will be sorted.

By Size (default)

The function will sort detected defects by their size, from the largest to smallest.

By Area

The function will sort detected defects by their area, from the largest to smallest.

By Position The function will sort detected defects by their Caliper index.
By Width The function will sort detected defects by their width, from the largest to smallest.

Gaps

Specifies the parameters for determining gaps in the edge pairs.

Enabled

Specifies whether or not the function will account for gaps in the found edge pairs.

0 = Off

The function will not account for gaps.

1 = On (default)

The function will account for gaps, based on the other Gaps parameter settings.

Gap Minimum

Specifies the minimum gap, in pixels; gaps less than this value are not considered to be gaps. Valid ranges are 0.001 to 3 times the In-Sight vision system's image width; default is 3 pixels.

Gap Maximum

Specifies the maximum gap, in pixels; gaps greater than this value are not considered to be gaps. Valid ranges are 0.001 to 3 times the In-Sight vision system's image width; default is 3 times the vision system's image width.

Max Displacement

Specifies the maximum displacement, in pixels, from the center of the region to the center of the edge pair to be considered a gap. Valid ranges are 1 to 3 times the In-Sight vision system's image width; default is 3 times the vision system's image width.

Ignore Gap Ends

Specifies whether or not the function will account for gaps detected at the beginning and end of the ROI.

0 = Off

The function will not account for gaps detected at the beginning and end of the ROI.

1 = On (default)

The function will account for gaps detected at the beginning and end of the ROI.

Sort Criteria

Specifies how the detected gaps will be sorted.

By Size (default)

The function will sort detected gaps by their size, from the largest to smallest.

By Position The function will sort detected gaps by their Caliper index.

Position

Specifies the parameters for determining positional defects in the edge pairs. The parameters define a defect as a deviation from the center of a model path, output by an InspectEdgeTrainBeadPath function. These parameters should only be used when referencing an InspectEdge function that is referencing an InspectEdgeTrainBeadPath function.

Enabled

Specifies whether or not the function will account for position defects in the found edge pairs.

0 = Off (default)

The function will not account for position defects.

1 = On

The function will account for position defects, based on the other Position parameter settings.

Min Distance

Specifies the minimum positional displacement, in pixels, from the center of the detected bead path; positional variations less than this value are not considered to be position defects. Valid ranges are 0.001 to 3 times the In-Sight vision system's image width; default is 3 pixels.

Max Distance

Specifies the maximum positional displacement, in pixels, from the center of the detected bead path; positional variations greater than this value are not considered to be position defects. Valid ranges are 0.001 to 3 times the In-Sight vision system's image width; default is 3 times the vision system's image width.

Size Enabled

Specifies whether or not the function will account for size defects. Size defects account for width deviations along the length of the detected edge pairs.

Note: When Size Enabled and Area Enabled are both On, only defects which fail both conditions will be displayed.

0 = Off

The function will not account for size defects.

1 = On (default)

The function will account for size defects, based on the Min Size and Max Size parameter settings.

Min Size Specifies the minimum defect size, in pixels; continuous deviations from the line fit which are less than this value are not considered defects. Valid ranges are 0.001 to 3 times the In-Sight vision system's image width; default is 3 pixels.
Max Size Specifies the maximum defect size, in pixels; continuous deviations from the line fit which are greater than this value are not considered defects. Valid ranges are 0.001 to 3 times the In-Sight vision system's image width; default is 3 times the vision system's width.
Area Enabled

Specifies whether or not the function will account for area defects. Area defects account for the length along the line fit and how far the defective edge is from the line fit.

Note: When Size Enabled and Area Enabled are both On, only defects which fail both conditions will be displayed.

0 = Off

The function will not account for area defects.

1 = On (default)

The function will account for area defects, based on the Min Area and Max Area parameter settings.

Min Area Specifies the minimum area defect, in pixels; an area less than this value is not considered a defect. Valid range is from 0.001 to 100000; default is 10.
Max Area Specifies the maximum area defect, in pixels; an area greater than this value is not considered a defect. Valid range is from 0.001 to 1000000; default is 1000000.
Sort Criteria

Specifies how the detected defects will be sorted.

By Size (default)

The function will sort detected defects by their size, from the largest to smallest.

By Area

The function will sort detected defects by their area, from the largest to smallest.

By Position

The function will sort detected defects by their Caliper index.

By Width

The function will sort detected defects by their width, from the largest to smallest.

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 InspectEdgeWidth graphical overlays on top of the image.

0 = hide all (default)

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

1 = result graphics only

The line fit, detected defects, outlier points and/or gaps will be displayed at all times.

2 = result graphics and found edge

The line fit, detected defects, outlier points and/or gaps, and detected edge points will be displayed at all times.

3 = result graphics and caliper detail

The line fit, detected defects, outlier points and/or gaps, detected edge points, and the indexed Caliper window will be displayed at all times.

4 = show all: input and result graphics

Both the input region, line fit, detected defects, outlier points and/or gaps, and detected edge points will be displayed at all times.

InspectEdgeWidth 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 InspectEdgeWidth is initially inserted into a cell, a results table is created in the spreadsheet.

Note: If the value of the Max Number of Defects/Gaps parameter is greater than zero, InspectEdgeWidth 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.

InspectEdgeWidth Vision Data Access Functions

The following InspectEdge Vision Data Access Functions are automatically inserted into the spreadsheet to create the data structure result table:

Label

Function

Description

Total Count GetTotalCount(Inspect) Returns the total number of results.
Defects/Gaps/Position GetWidthCount(Inspect, Defects/Gaps/Position) Returns the total number of specified defects or gaps (Defects = 0, Gaps = 1, Position = 2).
Defects/Gaps/Position
Size/Area/Width/Position GetDefectGapValue(Inspect, Defect/Gap Index, Defect/Gap/Position, Edge Pair Index, Size/Area/Width) Returns the size, area or width of the defect or gap (Defect = 0, Gap = 1, Position = 2; Size = 0, Area = 1, Width = 2).
X GetDefectGapBoundsX(Inspect, Defect/Gap Index, Defect/Gap/Position, Edge Pair Index) Returns the x-coordinate of the defect's bounding rectangle.
Y GetDefectGapBoundsY(Inspect, Defect/Gap Index, Defect/Gap/Position, Edge Pair Index) Returns the y-coordinate of the defect's bounding rectangle.
Height GetDefectGapBoundsHeight(Inspect, Defect/Gap Index, Defect/Gap/Position, Edge Pair Index) Returns the height of the defect's bounding rectangle.
Width GetDefectGapBoundsWidth(Inspect, Defect/Gap Index, Defect/Gap/Position, Edge Pair Index) Returns the width of the defect's bounding rectangle.
Angle GetDefectGapBoundsAngle(Inspect, Defect/Gap Index, Defect/Gap/Position, Edge Pair Index) Returns the angle of the defect's bounding rectangle.
Curve GetDefectGapBoundsCurve(Inspect, Defect/Gap Index, Defect/Gap/Position, Edge Pair Index) Returns the curve of the defect's bounding rectangle.
Start/End GetDefectGapCaliperIndex(Inspect, Defect/Gap Index, Defect/Gap/Position, Edge Pair Index, Defect Start/End) Returns the Caliper in which the defect starts or ends (Start = 0, End = 1).
Extremes - Furthest Point 1/2
Caliper GetExtremeWidth(Inspect, Thinnest/Thickest) Returns the index of the Caliper which contains the specified extreme width (Thinnest = 0 and Thickest = 1).
Width GetWidth(Inspect, Caliper Index) Returns the width value of the edge within the indexed Caliper; returns 0 if no edges are found within the indexed Caliper.
X (Start and End) GetEdgeX(Inspect, Caliper Index, Edge Pair Index or Edge Index) Returns the x-coordinate of the referenced edge.
Y (Start and End) GetEdgeY(Inspect, Caliper Index, Edge Pair Index or Edge Index) Returns the y-coordinate of the referenced edge.

 

Note:
  • All of the formulas for the InspectEdgeWidth conform to the following:
  • Inspect = An Inspect data structure output by an InspectEdgeWidth 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