INDOOR POSITIONING AND NAVIGATION BASED ON QR CODE MAP

: Solving the indoor positioning problem can effectively improve work and life efficiency. Outdoors, navigation and positioning mainly rely on satellites to provide global positioning and road network topology to constrain the direction of travel. Therefore, to achieve good indoor navigation and positioning, two things are needed: 1) continuous position acquisition and 2) an indoor road network. Since the indoor environment is relatively stable, the geodetic coordinates of key indoor nodes can be obtained in advance through measurement methods and control points can be set up. Inertial navigation is stable and autonomous, and when combined with control points, it can achieve stable position acquisition. QR codes are rich in information, low in cost, and easy to deploy. They can be used as nodes to construct an indoor road network or as control points. This study proposes an indoor road network map construction method that can achieve local accuracy and global consistency in large indoor scenes. In this indoor road network map, node information includes the position and posture of the QR code. When a machine passes through a node position, it can obtain its absolute position and direction in the geodetic coordinate system by taking a picture of the node’s QR code and combining it with IMU fusion positioning. Through map edge information, indoor navigation and path planning can be achieved.


INTRODUCTION
Individuals spend upwards of 70% of their time within indoor environments such as large parking facilities, airports, and libraries (Klepeis et al., 2001).Due to the unavailability of location services akin to outdoor Global Navigation Satellite Systems (GNSS), users within these environments often struggle to determine their position and plan routes to their desired destinations.Addressing the challenge of indoor positioning has the potential to significantly enhance both personal and professional efficiency.A diverse range of indoor positioning technologies are available for deployment within such environments; however, no industry-wide consensus exists regarding a standardized solution (Basiri et al., 2017).

Wireless positioning technologies including Wireless Local
Area Networks (WLAN) (Makki et al., 2015, Konings et al., 2018), Bluetooth (Li et al., 2018), Ultra Wide Band (UWB) (Mazhar et al., 2017), Radio Frequency Identification (RFID) (Brena et al., 2017), and Infrared (IR) may suffer from issues such as signal reflection or obstruction, power attenuation over distance or difficulties associated with large-scale deployment.High-precision positioning methods based on incremental estimation include visual Simultaneous Localization and Mapping (SLAM), laser radar SLAM, and inertial navigation.The reliability of visual SLAM and laser radar SLAM may be compromised within low-texture environments such as long corridors or large pipes.Inertial Navigation Systems (INS), by contrast, are capable of fully autonomous operation independent of external environmental factors and can maintain stability over extended periods.As such, they hold considerable promise within the field of indoor positioning and navigation.However, INS accuracy may degrade over time; periodic correction through the integration of external information is therefore necessary.
The accumulation of errors may be mitigated through the im- * Corresponding author plementation of control points containing both absolute position and posture data.These control points may be established through the manual placement of visual landmarks within a given environment.Passive visual landmarks, suitable for indoor navigation tasks (Kunhoth et al., 2019), should possess several key attributes: 1) the capacity to convey a broad range of information, encoded in an interactive format; 2) distinct geometric features, facilitating accurate positioning within images; 3) ease of recognition under variable environmental conditions, such as changing illumination or partial occlusion; 4) rapid decodability; and 5) Compatibility with commonly available recognition and decoding equipment.
Outdoor navigation typically relies upon the integration of Global Navigation Satellite System (GNSS) signals with path network data.GNSS technology facilitates the determination of current position, while path networks enable the establishment of relationships between origin and destination nodes and the calculation of optimal routes through network analysis.By analogy, if stable indoor positioning can be achieved through the use of INS in conjunction with control points, and combined with an indoor path network map, it may be possible to realize long-term, long-distance, and stable indoor navigation.
Quick Response (QR) codes provide an effective means of storing absolute pose information, offering benefits such as ease of acquisition, simple deployment, and low cost.Utilizing various encoding methods, QR codes are capable of representing a diverse range of information and may also function as control points within a scene.Furthermore, by considering indoor QR codes as network nodes and their interrelationships as edges, for the above indoor path network, if each node is a QR code, it can be called a QR code Map.The QR code information includes but is not limited to ID, location, floor, features (stairs, elevators, corridors, etc.), adjacent edges, etc.The edge is composed of connected QR codes and its information includes but is not limited to ID, starting QR code, ending QR code, features etc. Scanning QR code can determine its geodetic coordinates which solves the problem of determining the starting point position.At the same time, QR code also contains accessible destination information (equivalent to POI), and path planning can be performed by searching for POI to determine the destination QR code (Yan et al., 2022).
The main contribution and novelty of this paper can be summarized as follows: • A novel approach to indoor navigation and positioning that incorporates the use of control points.In contrast to traditional methods, which may be susceptible to sensor failure, our approach introduces control points containing position and posture data referenced to a geodetic coordinate system, enabling the correction of sensor readings.When combined with the autonomous and stable operation of inertial navigation systems, our approach facilitates long-term, large-scale indoor navigation and positioning.
• A design for an indoor map constructed using control points.Control point data is encoded within Quick Response (QR) codes, which serve as nodes within the indoor map network.Each QR code node functions both as a control point and as an information hub, providing accurate position and posture data for sensor correction while also facilitating navigation through the provision of node and edge information.

