FindLine
Locates a single straight-line edge within an image region. FindLine forms a one-dimensional projection of the image region by summing pixel values on radial line segments scanned in the positive y-direction relative to the region's local coordinate system. Edge transitions are extracted from the projected image data.
FindLine Inputs
Syntax: FindLine(Image,Fixture.Row,Fixture.Column,Fixture.Theta,Region.X,Region.Y,Region.High,Region.Wide,Region.Angle,Region.Curve,Polarity,Find By,Accept Thresh,Normalize Score,Angle Range,Edge Width,Show)
| Parameter | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Specifies a reference to a spreadsheet cell that contains an Image data structure; by default, this parameter references A0, the cell containing the AcquireImage Image data structure. This parameter can also reference other Image data structures, such as those returned by the Vision Tool Image functions or Coordinate Transforms Functions. |
|||||||||||||
|
Defines the Region of Interest (ROI) relative to a Fixture input or the output of a Vision Tool function's image coordinate system. Setting the ROI relative to a Fixture ensures that if the Fixture is rotated or translated, the ROI will be rotated or translated in relation to the Fixture. For more information, see Fixture and Vision Tools. Note: The default setting is (0,0,0), the top leftmost
corner of the image.
|
|||||||||||||
|
Also known as the Region of Interest (ROI), specifies the region of the image that undergoes analysis and creates a rectangular image region that can be transformed and rotated. For more information, see Interactive Graphics Mode. Tip: With this parameter
selected, you can press the Maximize
Region button on the property sheet's toolbar to maximize the region and cover the entire image.
|
|||||||||||||
|
Specifies the polarity of the edge to be located, relative to the scan direction of the Region; the function will only report edges of the specified polarity. Note: When using a horizontal or vertical linear edge feature as a fixture input, the function will only account for the movement of the edge in one direction, either along the horizontal or vertical axis, depending on the position of the scan direction of the ROI.
|
|||||||||||||
|
Specifies the edge selection technique the function will use to select an edge, amongst multiple edge candidates.
|
|||||||||||||
|
Specifies the minimum acceptable edge contrast (0 to 100; default = 25). The contrast value is normalized from the greyscale histogram within the Region to a scale of 0 to 100. The function will reject any edge whose contrast score falls below this value. |
|||||||||||||
|
Specifies whether the edge scores will be normalized by the greyscale histogram of the Region. When Normalize Score is enabled, raw edge scores are normalized by the maximum contrast found within the image region using the following formula: Score = (Raw Edge Score) x (100/Max Contrast) Where Raw Edge Score is the grey level difference across the edge and Max Contrast is the difference between the maximum and minimum grey level (0 to 255) within the image region. When Normalize Score is disabled, low contrast edges will score lower than high contrast edges. The following formula is used: Score = (Raw Edge Score) x (100/255)
Tip: This parameter is useful for finding edges in a low contrast region. If the edges to be detected are expected to be only high contrast, disable this parameter.
|
|||||||||||||
|
Specifies the function's tolerance to edge rotation (0 to 10; default = 0). The function will still find edges that are outside of the specified range, but the accuracy may not be as high. Note: Setting this parameter to a value greater than 0 will reduce the speed of the function.
|
|||||||||||||
|
Specifies the pixel distance (1 to 50; default = 3) over which an edge transition takes place. Edge Width is used to filter the image before edges are extracted. |
|||||||||||||
|
Specifies the display mode for FindLine graphical overlays on top of the image.
|
FindLine Outputs
|
Returns |
An Edges data structure containing a single straight-line edge segment, or #ERR if any of the input parameters are invalid. |
|
Results |
When FindLine is initially inserted into a cell, a result table is created in the spreadsheet. |
FindLine 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) |
The angle of the edge. |
|
Row0 |
GetRow(Edges,0,0) |
The row coordinate of the first endpoint. |
|
Col0 |
GetCol(Edges,0,0) |
The column coordinate of the first endpoint. |
|
Row1 |
GetRow(Edges,0,1) |
The row coordinate of the second endpoint. |
|
Col1 |
GetCol(Edges,0,1) |
The column coordinate of the second endpoint. |
|
Score |
GetScore(Edges,0) |
The edge contrast score. Score is positive for black-to-white transitions, negative for white-to-black transitions. |