Abstract
Computing the skeletal graph, or medial axis, of a 2D shape is a fundamental task in computer vision, yet balancing topological correctness with geometric accuracy remains challenging. This paper presents a robust algorithm that combines a physics-inspired divergence measure with topology-preserving thinning. By treating the distance gradient field as a flow and identifying sinks via net outward flux, the method produces subpixel-precise skeletons. A heap-based thinning process ensures the resulting graph maintains the original shape's homotopy. Experimental results on diverse biological and man-made silhouettes demonstrate the algorithm's efficiency and robustness to boundary noise.
Introduction
A "skeleton" serves as a compact, stick-figure representation of a shape, capturing its essential topology and geometry. While vital for shape recognition and matching, traditional extraction methods often struggle. Voronoi-based techniques frequently produce noisy branches, while distance-function methods often fail to preserve connectivity. This work bridges these approaches by using a divergence-ordered thinning process that is both accurate and topologically sound.
Methodology
Divergence as a Guide
The core of the approach treats the Euclidean distance function of a shape as a physical system. The algorithm calculates the divergence (net outward flux) of the gradient vector field. High negative divergence identifies "sinks"—points where the flow from boundaries converges—which naturally correspond to the medial axis. This integral measure is inherently more robust to boundary noise than local derivatives.
Homotopy-Preserving Thinning
Rather than simple thresholding, which can lead to disconnected components or unwanted "islands," the authors employ a thinning process ordered by the divergence values. The shape is "peeled" layer by layer, starting with pixels of lowest divergence. To maintain the shape's original topology (homotopy), each pixel removal is preceded by a local 3x3 neighborhood check. This check ensures that removing a pixel does not alter the Euler characteristic, preventing the creation of holes or the breaking of connections.
Efficiency and Precision
The algorithm utilizes a heap data structure to manage the thinning order, achieving $O(n \log n)$ complexity relative to the number of pixels. To overcome the limitations of a discrete grid, a final subpixel shifting step moves skeletal points to their exact locations on the continuous medial axis using the distance function, providing arbitrary precision.
Results and Discussion
The algorithm was evaluated on various silhouettes, including complex biological shapes like panthers and lizards, as well as man-made objects. Key findings include:
- Topological Integrity: The method consistently produces connected skeletons that faithfully represent the original shape's structure.
- Robustness: The use of flux over an area makes the skeleton less sensitive to minor boundary perturbations.
- Computational Performance: The heap-based implementation allows for rapid processing, making it suitable for large shape databases.
While highly effective, the authors note minor ambiguities in 2x2 pixel blocks and the need for a threshold to prune insignificant branches. Future work includes extending these robust thinning rules to 3D medial surfaces, where the topological constraints are significantly more complex.
Summary updated