Skeletonization (image processing)

from Wikipedia, the free encyclopedia
An image object with a skeleton line

A class of image processing methods is called skeletonization . During the skeletonization, a flat picture object is converted into an inner skeleton line 1 pixel wide.

Skeletonization is used, for example, to thin lines. The thinned lines can be vectorized well . A skeleton can also be used to reduce data . Further applications can be found in medicine, biology, writing , pattern and fingerprint recognition .

definition

There are several different definitions for the skeleton of an image region. One of the first comes from H. Blum (1967). Blum chose a steppe fire as an illustration. A dry steppe grass area, which represents a picture region, is lit at its borders at the same time, so that the fire spreads evenly inwards. The skeleton now consists of those places where at least two fire fronts meet. This definition can be formalized:

Let be a distance function that gives the distance from an inner point to the nearest edge point. The skeleton or the central axis is now defined by the set of inner points for which there is a local maximum in a certain direction, e.g. B. the X- / Y-axis or one of the two diagonals XY and -XY.

The points that make up the skeleton are also known as skeletal points or skeletal pixels .

Skeletonization algorithms

There are different algorithms for calculating skeletons.

  • "Steppe fire" definition: Calculation of the distance functions and the local maxima
    • "Erosion process" as a further development of the steppe fire definition, z. B. Fuzzy Skeletonization
  • Thinning / dilution process: Edge pixels are removed until no further thinning is possible. An example of this is the simple, parallelizable Zhang-Suen algorithm . See also mathematical morphology
  • Voronoi diagram

example

Scikit-image skeletonized-horse.jpeg

In this example, using the Python - Library Scikit-image , the image of a horse with a Skelettierungs algorithm processed.

from skimage.morphology import skeletonize
from skimage import data
import matplotlib.pyplot as plt
from skimage.util import invert

# Das Bild eines Pferdes wird invertiert
image = invert(data.horse())

# Ausführung der Skelettierung
skeleton = skeletonize(image)

# Anzeige des erzeugten Bildes
plt.axis('off')
plt.imshow(skeleton, interpolation='nearest')
plt.show()

Web links

Individual evidence

  1. ^ TY Zhang, CY Suen: A almost parallel algorithm for thinning digital patterns, Communications of the ACM . 27, No. 3, pp. 236-239, March 1984
  2. skeletonize - skimage docs. Retrieved September 7, 2018 .