Comment on page
Draw Line
The
Draw Line
node in AugeLab Studio allows you to draw a line on an input image by clicking on the image with the mouse. It provides the coordinates of the line and the corresponding angles.The
Draw Line
node takes an input image and a boolean value as inputs and provides the following output:- 1.Image: The input image with the drawn line.
- 2.Line Coordinates: The coordinates of the points on the drawn line.
- 3.Angles: The angles of the line segments.
- Node Title: Draw Line
- Node ID: OP_NODE_DRAW_LINE_ON_IMAGE
The
Draw Line
node has the following input sockets:- 1.Image: The input image on which the line will be drawn.
- 2.Calculate All Points: A boolean value indicating whether to calculate all points on the line. If set to true, the node will calculate all the points on the line; otherwise, it will only provide the coordinates of the start and end points.
The
Draw Line
node has the following output sockets:- 1.Image: The output image with the drawn line.
- 2.Line Coordinates: The coordinates of the points on the drawn line.
- 3.Angles: The angles of the line segments.
To draw a line on the image:
- 1.Connect the input image to the Image input socket of the
Draw Line
node. - 2.Run the pipeline.
- 3.Click on the image to draw the line. Each click adds a new point on the line.
- 4.Press 'C' to clear the drawn line.
- 5.Press 'U' to undo the last line segment.
The
Draw Line
node uses the OpenCV library to draw the line on the input image. It keeps track of the mouse coordinates when clicked on the image and stores them as line coordinates. The node then draws the line using the cv2.polylines
or cv2.line
function, depending on whether all points on the line need to be calculated.If the Calculate All Points input is set to true, the node calculates all the points on the line using linear interpolation between the start and end points. It also calculates the angles of the line segments based on the slope between consecutive points.
- 1.Drag and drop the
Draw Line
node from the node library onto the canvas in AugeLab Studio. - 2.Connect the input image to the Image input socket of the
Draw Line
node. - 3.Connect a boolean value (e.g., from a constant node or a boolean calculation) to the Calculate All Points input socket if needed.
- 4.Run the pipeline.
- 5.Click on the image to draw a line. Each click adds a new point on the line.
- 6.Press 'C' to clear the drawn line.
- 7.Press 'U' to undo the last line segment.
- 8.The output image will show the drawn line, and the line coordinates and angles will be available as outputs for further analysis or visualization.
- The
Draw Line
node is useful for interactively drawing lines on images for analysis or visualization purposes. - It allows you to calculate all points on the line or just the start and end points, depending on the Calculate All Points input.
- The node provides the line coordinates and angles as outputs for further processing or analysis.
That concludes the documentation for the
Draw Line on Image
node in AugeLab Studio. Use this node to draw lines on images and extract line coordinates and angles for further analysis or visualization.