# Building Classification Algorithm Based on Improved Hough Transform and Geographic Information System

Authors: Guanyao Lu; Dan Xu; Yue Meng
Journal: Wireless Communications and Mobile Computing
 (2022)

---

## Abstract

Although determining the type of building can be useful for 3D reconstruction, image retrieval, and other applications, it is often difficult to do so automatically. A building classification algorithm using a geographic information system (GIS) is proposed in this paper. The typical adjustment of building polygon, local convex-concave simplification of large-area polygon contour, and local exaggeration of competing polygon groups merging in small-area polygon is the main topics of this paper. The preliminary outline area is obtained by analyzing the corner characteristics of two basic types of buildings in urban buildings using a large-scale morphological screen. The classification statistics of all kinds of corners are carried out using the improved Hough transform and the proposed line segment and corner optimization algorithm, and the automatic classification of flat-roofed and nonflat-roofed buildings photographed by digital cameras is realized. The experimental results show that the algorithm simplifies the polygons in a reasonable way while maintaining the block shape. Furthermore, the optimization algorithm proposed in this paper effectively eliminates the influence of false contours, allowing for high-accuracy building type judgment.


---

## Body

## 1. Introduction

The fineness and complexity of the building model, as one of the most important components of urban basic geographic information, can have a direct impact on the quality and efficiency of 3D urban model application [1]. GIS is widely used in the management of cities and communities in other countries. The construction of digital cities and communities is also on the rise in China, but building management is only considered as part of the digital community and digital city [2]. Flat roof box buildings, herringbone roof buildings, and double-sided herringbone roof buildings make up the majority of the city’s basic structures. The general development method of building management software separates the management of graphics and attributes, which makes operation and maintenance more difficult. This method of development management is only applicable to two-dimensional plane design [3]. As a result, in the process of 3D modeling basic buildings, determining the model type of buildings based on building images captured by digital cameras can provide a valuable foundation for model reconstruction. Graphic data and attribute data can be linked seamlessly using GIS technology [4]. GIS not only has relational database retrieval, query, and statistics functions, but it can also perform spatial analysis of 3D models [5]. Image retrieval, 3D modeling, and building detection and recognition all benefit from building image classification.In the application of GIS system, expressing geographic data in three-dimensional visual form is an important means for spatial information expression, query and analysis [6]. At present, most of the research on building classification at home and abroad is used for image scene classification in image retrieval. Machine learning and probability methods are used to distinguish various images such as marine landscape, mountain image, and urban building image, but there is little specific research on which kind of buildings in the image belong [7]. The information used to identify buildings in image scene is insufficient and uncertain, and there is inevitable interference. The complexity of the algorithm is due to the design concept of making full use of all available information. In land captured images, determining the type of building roof is rare, and there are few studies on automatic classification [8]. Only gray, texture, angle, and line are available based on the recognition algorithm of a single gray image [9]. The algorithm is also relatively simple, which makes automatic and real-time operation of the actual system easier. Modern methods clearly tend to use more complex target models and algorithm structures as algorithm structure evolves [10]. Buildings are a type of artificial target. The extraction of the building target area can help to narrow the search range for building feature detection, improve feature detection efficiency, and improve higher-level building target recognition and 3D reconstruction efficiency [11]. The future development trend is a 3D real scene map. The extraction of the target area of a building can also be used to classify the extracted street scene automatically. Building texture can be collected for mapping when creating a 3D city map [12]. This paper uses GIS to present the overall design of a building classification algorithm and to classify architectural style images.Due to certain similarities between different architectural styles and certain differences between the same architectural style with regional changes, there are some difficulties in architectural style classification. The traditional architectural style classification algorithm cannot solve this problem well [13]. The extraction of building area in the image is helpful to realize the automatic classification of the extracted street view. When building a 3D city map, you can collect building texture for mapping, etc. At present, 3D visualization is mainly realized by Digital Elevation Model (DEM) and other data in the GIS system. For the area with buildings as the main characteristics, it is necessary to overlay the three-dimensional model of buildings on DEM. In the existing GIS system, the spatial analysis with buildings as the main body is not satisfactory [14]. One of the reasons is that the three-dimensional data model of buildings used in spatial analysis in the GIS system is not conducive to spatial analysis. Buildings contain a lot of inherent characteristics, such as symmetry, closure, and simplicity. These characteristics are just in line with the Gestalt theory reflecting visual perception. The core idea of Gestalt theory is that the key to solve the problem is to grasp the integrity of things. Based on the assumption of the world of urban buildings, a new image-based algorithm for automatically determining the flat roof and nonflat roof of buildings is proposed. The results show that the proposed optimization algorithm can effectively eliminate the influence of false contours and then realize building type judgment. And the algorithm can achieve high accuracy.


