A new phase-unwrapping algorithm for the phase map containing discontinuities by the use of a system with crossed grating is described in this paper. A crossed grating is projected onto the object in the usual way, the deformed grating image acquired is Fourier transformed and the frequency spectra for the individual gratings are separated. Using both phase distributions which have different sensitivities, the correct phase values in the presence of discontinuities, especially those caused by the object with height steps, can be obtained. This algorithm is fast and accurate. The results of the measurement of a three-dimensional object with height steps are presented.