With the development of hot charging and direct rolling technology in continuous slab casting, there are increasing demands for the surface quality of hot continuously cast slab evoked by modern metal material fabrication. In order to reduce noise, which is caused by scale, water film and oscillation marks, during on-line detection of surface defects, a sinusoidal phase grating projection method is presented to detect the depth and surface profile of surface cracks in continuous slab casting. This technology, based on a deformed projected grating pattern, which carries three-dimensional information of the measured surface of the slab, can provide an absolute measurement of the depth of the surface defect by using a temporal phase unwrapping algorithm. The main advantage is that objects containing depth discontinuities of the crack are profiled as easily as smooth ones. The experimental results show the method has a high signal to noise ratio, and good applicability for automatic crack depth testing in continuous casting.