## 2. Related Work

Literature [15] proposes that buildings, as one of the most important components of urban basic geographic information, show the main features of urban landscape and play an important role in people’s spatial environment cognition. Literature [16] uses local color histogram to extract building candidate targets in the image and then carries out fine matching to obtain building targets. This method uses less feature information and has good extraction effect in a single scene, but the extraction accuracy is not high when the building background is complex. According to the edge direction histogram information, literature [17] uses the multiscale method to extract the line feature information in the graph, then classifies the line segments belonging to the building and the background through the sample learning method, and distinguishes the building and the background through the line segment classification results. In Literature [18], aiming at the problem of building automatic recognition of 1 m resolution satellite images, a coarse to fine progressive automatic recognition algorithm based on feature learning is proposed. Literature [19] obtains the main tone of the building by analyzing the vertical straight line segments extracted from the image, determines the set of straight line segments containing the main tone as building segments, and automatically obtains the building area in the image. For this kind of method, its extraction time is fast, and it has a good effect on building extraction in simple scenes. However, this kind of algorithm does not combine the inherent characteristics of buildings and cannot deal with multitarget situations. At the same time, its extraction accuracy is not high in complex scenes. Literature [20] holds that 3D building model is one of the most complex models in 3D scene. Literature [21] adopts the method of machine learning, first divides the image into blocks by using the method of graph theory, then classifies the image blocks by SVM method, and marks the buildings in the image according to the structural characteristics of building targets. Literature [22] believes that although some research results have been achieved in the field of architectural style classification, the external relations between different architectural styles and the internal differences between the same architectural styles have not been well solved. Literature [23] established a three-dimensional shape model according to the perceptual theory, then extracted the building feature information in the 3D map through the improved light field method, and matched the extracted feature information with the established three-dimensional model library. Although this kind of method has good extraction effect, it needs to establish building model base or feature set in advance. The algorithm has many steps and complex calculation. In literature [24], each architectural style is different and has its unique characteristics and structure. Literature [25] uses color and line information to retrieve images in the image database, obtains a candidate set by comparing the hue histogram similarity between the image to be detected and the image in the image database, extracts the line feature information between the candidate set and the image to be detected through Hough transform, and calculates the similarity of line feature information by using cyclic correlation algorithm. Literature [26] holds that urban geographic information system provides decision support for urban construction and activities by storing, managing, analyzing, and displaying geographic information data in the whole or part of urban surface space. Literature [27] constructs the corresponding building model for the building target to be detected and matches the building in the image through the model. This method can only identify buildings similar to the template, and the effect of building target extraction is poor for buildings without corresponding building model. Literature [28] used DPM to capture the basic morphological characteristics of buildings and classified them with multiple potential logistic regression. Classification accuracy for ten and twenty-five architectural style data sets was 45.65% and 69.87 percent, respectively. To preserve the main contour area of the building, morphological sifting is used in this paper to fuse the small areas in the image. The contour is then extracted using an improved Hough transform, and a segment optimization algorithm is proposed, starting with the image’s point and line features. This optimization occurs throughout the algorithm, and it can be used to effectively eliminate the incorrect line segments generated during the Hough transform and line segment integration processes, as well as to eliminate the incorrect contour intersection and establish the corner adjacency graph. Finally, the number of extracted corners is used to determine the building type. This algorithm has a certain level of efficacy and precision. The experiment met its objective, demonstrating that the algorithm is practical and feasible, and that it can be used to classify buildings.


## 3. Methodology

### 3.1. Building Type Judgment Strategy

