## Materials and Methods
### Room Segmentation
#### 3.3.2 Room-Space Segmentation  
In this step, the floor plane is segmented into a room-space by using a morphological erosion method after projecting the points of one story onto a horizontal plane. A binary image is created after the points in each story are projected onto a horizontal plane. The projection image is presented in Figure 4a. The color is black if the pixel does not contain points. A pixel is colored gray if it contains no less than one point. The size of each pixel is set to 25 mm in this dataset. The size of each pixel is determined by the thickness of the walls and the size and density of the point cloud. We suggest that the size of the pixel should be less than 1/5 of the wall thickness. Then, a pixel with more than one point inside was labeled as 1 and a pixel with no points inside was labeled as 0. The nonblack pixels in the projected image are colored white and the black pixels are colored black, as shown in Figure 4b. The white pixels in the binary image represent the accessible areas inside the building, while the black pixels indicate inaccessible areas, such as walls and outer areas. The rooms that contain long corridors are segmented by using a morphological erosion method. The algorithm is inspired by the work of [35; 59]. The morphological erosion method has two important parameters: the room area's lower limit (lower threshold) and upper limit (upper threshold). The lower threshold represents the smallest room size in the data, while the upper threshold means the largest room size. A small value for the upper threshold will lead to over-segmentation, especially in a long corridor, as shown in Figure 5a,b. This is because a long corridor, which usually traverses the entire building [11; 12], tends to occupy a large space in the floor map. Furthermore, if the size of the largest room is far larger than that of the smallest room, the large upper threshold will lead to under-segmentation in certain adjacent domains, as shown in Figure 5c,d. Under these problems, room-space segmentation is error-prone and unreliable. If no connection exists between each room, the under-segmentation condition will become rare, so the results of room segmentation will become more stable. By definition, a room is enclosed by walls, ceilings, and floors, while doorways break the closure of a room. Thus, the doorways in each room that lead to other rooms or corridors should be closed to obtain a better result. An offset space from the ceiling height interval is defined, as shown in Figures 6 and 7. The points above the interval along the z-axis and its normal horizontal with the floor are projected onto the horizontal plane as boundaries, as shown in Figure 8a. Vertical walls are as high as the ceiling, so most clutter, windows, and doorways are less than the ceiling height, as shown in Figure 6. Moreover, this method can easily discern an open door from an opening in a wall, as illustrated in Figure 7.  
Figure 4: Image after projecting points in each story onto a horizontal plane. (**a**) Projected image (a pixel is colored gray if it contains no less than one point, and a pixel with no points inside is colored black). (**b**) Binary image (a pixel is colored white if it contains no less than one point, and a pixel with no points inside is colored black). The accessible pixels in the maps (white pixels in Figure 8a) are iteratively eroded by one pixel. Then, connectivity analysis is performed to verify whether any areas are separated after erosion. If a separated area has a certain size between the lower and upper thresholds after connectivity analysis, then all of the pixels in this area are labeled an individual area, as shown in Figure 8b. This procedure repeats until all of the remaining areas are smaller than the lower threshold. If one area is surrounded by another, this area will be merged into the surrounding region, as shown in Figure 8b. Based on the labeled areas in Figure 8c, the unlabeled area in the accessible regions is extended by a wavefront propagation algorithm [60], as shown in Figure 8d.