The online measurement of the metal surfaces’ parameters plays an important role in many industrial fields. Because the surfaces of the machined metal pieces have the characteristics of strong reflection and high possibilities of scattered disturbing irradiation points, this paper designs an online measurement system based on the measurement principles of linear structured light to detect whether the parameters of the machined metal surfaces’ height difference and inclination fulfill the compliance requirements, in which the grayscale gravity algorithm is applied to extract the sub-pixel coordinates of the center of laser, the least squares method is employed to fit the data and the Pauta criterion is utilized to remove the spurious points. The repeat accuracy of this system has been tested. The experimental results prove that the precision of inclination is 0.046° RMS under the speed of 40mm/sec, and the precision of height difference is 0.072mm RMS, which meets the design expectations. Hence, this system can be applied to online industrial detection of high speed and high precision.