Blobs.plot_perimeter#

Blobs.plot_perimeter(*args, show: str = 'full', epsilon: int | None = None, clockwise: bool = True, **kwargs: Any) None[source]#

Plot the perimeter of blobs using Matplotlib

Parameters:
  • show (str) – type of perimeter to plot, “full” (default), “approx” or “hull”

  • epsilon (int (only for show="approx")) – maximum distance between the original curve and its approximation, default is exact contour

  • clockwise (bool (only for show="hull")) – direction of travel for computing the hull, defaults to clockwise

  • kwargs – line style parameters passed to plot

Plots the perimeter of blob or blobs on the current Matplotlib axes.

Example:

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

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

../../_images/machinevisiontoolbox-Blobs-plot_perimeter-1.png
Seealso:

perimeter perimeter_approx perimeter_hull plot_box plot_centroid