In order to measure the optical distortion of float glass defect and obtain more accurate online measurement result, a novel online measuring method based on digital raster projection is proposed in the present paper. In this novel method, the deformation degree of optical distortion is represented as the diopter; thus a mathematical model is derived to describe the relationship between diopter and phase of fringe image. The image processing algorithm based on one-dimensional Fourier transform and elimination method of edge effect based on spliced removal method are used to process the fringe image. Finally, a diopter distribution of fringe image is obtained. The result shows that this novel method is able to fulfill the online measurement of the optical distortion with a higher accuracy of diopter which is up to 0.04D.