Arbitrary single view-oriented building shape similarity calculation method, device and equipment, medium and product
By extracting the internal and external feature lines in the single-view image of the building, constructing three-dimensional shape features, and using a deep learning network for similarity measurement, the accuracy and efficiency problems of building shape similarity calculation in the existing technology are solved, and the implementation Efficient and accurate building shape similarity assessment.
Patent Information
- Application Number
- CN202411425962.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-14
- Publication Date
- 2025-01-21
- Estimated Expiration
- 2044-10-14
AI Technical Summary
The prior art lacks effective quantitative theoretical methods in the quantitative description and evaluation of building facade geometric morphology and topological relationships, and it is difficult to accurately calculate the similarity of building shapes under single-view images.
By obtaining a single-view image of a building, extracting internal feature lines and external boundary feature lines, constructing three-dimensional shape features, and using a pre-trained deep learning network model to measure similarity, calculate the similarity of building shapes.
It realizes the similarity calculation of building target shapes in any two building single-view images under a unified standard, improves the accuracy and efficiency of calculation, and broadens the application scenarios of building shape similarity calculation.
Smart Images

Figure CN119339111A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of urban three-dimensional computing services, and in particular to a method, device, equipment, medium and product for calculating building shape similarity for any single view. Background Art
[0002] Similarity measurement plays an important role in quantitative research, computer vision and pattern recognition, and is the core technology for achieving key downstream tasks such as target recognition, perception and retrieval. With the acceleration of urbanization, in-depth exploration of building morphology and structure has become an important way to understand urban landscape and architectural features.
[0003] In terms of the overall form of the building, the building facade, as the interface for direct interaction between the building and the external environment, is the most intuitive external manifestation of the building's form. It contains most of the elements of the building's overall form and is an indispensable and important component in its quantitative analysis process.
[0004] However, current research on building shapes mostly focuses on plane shapes and spatial structures. Although the quantitative analysis of current architectural forms has received some attention and research, it usually uses statistical parameter indicators or vague, qualitative and subjective methods such as building styles to describe and evaluate building facades. There are still relatively few quantitative theoretical methods for representing the geometric form and topological relationships of the facades. Summary of the invention
[0005] The purpose of this application is to provide a method, device, equipment, medium and product for calculating the similarity of building shapes for any single view, which can realize the similarity calculation of the building target shapes in any two single-view images of the building under a unified standard.
[0006] To achieve the above objectives, this application provides the following solutions:
[0007] In a first aspect, the present application provides a method for calculating building shape similarity for any single view, comprising:
[0008] Acquire a single-view image of a building, and extract internal feature lines and external boundary feature lines of the building in the single-view image of the building;
[0009] Acquire the three-dimensional shape features of the building in the single-view image of the building based on the internal feature lines and the external boundary feature lines; form a three-dimensional shape feature pair from the three-dimensional shape features of the building in any two single-view images of the building;
[0010] Inputting the three-dimensional shape feature pair into a similarity measurement model of building shape similarity, and using the similarity measurement model to calculate the building shape similarity in any two single-view images of the building;
[0011] Among them, the similarity measurement model is obtained by iteratively training a preset deep learning network model using a sample data set, and the sample data set is constructed based on a three-dimensional shape feature pair composed of the three-dimensional shape features of the buildings in any two single-view images of the buildings, and the similarity of the buildings in any two single-view images of the buildings.
[0012] Optionally, acquiring a single-view image of a building and extracting internal feature lines and external boundary feature lines of the building in the single-view image of the building specifically includes:
[0013] Perform edge detection on the single-view image of the building to obtain the edge line pixel connected area;
[0014] Perform semantic segmentation of the building area on the single-view image of the building to obtain the pixel area of the building;
[0015] According to the edge line pixel connected area and the building pixel area, the internal characteristic line of the building is obtained;
[0016] The building area boundary is determined according to the pixel area of the building, and the external boundary feature line of the building is obtained.
[0017] Optionally, the acquiring the three-dimensional shape features of the building in the single-view image of the building based on the internal feature lines and the external boundary feature lines specifically includes:
[0018] The internal feature lines and the external boundary feature lines are superimposed and merged to obtain a preliminary feature line set of the building;
[0019] Eliminate preliminary feature lines whose values are smaller than a threshold or repeated preliminary feature lines from the preliminary feature line set to obtain a simplified feature line set;
[0020] Performing polyline splitting on the simplified feature lines in the simplified feature line set to obtain the split simplified feature line segments, simplified feature line endpoints, and the connection relationship between the split simplified feature line segments and simplified feature line endpoints;
[0021] The simplified feature line endpoints after splitting are used as nodes, and the simplified feature line segments after splitting are used as edges to construct a global three-dimensional shape feature map;
[0022] According to the connection relationship between the simplified feature line segments and the simplified feature line endpoints after splitting, it is judged whether it is a non-planar intersection. If it is a non-planar intersection, the local three-dimensional shape feature is constructed based on the local estimation method of the vanishing point, which is used as the node attribute of the global three-dimensional shape feature map to obtain the three-dimensional shape feature of the building in the single-view image of the building.
[0023] Optionally, the similarity measurement model includes a vector extraction structure and a similarity measurement structure;
[0024] The vector extraction structure obtains two measurement vectors according to the three-dimensional shape feature pair, and transmits the two measurement vectors to the similarity measurement structure;
[0025] The similarity measurement structure interacts with the two received measurement vectors, and uses the measurement result obtained by the interaction as the predicted local partition shape similarity; and obtains the predicted local partition shape similarity relationship according to the predicted local partition shape similarity;
[0026] The global shape similarity relationship is calculated based on the predicted local partition shape similarity relationship to obtain the predicted global shape similarity as the building shape similarity.
[0027] Optionally, the step of inputting the three-dimensional shape feature pair into a similarity measurement model of building shape similarity and calculating the building shape similarity in any two single-view images of the building using the similarity measurement model further includes: constructing a global shape similarity and a local shape similarity of the single-view images of the building based on the three-dimensional shape feature pair;
[0028] The global shape similarity and local shape similarity are used as labels of the similarity measurement model, and the similarity measurement model is optimized with the goal of minimizing the local shape similarity and the predicted local partition shape similarity, and the global shape similarity and the predicted global shape similarity.
[0029] Optionally, constructing the global shape similarity and the local shape similarity of the single-view image of the building based on the three-dimensional shape feature pair specifically includes:
[0030] The three-dimensional shape feature pairs are calculated through the WL graph, and the obtained similarity value is used as the global shape similarity;
[0031] Determine the building target area according to the external boundary feature line, and calculate the circumscribed rectangle of the building target area;
[0032] The bounding rectangle is divided into 9 shape sub-blocks, and the WL similarity between each shape sub-block of the 3D shape feature pair is calculated according to the WL kernel to obtain the WL similarity matrix;
[0033] The WL similarity matrix is transformed in dimension to obtain a WL similarity matrix in the form of an 81-dimensional vector as the local shape similarity.
[0034] In a second aspect, the present application provides a device for calculating building shape similarity for any single view, comprising:
[0035] A feature line acquisition module, used to acquire a single-view image of a building and extract internal feature lines and external boundary feature lines of the building in the single-view image of the building;
[0036] A feature pair acquisition module, configured to acquire the three-dimensional shape features of the building in the single-view image of the building based on the internal feature lines and the external boundary feature lines; and to form a three-dimensional shape feature pair from the three-dimensional shape features of the building in any two single-view images of the building;
[0037] A building shape similarity calculation module, used for inputting the three-dimensional shape feature pair into a similarity measurement model of building shape similarity, and calculating the building shape similarity in any two single-view images of the building using the similarity measurement model;
[0038] Among them, the similarity measurement model is obtained by iteratively training a preset deep learning network model using a sample data set, and the sample data set is constructed based on a three-dimensional shape feature pair composed of the three-dimensional shape features of the buildings in any two single-view images of the buildings, and the similarity of the buildings in any two single-view images of the buildings.
[0039] In a third aspect, the present application provides a computer device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of any of the above-mentioned methods for calculating the building shape similarity for any single view.
[0040] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the above-mentioned methods for calculating building shape similarity for any single view.
[0041] In a fifth aspect, the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of any of the above-mentioned methods for calculating building shape similarity for any single view.
[0042] According to the specific embodiments provided in this application, this application discloses the following technical effects:
[0043] The present application provides a method, device, equipment, medium and product for calculating the similarity of building shapes for any single view. By acquiring a single view image of a building and extracting internal feature lines and external boundary feature lines, the image processing technology is used to effectively extract key information that can characterize the shape of the building from a single image. By capturing the internal structure and external contour of the building, the present application realizes the comprehensive extraction of building shape features and provides a rich data source for the calculation of shape similarity. Based on the extracted internal feature lines and external boundary feature lines, the three-dimensional shape features of the building are constructed, and these features are input into a pre-trained similarity measurement model for similarity calculation, realizing the conversion from two-dimensional images to three-dimensional shape features, and the mapping from three-dimensional shape features to shape similarity scores. After iterative training with a large amount of sample data, the similarity measurement model can automatically learn and capture the subtle differences between building shapes, thereby accurately calculating the shape similarity of buildings in any two single-view images.
[0044] In summary, this application realizes the extraction of key shape features of buildings from single-view images, solves the problem that shape similarity is difficult to calculate accurately under single-view images, and realizes fast and accurate similarity evaluation based on deep learning technology. It not only broadens the application scenarios of building shape similarity calculation, but also provides strong technical support for urban planning, architectural design, image retrieval and other fields. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0046] Figure 1 This is an application environment diagram of a building shape similarity calculation method for any single view in one embodiment of the present application;
[0047] Figure 2 A schematic diagram of a flow chart of a method for calculating building shape similarity for any single view provided in an embodiment of the present application;
[0048] Figure 3 A diagram of a process of extracting building feature lines from any two single-view images of a building provided in an embodiment of the present application;
[0049] Figure 4 A diagram of a process of extracting building shape features from any two single-view images of a building provided in an embodiment of the present application;
[0050] Figure 5A schematic diagram of functional modules of a device for calculating building shape similarity for any single view provided in one embodiment of the present application;
[0051] Figure 6 A diagram of a similarity measurement model construction process provided in an embodiment of the present application;
[0052] Figure 7 A schematic diagram of the structure of a computer device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0053] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0054] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0055] The building shape similarity calculation method for any single view provided in the embodiment of the present application can be applied to Figure 1In the application environment shown, the terminal 102 communicates with the server 104 through a network. The data storage system can store data that the server 104 needs to process. The data storage system can be set up separately, integrated on the server 104, or placed on the cloud or other servers. The terminal 102 can send the single-view image of the building to the server 104. After the server 104 receives the single-view image of the building, for the single-view image of the building, the server 104 extracts the internal feature lines and the external boundary feature lines of the building in the single-view image of the building; obtains the three-dimensional shape features of the building in the single-view image of the building based on the internal feature lines and the external boundary feature lines; forms a three-dimensional shape feature pair with the three-dimensional shape features of the building in any two single-view images of the building; inputs the three-dimensional shape feature pair into a similarity measurement model of building shape similarity, and calculates the building shape similarity in any two single-view images of the building using the similarity measurement model; wherein the similarity measurement model is obtained by iteratively training a preset deep learning network model using a sample data set, and the sample data set is constructed based on the three-dimensional shape feature pairs formed by the three-dimensional shape features of the building in any two single-view images of the building, and the similarity of the building in any two single-view images of the building. The server 104 can feed back the obtained building shape similarity to the terminal 102. In addition, in some embodiments, the building shape similarity calculation method for any single view can also be implemented independently by the server 104 or the terminal 102. For example, the terminal 102 can directly process the single view image of the building, or the server 104 can obtain the single view image of the building from the data storage system and process the single view image of the building.
[0056] In an exemplary embodiment, Figure 2 As shown, a method for calculating the building shape similarity for any single view is provided. The method is executed by a computer device, and can be executed by a computer device such as a terminal or a server alone, or by a terminal and a server together. In the embodiment of the present application, the method is applied to Figure 1 The server 104 in the example is used as an example to illustrate, including the following steps 201 to 203. Among them:
[0057] Step 201 : acquiring a single-view image of a building, and extracting internal feature lines and external boundary feature lines of the building in the single-view image of the building.
[0058] Step 202: Acquire the three-dimensional shape features of the building in the single-view image of the building based on the internal feature lines and the external boundary feature lines; and form a three-dimensional shape feature pair by combining the three-dimensional shape features of the building in any two single-view images of the building.
[0059] Step 203: input the three-dimensional shape feature pair into a similarity measurement model of building shape similarity, and use the similarity measurement model to calculate the building shape similarity in any two single-view images of the building.
[0060] Among them, the similarity measurement model is obtained by iteratively training a preset deep learning network model using a sample data set, and the sample data set is constructed based on a three-dimensional shape feature pair composed of the three-dimensional shape features of the buildings in any two single-view images of the buildings, and the similarity of the buildings in any two single-view images of the buildings.
[0061] By implementing the above steps 201 to 203 , it is possible to calculate the similarity of the shapes of building targets in any two single-view images of the building.
[0062] Among them, implementing this embodiment, such as Figure 3 As shown, obtaining a single-view image of a building, and extracting the internal feature lines and the external boundary feature lines of the building in the single-view image of the building, specifically includes:
[0063] Based on RINDNet (Edge Detection for Discontinuity in Reflectance, Illumination, Normal and Depth), edge detection is performed on the single-view image of the building to obtain the edge line pixel connected area, which serves as the basis for the subsequent extraction of linear information of the building feature lines.
[0064] Based on FasterRCNN+SAM (Faster Region-based Convolutional Neural Network, fast regional convolutional neural network; Semantic Approximation Module, semantic approximation module), semantic segmentation of building areas in single-view images of buildings is performed to obtain the pixel area of the building; semantic recognition of building areas in single-view images of buildings is achieved, providing a semantic basis for the subsequent recognition of building feature lines.
[0065] According to the edge line pixel connected area and the pixel area of the building, the internal characteristic line of the building is obtained; according to the pixel area of the building, the building area boundary is determined to obtain the external boundary characteristic line of the building.
[0066] The internal feature lines and the external boundary feature lines are superimposed and merged to obtain a preliminary feature line set of the building; preliminary feature lines smaller than a threshold or repeated preliminary feature lines in the preliminary feature line set are eliminated to obtain a simplified feature line set.
[0067] The simplified feature lines in the simplified feature line set are split into polylines to obtain the split simplified feature line segments, simplified feature line endpoints, and the connection relationship between the split simplified feature line segments and simplified feature line endpoints.
[0068] In another exemplary embodiment of the present application, Figure 4 As shown, the simplified feature line endpoints after splitting are used as nodes, and the simplified feature line segments after splitting are used as edges to construct a global three-dimensional shape feature graph, which represents the global structure of the building shape in the form of graph data.
[0069] This application uses a two-intersecting line exhaustive search method to estimate the vanishing point of an image. The main principle of this method is to first use two parallel straight lines in the image to obtain the first vanishing point of the image, then evenly sample the second vanishing point on the equivalent sphere, and finally calculate the third vanishing point by the cross product of the first and second vanishing points. By iterating the assumed camera parameters in the algorithm, the vanishing point and camera parameters of any single view are optimized. It is assumed that the midpoint of the image is the origin of the camera, the initial focal length is 50 pixels, and the iteration interval is 50 pixels. Through the iterative operation of this method, a set of orthogonal vanishing point groups vp1 (v1, u1), vp2 (v2, u2), and vp3 (v3, u3) can be obtained each time. Among them, v1 represents the horizontal coordinate of the vanishing point vp1 in the image, u1 represents the vertical coordinate of the vanishing point vp1 in the image; v2 represents the horizontal coordinate of the vanishing point vp2 in the image, u2 represents the vertical coordinate of the vanishing point vp2 in the image; v3 represents the horizontal coordinate of the vanishing point vp3 in the image, u3 represents the vertical coordinate of the vanishing point vp3 in the image.
[0070] The specific grouping of feature line directions in this application is as follows: connect the midpoints of all line segments in the extracted building feature line group with three vanishing points, calculate the angle between the line segment and the connecting line, and record the angle between each line segment and the vanishing point as R = [r1, r2, r3]. Take the minimum angle in R as r. If r is less than 0.15, the line segment is considered to be orthogonal to the direction of the vanishing point. Otherwise, it will be marked as an unknown direction. Finally, the minimum number of iterations of the average value of each angle r in each orthogonal direction is selected, and the vanishing point group obtained by this iteration is regarded as the optimal vanishing point group of the image, and the iteratively generated camera parameters and the direction category of the line segment are retained.
[0071] Intersection extraction is to screen out the three-dimensional geometric intersections on the building shape from all the endpoints of the building feature lines according to the feature line endpoints and their relationships obtained when extracting the building shape information, and the information such as the vanishing point of the acquired image and the direction of the feature lines, and eliminate the plane edge intersections that do not have three-dimensional spatial features on the building appearance plane due to the texture material. Specifically, firstly, the endpoints belonging to multiple branches are extracted into the candidate intersection list of the building shape. Then, for any candidate intersection, according to the recorded branch number, the directions of all the line segments in its intersection list are obtained from the line segment direction category vector. If there are only line segments with the same known direction in the intersection direction, the intersection is removed from the candidate intersection set, and the intersections of the same known direction are eliminated, eliminating the misaligned intersections caused by detection and occlusion of non-planar structures. After completing the above screening, only the intersections obtained by the intersection of two or more known directions or unknown direction line segments are retained in the candidate intersections as the final geometric intersection set of the building shape.
[0072] According to the connection relationship between the simplified feature line segments and the simplified feature line endpoints after splitting, it is determined whether it is a non-planar intersection. If it is a non-planar intersection, the local three-dimensional shape feature is constructed based on the local estimation method of the vanishing point, and is used as the node attribute of the global three-dimensional shape feature map to form a global shape feature expression of the building with three-dimensional invariance, and obtain the three-dimensional shape feature of the building in the single-view image of the building.
[0073] In another exemplary embodiment of the present application, a building shape similarity measurement model based on the three-dimensional shape features of the buildings is constructed, and a similarity measurement model for the three-dimensional shape features of the buildings is built. The metric relationship between the three-dimensional shapes of the buildings, which is characterized by the metric relationship between the structures of the three-dimensional shape features of the buildings themselves, is used to construct a weakly supervised learning method with imprecise labels. Then, by formulating rules for model training, the model is guided by large-scale sample label knowledge to establish similarity measurement parameters and mapping relationships that are consistent with the shapes of the buildings.
[0074] like Figure 5 As shown, the similarity measurement model includes a vector extraction structure and a similarity measurement structure; the vector extraction structure obtains two measurement vectors according to the three-dimensional shape feature pair, and transmits the two measurement vectors to the similarity measurement structure.
[0075] The similarity measurement structure interacts with the two received measurement vectors, and uses the measurement result obtained by the interaction as the predicted local partition shape similarity; and obtains the predicted local partition shape similarity relationship according to the predicted local partition shape similarity.
[0076] The global shape similarity relationship is calculated based on the predicted local partition shape similarity relationship to obtain the predicted global shape similarity as the building shape similarity.
[0077] Among them, this implementation method is implemented. First, in the preparation stage of the vector extraction structure, a layer of GCN (Graph Convolutional Network) is used to globally learn and transform the dimensions of the three-dimensional shape features of the input building target. In the second layer, the local shape information with obvious characteristics in the building target shape is strengthened through GAT (Graph Attention Network) convolution, providing more prominent characteristic shape information of the target for global measurement and increasing the characteristic expression of the local shape for local measurement. Then, the global comprehensive information is obtained through GCN to learn the characteristics of the data at a deeper level. When extracting the global vector, the global average pooling structure is used to obtain the feature vectors of the input graph at different levels, and finally the multi-level feature vectors based on the local feature enhancement information are superimposed.
[0078] The similarity measurement module takes the two measurement vectors obtained after the three-dimensional shape features of the two building targets pass through the vector extraction module as input, and introduces the NTN (Neural Tensor NetWork) interaction structure proposed in the graph similarity calculation neural network model (Similarity Graph Neural Network, SimGNN) in the measurement process. The measurement result obtained by the first interaction between the two targets in the module is used as the predicted local partition shape similarity between the two targets and participates in the model learning and training at the same time. Then, based on the obtained predicted local partition shape similarity relationship, the global shape similarity relationship between the two targets is gradually learned and inferred to obtain the predicted global shape similarity as the building shape similarity.
[0079] Wherein, implementing this embodiment further includes: constructing the global shape similarity and the local shape similarity of the single view image of the building based on the three-dimensional shape feature pair.
[0080] The global shape similarity and local shape similarity are used as labels of the similarity measurement model, and the similarity measurement model is optimized with the goal of minimizing the local shape similarity and the predicted local partition shape similarity, and the global shape similarity and the predicted global shape similarity.
[0081] In another exemplary embodiment of the present application, in order to realize the global shape similarity and local shape similarity of constructing the single view image of the building based on the three-dimensional shape feature pair, the method further includes:
[0082] In the weakly supervised learning method with imprecise labels, the WL (Weisfiler-Lehman) kernel measurement results of the three-dimensional shape feature pairs are used to construct two parts of labels: global shape similarity and local shape similarity.
[0083] The global shape similarity label is calculated by comparing the three-dimensional shape feature pairs with the WL graph, and the obtained similarity value is used as the global shape similarity.
[0084] Local shape similarity, determine the building target area according to the external boundary feature line, and calculate the bounding rectangle of the building target area; divide the bounding rectangle into 9 shape sub-blocks, and calculate the WL similarity between each shape sub-block of the three-dimensional shape feature pair according to the WL kernel to obtain the WL similarity matrix; transform the WL similarity matrix by dimension to obtain the WL similarity matrix in the form of 81-dimensional vector as the local shape similarity.
[0085] In order to ensure the randomness of sample composition during training and avoid overfitting of the model to a certain type of label, this application adopts a proportional uniform mixing method to design the combination rules of strong and weak labels. That is, after determining the mixing ratio, the images in the data set are first randomly shuffled, and each image that has not been combined is combined with the next image to form a weak sample pair. Assuming a 1:1 mixing situation, the next group of each group of weak samples is a strong sample pair composed of the next image that has not been combined. Then in the training process, the model training is performed in the order in which the samples are composed.
[0086] The present application also provides an application scenario, which applies the above-mentioned building shape similarity calculation method for any single view. Specifically: The building shape similarity calculation method for any single view provided in this embodiment can be applied in the building comparison analysis scenario in the field of urban planning and management. The scenario usually includes four main links: data collection, feature extraction, similarity calculation and decision analysis. In the data collection link, the system obtains a large number of single-view images of buildings through drones, satellite images or ground photography, and these images constitute the basic data for subsequent analysis. Subsequently, the feature extraction link is entered, and the internal feature lines and external boundary feature lines of the building are automatically extracted from each single-view image using the method proposed in the present application, and three-dimensional shape features are further generated. These features accurately and comprehensively reflect the shape characteristics of the building. In the similarity calculation link, the three-dimensional shape features of any two buildings constitute a feature pair and are input into a pre-trained similarity measurement model. The model quickly and accurately calculates the shape similarity of the buildings in the two images through a deep learning algorithm, and outputs the building shape similarity. Finally, in the decision-making analysis phase, based on the similarity calculation results, urban planners or managers can conduct in-depth comparative analysis of buildings. For example, in an old city renovation project, the shape similarity between the new design and the existing building can be calculated to evaluate whether the design is coordinated with the surrounding environment; in disaster risk assessment, potential vulnerable areas or structural defects can be identified by comparing the shape characteristics of buildings.
[0087] The building shape similarity calculation method for any single view provided in this embodiment is a key link in feature extraction and similarity calculation in the building comparison analysis scenario. Through automated feature extraction and efficient similarity calculation, the method can significantly improve the efficiency and accuracy of urban planning and management, and provide strong support for urban development and security. In the specific implementation process, the specific implementation method and parameter settings of the method can be flexibly adjusted according to different application scenarios and requirements to achieve the best analysis effect.
[0088] Based on the same inventive concept, the embodiment of the present application also provides a device for implementing the above-mentioned building shape similarity calculation device for any single view. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above-mentioned method, so the specific limitations in the embodiments of one or more building shape similarity calculation devices for any single view provided below can be referred to the limitations of the building shape similarity calculation method for any single view above, and will not be repeated here.
[0089] In an exemplary embodiment, Figure 6 As shown, a device for calculating building shape similarity for any single view is provided, comprising:
[0090] The feature line acquisition module 301 is used to acquire a single-view image of a building and extract the internal feature lines and external boundary feature lines of the building in the single-view image of the building.
[0091] The feature pair acquisition module 302 is used to acquire the 3D shape features of the building in the single-view image of the building based on the internal feature lines and the external boundary feature lines; and to form a 3D shape feature pair from the 3D shape features of the building in any two single-view images of the building.
[0092] The building shape similarity calculation module 303 is used to input the three-dimensional shape feature pair into a similarity measurement model of building shape similarity, and use the similarity measurement model to calculate the building shape similarity in any two single-view building images.
[0093] Among them, the similarity measurement model is obtained by iteratively training a preset deep learning network model using a sample data set, and the sample data set is constructed based on a three-dimensional shape feature pair composed of the three-dimensional shape features of the buildings in any two single-view images of the buildings, and the similarity of the buildings in any two single-view images of the buildings.
[0094] In an exemplary embodiment, a computer device is provided. The computer device may be a server or a terminal. The internal structure diagram thereof may be as follows: Figure 7 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store single-view image processing data of buildings. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a building shape similarity calculation method for any single view is implemented.
[0095] Those skilled in the art will understand that Figure 7The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components. In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.
[0096] In an exemplary embodiment, a computer-readable storage medium is provided, storing a computer program, and when the computer program is executed by a processor, the steps in the above method embodiments are implemented.
[0097] In an exemplary embodiment, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps in the above method embodiments are implemented.
[0098] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0099] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM may be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0100] The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. The non-relational database may include a distributed database based on blockchain, etc., but is not limited thereto. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but is not limited thereto.
[0101] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0102] This article uses specific examples to illustrate the principles and implementation methods of this application. The description of the above embodiments is only used to help understand the method and core ideas of this application. At the same time, for those skilled in the art, according to the ideas of this application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting this application.
Claims
1. A method for calculating building shape similarity for any single view, characterized in that: The building shape similarity calculation method for any single view includes: Acquire a single-view image of a building, and extract internal feature lines and external boundary feature lines of the building in the single-view image of the building; Acquire the three-dimensional shape features of the building in the single-view image of the building based on the internal feature lines and the external boundary feature lines; form a three-dimensional shape feature pair from the three-dimensional shape features of the building in any two single-view images of the building; Inputting the three-dimensional shape feature pair into a similarity measurement model of building shape similarity, and using the similarity measurement model to calculate the building shape similarity in any two single-view images of the building; Among them, the similarity measurement model is obtained by iteratively training a preset deep learning network model using a sample data set, and the sample data set is constructed based on a three-dimensional shape feature pair composed of the three-dimensional shape features of the buildings in any two single-view images of the buildings, and the similarity of the buildings in any two single-view images of the buildings.
2. The method for calculating building shape similarity based on any single view according to claim 1, characterized in that: The acquiring of a single-view image of a building and extracting internal feature lines and external boundary feature lines of the building in the single-view image of the building specifically includes: Perform edge detection on the single-view image of the building to obtain the edge line pixel connected area; Perform semantic segmentation of the building area on the single-view image of the building to obtain the pixel area of the building; According to the edge line pixel connected area and the building pixel area, the internal characteristic line of the building is obtained; The building area boundary is determined according to the pixel area of the building, and the external boundary feature line of the building is obtained.
3. The method for calculating building shape similarity based on any single view according to claim 1, characterized in that: The acquiring of the three-dimensional shape features of the building in the single-view image of the building based on the internal feature lines and the external boundary feature lines specifically includes: The internal feature lines and the external boundary feature lines are superimposed and merged to obtain a preliminary feature line set of the building; Eliminate preliminary feature lines whose values are smaller than a threshold or repeated preliminary feature lines from the preliminary feature line set to obtain a simplified feature line set; Performing polyline splitting on the simplified feature lines in the simplified feature line set to obtain the split simplified feature line segments, simplified feature line endpoints, and the connection relationship between the split simplified feature line segments and simplified feature line endpoints; The simplified feature line endpoints after splitting are used as nodes, and the simplified feature line segments after splitting are used as edges to construct a global three-dimensional shape feature map; According to the connection relationship between the simplified feature line segments and the simplified feature line endpoints after splitting, it is judged whether it is a non-planar intersection. If it is a non-planar intersection, the local three-dimensional shape feature is constructed based on the local estimation method of the vanishing point, which is used as the node attribute of the global three-dimensional shape feature map to obtain the three-dimensional shape feature of the building in the single-view image of the building.
4. The method for calculating building shape similarity based on any single view according to claim 1, characterized in that: The similarity measurement model includes a vector extraction structure and a similarity measurement structure; The vector extraction structure obtains two measurement vectors according to the three-dimensional shape feature pair, and transmits the two measurement vectors to the similarity measurement structure; The similarity measurement structure interacts with the two received measurement vectors, and uses the measurement result obtained by the interaction as the predicted local partition shape similarity; and obtains the predicted local partition shape similarity relationship according to the predicted local partition shape similarity; The global shape similarity relationship is calculated based on the predicted local partition shape similarity relationship to obtain the predicted global shape similarity as the building shape similarity.
5. The method for calculating building shape similarity based on any single view according to claim 1, characterized in that: The step of inputting the three-dimensional shape feature pair into a similarity measurement model of building shape similarity and using the similarity measurement model to calculate the building shape similarity in any two single-view images of the building also includes: constructing a global shape similarity and a local shape similarity of the single-view images of the building based on the three-dimensional shape feature pair; The global shape similarity and local shape similarity are used as labels of the similarity measurement model, and the similarity measurement model is optimized with the goal of minimizing the local shape similarity and the predicted local partition shape similarity, and the global shape similarity and the predicted global shape similarity.
6. The method for calculating building shape similarity based on any single view according to claim 5, characterized in that: The constructing the global shape similarity and the local shape similarity of the single view image of the building based on the three-dimensional shape feature pair specifically includes: The three-dimensional shape feature pairs are calculated through the WL graph, and the obtained similarity value is used as the global shape similarity; Determine the building target area according to the external boundary feature line, and calculate the circumscribed rectangle of the building target area; The bounding rectangle is divided into 9 shape sub-blocks, and the WL similarity between each shape sub-block of the 3D shape feature pair is calculated according to the WL kernel to obtain the WL similarity matrix; The WL similarity matrix is transformed in dimension to obtain a WL similarity matrix in the form of an 81-dimensional vector as the local shape similarity.
7. A device for calculating building shape similarity for any single view, characterized in that: The building shape similarity calculation device for any single view comprises: A feature line acquisition module, used to acquire a single-view image of a building and extract internal feature lines and external boundary feature lines of the building in the single-view image of the building; A feature pair acquisition module, configured to acquire the three-dimensional shape features of the building in the single-view image of the building based on the internal feature lines and the external boundary feature lines; and to form a three-dimensional shape feature pair from the three-dimensional shape features of the building in any two single-view images of the building; A building shape similarity calculation module, used for inputting the three-dimensional shape feature pair into a similarity measurement model of building shape similarity, and calculating the building shape similarity in any two single-view images of the building using the similarity measurement model; Among them, the similarity measurement model is obtained by iteratively training a preset deep learning network model using a sample data set, and the sample data set is constructed based on a three-dimensional shape feature pair composed of the three-dimensional shape features of the buildings in any two single-view images of the buildings, and the similarity of the buildings in any two single-view images of the buildings.
8. A computer device comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the building shape similarity calculation method for any single view described in any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for calculating the building shape similarity for any single view described in any one of claims 1 to 6 is implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method for calculating the building shape similarity for any single view described in any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Fast high-precision geometric template matching method enabling rotation and scaling functions
CN105930858A
Three-dimensional model retrieval method and system based on deep metric learning
CN113392244A
Model training and image processing method and device, equipment and storage medium
CN114549612A
High-precision monocular depth estimation system and method for three-dimensional scene reconstruction
CN115272438A
Building monitoring method, equipment and medium
CN115311574A