Image.draw_labelbox#

Image.draw_labelbox(text: str, **kwargs: Any) → None[source][source]#

Draw label box into image

Parameters:
  • text (str) – text for the box label

  • kwargs – parameters passed to draw_labelbox to specify the box position, color, etc.

The box position is specified by the parameters accepted by draw_box

Example:

from machinevisiontoolbox import Image
img = Image.Read("monalisa.png")
img.draw_labelbox("Face", lb=(243,111), rt=(394,329), color="yellow", fontheight=20)
img.disp()

(Source code, png, hires.png, pdf)

../_images/machinevisiontoolbox-Image-draw_labelbox-1.png

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.

Warning

The image is drawn into in place, see draw_box for the requirement that the pixel data is C-contiguous.

Seealso:

draw_labelbox