Skip to content

2D Line Intersection

Operator Function

Input the parameters of lines/segments, determine whether two objects intersect within the set tolerance range, and if they do, output the intersection coordinates to the register.

Parameter Introduction

Input Parameters

ParameterRangeDefault ValueDescriptionIllustration
Input Image0-80IM number for image input

Calculation Parameters

ParameterRangeDefault ValueDescriptionIllustration
Line 12D Line/2D Segment2D SegmentManually set appropriate line or segment
Can bind to select existing R line or segment
Line 22D Line/2D Segment2D SegmentManually set appropriate line or segment
Can bind to select existing R line or segment

Extend the line segments to find the intersection point, α is the angle between the lines, P(x,y) is the intersection point coordinates. Line Intersection

Result Display

ParameterRangeDefault ValueDescriptionIllustration
Line 1true/falsefalseIf enabled, display the first line on the image
Line 2true/falsefalseIf enabled, display the second line on the image
Intersection Pointtrue/falsefalseIf enabled, display the intersection point of the two lines on the 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
pointpoint2dIntersection point XY information of the two lines
anglefloatAngle information at the intersection of the two lines

Exception Troubleshooting

No.Exception InformationCorresponding ParameterSolution
1Parallel, no intersection pointThe input lines are parallel and have no intersection point
2Input 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 two 2D Line tools to obtain two lines respectively.

  3. Select the 2D Line Intersection tool.

Tool Usage

  1. Select input image IM0.

  2. Bind the two lines output by the previous 2D Line tools as Line 1 and Line 2.

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

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

  5. 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