The building is a man-made target whose design and construction are in keeping with human visual aesthetics; so, it complies with Gestalt Rules [29]. As a result, we can extract information from local points, line segments, or building areas, combine it into a meaningful whole using gestalt theory, and use this integrated whole to complete the extraction, identification, and classification of building areas. The image in this paper is assumed to contain independent buildings, and that the camera is shooting in a roughly horizontal plane. This assumption is supported by statistics from a large number of unintentional images. At this time, the shot images show at least two planes of the building’s main body and describe complex structures with molecular characteristics. The common substructures of buildings are known as molecular features. This substructure is a program structure or class that is a data structure that is defined to simplify the data structure and make expression easier. Because the environment has such a strong influence on image quality, there are a few complicated factors to consider, such as occlusion from the top of the building. As a result, determining whether a building is flat-topped requires determining the roof type of the building in the image. To replace human visual interpretation, image classification involves quantitatively analyzing images by computer and categorizing each pixel or region in the image into one of several categories.In the visualization and spatial analysis of the GIS system, the relationship and attribute information between spatial entities are emphasized. Object-oriented 3D building modeling has its inherent advantages in building visualization and spatial query analysis. The flat-roofed and nonflat-roofed buildings are distinguished according to the number of three-line corners and corners on the roof or eaves of the two basic buildings. In the image of the building taken approximately horizontally, the number of three-line corners is more than that of the top of the flat-topped building, and the number of visible corners of the top of the flat-topped building in the image is generally very small. Under the condition of completely accurate extraction, the maximum number of visible corners is three corners, and the number of three-line corners is only one. The number of corners on the top of nonflat-roofed buildings is more than 4, and the number of corners on the third line is also more than 3. The simplest feature can be composed of one molecular feature, while the complex feature is generally composed of more than two molecular features. For example, a conical roof can be seen as being composed of many triangular roofs with common vertices. The molecular feature classification diagram of buildings is shown in Figure1.Figure 1
Example of a molecular feature classification map of a building.Image classification affects all aspects of human life and has had an impact on work and life. In academic circles, image classification has always been a hot topic. Image classification also serves as the foundation for image analysis and retrieval. The higher the picture’s resolution, the more pixels it contains and the clearer the image becomes. The image, on the other hand, is more hazy. The resolution was initially only used to evaluate the performance of display devices, and the overall quality of display results as an important index to describe the image display effect. The concept of resolution is becoming more widely used to describe the fineness of specific display contents in images as digital image processing technology and computer graphics advance. Targets with complete and fine details have a higher resolution, while targets with incomplete or vague details have a lower resolution. The quality of the actual images varies due to equipment, light, weather, occlusion, and other factors. Furthermore, the accuracy of contour feature extraction will affect the statistics of corner points during algorithm implementation. The number of different corners extracted from the building outline is counted as a result. If the number of three-line corners is greater than 2 or greater than or equal to 1 and the number of corners is greater than or equal to 3, the building is classified as a nonflat roof structure; otherwise, it is classified as a flat roof structure.


### 3.2. Building Classification Algorithm in GIS Environment

