A thinning algorithm by contour generation | Synapse