Added thresholding in Skeletonization algorithm