MATLAB implemention of  image thinning algorithm.