Morphological skeleton

In digital image processing, morphological skeleton is a skeleton (or medial axis) representation of a shape or binary image, computed by means of morphological operators.
Morphological skeletons are of two kinds: 
Skeleton by openings.
Lantuéjoul's formula.
Continuous images.
In (Lantuéjoul 1977), Lantuéjoul derived the following morphological formula for the skeleton of a continuous binary image formula_1:
where formula_3 and formula_4 are the morphological erosion and opening, respectively, formula_5 is an open ball of radius formula_6, and formula_7 is the closure of formula_8.
Discrete images.
Let formula_9, formula_10, be a family of shapes, where "B" is a structuring element,
The variable "n" is called the "size" of the structuring element.
Lantuéjoul's formula has been discretized as follows. For a discrete binary image formula_13, the skeleton "S(X)" is the union of the skeleton subsets formula_14, formula_15, where:
Reconstruction from the skeleton.
The original shape "X" can be reconstructed from the set of skeleton subsets formula_14 as follows:
Partial reconstructions can also be performed, leading to opened versions of the original shape:
The skeleton as the centers of the maximal disks.
Let formula_20 be the translated version of formula_21 to the point "z", that is, formula_22.
A shape formula_20 centered at "z" is called a maximal disk in a set "A" when:
Each skeleton subset formula_27 consists of the centers of all maximal disks of size "n".
Performing Morphological Skeletonization on Images.
Morphological Skeletonization can be considered as a controlled erosion process. This involves shrinking the image until the area of interest is 1 pixel wide. This can allow quick and accurate image processing on an otherwise large and memory intensive operation. A great example of using skeletonization on an image is processing fingerprints. This can be quickly accomplished using bwmorph; a built-in Matlab function which will implement the Skeletonization Morphology technique to the image. 
The image to the right shows the extent of what skeleton morphology can accomplish. Given a partial image, it is possible to extract a much fuller picture. Properly pre-processing the image with a simple Auto Threshold grayscale to binary converter will give the skeletonization function an easier time thinning. The higher contrast ratio will allow the lines to joined in a more accurate manner. Allowing to properly reconstruct the fingerprint. 
 skelIm = bwmorph(orIm,'skel',Inf); %Function used to generate Skeletonization Images 