Lee et al.This is a new implementation, developed with reference to the original paper and two other implementations:
"Building skeleton models via 3-D medial surface/axis thinning algorithms."
Computer Vision, Graphics, and Image Processing, 56(6):462–478, 1994.
- the ITK version from Hanno Homann (possibly-broken link http://hdl.handle.net/1926/1292)
- the Skeletonize3D ImageJ plugin by Ignacio Arganda-Carreras
- Pete Bankhead
thinpublic static void thin
(Mat mat)Thin the binary image in
Mat. Here, the image is assumed to be 2D or 3D; if 3D, then the z information is found along the channels dimension.
The thinning is performed in-place. The image is converted to uint8 if required; non-zero pixels are considered foreground and zero pixels background.
The resulting image has 0 in the background and retains the original (after conversion to 8-bit) value in the foreground (typically 1 or 255).
mat- the image to thin