In fringe projection profilometry, a method for solving 3D information by combining Gray code fringe images with phase-shifting fringe images has been widely used. In practice, there may still be phase mismatch between wrapped phase and complementary Gray code arrays. Based on the above problems, this paper proposes an improved complementary Gray code combined with phase-shifting profilometry (PSP) based on phase adjustment. First, the projected images are calibrated in advance, that is, the initial phase (image order) of the phase-shifting fringe images are adjusted so that the wrapped phase and the Gray code arrays match each other, and this image order is called the best order. Then, in the following practical measurements, the phase-shifting fringe images are substituted into the phase-shifting equation in accordance with this best order to obtain the wrapped phase. Finally, phase unwrapping is performed using the complementary Gray code phase unwrapping method to obtain the final unwrapped phase and 3D information from the phase-height mapping method. Compared to the traditional complementary Gray code combined with PSP, the proposed method can effectively improve the measurement quality without adding new projection images. Experiments show that the proposed method can improve the root mean square error (RMSE) and mean absolute error (MAE) accuracy by 89.63% and 89.76%, respectively, compared with the traditional complementary Gray code combined with the phase-shifting method (which has phase mismatch at this time), which improves the RMSE and MAE accuracy by −10.11% and −8.53%, respectively, and improves the efficiency compared with multi-frequency temporal phase unwrapping. © 2025 IOP Publishing Ltd. All rights, including for text and data mining, AI training, and similar technologies, are reserved.