![]() |
VOOZH | about |
The cv2.arrowedLine() method in OpenCV is used to draw an arrow between two points on an image. It lets you choose the arrowβs start point, end point, color, thickness, and arrow-tip size making it useful for annotations, directions, object tracking, and visual marking in images.
Note: For this article we will use a sample image "logo.png", to download it click here.
Example: This example loads an image and draws a simple green arrow using minimal parameters.
Output
Explanation:
cv2.arrowedLine(image, start_point, end_point, color, thickness, line_type, shift, tipLength)
Parameters:
Example 1: This example draws a thick green arrow in a diagonal direction using default arrow-tip size.
Output
Explanation: arrowedLine(img, start, end, (0, 255, 0), 8) draws a thick green arrow from top-left to bottom-right.
Example 2: This example draws a red arrow with a larger arrow-tip size (0.5) for more emphasis.
Output
Explanation:
Example 3: This example draws a thin blue arrow with a custom line type for smoother rendering.
Output
Explanation: