This work proposes a two-step phase-shifting algorithm as an improvement of fringe projection profilometry. Considering the working process of fringe projection, the captured fringe image is formulated with two variables, i.e. surface reflectivity and phase value. And a phase shift of 3π/2 is introduced to get the two-step phase-shifting. After appropriate variable substitution, expressions of two fringe images can be transformed into two equations corresponding to a line and a circle respectively. With this circle-line model, the characteristic of solution and the phase error due to non-zero ambient light are analyzed. Then the approach of error compensation is proposed based on estimation of the real fringe contrast and non-linear least square optimization. The validity of the proposed approach is demonstrated with both simulations and experiments.