bundles / skimage latest / skimage / morphology / _skeletonize / skeletonize
function
skimage.morphology._skeletonize:skeletonize
source: /dev/scikit-image/src/skimage/morphology/_skeletonize.py :18
Signature
def skeletonize ( image , * , method = None ) Summary
Compute the skeleton of the input image via thinning.
Parameters
image: (M, N[, P]) ndarray of bool or intThe image containing the objects to be skeletonized. Each connected component in the image is reduced to a single-pixel wide skeleton. The image is binarized prior to thinning; thus, adjacent objects of different intensities are considered as one. Zero or
Falsevalues represent the background, nonzero orTruevalues -- foreground.method: {'zhang', 'lee'}, optionalWhich algorithm to use. Zhang's algorithm [Zha84] only works for 2D images, and is the default for 2D. Lee's algorithm [Lee94] works for 2D or 3D images and is the default for 3D.
Returns
skeleton: (M, N[, P]) ndarray of boolThe thinned image.
Examples
X, Y = np.ogrid[0:9, 0:9] ellipse = (1./3 * (X - 4)**2 + (Y - 4)**2 < 3**2).astype(bool) ellipse.view(np.uint8) skel = skeletonize(ellipse) skel.view(np.uint8)✓
See also
Aliases
-
skimage.morphology.skeletonize