Blobs.plot_axes#

Blobs.plot_axes(*args: Any, major_style: dict[str, Any] | None = None, minor_style: dict[str, Any] | None = None, **kwargs: Any) → None[source][source]#

Plot equivalent ellipse axes of blobs using Matplotlib

Parameters:
  • major_style – Matplotlib line options for the major axis only, such as dict(color="orange", linestyle="--"), defaults to None

  • minor_style – Matplotlib line options for the minor axis only, defaults to None

  • args – optional Matplotlib format string, such as "r--", which applies to both axes

  • kwargs – line style parameters passed to plot, which apply to both axes

The options for each axis are merged in this order, later ones winning: the defaults (MAJOR_AXIS_STYLE and MINOR_AXIS_STYLE), the format string, kwargs, and finally major_style or minor_style.

Changed in version 2.5.0: Added major_style and minor_style.

Plot the major and minor axes of a blob or blobs on the current Matplotlib axes. These are the axes of the equivalent ellipse and the intersection point is the blob’s centroid.

Examples

>>> from machinevisiontoolbox import Image
>>> im = Image.Read("sharks.png")
>>> blobs = im.blobs()
>>> blobs.plot_axes() # axes for all blobs, different colors
>>> #
>>> blobs[0].plot_axes("c--") # cyan dashed line
>>> blobs[1].plot_axes(color="cyan", linestyle="--") # cyan dashed line
>>> blobs[2].plot_axes(color="red")
>>> blobs[3].plot_axes(color="orange", linewidth=3)

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

../../_images/machinevisiontoolbox-Blobs-plot_axes-1.png