From agriculture, transportation, energy, medical care, and other industries, to the monitoring and evaluation of natural disasters, military management, and other fields, GIS uses maps and virtual geographical environment to express abstractly and record digitally the real world. It improves the overall quality of information management by improving people’s spatial cognition level [30]. Compared with the traditional two-dimensional GIS, three-dimensional GIS can describe the spatial geographical environment more realistically and completely and help people better understand the real world. Therefore, it has become a research hotspot in the field of geographic information science. When classifying buildings, because different architectural styles have different characteristics, we can use architectural styles to classify buildings. However, the abundant external relations between different architectural styles and the internal differences between the same architectural style lead to many difficulties in the classification of architectural styles. Therefore, it is difficult to distinguish different styles with a strict standard.The external connection between architectural styles implies that different architectural styles share some characteristics, i.e., similarities between classes. Intrinsic differences are differences between the same architectural styles in the same area in different years, as well as differences between the same architectural styles in different areas in the same era. There are two types of original images used to extract and identify building targets at the moment. The first is a remote sensing or aerial image, and the second is a digital camera image of a building. Because the development of architectural style is a gradual process, there are variations in the same architectural style over time. Because different regions have different regional and cultural characteristics, when an architectural style spreads from one to the other, the same architectural style in these two regions has some distinct characteristics. Currently, there are two main methods for extracting building targets from digital camera images: (1) creating a building model library or feature set and then matching the features extracted from the images with the library or feature set to create building targets. The building area is extracted by analyzing the consistency of building edge color and direction characteristics, and the edge color and direction characteristics of the building area and the background area are quite different.Buildings belong to man-made objects. Man-made objects are created by human beings using creativity and tools. Man-made objects often have distinctive geometric or visual features. Therefore, significant areas in the image can be extracted and classified by analyzing the color, texture, and geometric characteristics of the image. Hough transform is used to extract straight lines from the image after morphological screen processing and edge extraction. The outer contour line of the building is generally long, and the gradient value of the corresponding pixel is large. Therefore, 30 straight lines detected by Hough transform are reserved according to the count value in the discrete count space, line segments are connected according to the distance between line segments, and line segments with a certain threshold length or more are reserved. The optimization process of line segment is shown in Figure2.Figure 2
Line segment optimization process.A double judgment mechanism for longer line segments is added to the above optimization steps to prevent the loss of important line segments. The pseudoline segments are well removed after the above processing, laying the groundwork for the next step of intersection extraction. Prior knowledge of the target to be detected is critical for recognition accuracy, but integrating prior knowledge into the learning machine has proven difficult. It is feasible to set up a verification link in the identification system based on prior knowledge, and this link can be changed repeatedly in the application.LetM be a subset of the two-dimensional space IR2. The gray image I is the mapping of M-IR, and λ is the size of the scale space. Suppose x⊂M is the pixel in the gray-scale image I, and the connected set X containing the pixel x is CxX, then
(1)rλaX=x∈XAreaCxX≥λ.In the formula, area (X) is the number of pixels contained in the connected area, rλaX is the combination of all connected sets Xi with an area greater than λ in the image, and the gray-scale image area morphology opening operation processes the maximum value area, which is defined as
(2)rλaIx=suph≤Ixx∈rλaThI,where
(3)ThI=x∈MIx≥h.The morphological closing operation of gray-scale region deals with the minimum value region, which is defined as:(4)ΦλaIx=subh≥Ixx∈ΦλaThIThe gray-scale area morphology opening-closing screen (AOCS) is composed of continuous area morphology opening and closing operations with gradually increasing scales. Therefore, for the gray-scale imageI, the morphological open-close sieve of the gray-scale region with scale i is defined as
(5)AOCSiI=ΦiariaΦi−1aΦi−1a⋯Φ1aΦ1aI.In the formula,ria and Φia are, respectively, the regional morphology opening operation and regional morphology closing operation of the scale i. The above formula is also called M sieve. The processes in the domain form a tree-like hierarchy.Calculate the intersection points of line segments with different slope values for the optimized contour line. These intersection points could be correct intersection points or incorrect intersection points. After removing the intersection points that are outside the region’s range, the validity of each intersection point is assessed again using a method similar to that of the optimized line segment: two endpoints in two intersecting line segments that are closest to the intersection point are selected, and the validity of the connection between the two endpoints and the intersection point is assessed. In the process of finding the intersection points, record the effective corner points and two line segments passing through the corner points and then average the corner points that coincide within a certain range.Letfx,y represent the brightness of the pixel, gx,y represent the average brightness in the neighborhood, and there is a vector i,j corresponding to any pixel:
(6)i,j=fx,y,gx,y.According to the value of the above vector and a classification function, the pixels are divided into two types of target and backgroundc0 and c1:
(7)ΦS,Tx,y=c1fx,y<Sandgx,y<Tc0else.Among them,(8)S×T∈0,L−12.In order to reduce the error rate of samples, the formula (7) is modified to
(9)ΦS,Tx,y=c1fx,y<Sandgx,y<T,c0fx,y≥Sandgx,y≥T.The above classification function abandons the boundary points that are easy to be wrongly classified, which makes the classification result purer. The selection of parametersS,T in the above formula is based on the maximum posterior entropy of the target and the background.There are numerous algorithms for classifying architectural style images currently available, most of which focus on the efficient extraction of various local blocks or patterns. There are many details inside buildings, and images often contain a lot of complicated information. It is hoped that the influence of small areas in the background and inside the building on the extraction of the outline can be removed in order to effectively obtain the outline of the building in order to calculate the number of corners. It is difficult to use a single model to express all types of buildings due to the variety and complexity of buildings. Thematic information, on the other hand, can be derived from data of molecular features arranged according to certain rules and classified according to building shape characteristics, with each category using a geometric data model, roaming the 3D GIS model of buildings in space, which includes arbitrary scaling, translation, viewpoint transformation, and projection mode selection, among other things. Figure3 depicts a two-class classification problem. The training data set is linearly separable, with red representing positive class and blue representing negative class. There will be a lot of straight lines at this point to correctly divide the two types of data. The straight line with the largest interval is found to be the dividing line between the two types after many separable straight lines are compared.Figure 3
Schematic diagram of the second-class classification problem.In 3D modeling, we must consider system software and hardware configuration, visualization algorithm efficiency, and spatial analysis. The first issues to consider in model visualization and spatial analysis are how to reduce data redundancy in visualization and spatial analysis in GIS data model design, how to build an efficient building model, and provide unified data operation methods. Gray level and texture are the most important features that can be used to identify a building from a single gray image. In light of the algorithm’s overall state, the coarse segmentation and subsequent fine segmentation must make use of the various information classes contained within the image. Second, the coarse segmentation algorithm is incapable of performing the complex calculation. The relationship between coding hierarchy and serial number can be used to find the ancestor nodes and descendant nodes at all levels in this neighborhood, and only the first few digits of this neighborhood code need to be scanned. The structure of the algorithm is simple, making it simple to understand and implement, as well as fast and accurate searching.


