Blobs.plot_labelbox#

Blobs.plot_labelbox(fmt=None, label: str = '{:d}', **kwargs: Any) None[source]#

Plot a labelled bounding box of blobs using Matplotlib

Parameters:
  • label (str or bool, optional) – label to be displayed on the bounding box, defaults to blob id

  • kwargs – arguments passed to plot_labelbox

Plot a labelled bounding box for every blob described by this object.

By default the label is the blob id, but a custom label can be provided by setting label to a string with a single format field, e.g. "Blob {:d}". Setting label to True is the same as the default.

By default, blobs are labeled by their blob id.

Example:

>>> from machinevisiontoolbox import Image
>>> im = Image.Read("sharks.png")
>>> blobs = im.blobs()
>>> blobs[:3].plot_labelbox(color="yellow")
>>> blobs[3].plot_labelbox(color="lightblue", linewidth=2, label="3")

(Source code)

Seealso:

plot_box plot_centroid plot_perimeter plot_labelbox