Accurate and rapid contour extraction of visual measurement for rail wear