Fringe projection is a versatile method for mapping the topography of surfaces. In this paper, it is used to measure the defects on the head of railroad rails while the rails are moving. Railroad rails are made by hot rolling. The quality of the finished product is generally good, but surface texture will deteriorate with increasing temperature. A method for online inspection therefore is very desirable. In the present experiment, dimensional inspection of the railroad rails was made online while moving at a speed of 1-2 m/s. Therefore, it is important to minimize the registration time. To achieve this, we apply a method of fringe location with subpixel accuracy that requires only a single exposure for each registration.