WIPIVERSE All articles

Thinning (morphology)

Thinning is a morphological operation in digital image processing that transforms a binary image into a simplified, topologically equivalent representation. It is a type of topological skeleton computed using mathematical morphology operators, commonly used to reduce foreground regions to single-pixel-wide lines while preserving connectivity and the overall shape of objects.

Overview

Thinning is applied to binary images (where pixels are either foreground or background) and produces another binary image as output. The operation selectively removes foreground pixels based on the local pattern of neighboring pixels, as determined by a structuring element. It is closely related to the hit-or-miss transform and can be expressed as:

$$ X \otimes B_i = X \setminus (X \odot B_i) $$

where $\setminus$ denotes set-theoretic difference and $\odot$ denotes the hit-or-miss transform.

How It Works

The thinning operation uses extended binary structuring elements that can contain both ones (foreground) and zeros (background), as well as "don't care" positions. The origin of the structuring element is translated to each pixel position in the image. If the foreground and background pixels in the structuring element exactly match the underlying image pixels, the image pixel under the origin is set to background (zero). Otherwise, it is left unchanged.

The operator is normally applied iteratively until convergence (i.e., until no further changes occur). In some applications, such as pruning, it may be applied for only a limited number of iterations.

Common Applications

Skeletonization

One of the most frequent uses of thinning is to compute the skeleton (or medial axis) of a binary shape. By iterating with a set of eight structuring elements (four 90° rotations of two base patterns), thinning erodes away the boundaries of foreground objects as much as possible without disconnecting the shape, leaving a single-pixel-wide connected skeleton.

Edge Detection Post-Processing

Thinning is used to tidy up the output of edge detectors (e.g., the Sobel operator) by reducing all detected boundary lines to a single pixel thickness, while preserving the full length of those lines.

Character Recognition

In automated handwriting or character recognition, thinning is used as a preprocessing step to reduce characters to their skeletal forms, which can then be analyzed for shape-based recognition.

Pruning

Pruning is a specialized form of thinning that removes short spurs or parasitic branches from skeletons. It uses specific structuring elements and is typically applied for a limited number of iterations to avoid removing legitimate line endings.

Thickening

Thickening is the dual operation of thinning. It grows selected regions of foreground pixels and is defined as:

$$ \text{thicken}(X, B_i) = X \cup (X \odot B_i) $$

In practice, thickening the foreground is equivalent to thinning the background.

Key Properties

  • Topological equivalence: Thinning preserves the connectivity of the original shape.
  • Iterative convergence: The operation is applied repeatedly until no further pixels can be removed.
  • Structuring element dependent: The behavior and result are determined entirely by the choice of structuring elements.
  • Dual of thickening: Thinning and thickening are complementary operations.

References

  • Gonzalez, Rafael C. and Woods, Richard E. Digital Image Processing (2nd ed.). Prentice-Hall, 2002. ISBN 0-201-18075-8.
  • Fisher, R., Perkins, S., Walker, A. and Wolfart, E. "Morphology - Thinning." Hypermedia Image Processing Reference (HIPR2), University of Edinburgh.
  • Haralick, R. and Shapiro, L. Computer and Robot Vision, Vol. 1, Addison-Wesley, 1992.
Browse

More topics to explore

    Browse all articles