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
labelto a string with a single format field, e.g."Blob {:d}". SettinglabeltoTrueis 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")
- Seealso: