In order to detect the distance automatically, a distance detect system was established. It applied methods such as how to obtain the laser center, how to obtain the three-dimensional information, and so on. First, set the width threshold and depth threshold to locate the laser, then searched the follow laser in a nearby region, and found the laser center by geometric methods. Second, reconstructed the laser center, transformed the data coordinate, converted the data into plane, finally computed the distance by geometric and statistics methods. Experimental results show the laser center data are continuous, noiseless. The precision of the step height is 50μm.