pythonimage-processingscikit-imagemathematical-morphology

Morphology skeleton - differences betwen scikit-image, pymorph, OpenCV-Python?


I noticed significant differences in skeleton geometry between various python scientific graphics oriented packages.

Skeleton using OpenCV-Python:

Skeleton using OpenCV-Python

Skeleton using pymorph:

Skeleton using pymorph

Skeleton using scikit-image:

Skeleton using scikit-image

As one can observe OpenCV-Python and pymorph produce the same skeleton but scikit-image does not. What is the reason for skeletons' differences? Which one is proper skeleton?


Solution

  • These packages implement different algorithms. The first two apply the Medial Axis Transform whereas scikit-image implements the method described in "A fast parallel algorithm for thinning digital patterns" by T. Y. Zhang and C. Y. Suen. If you want the same behavior in scikit-image, try skimage.morphology.medial_axis.