The results were divided into two sections. The first section describes the results of the camera calibration of the mobile device and the establishment of the magnetic field model in the training phase. The second section describes the results of the magnetic field positioning method and the ORB-SLAM method used for coordinate constraint corrections. In addition, the accuracy of the positioning results is discussed.
4.1. Analysis of the Results of the Training Phase
The calibration data in this study were obtained from images captured by the built-in camera of the Xiaomi Mi 10 Lite smartphone. During the shooting process, checkerboard calibration was used as the center. In every set, a total of 18 images were shot horizontally and vertically in nine directions around and directly above the center. Three sets of data were used for testing. The camera calibration toolbox for the MATLAB 9.8 software (R2020a) was used for processing, and the calibration result was used as the default value in the ORB-SLAM system. During the image collection process, the anti-shake feature of the mobile phone was turned off to prevent the automatic correction of the image. In addition, we ensured that the calibration mark remained flat and that the surrounding area remained white. We improved the image contrast and calibration effect and increased the accuracy of corner extraction by using the checkerboard calibration mark with different lengths and widths.
Table 4 presents the calibration results, where f is the focal length;
are the principal points of the image;
are the radiation distortion parameters; and
are the radiation distortion parameters.
Data sampling was performed on the basis of the planned route. The Xiaomi Mi 10 Lite mobile phone was used as the experimental tool, and magnetic field data were collected using the AndroSensor software to build a database.
Figure 5 presents the results of Kriging interpolation. The passages between the north and south of the building had high magnetic intensity values in both the vertical and horizontal directions. As stated by Li et al. [
10], a large amount of steel changes the indoor environmental magnetic field. Thus, we inferred that the connecting passage should be the location of the instrument and computer rooms. The environment contained many heavy metal utensils; thus, its magnetic force value was larger than those of the other areas. The training results were used for subsequent indoor magnetic field positioning experiments.
Finally, the stability of the indoor magnetic fingerprint map was analyzed. Three test points were selected as the sampling points, and the magnetic intensity value of the location was determined at different time intervals; the hourly variations in the values were analyzed.
Figure 6 presents the variation in the curves of the magnetic intensities at the different sampling points. The mean magnetic intensity values at the three sampling points were 20.927, 15.970, and 26.053 μT, respectively. The standard deviations were 0.559, 0.579 and 0.580, respectively. The magnetic intensity value was relatively stable over a medium and long term, and the indoor magnetic field exhibited a fixed value; these findings were similar to those reported for the environmental magnetic fields in previous studies.
4.2. Analysis of Constraint Correction
We minimized the positioning error to ensure that the positioning point traveled on the correct path and processed positioning data in real time. This study used the concepts of scene constraints and magnetic matching coordinates as the starting point of the ORB-SLAM line segment. The initial point was used as a scale to solve the problem of the trajectory offset caused by the rotation to complete indoor positioning coordinate correction. When the matching point of the magnetic field was used as the starting point, at least three consecutive points were required, and the three points were based on the matching coordinates obtained using the three consecutive steps. We performed a 4PCS coordinate conversion by using the positioning coordinates of the front part of the ORB-SLAM system to determine the conversion parameters. Then, the ORB-SLAM key frame coordinates were converted to real coordinates.
Figure 7 presents the key frame coordinates and matching points. In
Figure 7, the red points represent the SLAM key frame positions, and the purple points indicate the magnetic field matching points at the beginning of the line segments.
In the ORB-SLAM coordinate system, the first image was used as the starting point (0, 0, 0). The camera center coordinates were considered as the position; these points differed from the coordinates obtained from the sixth-floor plane in this experiment by one rotation and translation. We used the coordinate transformation method to determine the transformation parameters of the two coordinate systems.
Figure 8 presents a schematic of the selection of the coordinate conversion points. The magnetic field matching point was used as the reference point, and the ORB-SLAM coordinate was used as the point to be converted. As presented in
Figure 9, the original ORB-SLAM coordinate trajectory was converted to obtain the movement trajectory after the coordinate constraints were corrected in the magnetic fingerprint map.
Compared with loose coupling, this constraint method had the following two advantages. Coupling weighting uses the RMSE of two or more positioning techniques as the weight. However, when the positioning accuracy of any technique was considerably low, the overall accuracy of the ORB-SLAM system was high. However, a large deviation was observed in the latter part of the trajectory, resulting in a situation where both the weight and the positioning error were high. In addition, the coupling of the overall calculation process and the check point cannot be performed immediately; the check point can only be determined on the basis of the positioning results. Different from the coordinate constraint correction method, the conversion parameters could be obtained in real time through the initial location of positioning technology, and a starting reference for the subsequent key frames could be obtained.
The scope of the experiment included the north and south buildings with a total route length of 140 m, and eight check points were planned along the route to determine the positioning accuracy. The route included the 45° and 90° rotations.
Figure 10 illustrates the distribution of the eight check points and the direction of the route used in this study.
Figure 11a depicts the results of magnetic field positioning. Twists and turns were observed in the course of the trajectory.
Figure 11b presents the positioning trajectory of the ORB-SLAM system. The overall trajectory was not attached to the end point. In most cases, the trajectory deviated from the real path and was out of the walkable range.
Figure 11c illustrates the positioning trajectory of the coordinate constraint correction method. The corrected trajectory was within the walking range. This method effectively controlled accumulation errors and, thus, can be used for indoor positioning.
Table 5 presents the positioning errors determined after coordinate constraint corrections. The mean error of the test data of the three sets was 0.613 m. The maximum error was approximately 1 m, and the minimum error was less than 0.1 m. The three sets of the test data had stable results (
Figure 12), and the positioning error exhibited an accuracy of less than 0.6 m for 75% of the time. After long-distance movement, the algorithm used in this study exhibited good control of accumulated errors. The experimental findings indicated that the positioning accuracy could be adjusted according to different routes and user states. The level could be maintained within 1 m.
After coordinate constraint corrections, the improvements in the accuracy levels of the magnetic field and the ORB-SLAM system were 85.58% and 97.16%, respectively (
Table 6). These findings indicated that the coordinate constraint correction method could effectively improve indoor positioning accuracy.
To confirm the feasibility of the positioning system, we evaluated the same user at different times and states using different brands of mobile devices. The Samsung Galaxy Note 9 was selected as the second experimental device. The positioning errors of the magnetic field and the ORB-SLAM system were 1.762 m and 12.065 m, respectively (
Table 7). The positioning error of the coordinate constraint corrections reached 0.697 m. The accuracy was approximately 60% higher than that of magnetic field positioning and approximately 95% higher than that of the ORB-SLAM system.
Figure 13 reveals that in 80% of cases, the errors could be maintained below 1 m, and only some cases had errors of more than 1.5 m.
The positioning results and walking trajectories of a single positioning technology considerably differed from different mobile devices, and no correlation was observed between the positioning results and walking trajectories. However, the results obtained without correction could not meet the required indoor positioning accuracy. The positioning results obtained after coordinate constraint corrections were relatively stable. The positioning could still be determined within the same indoor range, and the positioning accuracy was between 0.5 and 0.7 m even when different mobile devices were used. Therefore, desirable positioning results were obtained for the same user by using different mobile devices at different times and states.