## 3.1. Building Type Judgment Strategy

The building is a man-made target whose design and construction are in keeping with human visual aesthetics; so, it complies with Gestalt Rules [29]. As a result, we can extract information from local points, line segments, or building areas, combine it into a meaningful whole using gestalt theory, and use this integrated whole to complete the extraction, identification, and classification of building areas. The image in this paper is assumed to contain independent buildings, and that the camera is shooting in a roughly horizontal plane. This assumption is supported by statistics from a large number of unintentional images. At this time, the shot images show at least two planes of the building’s main body and describe complex structures with molecular characteristics. The common substructures of buildings are known as molecular features. This substructure is a program structure or class that is a data structure that is defined to simplify the data structure and make expression easier. Because the environment has such a strong influence on image quality, there are a few complicated factors to consider, such as occlusion from the top of the building. As a result, determining whether a building is flat-topped requires determining the roof type of the building in the image. To replace human visual interpretation, image classification involves quantitatively analyzing images by computer and categorizing each pixel or region in the image into one of several categories.In the visualization and spatial analysis of the GIS system, the relationship and attribute information between spatial entities are emphasized. Object-oriented 3D building modeling has its inherent advantages in building visualization and spatial query analysis. The flat-roofed and nonflat-roofed buildings are distinguished according to the number of three-line corners and corners on the roof or eaves of the two basic buildings. In the image of the building taken approximately horizontally, the number of three-line corners is more than that of the top of the flat-topped building, and the number of visible corners of the top of the flat-topped building in the image is generally very small. Under the condition of completely accurate extraction, the maximum number of visible corners is three corners, and the number of three-line corners is only one. The number of corners on the top of nonflat-roofed buildings is more than 4, and the number of corners on the third line is also more than 3. The simplest feature can be composed of one molecular feature, while the complex feature is generally composed of more than two molecular features. For example, a conical roof can be seen as being composed of many triangular roofs with common vertices. The molecular feature classification diagram of buildings is shown in Figure1.Figure 1
Example of a molecular feature classification map of a building.Image classification affects all aspects of human life and has had an impact on work and life. In academic circles, image classification has always been a hot topic. Image classification also serves as the foundation for image analysis and retrieval. The higher the picture’s resolution, the more pixels it contains and the clearer the image becomes. The image, on the other hand, is more hazy. The resolution was initially only used to evaluate the performance of display devices, and the overall quality of display results as an important index to describe the image display effect. The concept of resolution is becoming more widely used to describe the fineness of specific display contents in images as digital image processing technology and computer graphics advance. Targets with complete and fine details have a higher resolution, while targets with incomplete or vague details have a lower resolution. The quality of the actual images varies due to equipment, light, weather, occlusion, and other factors. Furthermore, the accuracy of contour feature extraction will affect the statistics of corner points during algorithm implementation. The number of different corners extracted from the building outline is counted as a result. If the number of three-line corners is greater than 2 or greater than or equal to 1 and the number of corners is greater than or equal to 3, the building is classified as a nonflat roof structure; otherwise, it is classified as a flat roof structure.


## 3.2. Building Classification Algorithm in GIS Environment

