Completed skeleton segmentation algorithm.