Extracting topological relations between indoor spaces from point clouds

: 3D models of indoor environments are essential for many application domains such as navigation guidance, emergency management and a range of indoor location-based services. The principal components defined in different BIM standards contain not only building elements, such as floors, walls and doors, but also navigable spaces and their topological relations, which are essential for path planning and navigation. We present an approach to automatically reconstruct topological relations between navigable spaces from point clouds. Three types of topological relations, namely containment, adjacency and connectivity of the spaces are modelled. The results of initial experiments demonstrate the potential of the method in supporting indoor navigation.


INTRODUCTION
Today, people spend most of their time doing activities in indoor environments (Klepeis et al., 2001). 3D models of indoor environments are essential for a variety of routing and navigation applications and emergency response. In practice, 3D building information models (BIMs) are available for new buildings and represent the design state of the building, rather than the current state. Generally, BIMs include geometric elements but also spaces (i.e. rooms, corridors, and stairs) and their topological relations (Liebich, T. 2009;Lee, J et al., 2014). Up-to-date 3D models of indoor environments, which are providing not only building elements, spaces and semantic information, but also topological relations between indoor spaces, are useful for developing navigation guidance applications and emergency response systems.
In recent years, 3D indoor data models and methods for 3D indoor reconstruction have been topics of active research. In general, 3D indoor data models focus on the representation of geometry and semantic information as well as topological relations of indoor environments, yet without providing a method for deriving these from input data, such as point clouds or images (Lee and Kwan, 2005;Stoffel et al., 2007;Zlatanova, 2011, 2013). Meanwhile, most literature on 3D indoor modelling from point clouds and images focuses on the reconstruction of geometric elements, such as walls, floors and ceilings (Jenke et al. 2009;Budroni and Boehm, 2010;Sanchez and Zakhor, 2012;Xiao and Furukawa, 2012;Díaz-Vilariño et al., 2013;Xiong et al., 2013;Oesau et al., 2014;Díaz-Vilariño et al., 2015;Hong et al., 2015).
Several methods have been developed to establish topological relations between spaces and building elements from 3D models of indoor environments. Luo et al. (2014) derived interactively geometric network models as a navigable network for indoor environments from 3D models manually built by modelling experts. Jamali et al. (2015) presented a method to reconstruct a navigation network from a 3D building model represented as a primal graph and surveyed benchmarks as dual nodes. Gröger and Plümer, (2010) introduced a method to enable route planning using 3D geometric and topologically consistent models, generated automatically using predefined grammar rules from point cloud data. In practice, these methods require considerable human interaction in the reconstruction of 3D geometric and semantic models to facilitate the process of generating 3D indoor navigation networks. The interactive reconstruction process is time-consuming and requires expert knowledge.
The automatic reconstruction of navigable spaces and their topological relations from 3D point clouds/images has received little attention in indoor navigation research. Mura et al. (2016) developed a method to reconstruct a 3D cell complex from planes of permanent building elements to create a volumetric model of the rooms. This method models adjacency relations between surfaces of structural components, but not between the spaces. Khoshelham and Díaz-Vilariño (2014) proposed a shape grammar to model automatically navigable spaces of indoor environments as 3D parametric models from point clouds. In this approach, each room/corridor contains non-overlapping spaces containing geometric information, such as location, size, vertices and bounding faces, which can potentially be used to extract topological relations between navigable spaces for path planning and navigation applications.
In this paper, we propose an approach to automated extraction of topological relations between spaces of a Manhattan-world indoor environment from a point cloud. In this approach, the topological modelling process is implemented simultaneously with the process of modelling the spaces using the shape grammar rules proposed by Khoshelham and Díaz-Vilariño (2014). Three types of topological relations between spaces are modelled, namely adjacency, connectivity and containment. This paper is organized as follows: Section 2 elaborates the method for extracting topological relations between interior spaces. In Section 3, the experiments with both synthetic and real point clouds are presented and the results are discussed. Section 4 presents the conclusions and recommendations for future work to conclude the paper.

METHODOLOGY
Our approach to extracting topological relations between navigable spaces consists of two main steps. The first step is the geometric and semantic reconstruction, in which the point cloud is subdivided into navigable and non-navigable spaces. The second step is topology reconstruction, in which the adjacency, connectivity and containment relations between the navigable spaces are established.

