imgviz.draw.text

imgviz.draw.text(src, yx, text, size, color=(0, 0, 0), font_path=None)[source]

Draw text on numpy array with Pillow.

Parameters:
  • src (numpy.ndarray) – Input image.

  • yx ((2,) array-like) – Left top point of the text.

  • text (str) – Text to draw.

  • size (int) – Text size in pixel.

  • color ((3,) array-like) – Text RGB color in uint8. Default is (0, 0, 0), which is black.

  • font_path (str) – Default font is DejaVuSansMono in matplotlib.

Returns:

dst – Output image.

Return type:

numpy.ndarray