Image.thin_animate#

Image.thin_animate(delay: float = 0.5, title: str | None = None, **kwargs: Any) → Self[source]#

Morphological skeletonization with animation

Parameters:
  • delay (float, optional) – time in seconds between each iteration of display, default to 0.5

  • title (str, optional) – window title, defaults to “Animation of Morphological Skeletonization”

  • kwargs – options passed to hitormiss

Returns:

Image

Return type:

Image instance

Return the thinned version (skeleton) of the binary image as another binary image. Any non-zero region is replaced by a network of single-pixel wide lines.

The algorithm is iterative, and the result of of each iteration is displayed using Matplotlib.

Examples

>>> from machinevisiontoolbox import Image
>>> img = Image.Read("shark2.png")
>>> img.thin_animate()
Image(size=(500, 500), dtype=uint8)

References