Plane 3D modeling method, system, terminal and medium based on spatial elements
Through neural network models, spatial elements are identified and classified on the building plan, spatial topological relationship diagrams are generated and three-dimensional architectural models are constructed, which solves the problem of low efficiency in the construction of three-dimensional models in the existing technology and realizes a more efficient and accurate three-dimensional modeling process.
Patent Information
- Application Number
- CN202411397698.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-09
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2044-10-09
AI Technical Summary
The existing building plan recognition method is less efficient in building three-dimensional building models, and requires pre-setting layer information and switching layers, resulting in low recognition efficiency and conversion efficiency.
The spatial element recognition and classification method based on the neural network model is adopted to identify and classify the architectural floor plan through the trained neural network model, generate a spatial topological relationship diagram, and build a three-dimensional architectural model based on this.
It significantly improves the efficiency and accuracy of using two-dimensional plan diagrams to perform spatial segmentation and establish a single space three-dimensional model, and can automatically obtain structured spatial information and build an accurate three-dimensional model.
Smart Images

Figure CN118898692B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer graphics processing technology, and in particular to a plane based on space elements. Figure 3 Dimensional modeling method, system, terminal and medium. Background Art
[0002] The floor plan of a building is a key component in architectural design and analysis, and contains rich spatial elements and complex spatial relationships. These spatial information are crucial for understanding the spatial structure of the building. Therefore, floor plan recognition technology has become a research hotspot in the field of computer graphics and vision.
[0003] Existing architectural plane recognition methods are mainly based on layer information in CAD or other drawing tools, and the layer elements of architectural plane drawings in .jpg or .png formats are obtained according to the layer information, and a three-dimensional architectural model is established based on its layer elements. Existing methods require users to set layer information in advance according to preset rules when drawing primitives, and need to switch layers when drawing different primitives. It can be seen that this method has low recognition efficiency for architectural plane images, resulting in low conversion efficiency for generating three-dimensional architectural models using architectural plane drawings. Summary of the invention
[0004] In view of the above-mentioned deficiencies in the prior art, the object of the present invention is to provide a plane based on space elements. Figure 3 The invention discloses a three-dimensional modeling method, system, terminal and medium, aiming to solve the problem of low efficiency in constructing three-dimensional building models in the prior art.
[0005] In order to achieve the above object, the present invention first provides a plane based on space elements. Figure 3 Dimensional modeling methods, including:
[0006] Get building plans;
[0007] Using the trained neural network model to identify and classify spatial elements of the building plan to obtain several types of spatial elements;
[0008] Generate a spatial topological relationship diagram based on the type of the spatial elements and the preset spatial relationship division rules;
[0009] Based on the spatial topological relationship diagram, a three-dimensional building model is constructed.
[0010] Optionally, the trained neural network model is used to identify and classify spatial elements of the building plan to obtain several types of spatial elements, including:
[0011] Using the trained neural network model to identify the building plan, and determine the spatial element corresponding to each pixel in the building plan;
[0012] All the pixels are classified according to the types of the spatial elements to obtain several types of spatial elements.
[0013] Optionally, the generating a spatial topological relationship diagram based on the type of the spatial element and a preset spatial relationship division rule includes:
[0014] Based on the type of the spatial element and the preset spatial relationship division rule, using the spatial element to create nodes and edges;
[0015] Encode all the nodes and the edges using one-hot encoding to obtain a spatial relationship list;
[0016] The spatial relationship list is formatted to generate a spatial topological relationship diagram.
[0017] Optionally, the creating nodes and edges using the spatial elements based on the type of the spatial elements and a preset spatial relationship division rule includes:
[0018] According to the node division rule in the preset spatial relationship division rule, a node is created for the rooms or outdoor space areas corresponding to multiple continuous spatial elements of the same type;
[0019] According to the edge division rule in the preset spatial relationship division rule, an edge is created between adjacent nodes of the spatial elements of the door or window type with connectivity.
[0020] Optionally, constructing a three-dimensional building model based on the spatial topological relationship diagram includes:
[0021] Based on the spatial topological relationship diagram, identifying the range and boundary of each room in the building plan;
[0022] Segmenting the spatial topological relationship graph based on the boundary of each of the rooms to obtain a plurality of data slices;
[0023] Determine the area of each data slice based on the number of pixels contained in the node corresponding to each data slice;
[0024] Based on the area of each of the data slices, all of the data slices are converted into a three-dimensional data space to construct a three-dimensional building model.
[0025] Optionally, segmenting the spatial topological relationship graph based on the boundary of each room to obtain a plurality of data slices includes:
[0026] Expanding the boundary of each room according to a preset expansion range to obtain an expanded boundary corresponding to each room;
[0027] The spatial topological relationship graph is segmented based on each of the expanded boundaries to obtain a plurality of data slices.
[0028] Optionally, after constructing the three-dimensional building model, the method further includes:
[0029] Calculate the size of each door or window based on the pixel coordinates corresponding to the door or window of each room;
[0030] Based on the size of the door or window, the ventilation resistance of the side corresponding to the door or window is calculated.
[0031] The second aspect of the present invention provides a plane based on space elements Figure 3 A dimensional modeling system, the system comprising:
[0032] An information acquisition module, used to acquire a building plan;
[0033] A spatial element recognition module is used to recognize and classify spatial elements of the building plan using a trained neural network model to obtain several types of spatial elements;
[0034] A spatial topology relationship diagram construction module, used to generate a spatial topology relationship diagram based on the type of the spatial elements and a preset spatial relationship division rule;
[0035] The three-dimensional building model construction module is used to construct a three-dimensional building model based on the spatial topological relationship diagram.
[0036] The third aspect of the present invention provides an intelligent terminal, the intelligent terminal comprising a memory for storing executable instructions; a processor for calling and running the executable instructions in the memory to execute any one of the above-mentioned plane based on spatial elements. Figure 3 Steps of the dimensional modeling method.
[0037] A fourth aspect of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores program instructions, and when the program instructions are executed by a processor, any one of the above-mentioned planes based on spatial elements is implemented. Figure 3 Steps of the dimensional modeling method.
[0038] Compared with the prior art, the beneficial effects of this solution are as follows:
[0039] The present invention identifies the spatial elements and spatial relationships in the building plan based on a neural network model to obtain structured spatial topological relationships, and uses the spatial elements and spatial relationships to construct a spatial relationship list, and then organizes and connects the nodes and edges according to the spatial relationship to generate a spatial topological relationship graph, and finally automatically constructs a three-dimensional building model based on the spatial topological relationship graph. The present invention only needs to use the building plan to automatically obtain structured spatial information and construct a three-dimensional model, which can significantly improve the accuracy and efficiency of using a two-dimensional plan to perform space segmentation and establish a three-dimensional model of a single space; using the spatial topological relationship graph, a graph structure that accurately reflects the spatial layout and element relationship can be efficiently constructed, providing an intuitive visual representation for spatial analysis and understanding; at the same time, according to the ventilation connection relationship between the nodes in each room in the constructed three-dimensional building model, the ventilation resistance of each room is calculated, which can efficiently provide basic parameters for ventilation network calculation and improve the efficiency of multi-region airflow network calculation. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0041] Figure 1 The plane based on the space element of the present invention Figure 3 Dimensional modeling method flow chart;
[0042] Figure 2 The plane based on the space element of the present invention Figure 3 Schematic diagram of the main framework of the dimensional modeling method;
[0043] Figure 3 is a pre-processing flow chart of the plan view of the present invention;
[0044] Figure 4 A flow chart for identifying spatial elements of a plan view of the present invention;
[0045] Figure 5 The network architecture diagram of the adaptive frequency converter model;
[0046] Figure 6 A flow chart for identifying spatial relationships between spatial elements of a plan view of the present invention;
[0047] Figure 7 A ventilation connection relationship diagram between the rooms of the plan view of the present invention;
[0048] Figure 8 It is a three-dimensional modeling flow chart of the present invention;
[0049] Fig. 9 A flow chart for solving the ventilation resistance of each room of the present invention;
[0050] Fig.10 The plane based on the space element of the present invention Figure 3 Schematic diagram of the dimensional modeling system module;
[0051] Fig.11 It is a schematic diagram of the structure of the intelligent terminal of the present invention. DETAILED DESCRIPTION
[0052] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present invention. However, it should be clear to those skilled in the art that the present invention may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present invention.
[0053] It should be understood that when used in this specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof.
[0054] It should also be understood that the terms used in the present specification are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the present specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0055] It should be further understood that the term "and / or" used in the present description and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0056] The following is a clear and complete description of the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0057] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.
[0058] In view of the low efficiency of constructing three-dimensional building models in the prior art, the present invention proposes a planar model based on spatial elements. Figure 3 The three-dimensional modeling method mainly identifies the spatial elements and spatial relationships in the building plan based on the deep learning network model to obtain structured spatial topological relationships, and uses the spatial elements and spatial relationships to construct a spatial relationship list, and then converts and generates a spatial topological relationship diagram. Finally, the spatial topological relationship diagram is divided into multiple data slices based on a single room as a unit, and a three-dimensional building model is automatically constructed based on the spatial position relationship and area size between the data slices corresponding to each room. The present invention only needs to use the building plan (such as a house type picture) to automatically obtain structured spatial position and area information and construct a three-dimensional model, which can significantly improve the efficiency and accuracy of using a two-dimensional plan to perform spatial segmentation and establish a three-dimensional model of a single space. At the same time, the building layout topological relationship and room ventilation resistance information are obtained according to the three-dimensional building model, which can efficiently provide basic information for ventilation network calculation and improve the efficiency of multi-area ventilation evaluation.
[0059] The embodiment of the present invention provides a plane based on space elements Figure 3 3D modeling method, deployed on computers, servers and other electronic devices, is used in scenarios where a 3D building model needs to be constructed using a building plan. Figure 1 and Figure 2 As shown, the steps of the method in this embodiment include:
[0060] Step S100: Obtain a building plan.
[0061] Specifically, a building plan is obtained. The building plan is applicable to an indoor layout with multiple rooms, where there is a connection between the rooms, and at least one room is connected to the outdoors. However, there is no restriction on the number of rooms and the application places. It can be a public building type apartment such as a lobby, conference room, office, etc., or a residential apartment such as one bedroom and one living room, two bedrooms and one living room, three bedrooms and two living rooms, and multiple bedrooms. That is, the building plan includes apartment plans of public building types and residential apartment plans. For the convenience of description, the building plan that appears in the following text and the accompanying drawings of the present invention generally refers to various types of apartment plans.
[0062] In a preferred embodiment, in order to facilitate the subsequent accurate identification of spatial elements and spatial relationships, after obtaining the building floor plan, it also includes: performing standardized preprocessing on the building floor plan according to a calibrated image size, and updating the building floor plan, and the standardized preprocessing includes but is not limited to scaling, cropping, and image filling processing.
[0063] Specifically, Figure 2 and Figure 3 As shown in the figure, the image pre-processing module is used to scale the building plan while maintaining its own aspect ratio, so that the width and height of the scaled building plan meet the set standard plan size (such as 256*256 pixels), where the width and height range of the standard plan are set according to factors such as the building type, building area and apartment complexity corresponding to the building plan. If, according to the requirements of the image resolution, only the width or height of the scaled building plan is within the set width and height range of the image, then the scaled building plan needs to be intelligently cropped, such as using image recognition technology (such as edge detection, content recognition, etc.) to assist in determining the best cropping area and retaining the key information in the original image. In addition, for the situation where the content clarity of some areas is insufficient or missing due to occlusion, damage during shooting or data loss during transmission, the image filling technology is used to fill it to the standard size to improve the image quality and make the edges smoother and more natural. After preprocessing, the image is verified. If the image quality is poor or too much information is lost, which does not meet the image quality standards, the scaling and cropping parameters are readjusted, and preprocessing operations such as scaling, cropping, and image filling are performed again until it meets the set standard floor plan size. Ensure that all preprocessed images are output in the standard floor plan size and retain the key information in the original image, so that the updated building floor plan can be used as the basis for subsequent processing.
[0064] Step S200: using the trained neural network model to identify and classify spatial elements of the building plan to obtain several types of spatial elements.
[0065] Specifically, the trained neural network model is used to identify the building plan to determine the spatial element corresponding to each pixel in the building plan; all the pixels are classified according to the type of the spatial element to obtain several types of spatial elements.
[0066] In the inference stage, the preprocessed building floor plan is directly input into the semantic segmentation model (i.e., the trained neural network model) using the floor plan feature recognition module to automatically perform spatial feature recognition and classification operations on the building floor plan to obtain several types of spatial features, and perform pixel-by-pixel semantic masking operations on each type of spatial feature to obtain feature label masks, i.e., semantic labels, such as Figure 4 As shown in Figure 1, the floor plan includes a living room, balcony, kitchen, bathroom, master bedroom and second bedroom. After being processed by the trained neural network model, the red lines represent external doors, the blue lines represent internal doors, the lavender lines represent windows, the light gray area represents the kitchen, the brown-red area represents the living room, the off-white area represents the bathroom, the smoky gray area represents the bedroom (including the master bedroom and the second bedroom), and the dark gray area represents the balcony. It can be seen that each semantic label type in the semantic label map corresponds to the spatial element type in the floor plan, as shown in Table 1.
[0067] Table 1:
[0068]
[0069] As can be seen from Table 1, using semantic labels to represent spatial element types greatly simplifies the complexity of spatial structure representation, which is conducive to improving the recognition accuracy and efficiency of different types of spatial elements.
[0070] It should be stated that the semantic segmentation model adopted by the present invention can adopt the Transform model, Fully Convolutional Network (FCN), Symmetric Semantic Segmentation Network (Encoder-Decoder with Skip Connection, U-net), Multi-path Refinement Network (RefineNet), Pyramid Scene Parsing Network (PSPNet) and other neural network models that can realize image semantic segmentation, and the present invention does not make specific restrictions on this.
[0071] In the training phase, this embodiment builds a semantic segmentation model based on the Adaptive Frequency Transformer (AFFormer) model in the Transform model, and describes in detail the training process of the neural network model built based on the AFFormer model, specifically:
[0072] Step M100: construct an initial neural network model based on the preset neural network.
[0073] Specifically, since the AFFormer model is a headless lightweight parallel architecture for semantic segmentation, it uses heterogeneous operators for pixel embedding and prototype representation, and uses the prototype representation as a specific learnable local description to replace the decoder and retain rich image semantics on high-resolution features. Based on this, this embodiment uses AFFormer as the basic architecture to build the initial neural network model.
[0074] The network architecture of the initial neural network model built based on AFFormer is as follows: Figure 5 As shown in the figure, it contains a stem module with two convolutional layers and multiple processing units connected in sequence. Each processing unit includes a clustering module, which performs block and convolution operations on the features extracted from the input building floor plan to obtain prototype features. , and the prototype features Input to a parallel network structure, including two heterogeneous operators, PL operator and PD operator, prototype features After being processed by the PL operator, the PD operator is used for further processing. The result after the PD operator processing is connected to the Clustering module of the next processing unit. is from The high-level features abstracted from the proposed method include enhanced semantic features that help distinguish different building elements such as rooms, doors, windows, etc.
[0075] Figure 5 The overall flow of the architecture shown is: the building plan is fed into the Stem module to extract the input features of the building plan , where the input feature It includes the original pixel information of the building plan, the spatial layout and position information of each element in the image, and semantic information such as edges, corners, and textures, which contains the key visual and structural information of the building plan. After the first processing unit, the restored features are obtained , then The input is sent to the second processing unit, and so on. The overall architecture includes four processing units. After passing through the four processing units, the output Connect to the CLS module and finally output the processed building floor plan. For each processing unit, initialize the features input to the Clustering module as prototype features As a prototype of the image, Each point in is taken as a local cluster center . Use the prototype feature learning (Prototype Learning, PL) operator to update the cluster center , instead of updating the features directly , this method can greatly reduce the amount of calculation, and the updated cluster center is recorded as , the updated cluster center is recorded as Contains richer semantic and contextual information, which enables the model to better understand and distinguish different building elements such as rooms, doors, windows, etc. For the updated cluster centers , use the pixel descriptor (PD) operator to restore and obtain the restored features , which contains pixel semantics and updated prototype semantics The specific process of using the pixel descriptor (PD) operator for recovery is as follows: the PD operator first Pixel semantic modeling of local details in Project it into a low-dimensional space and establish the local relationship between pixels so that each local block maintains a clear boundary. Embed in In the example, bilinear interpolation is used to restore the original spatial features, that is, the restored features , By combining and The information of the prototype features can more accurately identify and distinguish different building elements such as rooms, doors, windows, etc. This enhanced semantic understanding helps improve the accuracy of segmentation. Some local details may be lost in the clustering process. Through the restoration process of the PD operator, these details can be reconstructed, making the segmentation results more refined and accurate. Its comprehensive features enable the model to have better generalization capabilities when facing different building floor plans and can adapt to various layouts and designs. The difference between each processing unit lies in the different input feature sizes. By gradually reducing the spatial resolution and adjusting the number of channels, the model can gradually transition from low-level features to high-level features. Therefore, each processing unit undertakes different learning tasks. For example, in the early units, more emphasis may be placed on the extraction of basic features, and in the later units, more emphasis may be placed on the integration and classification of high-level features. For example, the dimensions of the building floor plan are , the prototype features corresponding to each processing unit The dimensions become , , and ,in, , , and Represents the number of channels of the feature dimension. It can be seen that after the processing operations of these processing units, the number of channels changes. The change in the number of channels is conducive to helping the model express features at different levels and improving the expressiveness of features; the spatial size of the feature map gradually decreases, which is conducive to gradually reducing the amount of calculation, and the spatial resolution gradually decreases, which helps the model capture more abstract features. Therefore, the processing operations of these processing units can gradually reduce the spatial resolution and adjust the number of channels, and the model can gradually transition from low-level features to high-level features. Among them, the PD operator is used to restore or enhance features, and the feature map is restored by upsampling, so that the height and width of the feature map can be adjusted.
[0076] Among them, the Stem module contains two convolutional layers, which are used to extract preliminary feature representations from the input building plan, increase the number of channels while reducing the spatial dimension of the image, and provide compression and preliminary abstract features for subsequent processing. The PL operator is an adaptive frequency filtering module based on the Transformer construction. It uses adaptive filters for feature learning to capture and enhance frequency information that is important for semantic segmentation tasks. It can automatically adjust its filtering parameters to match the changes in the input signal characteristics. Through the adaptive algorithm, the coefficients or parameters of the filter are adjusted in real time according to the error between the input signal and the reference signal, which can help the model better understand and process the semantic information in the input image, thereby helping to mine more frequency information to enhance the differences between different types of spatial elements and make the boundaries between different types of spatial elements clearer, thereby improving the accuracy and efficiency of spatial element segmentation. The PD operator is used to extract features from the building plan. Specifically, bilinear interpolation is a common technique for image scaling and feature mapping, which is used to interpolate in two directions (horizontally and vertically) to smoothly map from low resolution back to high resolution. Project it into a low-dimensional space, establish the local relationship between pixels, so that each local block maintains a clear boundary, and then update the cluster center Embedded into features In the process, the updated cluster center features are mapped back to the spatial resolution of the original image through bilinear interpolation to obtain the original spatial features , original space features It has the same spatial resolution as the original input image, but contains updated and optimized feature representations that are optimized to make better task-related decisions and are suitable for subsequent image segmentation tasks. Finally, the linear projection layer is included in the PD operator, which uses a 1×1 convolution to perform linear projection after recovering the features to integrate features from different sources. The PD operator uses a linear projection layer to integrate features from cluster centers. and the original features The integrated features contain the original pixel semantics and the prototype semantics collected by the clustering center. The CLS module is a classification layer, which consists of a convolutional layer and is used to determine the category semantic label of each pixel.
[0077] Step M200: Acquire a number of sample building plan images, and add a semantic label image after adding spatial element tags to each of the sample building plan images to construct a training set.
[0078] Specifically, a variety of different types of building plan sample images are obtained, and each building plan sample image is marked according to the spatial element type shown in Table 1 to obtain the building plan sample image. Figure 1 A corresponding semantic label map is obtained, and the training set is constructed using the building plan sample map and the semantic label map. For example, more than 400 apartment plan sample maps are obtained, and the types and semantic labels of the spatial elements defined in Table 1 are marked to obtain apartment plan sample maps. Figure 1 A corresponding semantic label map. The sample apartment plan map may be a real apartment map that has been actually built or an abstract apartment map that has been designed but not built. This embodiment does not impose any specific restrictions on this.
[0079] Step M300: Iteratively train the initial neural network model using the training set until the value of a preset loss function reaches a preset loss function threshold or reaches a preset number of iterations, thereby obtaining a trained neural network model.
[0080] Specifically, the initial neural network model is iteratively trained using the training set, the root mean square error (RMSE) is used as the loss function, and the model optimization can use optimization algorithms such as gradient descent algorithm, root mean square error optimization (RMSEProp), adaptive moment estimation (Adam) and so on for iterative solution until the value of the solved loss function reaches a preset loss function threshold or reaches a preset number of iterations to obtain a trained neural network model.
[0081] Step S300: Generate a spatial topological relationship diagram based on the type of the spatial elements and preset spatial relationship division rules.
[0082] Specifically, the spatial relationship recognition module is first used to create nodes based on the type of spatial elements and the preset spatial relationship division rules, using the spatial areas corresponding to one or more continuous spatial elements of the same type (such as rooms, doors and windows, etc.) represented by each semantic label, and edges are created using the connection relationship between different spatial elements in the spatial structure. These connection relationships are limited to physical connections, such as door connection relationships, and connection relationships between adjacent spatial elements without partition walls. Among them, door connection means that two spatial elements are connected by a door, such as the living room and bedroom are connected by a door. The recognition rule of this step is: identify the spatial element "door" in the image, extract the labels of its adjacent pixels, identify the nodes to which the labels belong, that is, determine the type of spatial element corresponding to the label. If there is a group of adjacent nodes for the same door, an edge is created between them, and its connection relationship is assigned a value of 1. Adjacent without partition walls means that two spatial elements are directly adjacent. For example, if some rooms have no doors and are directly connected to the living room, they are adjacent without partition walls. Here, it can be judged by identifying whether the pixels where the two spatial elements are located are adjacent. The spatial relationship division rule is used to define the division of spatial elements into regions according to the types of spatial elements and the spatial relationships between them, so as to obtain nodes representing different spatial regions and edges representing different adjacency relationships; then all nodes and edges are encoded using One-Hot Encoding, and all nodes and edges between them are organized into a spatial relationship list, which represents the relationship between rooms and the relationship between rooms and external doors and windows. It can be a set containing multiple spatial element pairs, each of which contains two nodes and their connection relationships, which are 1 if connected and 0 if not connected. Finally, the spatial relationship list is formatted, and nodes and edges are added to the graph by creating a data structure graph, so that nodes and edges are organized and connected according to spatial relationships, and a spatial topological relationship graph is generated, such as Figure 6 As shown. According to the results of node judgment, dots are drawn in the center of continuous pixel areas with the same semantic label to represent different nodes. The pixel area is used to represent the corresponding spatial area in the plan view, and edges are drawn according to the spatial relationship between the spatial elements in the spatial relationship list. The connection relationship between the nodes is determined, and edges are created between the nodes according to the connection relationship, so as to efficiently construct a graph structure that can accurately reflect the spatial layout and element relationship, thereby providing an intuitive visual representation for spatial analysis and understanding.
[0083] In a preferred embodiment, the creating nodes and edges using the spatial elements based on the type of the spatial elements and the preset spatial relationship division rules includes:
[0084] Step S310: creating a node for rooms or outdoor space areas corresponding to a plurality of continuous space elements of the same type according to the node division rule in the preset space relationship division rule.
[0085] Specifically, according to the node division rule in the preset spatial relationship division rule, a node is created for the rooms or outdoor space areas corresponding to multiple continuous spatial elements of the same type, so that each room and the external space in the entire building plan are represented as different nodes. For example, a series of pixel areas corresponding to the room areas that are continuous and marked with the same semantic label are extracted and represented as a node, and the external door or window connected to the outdoor space is represented as an external node, and each node is named with the semantic label corresponding to the corresponding spatial element type. In particular, if the node to which the door or window belongs contains outdoor space, the door is an external door or the window is an external window, and the external door or window is represented as an external node separately. It is worth stating that the external node actually refers to the outdoor space connected to the external door or window, but since the research area is only the building plan itself and does not include the outdoor space outside the building plan, this embodiment only marks the nodes on the building plan, so for the convenience of marking, the external door or window directly connected to the outdoor space represents the external node.
[0086] Step S320: according to the edge division rule in the preset spatial relationship division rule, an edge is created between adjacent nodes of the spatial elements of the door or window type with connectivity.
[0087] Specifically, according to the edge division rules in the preset spatial relationship division rules, edges are created according to the connectivity between rooms. First, the continuous space of semantic labels representing doors (including external doors and internal doors) or windows (including external windows and internal windows, or only external windows) is extracted as the door and window space, and then the adjacent semantic labels of the door and window space are extracted, and the nodes to which the adjacent semantic labels belong are identified. If the same door is adjacent to at least two nodes, an edge is created between these two or more nodes, and the connection relationship between the two or more nodes is assigned a value of 1, otherwise it is assigned a value of 0, that is, edges are only created between adjacent nodes of spatial elements of door or window types with connectivity.
[0088] For example, Figure 7 As shown, the building plan is divided into multiple nodes according to the spatial relationship division rule, including nodes numbered 1-6 and 6 external nodes, wherein any node numbered 1-6 is composed of an indoor space area surrounded by multiple continuous spatial elements of the same type, and each external node is composed of an external door or window connected to the external space, and then based on these nodes and the connectivity between rooms and between rooms and the outside world, a ventilation connection relationship diagram between nodes is constructed.
[0089] This embodiment uses all the spatial elements in the building plan to create a number of nodes and edges according to the above-mentioned spatial relationship division rules, and uses all the nodes and edges to generate a spatial topological relationship diagram to comprehensively describe the spatial range occupied by each room in the building corresponding to each node, and the connection relationship between the walls connected to the doors or windows in the building corresponding to each edge, so as to accurately reflect the spatial relationship between the various spatial elements in the building plan, as well as the relative position and connectivity between the rooms, providing a good foundation for the subsequent construction of a three-dimensional building model.
[0090] Step S400: constructing a three-dimensional building model based on the spatial topological relationship diagram.
[0091] Specifically, based on the spatial topological relationship graph, the scope and boundaries of each room in the building plan are identified. Since rooms are usually composed of doors, windows and walls, the scope of each room refers to the spatial area enclosed by the doors, windows and walls of the room. The doors, windows and walls of the room are the boundaries of the room. Then, image processing or graphic recognition technology (such as edge detection, shape analysis, etc.) is used in combination with the information of the spatial topological relationship graph to identify various types of spatial elements on the boundary of the room according to the semantic labels corresponding to the spatial elements such as doors, windows and walls, so as to obtain the boundary of each room. The boundary of each room is used as the basis for segmentation to segment the spatial topological relationship graph and obtain several data slices. The nodes (representing rooms or spaces) and edges (representing connection relationships) in the topological relationship graph are re-divided according to the boundary lines to represent each room with an independent two-dimensional slice. The slice contains the topological information and boundary information of the corresponding room, thereby ensuring that each data slice accurately reflects its position and shape on the building plan; then based on the number of pixels contained in the node corresponding to each data slice, according to the resolution information in S100, by counting the number of pixels corresponding to the nodes that are continuous and have the same semantic label, the actual building area corresponding to each node in each data slice is determined; finally, based on the area corresponding to each node in each of the data slices, corresponding height, length, width and other information are assigned to each data slice, and the two-dimensional data slices are stretched in the height direction using three-dimensional modeling software or algorithms, while considering the topological information and boundary information between the rooms, so as to convert all data slices into three-dimensional data space and construct a three-dimensional building model.
[0092] It can be seen that this embodiment effectively identifies the scope and boundaries of each room in the building plan based on the spatial topological relationship diagram, and constructs an accurate three-dimensional building model, which can significantly improve the accuracy and efficiency of using two-dimensional plan views to segment the space and establish a three-dimensional model of a single space.
[0093] In a preferred embodiment, the spatial topological relationship diagram is segmented based on the boundary of each of the rooms to obtain a number of data slices, including: extending the boundary of each of the rooms according to a preset expansion range to obtain the expanded boundary corresponding to each of the rooms; and segmenting the spatial topological relationship diagram based on each of the expanded boundaries to obtain a number of data slices.
[0094] Specifically, after determining the boundaries of each room, this embodiment expands the boundaries of each room according to a preset expansion range to obtain the expanded boundaries corresponding to each room, wherein the preset expansion range refers to expanding a set number of pixels outward along the boundary to fully capture the environmental characteristics around the room. Then, based on the expanded room range, the boundary of each room is used as a segmentation basis to segment the spatial topological relationship diagram to obtain a number of data slices. These data slices integrate the topological information and boundary information of the room and its adjacent areas, thereby ensuring that the position and shape of each room on the building plan can be completely cut and displayed. After all the data slices on the building plane are cut, a semantic label 0 is added to the pixel area without a semantic label to distinguish the room from the external space area. Finally, all the data slices and semantic labels are used as inputs to the modeling program. The modeling program establishes a corresponding number of grids in the horizontal and vertical directions according to the size of the data slice and the image size set in the previous preprocessing stage. Each grid represents a pixel. The semantic label information in the slice is read through the preset 3D modeling algorithm. For the grid marked as 0 in the data slice, the bottom surface is generated with the outline of the grid where the semantic label is located and stretched upward to form a wall. For the data corresponding to the semantic label marked as a window or door in the data slice, the door and window plane is generated at the location of the grid according to the default size. For the top and bottom surfaces of the model, the wall boundary is obtained, the boundary is used to enclose the plane to form a plane, and it is moved or copied to the highest and lowest points of the model to construct a complete 3D building model. Figure 8 shown.
[0095] This embodiment utilizes the expanded boundaries corresponding to the rooms segmented in the spatial topological relationship diagram to realize the automatic conversion from the two-dimensional spatial topological relationship diagram to the three-dimensional building model, which can significantly enhance the structural integrity of the three-dimensional building model and provide a richer detailed description.
[0096] In a preferred embodiment, after constructing the three-dimensional building model, the method further comprises:
[0097] Based on the pixel coordinates corresponding to the door or window of each of the rooms, the size of the door or window is calculated; based on the size of the door or window, the ventilation resistance of the edge corresponding to the door or window is calculated.
[0098] Specifically, when the connection relationship between nodes is 1, the semantic label coordinates corresponding to the door or window are obtained, and the longest distance between the coordinates is calculated as the size of the door or window according to the pixel coordinates to which the semantic label belongs. The area of the door or window is calculated according to the size of the door or window, and the ventilation resistance of the edge corresponding to the door or window is calculated. ,in, is the air density, is the flow coefficient, is the door or window area. After all edges are identified and resistances are calculated, the data is summarized and displayed in a table. The semantic label coordinates are pixel coordinates corresponding to the semantic label determined according to the semantic label corresponding to each pixel position in the building plan. For example, according to the standard plan size in S100 (such as 256×256 pixels), a neural network is used in S200 to obtain the semantic label of each pixel. Row, No. The semantic label of the pixel is 6, so the coordinates of the semantic label are , the corresponding semantic label type is gate.
[0099] For example, Fig. 9 As shown in Figure 1, the boundaries of each door and window node are identified based on the ventilation connection relationship between nodes. Figure 7 The connection relationship between node 1 and node 4 in Fig. 9 Taking the leftmost red connecting line for connecting node 1 and node 4 as an example, a ventilation connection relationship diagram between nodes is constructed according to connectivity. According to the connection relationship between rooms, the corresponding connection components, such as doors or external windows and their corresponding semantic labels, are obtained. According to the pixel coordinates to which the semantic labels belong, the size of the door or window is calculated. The specific method is to use the pixel coordinates of the lower left corner of all pixel coordinates contained in the door or window as the reference point, calculate the distance between the reference point and all other pixel coordinates contained in the door or window, and use the longest distance as the length of the door or window to calculate the ventilation resistance of the edge. Repeat the above steps until all the ventilation resistances of the connection relationships are calculated, and the ventilation resistance list of the node connection relationships is obtained as shown in Table 2, where connection node 1 and connection node 2 represent any two nodes with a connection relationship of 1. Since the external window nodes (such as external 5 and external 6) do not need to define the room area, they are represented by “—”.
[0100] Table 2:
[0101]
[0102] In this embodiment, the ventilation resistance of each room is calculated according to the ventilation connection relationship between the nodes in each room in the constructed three-dimensional building model, which can efficiently provide basic parameters for ventilation network calculation, improve the efficiency of multi-region airflow network calculation, and help as reference information in subsequent actual construction to ensure the stability and safety of the constructed real building.
[0103] like Fig.10 As shown, it corresponds to the plane based on the above spatial elements Figure 3 The embodiment of the present invention also provides a plane modeling method based on spatial elements. Figure 3 dimensional modeling system, the above plane based on spatial elements Figure 3 The dimensional modeling system includes:
[0104] The information acquisition module 101 is used to acquire a building plan;
[0105] A spatial element recognition module 102 is used to recognize and classify spatial elements of the building plan using a trained neural network model to obtain several types of spatial elements;
[0106] A spatial topology relationship graph construction module 103, used to generate a spatial topology relationship graph based on the type of the spatial elements and a preset spatial relationship division rule;
[0107] The three-dimensional building model construction module 104 is used to construct a three-dimensional building model based on the spatial topological relationship diagram.
[0108] Specifically, in this embodiment, the plane based on the space element Figure 3 The specific functions of the dimensional modeling system can also refer to the above-mentioned plane based on spatial elements. Figure 3 The corresponding description in the dimensional modeling method will not be repeated here.
[0109] Based on the above embodiments, the present invention further provides an intelligent terminal, whose principle block diagram can be shown as follows: Fig.11 The intelligent terminal can be used to execute the plane based on space elements provided in the above embodiment. Figure 3 The dimensional modeling method is not described here for brevity. The intelligent terminal includes: a processor, the processor is coupled to a memory, the memory is used to store computer programs or instructions, and the processor is used to execute the computer programs or instructions stored in the memory, so that the method in the above method embodiment is executed.
[0110] The present invention also provides a computer-readable storage medium on which computer instructions for implementing the method in the above method embodiment are stored.
[0111] For example, when the computer program is executed by a computer, the computer can implement the method in the above method embodiment.
[0112] The embodiment of the present application also provides a computer program product including instructions, which, when executed by a computer, enables the computer to implement the method in the above method embodiment.
[0113] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0114] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0115] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0116] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0117] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0118] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, and other media that can store program codes.
Claims
1. A three-dimensional modeling method of a plane diagram based on spatial elements, characterized in that: The following steps are involved: Get building plans; Using the trained neural network model to identify and classify spatial elements of the building plan to obtain several types of spatial elements; Generate a spatial topological relationship diagram based on the type of the spatial elements and the preset spatial relationship division rules; Based on the spatial topological relationship diagram, construct a three-dimensional building model; The neural network model is constructed based on the AFFormer model, and the network architecture includes a stem module of two convolutional layers and multi-level processing units connected in sequence; each processing unit includes a clustering module, which is used to perform block and convolution operations on the features extracted from the input building plan to obtain prototype features, and input the prototype features into a parallel network structure, including two heterogeneous operators, the PL operator and the PD operator. The prototype features are first processed by the PL operator and then further processed by the PD operator. The results after the PD operator processing are connected to the clustering module of the next processing unit; wherein, the features extracted from the input building plan include the original pixel information of the building plan, the spatial layout and position information of each element in the image, as well as the semantic information, and the key visual and structural information of the building plan; the stem module is used to extract preliminary feature representations from the input building plan; the PL operator is used to capture and enhance the frequency information important for the semantic segmentation task; the PD operator is used to perform pixel semantic modeling on the local details in the features extracted from the building plan; the clustering module is used to determine the semantic label of each pixel, and use the semantic label to represent the spatial elements; The generating of a spatial topological relationship diagram based on the type of the spatial elements and a preset spatial relationship division rule includes: Based on the type of the spatial elements and the preset spatial relationship division rules, the spatial elements are used to create nodes and edges; all the nodes and edges are encoded in a one-hot encoding manner to obtain a spatial relationship list; the spatial relationship list is formatted to generate a spatial topological relationship diagram; The creating nodes and edges by using the spatial elements based on the type of the spatial elements and the preset spatial relationship division rule includes: According to the node division rule in the preset spatial relationship division rule, a node is created for the rooms or outdoor space areas corresponding to multiple continuous spatial elements of the same type; according to the edge division rule in the preset spatial relationship division rule, an edge is created between adjacent nodes of the spatial elements of the door or window type with connectivity; The step of constructing a three-dimensional building model based on the spatial topological relationship diagram includes: Based on the spatial topological relationship diagram, the scope and boundaries of each room in the building plan are identified; based on the boundaries of each room, the spatial topological relationship diagram is segmented to obtain a number of data slices; based on the number of pixels contained in the nodes corresponding to each data slice, the area of each data slice is determined; based on the area and semantic label of each data slice, all the data slices are converted into a three-dimensional data space to construct a three-dimensional building model of a single space.
2. The three-dimensional modeling method of a plane diagram based on spatial elements according to claim 1, characterized in that: The step of segmenting the spatial topological relationship graph based on the boundary of each room to obtain a plurality of data slices includes: Expanding the boundary of each room according to a preset expansion range to obtain an expanded boundary corresponding to each room; The spatial topological relationship graph is segmented based on each of the expanded boundaries to obtain a plurality of data slices.
3. The three-dimensional modeling method of a plane diagram based on spatial elements according to claim 1, characterized in that: After constructing the three-dimensional building model, the method further includes: Calculate the size of each door or window based on the pixel coordinates corresponding to the door or window of each room; Based on the size of the door or window, the ventilation resistance of the side corresponding to the door or window is calculated.
4. A three-dimensional modeling system for a plane diagram based on spatial elements, characterized in that: The system is applied to implement the steps of the plan view three-dimensional modeling method based on spatial elements as described in any one of claims 1 to 3, and comprises: An information acquisition module, used to acquire a building plan; A spatial element recognition module is used to recognize and classify spatial elements of the building plan using a trained neural network model to obtain several types of spatial elements; A spatial topology relationship diagram construction module, used to generate a spatial topology relationship diagram based on the type of the spatial elements and a preset spatial relationship division rule; The three-dimensional building model construction module is used to construct a three-dimensional building model based on the spatial topological relationship diagram.
5. An intelligent terminal, characterized in that: include: A memory for storing executable instructions; A processor is used to call and run the executable instructions in the memory to execute the steps of the plan view three-dimensional modeling method based on spatial elements as described in any one of claims 1-3.
6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program instructions, and when the program instructions are executed by a processor, the plan view three-dimensional modeling method based on spatial elements as described in any one of claims 1 to 3 is implemented.