Design and Construction of Indoor QR code map
The original indoor path network can be obtained through the indoor design plan.Indoor merchants, doors, intersections, landmarks, elevators, stairs, etc. can be used as nodes of the indoor path network.
Nodes within the indoor map network encode a diverse range of information including, but not limited to: unique identification codes; three-dimensional corner position data referenced to a world coordinate system; floor-level data; node-type data; connectivity data for linked edges; lists of typically reachable nodes; and positional offsets.Relationships between nodes are represented as edges corresponding to traversable pathways such as corridors.Edge data includes unique identification codes; start and end nodes; length and width measurements; and centerline data.Table 1 presents an overview of QR code node content, while Table 2 details edge content.QR codes are deployed at each node within the indoor map network.Geodetic coordinates for corners may be obtained through techniques such as in situ measurement using a total station.

Indoor Positioning Method Based on QR Codes
QR codes are composed of black squares arranged in a square grid on a white background.They can be detected and decoded by imaging devices for correct interpretation.A QR code contains position markers, alignment makers, the timing pattern to determine the size of the code, version and format information, and data and error correction keys (Soon, 2008).There are many open libraries that can generate and detect QR codes.This study use the ZBar library for QR codes detection and interpretation.
When the device is near the road network node and needs to obtain its own position and orientation angle, QR code detection can obtain the pixel coordinates of the four corner points of the QR code on the image (ua, va), (u b , v b ), (uc, vc), (u d , v d ).
By decoding the information, we can obtain the real coordinates of the four corner points in the geodetic coordinate system, r w a r w b , r w c , r w d .At this point, we have four 2D-3D point pairs and can compute the camera pose by solving the PnP (Perspective n Points) problem.Before this, it is necessary to obtain the camera intrinsic parameters.In this paper, we choose the P3P (Gao et al., 2003) method which requires the geometric relationship between three pairs of 3D-2D matching points and uses an additional pair of points as validation to obtain the coordinates of 3D points in the camera coordinate system.We then solve for transformations of the camera coordinate system with respect to the geodetic coordinate system Rw2c and Tw2c by using the ICP method.The camera coordinate system and inertial guide base coordinate system can be calculated by solving for PnP (Perspective n Points) problem through camera calibration.The camera position can also be calculated by solving for PnP (Perspective n Points) problem.If transformations Rc2b and Tc2b between camera coordinate system and inertial guide base coordinate system have been obtained through calibration, we can obtain transformations of inertial guide relative to geodetic coordinate system by the following equations to obtain absolute

Position offset
The geodetic coordinates of traversable locations for this node.position and attitude of inertial guide in geodetic coordinate system.

EKF-Based Fusion for QR and PDR
Pedestrian Dead Reckoning (PDR) positioning algorithms determine pedestrian location in real-time through the accumulation of changes in pedestrian state variables such as position and heading angle.Within a two-dimensional plane, pedestrian trajectories may be calculated based on step length and direction angle.Given known position coordinates Pt k−1 = Et k−1 , Nt k−1 at time t k − 1, the corresponding position coordinates at time t k may be determined as follows: Where dt k−1 represents the walking step length between times t k−1 and t k , and thetat k−1 denotes the heading angle at time t k−1 .
Step frequency detection within PDR may be achieved through peak detection methods, identifying individual steps through the detection of peaks within accelerometer output signals.Two consecutive peaks are interpreted as a single step.Step length estimation is performed using the Weinberg step length estimation model: Where k represents the step length proportionality factor, and amax and amin denote the maximum and minimum accelerations detected during a single pedestrian step, respectively.
Whenever a QR code is detected, the accumulated error of position and heading angle estimation is corrected by combining the IMU with the external QR code, and the EKF is adopted.The initial system state is determined through the scanning of a QR code in proximity to the starting point and the subsequent calculation of position and pose.
The system state and observation equations are given by: The International Archives of the Photogrammetry, Remote Sensing and Spatial Information Sciences, Volume XLVIII-1/W2-2023 ISPRS Geospatial Week 2023, 2-7 September 2023, Cairo, Egypt Where W and V represent Gaussian white noise vectors associated with system state and observation equations, respectively.W and V are mutually independent, with noise covariance matrices denoted by Q and R. Within the state equation, x ′ k and y ′ k represent predicted k-th step positions, while θ ′ k denotes the predicted heading angle.x k−1 and y k−1 correspond to fused positioning results from the previous time step, while s k−1 and θ k−1 represent observed values for step length and heading angle.Within the observation equation, x − k , y − k , and θ − k denote geodetic coordinates and heading angle as determined through QR code analysis at time k.
The state transition and observation matrices, A and H, are given by: Additional: Where δx, δy, δS, and δ θ represent average errors associated with PDR positioning along the X-and Y-axes, step length estimation, and heading angle estimation, which is yields by experimental analysis.
The main process of EKF are as follows:

