Image.draw_line#

Image.draw_line(start: tuple[int, int] | ndarray, end: tuple[int, int] | ndarray, **kwargs: Any) None[source][source]#

Draw line into image

Parameters:
  • start (array_like(2)) – start coordinate (u,v)

  • end (array_like(2)) – end coordinate (u,v)

  • kwargs – parameters passed to draw_line

Example, “burn” a line into the Mona Lisa image:

from machinevisiontoolbox import Image
img = Image.Read("monalisa.png")
img.draw_line((20,30), (500,600), thickness=5, color="orange")
img.disp()

(Source code)

Note

If image has multiple planes then color should have the same number of elements as the image has planes. If it is a scalar that value is used for each color plane. For a color image color can be a string color name.

Seealso:

draw_line