The phase-to-height imaging model, as a three-dimensional (3D) measurement technology, has been commonly applied in fringe projection to assist surface profile measurement, where the efficient and accurate calculation of phase plays a critical role in precise imaging. To deal with multiple extra coded patterns and 2π jump error caused to the existing absolute phase demodulation methods, a novel method of phase demodulation is proposed based on dual variable-frequency (VF) coded patterns. In this paper, the frequency of coded fringe is defined as the number of coded fringes within a single sinusoidal fringe period. First, the effective wrapped phase (EWP) as calculated using the four-step phase shifting method was split into the wrapped phase region with complete period and the wrapped phase region without complete period. Second, the fringe orders in wrapped phase region with complete period were decoded according to the frequency of the VF coded fringes and the continuous characteristic of the fringe order. Notably, the sampling frequency of fast Fourier transform (FFT) was determined by the length of the decoding interval and can be adjusted automatically with the variation in height of the object. Third, the fringe orders in wrapped phase region without complete period were decoded depending on the consistency of fringe orders in the connected region of wrapped phase. Last, phase demodulation was performed. The experimental results were obtained to confirm the effectiveness of the proposed method in the phase demodulation of both discontinuous objects and highly abrupt objects.