Skip to content

2D Line

Operator Function

Find line segments in the input image using 2D calipers and output the start and end points of the line segments.

Parameter Introduction

Input Parameters

ParameterRangeDefault ValueDescriptionIllustration
Input Image0-80IM number for image input

Calculation Parameters

ParameterRangeDefault ValueDescriptionIllustration
CaliperSet the range of the search area
Outlier RemovalRemove noise points and outliers
Minimum Distance Threshold0-5000100If the distance between a point on the caliper and the initially fitted line is greater than this value, delete it
Maximum Deletion Count0-1000Number of points to delete in descending order of distance from the fitted line
TransitionPositive/Negative/AllAllPositive: Transition from black to white
Negative: Transition from white to black
All: Both transitions
SelectionFirst/Last/BestBestFirst: The first point found that meets the threshold
Last: The last point that meets the threshold
Best: The point with the largest threshold change
Threshold1-25520.000Threshold setting for gradient change
Standard Deviation0.4-1002.000Standard deviation for smoothing gradient changes

Result Display

ParameterRangeDefault ValueDescriptionIllustration
Line Segmenttrue/falsefalseIf enabled, display the found line segment on the IM image
Edge Pointstrue/falsefalseIf enabled, display the found caliper contour points on the IM image

Output Parameters

NameTypeRangeDescription
Resultbooltrue/falsetrue for success
false for failure
Warningbooltrue/falsetrue indicates a warning
false indicates no warning
MessagestringOutput success, error, or warning messages. Empty if no error or warning.
TimefloatOperator execution time, unit: ms
Segmentsegment2dFound line segment informationStart and end point XY position information

Exception Troubleshooting

No.Exception InformationCorresponding ParameterSolution
1Not enough suitable points found1. Increase the number of calipers
2. Adjust the threshold
2Insufficient filtered fitting pointsInsufficient points after filtering, adjust the minimum distance threshold and maximum exclusion count
3Input image is emptyCheck if the input image is empty

Example Introduction

Engineering Design

  1. Select the Load Image tool to load the required 2D image to IM0.

  2. Select the 2D Line tool.

Tool Usage

  1. Select the input image for the operation. The image number must match the IM number where the image is located in the project.

  2. Use the caliper to select the area where the line needs to be found.

::: Warning Tips 1. Use the ROI controller on the image window to drag or scale the caliper; 2. Directly modify the caliper parameters (such as start and end points) in the calculation parameters to set the caliper; :::

  1. Set the parameters.

  2. Check the content you want to display in the result display section.

  3. Click Test to check if the image window and parameters meet expectations.

  4. If there are no issues, click Save. Run the operator in the run list, and then view the running results in the corresponding IM.

Local Image

AI-Vision, Making 3D Measurement Easier