A sequential thinning algorithm is presented, which maintains connectivity within a 3-by-3 window to produce a pixel-thin skeleton from a connected, unevenly thick skeleton. The algorithm can be readily adapted for either 4-neighbor or 8-neighbor connectedness to aid the shape extraction of an object in a complex scene. The algorithm includes an efficient test for connectivity thereby minimizing processing time.
Chung Chang Lee,
"A Sequential Thinning Algorithm For Image Skeletonization", Proc. SPIE 0432, Applications of Digital Image Processing VI, (9 January 1984); doi: 10.1117/12.936680; https://doi.org/10.1117/12.936680