Geometric and semantic reconstruction
The process of modelling geometric and semantic information of indoor environments is based on subdividing an input point cloud into navigable and non-navigable spaces by iteratively applying the shape grammar rules. Figure 1 shows the general workflow of the subdivision process. and merging them to form the final spaces (c). The brown, blue and grey cuboids represent walls, interior spaces and exteriors respectively.
Given a point cloud that is rotated such that the walls are vertical and parallel to the x and y axes of the point cloud, the shape grammar generates a 3D parametric model, which includes both geometric and semantic information of indoor environments, by repeatedly placing cuboid shapes into spaces enclosed by points, and classifying them into one of three types: interior space, exterior and wall. Then a merge rule is applied to sequentially merge the interior spaces and form the final navigable and non-navigable spaces. The parameters and conditions for invoking the grammar rules are learned from the input point cloud and the current state of the model. For more details on the geometric and semantic reconstruction and the learning of grammar rules, the reader is referred to Khoshelham and Díaz-Vilariño (2014).
Each shape generated by the grammar rules is stored as an object with a unique shape identifier id, a pair of grid coordinates (i,j), the parametric representation, consisting of location and size of the shape, and boundary representation (Brep), consisting of vertices and faces. This dual representation is useful in the derivation of the topological relations.

Grammar rules for topology reconstruction
Once the spaces are reconstructed, the modelling process proceeds with the extraction of topological relations between the spaces. To establish the adjacency, connectivity, and containment relations, we extend the grammar with the following three rules: The adjacency rule reads: shapes A 1 and A 2 are replaced with new shapes A 1 and A 2 containing updated adjacency relations on the condition cond. The evaluation of the condition cond depends on whether the adjacency rule is applied before or after the merge rule. When applied before the merge rule (see cuboids in Figure 1b, two shapes are considered adjacent on the condition cond that they share a common face. If A 1 and A 2 are produced by the application of the merge rule (see cuboids in Figure 1c, then the adjacency relations between them is established on the condition that they are of the type interior space (rooms, corridors) and there exists a common wall between them. The adjacency property adj of each shape contains a list of ids of all shapes that are adjacent to it.

Connectivity rule: Rconn
The connectivity rule establishes the connectivity relation between two shapes A 1 and A 2 . Before the merge rule, two shapes are connected on the condition cond that they are adjacent and they are classified as interior spaces. After the merge rule, two shapes are connected on the condition cond that they are adjacent, of the type interior space, and that the common wall between them contains a door. The connectivity property conn of each shape contains a list of ids of all shapes that are connected to it. The containment rule establishes whether a shape contains or is contained in another shape. The condition for the containment is that A 1 and A 2 are antecedent and subsequent (or vice versa) of a previously applied merge rule. More specifically, if A 2 is produced by merging A 1 with another shape, then A 2 contains A 1 , and A 1 is contained within A 2 . The containment rule can also be invoked interactively, for example to specify that a wall contains a door.

Learning the conditions and the sequence of grammar rules
The conditions cond to invoke the grammar rules for topology reconstruction are learned automatically from the input point cloud and the geometric and semantic information of the reconstructed cuboids. The grid coordinates of the shapes determine whether two shapes are neighbours. The B-rep information, specifically the vertices of the faces, determines whether two neighbouring shapes share a common face.
The sequence of applying the grammar rules is also learned from the point cloud and the current state of the model. The procedure starts by applying a placement rule, which places cuboid shapes into spaces enclosed by points. The size and location of each cuboid are learned from the histograms of x, y, and z coordinates of the points. Then the adjacency rule is applied followed by the classification rule to assign a label (interior space, exterior and wall) to each shape. The classification rule produces the terminal exterior spaces and walls, which will not be processed further. The interior spaces will be subject to the connectivity rule to establish the connectivity relations. The connectivity rule is applied iteratively until all pairs of adjacent interior spaces are checked for connectivity. The connectivity relations guide the application of the merge rule, which replaces pairs of connected interior spaces with their union.
After every application of the merge rule, the containment rule is applied to establish the containment relations and the adjacency rule is invoked to construct the adjacency relations of the produced shapes. The merge rule, the containment rule, and the adjacency rule are applied iteratively until no more cuboids can be merged. Finally, the connectivity rule is applied to produce the terminal interior spaces (i.e., rooms and corridors) with updated connectivity relations.

EXPERIMENTS AND RESULTS
Several experiments with a synthetic point cloud of a two-storey building and a real point cloud were carried out to evaluate the performance of the new grammar rules for establishing the topological relations between spaces of indoor environments. The synthetic point cloud was created with an average point spacing and random error of 5 cm. The synthetic data represents the building structure containing separate individual rooms connected via a long corridor. The maximum thickness of the walls is 0.5 m. The real point cloud was captured in an office building using a terrestrial laser scanner. The office building includes 5 office rooms and a long corridor running through all the individual office rooms. The maximum wall thickness of the real world indoor environment was 0.25 m, while the random error of points and the average point spacing were 8 cm and 5 mm respectively.
To evaluate the topological relations between the spaces of indoor environments, doors were inserted manually into the wall structures of the reconstructed models. We designed an interactive tool for adding the door locations and updating the containment relation of the corresponding walls. The following sections present the preliminary results of our experiments.

Results for the synthetic point cloud
The simulated point cloud of a two-storey building was divided into two sub-clouds based on the point distribution along the zaxis (Khoshelham and Díaz-Vilariño, 2014). The modelling process was applied for these two sub-clouds individually. Figure 2 shows the geometric and semantic reconstruction for the synthetic point cloud of the first storey by applying the shape grammar of Khoshelham and Díaz-Vilariño (2014). The doors are manually inserted into the 3D model. The brown cuboids are walls, while the blue cuboids represent spaces. Figure 3 illustrates the reconstruction of the topological relation between spaces by applying our proposed grammar rules for rooms 1, 2 and 3 of the first storey of the synthetic point cloud.
The blue circles represent the containment relations between the final interior spaces and their merged cuboids shown by yellow circles. Note that a unique id is generated for each cuboid. The walls without doors are shown as brown circles, while green circles show the walls containing doors. The adjacency and connectivity relations are represented as red dashed lines and black solid lines respectively. As shown in Figure 3a, rooms 1 and 2 are in the adjacency relation with three common wall cuboids (ids 12, 13 and 14). Meanwhile, room 2 and 3 are in the adjacency relation with a common wall with a door (id 56). Figure 3b shows how connectivity relations are reconstructed between the rooms, and also between adjacent cuboids within each room. The topological relations between the final interior spaces (i.e. rooms and corridors) are modelled by applying the adjacency, containment and connectivity rules after the merging process. Figure 4 shows the reconstructed adjacency and connectivity relations between the rooms and the corridor of the first floor of the synthetic point cloud. The relations between rooms 1 and 2, 4 and 5, and 6 and 7 are adjacency relations, shown as dashed lines in red. It is because these pairs of rooms are sharing common walls with no doors. Rooms 1, 2, 3, 6 and 7 are connected to the corridor, which is shown with black solid lines. These connectivity relations are derived since the common walls between the rooms and the corridor contain doors. Note also the connectivity relation between rooms 2 and 3, 3 and 4, and 5 and 6, due to the presence of doors in their common walls.   Figure 6 shows the topological relations established between the spaces by applying our proposed grammar rules. Figure 7 shows the adjacency and connectivity relations between the final interior spaces.

Results for the real point cloud
We evaluate our method on a real point cloud of an office building with a long corridor and 5 individual office rooms. Figure 8 shows the geometric and semantic reconstruction of a 3D indoor model from the real point cloud. The doors are inserted manually to connect the rooms with the long corridor. Room 1 and room 2 share a common wall also with a door. In this dataset, several cuboids were classified as exteriors (shown in grey colour) by the classification rule as they contain points neither on the sides nor on the ceiling.  Figure 9 shows the topological relations, including containment, connectivity and adjacency, established between the spaces by applying our proposed grammar rules. Figure 10 presents the adjacency and connectivity relations between the final interior spaces of the office building.

CONCLUSION
In this paper, we presented an approach to reconstruct topological relations between the spaces of an indoor environment from point clouds. We demonstrated that topological relations, such as adjacency, connectivity and containment, can be derived automatically from the geometric and semantic information of a 3D model of the indoor environment. This enables path planning and navigation guidance in indoor environments.
Our method is suitable for modelling indoor environments with Manhattan-world structure. The initial experiments presented in this paper showed the capability of our approach in reconstructing topological relations of Manhattan-world indoor environments. In future, we will evaluate our method with more complex indoor environments and point clouds containing clutters and occlusions.