With the development of the Internet-of-Things, urgent market demands have also provided a huge development space for indoor pedestrian positioning systems (IPPS). Complementary filters (CF), Kalman filters and their various modifications are usually used to estimate the orientation in foot-mounted IPPS. However, the accuracy of the orientation is still low because of various types of electromagnetic interference and the diversity of pedestrians’ motion states. In this paper, an orientation estimation algorithm is proposed innovatively. First, the nine-axes inertial/magnetic sensors are calibrated using the error model of micro-electromechanical systems sensors. Then, the adaptive complementary filtering (ACF) algorithm is used to determine short- and medium-term orientation by making full use of the complementary error characteristics of the nine-axes inertial/magnetic sensors; the corridor geometry in rectangular buildings can also be regarded as prior information. Finally, the fusion of the orientation calculated by the ACF algorithm and the prior information is realized by the extended Kalman filter algorithm, which can improve the long-term accuracy of the orientation. To verify the performance of the proposed algorithm, a foot-mounted IPPS is set up based on MPU9250, and the raw data from the sensors are calibrated and imported into MATLAB for processing and analysis. The root mean square error of the orientation is less than 1.5° using the proposed method, and the results show that the proposed algorithm significantly surpasses other state-of-the-art algorithms, contributing to higher accuracy of orientation.