# A BIM Based Framework for Damage Segmentation, Modeling, and Visualization Using IFC
## 5 Case Study
### Generation of BIM with Physical Defects  
The photos for automatic processing have been taken manually with a Sony Alpha 7 III camera and a 28-70 mm lens. Figure 10a shows some example photos that have been used for the damage segmentation. The spalling investigated is on a primary beam of the bridge. It shows several exposed and corroded reinforcement. 26 images with a resolution of 4000 \(\times\) 6000 Pixels of this spalling have been taken. These images were used segmenting the defect as shown in Figure 10b. In parallel, the images are used to generate the point cloud of the damaged beam. Figure 11 shows a demonstrative series of images to illustrate the resulting segmentation via inference, where Figure 11a show a spalling in concrete, the inferred damage probability map after damage segmentation is depicted in Figure 11b, whereas Figure 11c show the thresholded binary images of the prediction maps, and Finally, Figure 11d the show the defect with the binary damage map superimposed on the original inspection images. Figure 10d illustrates the generation of the point cloud with the defect based on the segmented defect and the point cloud of the component. Highlighted orange and cyan points in the damaged point cloud are labeled as damaged in Figure 12d,h respectively. Figure 9: Bridge that has been used for the investigation. Name and location of the bridge are confidential. Figure 10: Overview of the case study with all included steps. The described process of geometry generation requires the alignment of the point cloud that has been generated from the BIM model and from the SfM. This alignment is achieved by using the GoICP algorithm [50,51]. Figure 13b shows the resultant extrusion of the points marked as spalling. The multitude of points in the point cloud is not required for subsequent finite element analysis or visualization, and hence, the geometry is simplified to limit the memory required. Therefore, Figure 13c shows a geometry with reduced details, which may be observed by decreased roughness of the surface on the front. Subsequently, the point cloud with the defect information is used for generating the vertices of the defect geometry. Damaged points are used to triangulate a mesh, which is used as a profile for extruding the final geometry. Figure 13 shows the point cloud with the defect as input and the resultant defect geometry. Figure 11: Inference output of the retrained TeranusNet16 model via transfer learning on the use case inspection images. (**a**) First inspection image for the presented case study. (**b**) The resulting prediction map of (**a**) from inference. (**c**) Binary thresholded prediction mask of (**b**). (**d**) Binary mask overlaid onto the image in (**a**). (**e**) Second inspection image. (**f**) The prediction map of (**e**). (**g**) Binary thresholded prediction mask of (**f**). (**h**) Binary mask overlaid onto the image in (**e**). Figure 12: The process of backwards projection of specific pixels into 3D space. (**a**) The 3D reconstructed point cloud. (**b**) Labeled binary map of Figure 11c. (**c**) The estimated depth map of the photo in Figure 11a. (**d**) The back projected labelled points from (**b**). (**e**) The conformed normals of the vertices in the point cloud pointing towards the camera. (**f**) Labeled binary map of Figure 11c. (**g**) The estimated depth map of the photo in Figure 11a. (**h**) The back projected labeled points from (**f**). A BIM model of the bridge has been created by using existing plans, measurements on site, and Google Maps. Based on the BIM model, a synthetic point cloud of the as-built bridge model is generated by OpenSfM. The mesh of the segmented defect is generated by triangulating the vertices of the back-projected pixels in the segmented image into 3D world coordinates using its estimated depth map, the available intrinsic parameters of the camera, and its estimated pose calculated during the 3D reconstruction process via OpenSfM.