From agriculture, transportation, energy, medical care, and other industries, to the monitoring and evaluation of natural disasters, military management, and other fields, GIS uses maps and virtual geographical environment to express abstractly and record digitally the real world. It improves the overall quality of information management by improving people’s spatial cognition level [30]. Compared with the traditional two-dimensional GIS, three-dimensional GIS can describe the spatial geographical environment more realistically and completely and help people better understand the real world. Therefore, it has become a research hotspot in the field of geographic information science. When classifying buildings, because different architectural styles have different characteristics, we can use architectural styles to classify buildings. However, the abundant external relations between different architectural styles and the internal differences between the same architectural style lead to many difficulties in the classification of architectural styles. Therefore, it is difficult to distinguish different styles with a strict standard.The external connection between architectural styles implies that different architectural styles share some characteristics, i.e., similarities between classes. Intrinsic differences are differences between the same architectural styles in the same area in different years, as well as differences between the same architectural styles in different areas in the same era. There are two types of original images used to extract and identify building targets at the moment. The first is a remote sensing or aerial image, and the second is a digital camera image of a building. Because the development of architectural style is a gradual process, there are variations in the same architectural style over time. Because different regions have different regional and cultural characteristics, when an architectural style spreads from one to the other, the same architectural style in these two regions has some distinct characteristics. Currently, there are two main methods for extracting building targets from digital camera images: (1) creating a building model library or feature set and then matching the features extracted from the images with the library or feature set to create building targets. The building area is extracted by analyzing the consistency of building edge color and direction characteristics, and the edge color and direction characteristics of the building area and the background area are quite different.Buildings belong to man-made objects. Man-made objects are created by human beings using creativity and tools. Man-made objects often have distinctive geometric or visual features. Therefore, significant areas in the image can be extracted and classified by analyzing the color, texture, and geometric characteristics of the image. Hough transform is used to extract straight lines from the image after morphological screen processing and edge extraction. The outer contour line of the building is generally long, and the gradient value of the corresponding pixel is large. Therefore, 30 straight lines detected by Hough transform are reserved according to the count value in the discrete count space, line segments are connected according to the distance between line segments, and line segments with a certain threshold length or more are reserved. The optimization process of line segment is shown in Figure2.Figure 2
Line segment optimization process.A double judgment mechanism for longer line segments is added to the above optimization steps to prevent the loss of important line segments. The pseudoline segments are well removed after the above processing, laying the groundwork for the next step of intersection extraction. Prior knowledge of the target to be detected is critical for recognition accuracy, but integrating prior knowledge into the learning machine has proven difficult. It is feasible to set up a verification link in the identification system based on prior knowledge, and this link can be changed repeatedly in the application.LetM be a subset of the two-dimensional space IR2. The gray image I is the mapping of M-IR, and λ is the size of the scale space. Suppose x⊂M is the pixel in the gray-scale image I, and the connected set X containing the pixel x is CxX, then
(1)rλaX=x∈XAreaCxX≥λ.In the formula, area (X) is the number of pixels contained in the connected area, rλaX is the combination of all connected sets Xi with an area greater than λ in the image, and the gray-scale image area morphology opening operation processes the maximum value area, which is defined as
(2)rλaIx=suph≤Ixx∈rλaThI,where
(3)ThI=x∈MIx≥h.The morphological closing operation of gray-scale region deals with the minimum value region, which is defined as:(4)ΦλaIx=subh≥Ixx∈ΦλaThIThe gray-scale area morphology opening-closing screen (AOCS) is composed of continuous area morphology opening and closing operations with gradually increasing scales. Therefore, for the gray-scale imageI, the morphological open-close sieve of the gray-scale region with scale i is defined as
(5)AOCSiI=ΦiariaΦi−1aΦi−1a⋯Φ1aΦ1aI.In the formula,ria and Φia are, respectively, the regional morphology opening operation and regional morphology closing operation of the scale i. The above formula is also called M sieve. The processes in the domain form a tree-like hierarchy.Calculate the intersection points of line segments with different slope values for the optimized contour line. These intersection points could be correct intersection points or incorrect intersection points. After removing the intersection points that are outside the region’s range, the validity of each intersection point is assessed again using a method similar to that of the optimized line segment: two endpoints in two intersecting line segments that are closest to the intersection point are selected, and the validity of the connection between the two endpoints and the intersection point is assessed. In the process of finding the intersection points, record the effective corner points and two line segments passing through the corner points and then average the corner points that coincide within a certain range.Letfx,y represent the brightness of the pixel, gx,y represent the average brightness in the neighborhood, and there is a vector i,j corresponding to any pixel:
(6)i,j=fx,y,gx,y.According to the value of the above vector and a classification function, the pixels are divided into two types of target and backgroundc0 and c1:
(7)ΦS,Tx,y=c1fx,y<Sandgx,y<Tc0else.Among them,(8)S×T∈0,L−12.In order to reduce the error rate of samples, the formula (7) is modified to
(9)ΦS,Tx,y=c1fx,y<Sandgx,y<T,c0fx,y≥Sandgx,y≥T.The above classification function abandons the boundary points that are easy to be wrongly classified, which makes the classification result purer. The selection of parametersS,T in the above formula is based on the maximum posterior entropy of the target and the background.There are numerous algorithms for classifying architectural style images currently available, most of which focus on the efficient extraction of various local blocks or patterns. There are many details inside buildings, and images often contain a lot of complicated information. It is hoped that the influence of small areas in the background and inside the building on the extraction of the outline can be removed in order to effectively obtain the outline of the building in order to calculate the number of corners. It is difficult to use a single model to express all types of buildings due to the variety and complexity of buildings. Thematic information, on the other hand, can be derived from data of molecular features arranged according to certain rules and classified according to building shape characteristics, with each category using a geometric data model, roaming the 3D GIS model of buildings in space, which includes arbitrary scaling, translation, viewpoint transformation, and projection mode selection, among other things. Figure3 depicts a two-class classification problem. The training data set is linearly separable, with red representing positive class and blue representing negative class. There will be a lot of straight lines at this point to correctly divide the two types of data. The straight line with the largest interval is found to be the dividing line between the two types after many separable straight lines are compared.Figure 3
Schematic diagram of the second-class classification problem.In 3D modeling, we must consider system software and hardware configuration, visualization algorithm efficiency, and spatial analysis. The first issues to consider in model visualization and spatial analysis are how to reduce data redundancy in visualization and spatial analysis in GIS data model design, how to build an efficient building model, and provide unified data operation methods. Gray level and texture are the most important features that can be used to identify a building from a single gray image. In light of the algorithm’s overall state, the coarse segmentation and subsequent fine segmentation must make use of the various information classes contained within the image. Second, the coarse segmentation algorithm is incapable of performing the complex calculation. The relationship between coding hierarchy and serial number can be used to find the ancestor nodes and descendant nodes at all levels in this neighborhood, and only the first few digits of this neighborhood code need to be scanned. The structure of the algorithm is simple, making it simple to understand and implement, as well as fast and accurate searching.


