## 3 Methods
### Composition of Digital-Twin-Based Spatial Object Extraction Algorithm  
In computer vision, image segmentation is the process of dividing a digital image into multiple segments (sets of pixels), often referred to as superpixels. This process is aimed to simplify and/or change the representation of an image into something more meaningful and easier to analyze. This process is commonly used to identify objects and boundaries (such as lines and curves) in an image. In the context of digital twins, image segmentation is significant for understanding and replicating the physical attributes and details of an object or environment.  
To derive spatial objects from point cloud data, relationships among each data point, which are typically three-dimensional, must be established using location coordinates (X, Y, and Z) and color values (R, G, and B) via segmentation. Segmentation resembles assembling pixels in 2D images into a singular entity. For 3D data, segmentation entails collecting proximate points and segregating them into a single-point cloud. PCL offers various segmentation methods. This study employed the region growing (RG) segmentation algorithm, which is recognized as the most effective means to segment points, lines, and planes.  
When dealing with a large number of outliers, segmentation may fail to extract the desired object accurately. In such cases, outliers may be removed using two methods: the preprocessor method and random sample consensus (RANSAC). The preprocessor method removes nearby data to segment the region that the user wants to extract from all the points. Preprocessors can be set up based on both relative and absolute coordinates. In this study, the preprocessor function was initially based on relative coordinates because absolute coordinates were not yet set. However, even with preprocessing, outliers may remain. For example, if a user wants to extract fire extinguishers, which are point objects, the preprocessed 3D data may still contain line and plane data. In such cases, the RANSAC algorithm is used to remove elements such as planes, floors, ceilings, and walls. It can also be used to extract only plane data. PCL provides the self-supervised augmentation consistency algorithm for implementing RANSAC.  
The objective of this study was to achieve spatial object extraction in (near) real-time. Therefore, Open3D was deemed less suitable than PCL, which was the primary point cloud library selected to manage the final data. The core algorithms of PCL, including segmentation and RANSAC (to be discussed later), offer multiple configuration options and make it highly user-friendly. In addition, it is open-source and provides thoroughly validated reliability and efficiency.  
Figure 2: (**a**) Ochang underground utility tunnel and (**b**) floor plan of the target underground utility tunnel [4].  
The algorithm for identifying changes in the final spatial objects, which compares the final classified 3D point cloud data with the original data, used an octree. Octrees are frequently employed to condense large volumes of 3D data. In this context, they were used to ascertain whether objects have changed. The algorithm determines this with the absence of data in the octree, which signals that the data have been displaced when contrasted with the existing data. Because 3D data change across the x, y, and z coordinates, unlike 2D data, the algorithm of this study had to consider the extent of data variation. Therefore, an octree was incorporated into it.