# Geovisualization of Buildings: AI vs. Procedural Modeling
## 2 Materials and Methods
### Optical Recognition of Building Images  
Alternatively, the optical recognition of building images involves the utilization of computer vision algorithms to analyze visual data captured from images or videos of buildings. This approach relies on image processing techniques to identify and extract architectural features, spatial relationships, and structural elements from visual inputs. By leveraging convolutional neural networks (CNNs) or other deep learning models, optical recognition can discern intricate details and nuances in building facades, enabling the generation of highly accurate procedural models. However, the effectiveness of this approach may be influenced by factors such as image quality, lighting conditions, and occlusions, which can impact the accuracy of feature extraction and subsequent model generation. The automatic recognition of buildings and the generation of their 3D models has been created and demonstrated. Using neural networks and AI has resulted in successful and well-rendered examples; however, certain building photos require further refinement to achieve a visually satisfactory result. Automation has been shown and proven to be very useful for geovisualization cartographic purposes for shaping individual buildings as well as entire cities. First, image segmentation is performed (Figure 2), where individual elements of the image are separated so that AI can recognize them from a database of 3D building parts. Some other databases are also used for accessing building geometry parts, such as OpenStreetMap (OSM), CityGML, SketchUp 3D Warehouse, Trimble Building Point Cloud Library (PCL), Google Poly, Building Information Model (BIM) Repositories  
Depending on the level of technology available today, it can be observed that with a building image like in Figures 2 and 3, the models are visually satisfactory for the building in Figure 2, but not for the building in Figure 3. This is because computers and all available technology can only assume what is on the other side of the building. Therefore, it is necessary to have multiple images from all sides of the building (which is  
Figure 4: (**a**) Original image, (**b**) optical recognition and segmented image, (**c**) 3D model of the same building. Figure 3: (**a**) Original image, (**b**) optical recognition and segmented image, (**c,d**) 3D model of the same building. sometimes not possible) or at least one from the building's facade. However, the model is faithful to the building's visualization only if the building is symmetrical relative to the two surfaces captured from the facade. The drawback of this method is that when a building is photographed typically from only one side or the front, it is assumed that the rear side mirrors the front side. When this is not the case, unusual results can occur, which can distort the visual identity of the building, as seen in Figure 4, where the church towers are too far apart, and the entire church is deformed and stretched on the side opposite the photographer's viewpoint. Therefore, it is beneficial to introduce another step: primarily removing excess elements from the image before the modeling process. If a building is surrounded by other buildings, the so-called unwanted excess can also be automatically removed from the image, adding another step to the entire process of obtaining a 3D model. However, given the time-consuming nature of the process, this step is negligible and can be performed online; for example, in Ref. [51], with the result shown in Figure 4. The limitation of such a model is visible in Figures 4 and 5 because the optical recognition of parts from the original image is not possible in the lower part of the cathedral, where surrounding houses and buildings obscure the base of the cathedral, making it invisible in the original image. The original image of the object should always be of the entire object from all sides, which in this case can be achieved using a drone or terrestrial photogrammetry.