## 4. Result Analysis and Discussion

Use Deformable Parts Models (DPM) to preprocess the architectural style image data set and then use the Secondary classification based on Ensemble Projection (SEP) algorithm to classify the preprocessed images. The SEP algorithm is divided into two parts: the unsupervised feature learning process and the supervised classification process. In the process of unsupervised feature learning, the maximum and minimum sampling method is used to determine the sample points. This method uses the maximum distance between sample points to determine different classes and the minimum distance between sample points to determine the same class, so as to solve the similarities between different architectural styles and the differences between the same architectural styles. In the process of supervised classification, the idea of secondary classification is used to classify the image, and the dividing point of the secondary classification is determined by the weighted average method.This paper uses 13 learning rates to train the network. In the experiment, whether 10 types or 25 types of architectural style images are classified, 40 samples are selected for each type as test samples, others as training samples, and the average value of ten times is taken as the final test result. The test results are shown in Figure4. The abscissa in the figure represents the learning rate, the ordinate represents the classification accuracy, the black line represents the selection of ten categories of learning rate, and the red line represents the selection of twenty-five categories of learning rate.Figure 4
Schematic diagram of the learning rate selection of the classification algorithm in this paper for 10 and 25 categories.The small areas in the image are fused first, using morphological screen processing, in order to keep the building’s main outline areas. The improved Hough transform is then used to extract contour lines, starting with the image’s point and line features, and a line segment optimization algorithm is proposed. This optimization runs throughout the algorithm, effectively eliminating the incorrect line segments generated during the Hough transform and line segment integration processes, and is used to eliminate incorrect contour line intersection points and establish corner adjacency graphs. Finally, the number of extracted corners is used to determine the building type. In this paper, different algorithms are used to classify ten and twenty-five different types of architectural style image data sets, and the corresponding classification accuracy is determined. Figure5 shows a comparison of algorithm classification results.Figure 5
Comparison of architectural style image classification results between the traditional algorithm and the classification algorithm of this article.As can be seen from Figure5, when classifying architectural style images, the classification effect of this algorithm is better than that of traditional algorithms. First-order differential operator is convolution operation using template, which is sensitive to noise and takes a long time to calculate if the image is too large. In order to solve this problem, an edge detection method based on second-order differential is proposed, which can effectively overcome the problem of noise sensitivity and improve the accuracy of edge detection. Using extreme value discrimination method, local Zhongtun and voxels which can effectively represent the shape distribution of buildings in the horizontal direction are extracted from the spatial distance field of each floor, and the Zhongtun and voxels are aggregated. Cluster the internal and external voxels of the model according to specific rules and find out the relatively independent main structural units of the building model in space.Calculate the model’s voxel expression by determining whether the model’sK-corner patch intersects with the voxel: if a voxel intersects with the model surface, it is the model’s boundary voxel; otherwise, it is an invalid voxel. The separation axis theory states that if there is a projection in one direction that does not overlap in the projection of the H-corner patch and the fixed voxel in 13 directions, then the H-corner patch and the voxel are separated; that is, they do not intersect. There will be different management objectives for the classification of urban buildings in different districts. The actual data and target data of urban buildings in different districts can be analyzed, and the actual management progress and management problems can be understood, thanks to the auxiliary decision-making function. The evaluation information of urban residents on the classification of buildings can also be included in the auxiliary decision-making function, improving residents’ recognition and satisfaction with the classification of urban buildings. Figure 6 shows the comparison between the predicted and experimental values of the building classification recognition degree.Figure 6
Comparison results of predicted and experimental values of building classification recognition.Considering the unique layered characteristics of the building during the construction process, in order to effectively extract the main structure of the building model, in this paper, in the process of building main structure identification, the voxel space of the model is horizontally layered, then the two-dimensional Euclidean distance between the internal voxel of the model and all the external voxels of the same layer is calculated in each layer of voxel space, and then the layered DEM of the three-dimensional building model is constructed. Because the power of image gray level is the main factor affecting the complexity of the algorithm, for high-resolution images, the amount of computation will increase with the gray level. The method is used for rough segmentation, which does not require high segmentation accuracy, and at the same time, it is hoped that the method will not fall into complicated operations. By reducing the gray level of the image, a trade-off between segmentation accuracy and computational complexity can be achieved. The physical properties of objects should be considered in the classification of buildings in cities. Figure7 shows the comparison results of algorithm performance before and after storage optimization.Figure 7
Algorithm performance comparison before and after storage optimization.By detecting corners, you can figure out how many there are. The algorithm proposed in this paper can judge the types of simple buildings in a single building image automatically, and the result is fairly accurate. After determining that the image of the nonflat-topped building is nonflat-topped, the outline of the roof can be roughly determined using the determined corner region adjacency graph. The features in a loose combination can be edited and queried separately, whereas in a tight combination, the molecular features in the same building cannot be edited or queried separately because they have no separate physical meaning. With increasing spatial distance, the spatial correlation of pixels decreases. Pixels are correlated in the neighborhood and irrelevant outside the neighborhood, to put it another way. This assumption is largely supported by objective facts.In the experiment, there is the possibility of missing or false detection in the corner detection process, but it does not affect the determination of the final roof type. The determination of each threshold is related to the size of the image, the proportion of buildings in the image, and the shooting quality of the image. In the scene recognition, DPM is used to locate the target with weak supervision, it is proved that the scene recognition problem can be divided into several local recognition problems, the root filter is used to capture the whole frame of the image, and the component filter is used to learn the region of interest. The result of rough segmentation has wrong segmentation areas, but it is statistically correct. That is, the background is wrongly divided into targets, and the targets are wrongly divided into backgrounds. Measured by the number of pixels, it is rare. This requires the learning machine to learn the characteristics of the target/background class when there are a few errors in the sample, so as to ensure that the trained machine can have a smaller error rate. Simulation comparison of building classification optimization is shown in Figure8.Figure 8
Comparison of optimization simulation.The optimized classification algorithm has a higher classification accuracy for buildings, as shown in Figure8. Hundreds of building images taken with digital cameras in various angles, seasons, and lighting conditions are tested in this paper to verify the algorithm’s effectiveness. Polygons with various morphological features are classified and simplified using various methods in practice. Experiments are carried out using the images of buildings that have been collected. For various application objects, it is beneficial to weigh the algorithm’s complexity and effectiveness. If an airborne real-time system is built on this foundation, and different initial segmentation, texture descriptions, machine learning, and prior knowledge are used within the same algorithm framework, a classification and recognition system suitable for a variety of application backgrounds can be obtained. The proposed line debugging algorithm effectively improves the accuracy of contour extraction and is simple to implement. It is possible to determine the type of building in an automated manner.


## 5. Conclusions

This paper focuses on building classification algorithms based on GIS, based on extensive research and analysis of building classification algorithms both at home and abroad. There are a lot of linear features in images. As a result, an algorithm is proposed for extracting the building area from images by detecting linear features in the images, filtering and classifying them, and obtaining a set of linear segments that belong to buildings. To store and operate the model, the unified model operation mode is used, which improves system efficiency. The building management information system based on GIS is a systematic project that incorporates architecture, geography, computer, surveying, and mapping technologies, among others. It is the integration of interdisciplinary knowledge in its entirety. A GIS-based algorithm for automatically determining urban building types is proposed in this paper. A morphological screen is used for image preprocessing, the Hough transform is improved for contour line detection, and a line segment optimization algorithm is proposed to integrate and optimize the detected contour line and the intersection of line segments, as well as the establishment of a corner adjacency graph. It is finally determined whether the buildings in the image are flat-roofed or nonflat-roofed by counting the number of corner points and corner points of three lines. The experimental results show that the algorithm is effective and correct, and that it achieves the desired result, demonstrating that the model is practical and feasible. This algorithm effectively determines the type of building in an automated manner.In addition, real-time building classification based on IOT technology is the focus of our next research work.



---

*Source: 2325105-2022-02-03.xml*