Path Planning and Navigation Based on QR Code Map
According to the existing topological information on the QR code map network, including the code number in the node content as the node and the path length information in the edge content as the weight of the edge, search for the QR code node np as the starting point and the QR code node nq as the end point according to the 3D code obtained by the camera scan, and complete the optimal navigation route planning, including the following steps: Step 1: Initialize set M and set N, set M only contains the starting node np, that is, Step Step 4: Repeat steps 2 and 3 until the target end point node nq is added to set M , export the node sequence of set M , which is the optimal path of QR code map route planning.
Upon successful decoding of QR code in proximity to a given node, both the current pose and the direction to the next node, referenced to a geodetic coordinate system, are known.Pedestrian navigation may be facilitated through the display of rotation angles on a device or through the use of visual aids to support decision-making.
When the device is traveling between nodes, let the width of the current planned path be denoted as w.If the distance d between the current positioning point and the centerline of the planned path is greater than 1/2w, it indicates that the dead reckoning error is severe at this time.P0 is the position of the current dead reckoning.A vertical projection is made to the centerline of the current planned path, and the projection point Pi is taken as the calculated position after calibration and used as the starting point for the next calculation.At the same time, the camera immediately starts searching for nearby node QR codes for pose estimation until a successful scan is achieved.

EXPERIMENT
Utilizing a laser rangefinder and protractor, images are captured by a mobile phone camera at distances of 1, 2, and 3 meters from the center of a Quick Response (QR) code along both 0°a nd 45°axes.Twenty images are captured at each position, as illustrated in Figure 6.At each position, the true location and pose of the mobile phone camera within a world coordinate system are determined using a total station.Tables 3 and 4 present data on the relationship between QR code detection error, distance, and angle.
Results indicate that, during subsequent experimentation, when an individual is walking parallel to a wall bearing a Quick Response (QR) code, their distance from the wall must be maintained at 2 meters or less in order to facilitate QR code detection and state observation.The experiment involved 31 position states.Six QR codes were placed along the path, all of which were affixed to pillars on one side of the path.The fusion results are shown in 5.
As shown in the figure, although the pedestrian dead reckoning method can continuously calculate position, the difficulty in determining the initial state and the cumulative error may result in a significant deviation in the calculated position.In contrast, the fusion positioning method that incorporates QR codes produces a position closer to the true trajectory and effectively reduces cumulative error.0°0°1 m 0.15 0.08 2m 0.25 0.21 3m failed to decode

CONCLUSION
In order to achieve stable indoor positioning and navigation over long distances and extended periods of time, a simple and effective positioning method is needed.Since inertial navigation positioning accumulates error over time, it is necessary to periodically correct the positioning error by introducing external control points.QR codes have mature detection and decoding capabilities and can be used as control points or as indoor nodes to construct a network map.In this study, QR codes were used as control points for indoor positioning and navigation.When a QR code is detected during navigation, the accumulated dead reckoning error is eliminated.The EKF algorithm was used to combine IMU data with QR code information.

Figure 1 .
Figure 1.Overall Framework of this study.

Figure 4 .
Figure 4. Navigation based on QR code Map.

Table 1 .
The Information Contained in QR Code Nodes.

Table 2 .
The Information Contained in QR Code Edges.
2: If node np and node ni in set N are adjacent connected nodes, search for node ni such that the node satisfying Lengthn [n,n i ] is minimal is n k , add node n k to set M, if node ni is not an adjacent connected node of node np, then Length h [ p ,n i ] weight is ∞.Step 3: With n k as a new intermediate point, if the weight from passing through node n k to node n f in set N is smaller than the weight without passing through node n f , update the weight of node n f in set N, otherwise do not process.