imgviz.draw.rectangle

imgviz.draw.rectangle(src, aabb1, aabb2, fill=None, outline=None, width=0)[source]

Draw rectangle on numpy array with Pillow.

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

  • aabb1 (array-like, (2,)) – Minimum vertex (y_min, x_min) of the axis aligned bounding box (AABB).

  • aabb2 (array-like, (2,)) – Maximum vertex (y_max, x_max) of the AABB.

  • fill (int or array-like, (3,), optional) – RGB color to fill the mark. None for no fill. (default: None)

  • outline (int or array-like, (3,), optional) – RGB color to draw the outline.

  • width (int, optional) – Rectangle line width. (default: 0)

Returns:

dst – Output image.

Return type:

numpy.ndarray