# Generating skeletons and centerlines from the distance transform

## Abstract

We describe an algorithm for generating connected skeletons of objects in a binary image. The algorithm combines essentially all desirable properties of a skeletonization method: (1) the skeletons it produces have the same simple connectivity as the objects; it is based on a distance transform and can use any "natural" distance metric (in particular those giving a good approximation to the Euclidean distance), resulting in skeletons that are both (2) well-centered and (3) robust with respect to rotation; the skeletons allow the objects to be reconstructed either (4) exactly or (5) approximately to within a specified error; (6) for approximate reconstruction, the skeletons are insensitive to "border noise" without image prefiltering or skeleton postpruning; (7) the skeletons can be thin; (8) the algorithm is fast, taking a fixed number of passes through the image regardless of the width of the objects; and (9) the skeletons have a pleasing visual appearance. Several of these properties may conflict. For example, skeletons cannot always be both thin and allow exact reconstruction and our algorithm can be run to give priority to either property. This paper describes the skeletonization algorithm, discusses the tradeoffs involved and summarizes the formal proofs of its connectivity and reconstructability properties. Because the algorithm is fast, robust, flexible, and provably correct, it is ideally suited for many of the applications of skeletonization-data compression, OCR, shape representation and binary image analysis. The quality of the skeletons produced is demonstrated with numerous examples. © 1992.