1. Introduction
Indoor positioning technology is of great significance for location-based services (LBS) and boasts a wide range of applications in our daily lives [
1], such as emergency rescue and hospital navigation [
2,
3,
4]. In recent years, with the miniaturization and integration of sensors, inertial navigation positioning technology based on Inertial Measurement Units (IMUs) has been frequently adopted for indoor pedestrian tracking and navigation [
5,
6]. One of the main implementation methods is the Pedestrian Dead Reckoning (PDR) algorithm [
7,
8]. However, it inevitably incurs cumulative positioning errors that cannot be mitigated over time. There are two solutions to this problem: one is infrastructure-based methods, and the other is infrastructure-free methods.
The infrastructure-based methods combine UWB [
9], Wi-Fi [
10], Bluetooth, and other technologies. However, these technologies rely on supporting infrastructure, which entails time-consuming, laborious, and costly large-scale facility installations [
11]. Meanwhile, due to the constraints of indoor terrain, the signal is significantly interfered by the multipath effect [
12]. Therefore, the infrastructure-based PDR calibration algorithm can hardly be applicated to constrained terrain scenes.
The infrastructure-free PDR calibration method reduces errors through an algorithmic process. A representative method is the zero-velocity update algorithm (ZUPT) [
13,
14], which is generally suited for foot-based dead reckoning systems. However, Yu et al. proposed that an IMU installed on the feet may be influenced by impacts between the feet and the ground during walking [
15]. In contrast, IMUs placed on the waist do not encounter this issue, resulting in higher accuracy for step detection. Meanwhile, Yu et al. compared the effectiveness of pedestrian tracking methods using IMUs placed on the feet, waist, and a handheld smartphone. By conducting walking experiments on three different paths, they concluded that the waist-mounted system exhibits the highest positioning accuracy and stability [
15]. The foot-mounted system was most affected by variations in the walking paths. Liu et al. [
16] compared the effectiveness of installing inertial sensors on the waist, feet, and knees. Their findings indicated that the gyroscope readings from the waist location provided the most accurate estimation of pedestrian heading. Li et al. [
17] designed a magnetic matching-assisted indoor positioning system based on a waist-mounted sensor array. However, the performance of this method will decrease due to the magnetic interference generated by metal objects in modern architecture. In the case of avoiding external interference, Shi et al. [
18] proposed a PF-SLAM indoor pedestrian location algorithm based on a feature point map without prior knowledge of the map. However, the accuracy of the constructed feature points depends on the amount of data and the accuracy of the device, which bring a high cost and instability for positioning. Note that only the building structure will remain constant, and it is presented on the map. Zizzo et al. [
19] integrated a map-based particle filter to correct the errors in the inertial navigation algorithm. However, the particle filter algorithm operates too slowly to run in real time. The method of setting landmarks on the map for matching can help to calibrate the positioning error [
20]. Ghaoui et al. [
21] designed a landmark matching system based on a PDR and a particle filter (PF), achieving a high-precision indoor positioning result. Although these methods can achieve better performance in 2D positioning, they cannot achieve 3D positioning, which has a wider range of application scenarios.
Yang et al. [
22] extended the indoor positioning problem to three dimensions by combining it with multiple sensors. Zhao et al. [
23] combined inertial sensing devices with a barometer for 3D positioning. They effectively eliminated the accumulated altitude estimation error caused by the inherent drift of IMU sensors through the complementary filters and error compensation algorithms. Nam et al. [
24] proposed using multiple sensors to detect terrain features, in order to identify unique landmark information. They utilized this landmark information to correct positioning drift errors in systems without infrastructure. However, the methods mentioned above that combine inertial sensors and barometers will inevitably have a certain degree of error. Experiments designed by Yang et al. indicated that even on level ground, atmospheric pressure fluctuates with pedestrian movement, leading to estimation errors [
22]. Additionally, atmospheric pressure is significantly influenced by weather conditions such as temperature and humidity, impacting the measurement results and height accuracy. Regular calibration is necessary to ensure precision, with different calibration parameters required at varying altitudes. The error of the above methods is essentially derived from the influence of the environment. In order to avoid the influence of the external environment, Xie et al. [
25] proposed a foot-mounted pedestrian navigation system with an IMU. The experiment results show its high accuracy in 2D positioning and altitude estimation. The method they proposed relies on the pre-obtained motion pattern of a pedestrian, that is, the zero-velocity detection method and lateral-velocity restriction method are applied when a pedestrian walks horizontally in a 2D plane, and the stair step height correction method is applied when a pedestrian takes stairs. Under the condition of continuous 3D positioning, the motion pattern of a pedestrian will change, thus introducing an extra accumulated error which is hard to eliminate by the previous methods.
Fortunately, the change of motion patterns of people also provides extra information about their position in the building. Therefore, in this paper, a 3D positioning scheme is proposed to obtain the positional information of a pedestrian with the aid of motion pattern recognition. Note that the stair entrance is the position where the pedestrian’s motion pattern changes, and it marks a change in altitude. Moreover, indoor corners contain clear position and direction information, which can be used to identify turns in behavior [
26]. Therefore, we could use the terrain features of the building, i.e., indoor stair entrances and the corners of the corridor, to calibrate the error, achieving accurate 3D positioning. The positions of all indoor terrain feature points can be obtained through engineering drawings. The Terrain Feature Matching Calibration (TFMC) method is as follows: (1) The acceleration data collected by inertial sensors are divided into data under the pattern of taking the stairs and horizontal walking through the motion pattern recognition. (2) Through the reckoning of pedestrian planar trajectory and altitude, the stair path and horizontal path can be recovered. For the stair path, stair entrances are matched with transition points of motion patterns. For the horizontal path, corners of the corridor are matched with pedestrian turning points. After matching, position calibration is performed to eliminate the accumulated errors, with further calibration of step length and yaw for the horizontal path. The main contribution of the proposed method lies in its effective reduction of PDR error, and thus it more accurately calibrates pedestrian 3D walking trajectories with the use of IMUs only.
The rest of this paper is structured as follows. First,
Section 2 discusses some related work in the paper.
Section 3 introduces the Terrain Feature Matching Calibration (TFMC) method under indoor constrained terrain.
Section 4 conducts experimental verification and result analysis.
Section 5 summarizes the full text.
3. TFMC Method
3.1. Method Overview
Figure 1 gives an overview of the proposed TFMC method, which includes motion pattern recognition (MPR), pedestrian planar trajectory reckoning (PPTR), pedestrian altitude reckoning (PAR), position matching-based calibration (PMC), and extended position matching-based calibration (EPMC). MPR is applied to divide the acceleration data into the data under the patterns of taking the stairs and horizontal walking. For the data of horizontal walking, PPTR is performed to recover the horizontal path. Then, the starting point and end point of each horizontal path are obtained. Note that between the end point of the previous horizontal path and the starting point of the next horizontal path is the stair path. Based on the data of taking the stairs, actual terrain information, and starting points and end points produced by PPTR, PAR is performed to recover the stair path. Subsequently, the stair path is calibrated by using the method of PMC with the position information of stair entrances. Similarly, the horizontal path is calibrated by using the method of EPMC with the position information of corridor corners. Finally, the calibrated stair path and horizontal path are combined to reconstruct the path, and the calibrated three-dimensional path is obtained.
3.2. Motion Pattern Recognition
The interquartile range (IQR) is a statistical method used to measure the dispersion of data, which is robust against outliers or extreme values. It effectively mitigates the impact of extreme values in acceleration data. Therefore, the IQR is utilized to process the acceleration data [
36]. The window size of accelerometer signals is set as 100, and the data of the series are arranged in descending order. The calculation formula of the IQR is as follows:
where
and
are the median values of the first 50 and the last 50 data, respectively.
It can be seen from the indoor building structure that when a pedestrian walks in a constrained terrain, the pedestrian will turn significantly at the corner of the corridor to enter the next constrained terrain area. A pedestrian will first pass through a corner of the corridor before reaching the stair entrance. Therefore, the turning time point can be used to divide the IQR data, and the complex walking process of a pedestrian can be divided into several parts containing single motion patterns. With the sliding window detection method, if the window continuously detects coordinate points that meet the threshold conditions, then the last coordinate point is regarded as a corridor turning point. The division of IQR is shown in
Figure 2.
According to the figure, the pedestrian walking process is divided into nine parts. These parts are roughly categorized based on the size of their IQR values. The cumulative probability distribution curve is shown in
Figure 3.
The mean and standard deviations of the IQR data are selected as the characteristic variables, and standard deviation is computed by:
where
is the sample data,
is the sample average, and
N denotes the sample number. As depicted in
Figure 4, acceleration data for the three motion patterns were collected utilizing an inertial sensor, comprising 100 groups for each pattern.
Analysis of the time-domain characteristics of the IQR shows a distinct ascending trend for mean values when comparing the patterns of going upstairs, walking horizontally, and going downstairs. Additionally, the standard deviation of going downstairs is significantly larger than that of walking horizontally or going upstairs. The mean and standard deviations of the IQR are composed of pattern feature points that can be used to characterize the motion pattern.
The KNN algorithm is used for classification. The KNN algorithm is a case-based learning method, which starts the classification process only when it receives a prediction request, classifying by finding the K cases in the training set nearest to the new instance [
37].
Table 1 shows the process of the KNN algorithm.
Through the KNN algorithm, the motion pattern of each part of the walking process can be recognized. Subsequently, the acceleration data of the walking process are divided into data of taking the stairs and horizontal walking.
3.3. Pedestrian Planar Trajectory Reckoning and Pedestrian Altitude Reckoning
Through pattern recognition, it can be obtained that the time pedestrians pass through some turning points corresponds to that of motion pattern transition. However, in the actual scene, after passing the corner of the corridor, the pedestrian will walk a distance before reaching the stair entrance and get into either the going upstairs or going downstairs pattern, which is the transition part. Therefore, PPTR is proposed to estimate the walking duration of the pedestrian on the transition part and thereby recover the horizontal path.
As mentioned in
Section 2.2, the PDR algorithm is performed to recover the horizontal path without the transition part, based on the acceleration data of horizontal walking. And the average speed of the pedestrian on the horizontal path can be calculated. The calculation formula is as follows:
where
is the step length of each step in the previous horizontal path, and
T is the total walking duration. The average speed
is set as the speed of pedestrians when they walk on the transition part.
The straight distance
D from the corner of the corridor to the stair entrance can be obtained from engineering drawings. The walking duration on the transition section is calculated as follows:
where
is the transition duration. The acceleration data of the first
seconds of taking the stairs, that is, the acceleration data of the transition part, are extracted and then merged into the data of horizontal walking. The change in the motion pattern occurs at the moment when the pedestrian reaches the stair entrance. Subsequently, the PDR algorithm is performed to recover the horizontal path. Then, the starting point and end point of each horizontal path are obtained.
Based on the acceleration data of taking the stairs, actual terrain information, and starting points and end points produced by PPTR, PAR is performed to recover the stair path.
Considering actual terrain information, the pedestrian will have a short horizontal walking pattern with turns at the half-story height of the building, which will be regarded as turning feature points. Therefore, a one-floor ascending process is decomposed into two parts, and a similar situation is applied to the descending process. The altitude change of the pedestrian walking through the stairs can be obtained as follows:
where
m is the number of continuous upstairs or downstairs parts, and
H is the story height.
As a simple connection passage between floors, a stair is a strong constraint that only serves to facilitate changes in altitude. And two adjacent horizontal paths are connected by stairs. The end position of a horizontal path is set to , where the pedestrian’s motion pattern changes. Since the 2D position does not change after walking through the stairs, the starting position of the adjacent next horizontal path is equal to , where the pedestrian’s motion pattern changes. Note that the change of the motion pattern occurs at the moment when the pedestrian reaches the stair entrance. Therefore, and are the positions of the pedestrian entering and leaving the stairs, respectively. The stair path can be recovered by connecting the above two points.
The stair path and horizontal path are combined in chronological order to recover a complete 3D pedestrian path.
3.4. Position Matching-Based Calibration on Stair Path
PMC is proposed to calibrate the stair path. The stair entrance where the pedestrian enters is regarded as the path feature point to form the set
M, and the stair entrance of the building is regarded as the terrain feature point to form the set
N. The Euclidean distance between all the feature points of the set
M and the set
N is calculated in turn. The calculation formula is:
where
is the coordinate of the path feature point, and
is the coordinate of the terrain feature point.
Having matched the nearest path feature point with the corresponding terrain feature point, the coordinates of the path feature points undergo calibration using those of their respective terrain feature points. This process accomplishes the position calibration. Due to the long Euclidean distance between different stair entrances, the method based on distance matching has a high fault tolerance rate.
3.5. Extended Position Matching-Based Calibration on Horizontal Path
For the horizontal path, due to the close distance between the corner feature points, relying solely on Euclidean distance matching will result in a higher mismatch rate. Therefore, EPMC is proposed to calibrate the horizontal path.
The position where the pedestrian turns is considered to be a path feature point, while the corner of a corridor is deemed to be a terrain feature point. The two-dimensional coordinates of the feature path segment to be calibrated, where the path feature points are located, are extracted to form the set
P. The two-dimensional coordinates of the standard feature path segment, where the terrain feature points are located, are extracted to form the set
Q as part of the standard path library. The schematic diagram of the path segments is shown in
Figure 5.
The abscissa of each point in the feature path segment to be calibrated constitutes the variable
, and the ordinate constitutes the variable
. The abscissa of the points in each standard feature path segment constitutes the variable
, and the ordinate constitutes the variable
. The linear correlation coefficients
and
between the feature path segment to be calibrated and the standard feature path segment are calculated. The calculation formula i:
where
is the covariance between the variables
and
, and
,
,
,
are the standard deviations of the variables
, respectively. When the linear correlation coefficient is greater than 0.8, it is judged as a very strong positive correlation, meeting the matching conditions. The corresponding feature points of the terrain feature points and the path feature points are matched. Otherwise, no matching is performed.
If the segments in sets
P and
Q cannot achieve a one-to-one match, the Euclidean distance between the path feature points and the terrain feature points in the remaining path segments is calculated as follows:
where
is the coordinate of the path feature point, and
is the coordinate of the terrain feature point. The nearest path feature point is matched with the terrain feature point.
After feature point matching, coordinates of the path feature points are calibrated to the coordinates of the matching terrain feature points. Additionally, the step length calibration and yaw calibration can also be performed based on the feature point information at the corner of the corridor.
Concerning step length, when estimating PDR step length, the constructed step length estimation model in Equation (2) may have deviations. Therefore, it is necessary to perform personalized step length estimation for different users through off-line calibration or external information [
38]. Since the pedestrian’s motion pattern is relatively stable during horizontal walking, the average step length
can be used to replace the step length of each step between two adjacent feature points. Considering that the gait speed may change around the corners, the step length before and after the turning point will be affected. When calculating the average step length of pedestrians, the step length affected by the turn is deleted.
Taking the turning point as the center of the circle, a circle with a radius of one meter is made, and the area inside the circle is the turning area. If the step position is in the turning area, it will be deleted. As illustrated in
Figure 6, T
1 and T
2 are two adjacent turning points. Between T
1 and T
2, their corresponding deleted step lengths are sl
1 and sl
2, respectively.
The average step length calculation formula is as follows:
where
S is the distance between two adjacent path feature points, as the reference distance of pedestrian walking, and
sl is the sum of the deleted step lengths.
N is the number of steps between two adjacent path feature points, and
n is the number of deleted steps.
For yaw calibration, the error in the yaw angle will accumulate over time. By matching the feature points, the yaw information corresponding to the terrain feature points can be used as a reliable direction for calibrating the original yaw angle. The calibration process is illustrated in
Figure 7.
For the horizontal path divided by the turning point, the difference
between the average yaw angle of the previous horizontal path and the current horizontal path is calculated. And the yaw angle of the current horizontal path is calibrated by the terrain corner angle
, corresponding to the turning point. The calculation formula is
where
is the calibration value of the average yaw angle of the path. The yaw angle of the current path is calibrated to
where
represents the yaw angle corresponding to each step of the current path. The calibrated yaw angle is averaged to update the average heading angle
of the current path. According to the order of the pedestrian passing through the corner of the corridor, the above steps are carried out in turn to complete the yaw calibration.
Finally, the calibrated stair path and horizontal path are combined in chronological order to reconstruct a complete 3D pedestrian path.
5. Conclusions
In this work, an indoor 3D positioning algorithm using Terrain Feature Matching Calibration (TFMC) is proposed. The proposed method contains motion pattern recognition and position matching-based calibration. The proposed motion pattern recognition realizes the accurate recognition of pedestrian motion patterns. Based on the motion patterns of pedestrians, the pedestrian 3D walking trajectory can be recovered. The proposed position matching-based calibration can achieve effectively reduce PDR errors to calibrate pedestrian 3D walking trajectory. The experimental results show that the accuracy of motion pattern recognition is over 97%, and the average positioning error decreases from 6.60 m to 1.37 m. Compared with the previous methods that only use IMUs, the proposed method shows an advantage for achieving complete 3D positioning. On this basis, the PDR positioning error is reduced by 79.2%, and accurate 3D positioning is achieved. Due to its sole reliance on inertial sensors without the necessity for additional sensors, the proposed method ensures both convenience and cost-effectiveness, making it a promising choice for indoor positioning in various LBS applications.
In modern buildings, in addition to taking the stairs, a pedestrian can also take the elevator. In the future, the motion pattern of taking the elevator can be included in the motion pattern recognition.