1. Introduction
Indoor disaster sites urgently requiring emergency services can be very dangerous; rescuers require data about the indoor conditions to efficiently perform their rescue mission and mitigate losses [
1] AR(Augmented Reality) devices allow rescuers to evaluate indoor disaster sites quickly, thus improving rescue efficiency [
2].
AR navigation considers the structure of the building and the locations of all rescue personnel. However, not only is the existing GPS focused on the outdoors [
3,
4], but also indoor navigation using GPS is difficult because GPS signals are weak or blocked in urban areas and inside buildings [
5,
6,
7,
8]. In addition, indoor disasters may create new obstacles such as collapses [
9].
We thus generated topological maps from image-based maps and updated obstacles in real time so that rescuers could quickly understand the building scenario. We also are developing AR navigation systems for indoor disaster sites. A schematic of topological map generation is shown in
Figure 1.
The A* algorithm [
10] has been available for some time, and is widely used because it is easy to implement and tends to generate accurate routes. Nevertheless, efforts are being made to increase the efficiency of pathfinding by improving heuristic methods [
11,
12,
13,
14,
15,
16].
A critical disadvantage of the A* approach is that it consumes a considerable amount of memory and computational power when the resolution of the map image is high [
15,
16]. As such, here we applied the corner node algorithm (CNA) in combination with A* for pathfinding; this approach requires less computational power and memory by preprocessing the data to generate the topology map.
CNA generates a topology map based on a two-dimensional (2D) array of map data via two steps: creating nodes by searching a physically inaccessible space, such as a wall, and determining whether individual nodes can be connected in a straight line. The topology map is then generated by connecting the valid nodes.
Because the CNA predefines the connections between paths by generating a topology map, it shortens the path search computation process, thus improving the efficiency and accuracy of the identification of the optimal path. The combined algorithm is suitable for indoor disaster-related applications, such as in situations in which routes must be found quickly, due to its significantly shorter computational time.
Section 2 of this paper introduces the A* algorithm.
Section 3 discusses the CNA.
Section 4 presents our experimental results,
Section 5 introduces AR navigation implemented using the algorithm, and
Section 6 provides a summary of our findings and concluding remarks.
2. Related Works
2.1. Path-Finding Algorithms
A* is a very effective and popular algorithm for pathfinding due to its excellent performance in real-world applications compared with the Dijkstra algorithm [
17].
A* is similar to the Dijkstra algorithm [
18]. However, one difference is that it assigns a heuristic estimate
, a rank value that estimates the best path through the vertex for each vertex x [
19] and defines an evaluation function for each vertex to find the optimal path from the starting vertex to the target vertex. The evaluation function
for this is as follows:
where
is the path weight from the starting vertex to vertex n, and
is the heuristic value from vertex n to the target vertex. The heuristic value of A* in this paper uses the distance between the starting and destination vertexes.
From the starting vertex, the algorithm evaluates the connected vertex by and adds it to the Open List. The node with the smallest cost among the nodes added to the Open List is added to the Close List, and this process is repeated for the selected node until the destination node is selected and added to the Close List. If the procedure cannot be continued because the Open List is empty, the algorithm determines that there are no possible routes to find.
2.2. Comparing the Related Works
The A* algorithm performs better than other path-finding algorithms because it uses heuristic estimations. However, the amount of computation increases rapidly when the resolution of an image-based map increases. Several researchers have sought to improve the heuristics or to increase efficiency via preprocessing.
The Jump Point Search (JPS) [
20] algorithm reduces the number of nodes by creating jump points in an A* algorithm that uses image-based maps. JPS creates a jump point when a specific condition is met. JPS searches all directions that can be taken from a reference point and creates a connection by defining the start node as a parent. However, a disadvantage is that nodes can be created at dead ends (independent of destination guidance) because jump points are nominated when it is possible to navigate in all directions from a specified point despite the existence of obstacles. Conversely, as CNA creates nodes employing obstacles (not spaces) as start points, it is possible to prevent node creation on paths that lead to dead ends.
The regions discovery algorithm (RDA) [
21] automatically creates boundaries and then divides maps into clusters by reference to specific conditions. RDA finds a start node from which it is possible to search a region from the top left of the map, from left to right and top to bottom, and then move to the right. If an obstacle is encountered or another area attained, a boundary is created; this process is repeated until all tiles are assigned to areal clusters. The A* algorithm can also be used in this manner, and it has the advantage that nodes are unnecessary. However, such algorithms are inappropriate for AR devices with relatively low specifications, because a large priority queue size must be allocated to memory. In contrast, for the CNA proposed in this paper, the amount of memory required for preprocessing is minimal because the number of nodes can be reduced to the number of corners of all obstacles if A* is employed.
3. Corner Node Algorithm
The computational time and type of error depend on the heuristic value used with A*.
Figure 2 shows an example of a distortion that may occur when using the straight-line distance from the selected node to the destination as the heuristic value. Distortion arises because the evaluation function
assigns a low score to the wrong path compared with the ideal path, even though there is an obstacle between the origin and destination. The A* algorithm’s performance also decreases when a high-resolution image is provided and there are many obstacles on the map. This is because each pixel must be used as a node in the absence of a topology map.
Figure 3 shows the difference in the pathfinding process when an algorithm processes an image-based map with versus without a topology map. In the case of
Figure 3a, because a topology map is not provided, all of the pixels are required for the process, resulting in performance degradation. However,
Figure 3b shows that the number of nodes required for the path search is significantly reduced with the use of a topology map.
If the topology map is provided through the CNA, it is possible to predefine efficient node connections during preprocessing compared with the existing method, in which obstacles cannot be determined until the selected node approaches the obstacle. Therefore, the addition of the CNA reduces the computation required after encountering an obstacle.
This paper proposes using the CNA to generate topology maps. Before processing the map data, an obstacle such as a wall is stored in a list. The algorithm then generates a topology map in a two-step process involving the creation and connection of nodes. A description of the process is provided in the following.
First, the algorithm searches the data corresponding to an obstacle, and a node is created in the free space adjacent to the data corresponding to a corner. In other words, this step creates a node after referencing all of the previously stored obstacle data lists, searching for adjacent data again, and determining whether the corresponding data correspond to a corner.
Second, the algorithm creates a connection between the nodes when the nodes can be connected in a straight line. Once determined, the algorithm performs vector subtraction by converting the position of each node into a 2D vector. If there is no obstacle between the generated vectors, the algorithm determines that the node can be connected in a straight line and makes the connection between the two vectors.
After completing the two-step preprocessing step, the path search can proceed with a pathfinding algorithm such as A*.
3.1. Node Creation
To create a node, the process of corner detection must first be completed. To detect a corner, all of the obstacle data stored in the predefined list are sequentially processed. After selecting a free space from the data adjacent to the diagonal line from the selected obstacle data, the adjacent data are searched again in the selected free space. If there is only one obstacle data point, it is determined to be a corner and a node is created.
Figure 4a represents the process of searching for data adjacent to a diagonal line by selecting data node (No.) 7 from among 16 cells. The reason for searching only the diagonal data of the eight directions is that if a node is created in the diagonal direction, it can be created in any corner, and the number of operations can be reduced by not exploring all eight directions.
With the selection of a data point adjacent to the obstacle, if it is a free space, the algorithm checks to see if the data can represent a corner node. For example, since data Nos. 2, 10, and 12 are free spaces corresponding to data No. 7, it is possible to determine whether a node can be created. Conversely, because data No.4 corresponds to an obstacle, it cannot be used to determine whether a node can be created or not.
Figure 4b shows an example in which No. 10 was selected from among the three data described above. Since No. 7 is the only obstacle data point among adjacent data, it is determined to be a corner, and a node is generated, as shown in
Figure 4c.
Figure 4d is an example in which No. 2 was selected. Because the data outside the image are not determined, only adjacent data in five directions are processed. In this case, there are two adjacent obstacle data; thus, No. 2 is not a corner, and no node is generated.
Figure 4e is an example in which No. 12 was selected. Likewise, as there are two adjacent obstacle data points, we determine that No. 12 is not a corner, and no node is created. After searching all of the data adjacent to the diagonal for all obstacle data, the process is terminated.
Algorithm 1: Pseudocodes for corner detection and node generation |
mapData[][] = data in 2-dimension array |
wallList[] = obstacle data |
PathNodeList[] = a list containing the generated nodes |
|
direction = {North, Northeast, East, Southeast, South, Southwest, West, Northwest} |
diagonalDirection = { Northeast, Southeast, Southwest, Northwest } |
|
for wallList.begin to wallList.end do |
if more than one of the data points of the wallList did not participate in the corner detection process, then |
Execute ‘Generate node based on the obstacle data’ |
endif |
endfor |
|
function ‘Generate node based on the obstacle data { |
for i = 0 to 4 do |
if Point(x,y) of direction diagonalDirection[i] == ‘Free space’ then |
Execute ‘Detect corner node’ |
endfor |
} |
|
function Detect corner node { |
wallCount = 0 |
for i = 0 to 8 do |
if Point(x,y) of direction direction[i] == ‘obstacle’ then |
wallCount += 1 |
endif |
if wallCount == 1 then |
Create node at Point(x,y) |
Add node to PathNodeList |
endfor |
} |
3.2. Node Connection
The algorithm uses vector subtraction to connect nodes. The equation below describes the vector subtraction performed on any two vectors separated by (x,y) from zero:
As in the above equation, by performing subtraction on two vectors, a vector connecting the two vectors can be generated. Therefore, using the coordinate of the node to generate a vector separated by (x,y) from the zero point, each node can be connected in a straight line, as shown in
Figure 5.
By normalising the newly created Vector 3, Vector 4 with only a direction value for the target node can be generated, as shown in
Figure 6.
The generated Vector 4 determines whether the start node and target node can be connected in a straight line. The scalar product process is repeated until multiples of Vector 4 (shown as green arrows in
Figure 7) connect with the target node.
As shown in
Figure 7a, if an obstacle other than the target node is encountered on the way, the algorithm determines that the two nodes cannot be connected. The algorithm connects the two nodes when Vector 4 reaches the target node without encountering an obstacle.
At this time, Vector 4 may be used by adjusting the size by a
multiple. As
decreases, the obstacle recognition accuracy increases. Conversely, as
increases, the accuracy decreases, but the speed increases. We recommend using a
of 1 because when
> 1, as shown in
Figure 8, adjacent data may cross.
Figure 9 shows a scenario in which overlapping paths may be generated when multiple nodes are placed on a straight line. In
Figure 9a, it is possible to generate a connection even though the movement paths overlap, because the node lies on a vertical line. However, in
Figure 9b, when a node is recognised as an obstacle, it is possible to prevent a connection that creates a duplicate path.
The algorithm is terminated when all nodes have been processed for node connectivity. Each node has connected node information and a weight (linear distance). In addition, the generated topology map can apply a path search algorithm, such as A*.
4. Implementation
Here we consider AR systems that rescuers are likely to use in indoor disaster situations. The AR system aims to provide preliminary information necessary for rescuers to perform the rescue mission, as well as enhanced functionality for navigating the disaster area and making decisions regarding the mission.
The algorithm in this paper is part of the AR system under study and was developed to generate a topology map using field images. It calculates the shortest distance to the destination.
When implementing the pathfinding application, we assumed that the image is processed in a form that can be used in the system and that the user’s location is trackable. Microsoft’s HoloLens 2 was used to run this application, and the Unity Engine and MRTK libraries were used as development tools.
Due to the nature of Unity Engine, the application was converted into C++ when compiling the code, and C# was used for implementation. The detailed system environment is shown in
Table 1.
Figure 10 is a photograph of a user selecting a destination location. The red circle indicates the user’s location, and the green box indicates the destination. The destination can be selected through the user interface (UI) at the bottom. Clicking the Start button generates a path to the selected destination.
The generated path is displayed on top of the mini-map, and the route is guided through HoloLens 2.
Figure 11 shows the virtual object for navigating superimposed on top of the real world viewed through HoloLens 2.
5. Experimental Results
The map data used in the experiment and building floor plan are shown in
Table 2. The map data were used to evaluate complexity with respect to the resolution, number of rooms, number of wall data, and preprocessing time, and were divided into very simple, simple, intermediate, complicated, and very complicated.
To demonstrate the map generation results of CNAs, we used maze data generated with mazegenerator.net of Alice AB. The experimental environment is the same as that shown in
Table 1.
Table 3 summarises five examples from among the results of applying the methodology described above to the virtual map data. Map Image is an image of the virtual maze map data created on mazegenerator.net.
Topology Map is a topology map image created based on map data. Maze Solution is included to prove that the path can be successfully explored when the pathfinding algorithm (here A*) is applied to the topology map (produced by the CNA). CNA + A* is the result of applying the A* algorithm to the generated topology map.
As shown above, CNA + A* obtained the same results in a comparison of the correct solutions. We also tested 100 virtual maze data points, from which a topology map was successfully created. Pathfinding was successfully carried out based on the generated topology map.
To verify that generating a topology map through preprocessing aids path discovery, 10 scenarios per map data were created, and the performance was compared and analysed according to the time required to search for a path, number of nodes visited and the specified starting and ending points. For the same scenario, A* used the straight-line distance between the starting point and arrival point as a heuristic. The experiment in which A* applied the same heuristic to the topology map generated by the CNA was repeated. In this case, the starting and ending points of the scenario were arbitrary points, in which the linear distance differed by ≥100; scenarios in which a route could not be searched were excluded.
Table 4 shows the results of reducing the number of nodes through preprocessing.
Complexity refers to the complexity of each map. We used the number of image pixels and the number of corners when evaluating map complexity.
The information on the image used for each complexity is shown in
Table 2.
Table 5 shows the results of analysing the time difference when A* is used alone versus when A* is applied to the topology map generated with the CNA.
Complexity refers to the complexity of each map. Single A* time is the average time taken to search for a route using only A* in the map data.
Preprocessing Time is the average time taken to generate the topology map by performing the CNA. Topology Map + A* Time is the average time taken when the A* algorithm is applied to the topology map generated by applying the CNA.
Percentage represents the difference (in milliseconds) when A* is used alone and with the Topology Map, rounded to the third decimal place.
5.1. Very Simple
When finding a path to a destination, when the same pathfinding algorithm was performed on the preprocessed topology map, 39 nodes were visited, representing a reduction of 99.92% compared with the average of 46,062.5 nodes visited with the existing image map. If path finding was performed using an image map with only the existing A* algorithm, the number of nodes visited was very high, resulting in performance degradation. When the topology map was generated and applied through preprocessing, the number of unnecessary and repetitive operations to the destination was reduced significantly. Preprocessing through the CNA took 7 ms, compared with 75. 8 ms when only A* was used; applying the same algorithm to the topology map generated by the CNA took 1.2 ms. The processing time decreased by 90.77% when the preprocessing and pathfinding processes were performed together relative to when they were performed alone.
5.2. Simple
It had a structure similar to that of the very simple map, but was more spacious. Moreover, there were more obstacles to reaching the destination. Compared with the average of 122,703 nodes visited in the image map when searching for routes to the destination, an average of 102.2 nodes (reduction of 99.92%) was required when the same path search algorithm was performed on the preprocessed topology map. Since the resolution was higher compared with the map data of very simple complexity, the time required for the path search with the image map was further increased. When only A* was used, it took an average of 264.2 ms, and when preprocessing was performed through the CNA, it took an average of 46.2 ms. When the same algorithm was applied to the topology map generated by the CNA, it took 2.5 ms, representing a reduction of 99.05% when preprocessing and path search were performed together versus alone.
5.3. Intermediate
Unlike the previous map, which was rectangular, the intermediate map had an elbow-shaped structure with more rooms, as well as more obstacles to reaching the destination. When finding the path to the destination, when the same path was found for the preprocessed topology map, 147.2 nodes were visited on average, representing a reduction of 99.86% compared with the average of 107,462.6 nodes visited in the existing grid environment. It is assumed that the average number of visited nodes in the image map decreased despite the further increase in resolution because the amount of internally accessible free-space data was smaller than the image resolution. Applying A* to the image map took 183.8 ms on average, which is shorter than for the map with Simple complexity. However, because the number of generated nodes and resolution are higher, the preprocessing time through the CNA was further increased to 90.4 ms. When the same algorithm was applied to the topology map generated by the CNA, it took 2.8 ms (a decrease of 98.48%) when preprocessing and pathfinding were performed together versus alone.
5.4. Complicated
The map was square-shaped, with a structure in the centre and more rooms, entrances, and obstacles than the previous maps. Compared with the average of 176,671.1 nodes visited with the conventional image map for pathfinding to a destination, when the same pathfinding algorithm was applied to the preprocessed topology map, an average of 200.8 nodes were visited (decrease of 99.89%). Since more obstacles are encountered due to the central structure when generating a path, the time required for pathfinding through the image map is greatly increased. When A* was applied to the image map, it took an average of 775.5 ms, and when the preprocessing was performed through the CNA, the average time was 280.8 ms. When the same pathfinding algorithm was applied to the topology map generated by the CNA, it took an average of 6.7 ms; this represents a a 98.48% decrease when preprocessing and pathfinding were performed together versus alone.
5.5. Very Complicated
The image showed an inverted U-shaped structure and had the most rooms, entrances, and obstacles among all maps considered. Compared with the average of 759,311.4 nodes visited with the conventional image map for pathfinding to the destination, when the same path search algorithm was performed on the preprocessed topology map, an average of 380.8 nodes were visited (decrease of 99.95%). Given its higher resolution, more obstacles, and longer moving distance compared with the map with lower complexity, the time required for path search with an image map increased greatly. When A* was applied to the image map, the average path search time was 3342.1 ms, and when preprocessing was performed through the CNA, the average time was 1137.2 ms. When the same pathfinding algorithm was applied to the topology map generated by the CNA, the search took 9.7 ms (99.71% less time when preprocessing and pathfinding were performed together versus alone).
5.6. Special Case
This map was U-shaped, with more rooms and entrances compared with the map with low complexity. When the same pathfinding algorithm was applied to the preprocessed topology map, the average number of nodes visited (n = 260 nodes) was reduced by 99.82% compared with the average of 143,376.6 nodes visited in the case of the existing image map (to search for a path to the destination). Although the image resolution did not increase compared with the map data with intermediate complexity, the time required for pathfinding through the image map increased, as there were more obstacles and the distance to be moved increased substantially. As a result, when only A* was used, it took an average of 557.6 ms. The average time required for preprocessing through the CNA was 582.8 ms, and when the same algorithm was applied to the topology map generated by the CNA, it took 2.8 ms, which means the overall execution time increased by 99.01%.
6. Discussion
Although the overall image resolution of special case was lower than that of intermediate, the preprocessing time and number of generated nodes increased greatly due to the diagonal wall space.
Figure 12 shows a diagram explaining this phenomenon. When the image is viewed in units of pixels, the spaces drawn diagonally are stored in the form of
Figure 12. When the image is converted into map data, the cells are identified as corners in the CNA; thus, a large number of nodes are created in the diagonal space.
Therefore, the preprocessing time increases because more operations are required to connect the nodes. However, if the preprocessing is performed only once when generating the topology map, it can be applied continuously until the building structure is changed; thus, even if the preprocessing process takes a long time, the pathfinding time can be greatly reduced.
7. Conclusions
Here, we propose using a CNA for generating a topology map through preprocessing to address the limitations of pathfinding algorithms encountered when processing high-resolution image maps. The performance of existing pathfinding algorithms, such as A*, improved significantly by first generating the topology map with the CNA. The CNA creates a topology map through two steps: node creation and connection. Since implementing the CNA is simple and uses a mathematical method to connect nodes, a path can be easily created. In addition, the topology map has the advantage that it can be reused as long as the map data do not change. For indoor situations, the CNA is highly useful because the internal structure of the building itself rarely changes. In this paper, we applied the CNA to an AR device, HoloLens2, and displayed the path using a topology map for indoor navigation. The user selects the destination location through the application, and a path from the user’s location to the destination is created and given to the user as a guide.
Since the generated path is displayed as a virtual object, in the real world and on the mini-map, the user does not need to understand the structure of the building because the application directly displays the path in the real world as a guideline through AR devices. We expect that the time required for pathfinding during activities such as rescue will be reduced.
To compare performance when using the A* algorithm alone with the image map and using it with the topology map generated through the CNA, we analysed the node compression rate, number of node visits in the topology map, and processing time. The CNA reduced the number of visited nodes by (at least) 99.82 to 99.95%. A comparison of the path search times with and without the topology map showed that the processing time was reduced by at least 90.77% and up to 99.71%.
The CNA showed excellent results in most cases, especially with fewer corners and more obstacles to the destination. However, it showed poor performance when preprocessing in a diagonal space, which should be addressed in future work.