A spectral encoding imaging scheme based on the optical frequency comb (OFC) is proposed to improve the axial capability. The surface topography information of the measured sample is encoded to the frequency and phase of the mode-locked OFC, then extracted from the interference spectrum through our well-designed data processing algorithm to obtain the relative position and depth of multiple pixels simultaneously. Finally, only one-dimensional (1D) scanning is required to reconstruct the three-dimensional (3D) shape of the measured object. With the comprehensive utilization of spatial dispersion and spectral interference technique, a 3D imaging system with axial resolution of 12.5 µm, axial measurement accuracy of 0.6 µm, and depth measurement range greater than 28 mm, is experimentally demonstrated.