Line Geometry
This function block provides a single, flexible tool for a wide range of line and geometry operations: angles, distances, intersections, projections, midpoints, segment extraction and more. It can produce numeric results, points, extra operation-specific data and (optionally) an annotated image for visualization.
π₯ Inputs
Input ImageOptional image used for visualization overlays (if you want drawn lines, points or contours).Line 1Required for most operations. Accepts a line described as [(x1, y1), (x2, y2)] or compatible shape input.Line 2Required for angle / intersection / some distance operations. Accepts a second line in the same format.Anchor PointOptional point (x, y) used by projection and point-to-line operations or when a contour is supplied for shape intersection.
π€ Outputs
Output ImageAnnotated image (ifInput Imageis provided andShow Visualizationis enabled).ResultNumerical result of the selected operation (for example angle in degrees or distance in pixels).Point OutputA point result when the operation yields a coordinate (e.g., intersection, projection, midpoint).Extra OutputOperation-specific data (for example segment endpoints, list of intersection points, or other debug info).
πΉοΈ Controls
Operation TypeChoose the geometry operation to perform (e.g., Angle Between Lines, Intersection Point, Segment Extraction, Projection).Offset (px)Slider used by segment / projection operations to apply an offset in pixels.Interpolation FactorSlider (0β100%) used for interpolation-based operations (segment extraction, projection along line).Show VisualizationCheckbox toggles annotatedOutput Imagedrawing when anInput Imageis provided.
π― Key Features
Single multi-purpose block covering many common geometry tasks.
Context-sensitive behavior: only the outputs relevant to the selected operation will contain meaningful data.
Optional visual overlays: draw lines, midpoints, intersections, projections and segments directly on the provided image.
Interactive tooltips and control hints help you select the right inputs and parameters for each operation.
βοΈ How it runs
When executed, the block reads the connected sockets and the selected Operation Type. It performs the requested geometric computation using the provided Line 1, optional Line 2 and optional Anchor Point. If an Input Image is connected and Show Visualization is enabled, the block returns an annotated image in Output Image. Numeric and point results appear on the corresponding outputs based on the operation.
π Usage Instructions
Select the desired operation in
Operation Type.Connect the required sockets: at minimum connect
Line 1. ConnectLine 2orAnchor Pointwhere needed by the chosen operation.Optionally provide
Input Imageand enableShow Visualizationto get an annotated image overlay.Adjust
Offset (px)orInterpolation Factorwhen using Segment Extraction or Projection operations.Run the scenario; inspect the
Result,Point Outputand/orExtra Outputand view the visual overlay inOutput Imageor with a display block.
π‘ Tips and Tricks (combining with other blocks)
To get lines from contours or edges automatically, combine with
Find ContourorLine Detectorto extract shape/line data and feed the results intoLine Geometry.Crop a region and do focused geometry with
Image ROI,Image ROI SelectorImage ROI Polygonbefore sending the image to this block β this reduces noise and improves results.Visualize outputs in the UI using
Show Imageso you can inspect annotated images and interactively verify points and intersections.If you need to overlay textual results on the annotated image for reports or dashboards, add
Draw Result On Imageafter the visualized output.For measuring distances between detected features, use
Find ContourorFeature Detectorto locate points, then useLine Geometryto compute midpoints, distances or projections. Feed numeric point outputs toMeasure Position Distancefor additional distance breakdowns.To isolate only relevant detections before geometry calculations, use
Image ROI SelectorCheck Area (Polygon)to filter positions and shapes.When combining detections and tracking workflows, use
Object DetectionorObject Detection - Customupstream to provide coordinates, then useLine Geometryfor analytics such as intersection checks or approach angle calculations.
(hint: use the block outputs like Point Output or Extra Output as inputs to other processing blocks such as Measure Position Distance, Draw Point or logging/export blocks.)
π οΈ Troubleshooting
If
Output Imageis empty: ensure anInput Imageis connected andShow Visualizationis enabled.If an operation returns no value in
ResultorPoint Output: check that the required sockets for that operation are connected (for example,Line 2is required for angle/intersection operations).If coordinates seem wrong: verify the coordinate format and that lines are provided as [(x1, y1), (x2, y2)]. Use preview blocks like
Show ImageorDraw Pointto inspect intermediate points.For projection and interpolation results that look off, fine-tune
Offset (px)andInterpolation Factorto match your expected scale and units.
If you need step-by-step visual checks, combine the block with Show Image and Draw Point to validate intermediate geometry before using results downstream.
Last updated
Was this helpful?