A method for constructing three-dimensional city scenes
By acquiring and utilizing the semantic labels of scene models and automatically laying them out in the basic scene framework, the problem of model splicing not conforming to the rules of real space in 3D urban scene modeling is solved, and efficient and accurate 3D urban scene construction is achieved.
Patent Information
- Application Number
- CN202510857008.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-25
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2045-06-25
Smart Images

Figure CN120355863B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of three-dimensional scene generation, and in particular to a method for constructing a three-dimensional urban scene. Background Art
[0002] In 3D modeling of urban scenes, model stitching methods primarily rely on the automatic matching of geometric features. While these geometric feature-based matching methods, such as the Iterative Closest Point (ICP) algorithm and feature point matching, can achieve a certain degree of automatic alignment, they only consider the similarity of geometric features and fail to identify semantic relationships between models. This can lead to stitching results that violate the rules of real space, such as incorrectly embedding a building model into a road model.
[0003] The above content is only used to assist in understanding the technical solution of this application and does not constitute an admission that the above content is prior art. Summary of the Invention
[0004] The main purpose of this application is to provide a three-dimensional urban scene construction method, which aims to solve the technical problem that three-dimensional urban scene modeling does not take into account the semantic association relationship between models, resulting in incorrect model splicing.
[0005] To achieve the above objectives, an embodiment of the present application provides a method for constructing a three-dimensional city scene, the method comprising:
[0006] In response to the scene assembly instruction, the basic city model resource library is displayed on the scene assembly interface, and the scene model is initialized and loaded according to the received model resources;
[0007] Generate a basic scene framework according to the scene theme and area range parameters included in the scene assembly instruction;
[0008] Acquiring a semantic tag of the scene model, and determining a spatial layout requirement of the scene model based on the semantic tag;
[0009] According to the spatial layout requirements, the scene model is automatically laid out into the basic scene framework to construct a three-dimensional city scene.
[0010] In one embodiment, the step of generating a basic scene framework according to the scene theme and area range parameters included in the scene assembly instruction includes:
[0011] Matching a preset urban planning template according to the scene theme, wherein the urban planning template includes road grid parameters, functional zoning ratios, and terrain feature data;
[0012] generating an initial terrain grid based on the regional range parameters, and performing elevation processing on the initial terrain grid according to the terrain feature data;
[0013] Generating a trunk road network on the initial terrain grid according to the road grid parameters, and dividing the initial terrain grid into different functional zones according to the functional zone ratios;
[0014] Automatically generate basic building placeholders and public facility placeholders that meet the attribute characteristics of each functional zone;
[0015] The main road network, the functional zones, the basic building placeholders and the public facility placeholders are integrated with the initial terrain grid to generate the basic scene framework.
[0016] In one embodiment, the step of obtaining the semantic label of the scene model and determining the spatial layout requirement of the scene model based on the semantic label includes:
[0017] Performing semantic analysis on the semantic tag to determine the model type of the scene model;
[0018] A preset layout rule library is matched according to the model type to obtain the spatial layout requirements corresponding to the scene model.
[0019] In one embodiment, the step of automatically laying out the scene model into the basic scene framework according to the spatial layout requirements to construct a three-dimensional city scene includes:
[0020] Dividing the basic scene framework into a plurality of voxel grids, and constructing a scene space topology structure by calculating the occupancy state of each voxel grid;
[0021] According to the spatial layout requirements, screening candidate placement areas in the scene space topology structure;
[0022] For each candidate placement area, calculating a spatial fitness score of the scene model in the candidate placement area based on the bounding box size of the scene model;
[0023] The candidate placement area with the highest spatial fitness score is selected as the final placement position of the scene model, and the scene model is spliced into the target voxel grid corresponding to the final placement position to construct a three-dimensional city scene.
[0024] In one embodiment, the step of screening candidate placement areas in the scene space topology structure according to the spatial layout requirements includes:
[0025] generating a spatial constraint expression according to the planning constraint conditions in the spatial layout requirements;
[0026] The voxel grids in the scene space topology structure are traversed, and the voxel grids satisfying the spatial constraint expression are screened out as the candidate placement areas using a spatial relationship reasoning algorithm.
[0027] In one embodiment, the step of selecting the candidate placement area with the highest spatial fitness score as the final placement location of the scene model, splicing the scene model into the target voxel grid corresponding to the final placement location, and constructing the three-dimensional city scene includes:
[0028] Performing collision detection on the candidate placement area with the highest spatial fitness score;
[0029] If the collision detection passes, splicing the scene model to the target voxel grid;
[0030] If the collision detection fails, the candidate placement area with the second highest score is selected to repeat the collision detection until the candidate placement area that passes the collision detection is found or all the candidate placement areas are traversed to generate the three-dimensional city scene.
[0031] In one embodiment, if the collision detection fails, the candidate placement area with the next highest score is selected and the collision detection is repeated until a candidate placement area that passes the collision detection is found or all candidate placement areas are traversed to generate the three-dimensional city scene. The three-dimensional city scene construction method further includes:
[0032] When the collision detection of all candidate placement areas fails, perform at least one of the following operations:
[0033] Generate a conflict detection report, mark the conflict location and conflict type, and provide modification suggestions; or,
[0034] Providing a manual adjustment interface to allow the user to adjust the position, rotation angle or scaling of the scene model;
[0035] The finalized scene model is spliced with the target voxel grid to construct a three-dimensional city scene.
[0036] In one embodiment, after the step of automatically laying out the scene model into the basic scene framework according to the spatial layout requirements to construct a three-dimensional city scene, the three-dimensional city scene construction method further includes:
[0037] Constructing a scene element graph according to the scene model in the basic scene framework;
[0038] Traversing the scene element graph to identify blank areas in the basic scene frame;
[0039] According to the spatial size of the blank area and the type of surrounding elements, matching the corresponding scene model from the basic city model resource library to obtain a candidate filling model;
[0040] The candidate filling models are spliced into the blank area to construct the complete three-dimensional city scene.
[0041] An embodiment of the present application also provides a three-dimensional urban scene construction device, which includes: a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the computer program is configured to implement the steps of the three-dimensional urban scene construction method described above.
[0042] An embodiment of the present application also provides a storage medium, which is a computer-readable storage medium. A computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the three-dimensional city scene construction method described above are implemented.
[0043] One or more technical solutions proposed in this application have at least the following technical effects:
[0044] This application significantly improves the speed and convenience of model loading by quickly responding to user instructions and directly displaying the basic city model resource library on the interface, allowing users to carry out scene construction work more efficiently. Furthermore, this application generates a basic scene framework based on the scene theme and area range parameters in the scene assembly instructions, which not only lays a solid foundation for the subsequent model layout, but also effectively improves the efficiency of the entire scene construction process. In addition, this application obtains the semantic tags of the scene model and guides the model layout according to the spatial layout requirements corresponding to these semantic tags, ensuring the reasonable distribution of the model in the geometric space while also making it functionally and logically consistent with the actual scene requirements. Finally, the scene model is automatically laid out in the basic scene framework according to the spatial layout requirements, which can quickly complete the reasonable placement of the model, greatly reduce manual intervention, improve the efficiency of scene construction, and effectively reduce the risk of errors caused by human factors. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 This is a flow chart of a first embodiment of a method for constructing a three-dimensional city scene according to an embodiment of the present application;
[0046] Figure 2 This is a flow chart of a second embodiment of a method for constructing a three-dimensional city scene according to an embodiment of the present application;
[0047] Figure 3 This is a flow chart of a third embodiment of a method for constructing a three-dimensional city scene according to an embodiment of the present application;
[0048] Figure 4 This is a flow chart of a fourth embodiment of a method for constructing a three-dimensional city scene according to an embodiment of the present application;
[0049] Figure 5 This is a structural diagram of the three-dimensional city scene construction device involved in the embodiment of the present application.
[0050] The purpose, features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0051] It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application.
[0052] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0053] In 3D modeling of urban scenes, model stitching methods primarily rely on the automatic matching of geometric features. While these geometric feature-based matching methods, such as the Iterative Closest Point (ICP) algorithm and feature point matching, can achieve a certain degree of automatic alignment, they only consider the similarity of geometric features and fail to identify semantic relationships between models. This can lead to stitching results that violate the rules of real space, such as incorrectly embedding a building model into a road model.
[0054] In view of the above problems, this application proposes a three-dimensional urban scene construction method, which displays a basic city model resource library on the scene assembly interface in response to a scene assembly instruction, initializes and loads the scene model based on the received model resources; generates a basic scene framework based on the scene theme and area range parameters contained in the scene assembly instruction; obtains the semantic label of the scene model, and determines the spatial layout requirements of the scene model based on the semantic label; and automatically layouts the scene model into the basic scene framework according to the spatial layout requirements to construct a three-dimensional urban scene. This application determines the spatial layout requirements of the model through semantic labels, ensures the rationality of the splicing of each scene model, and accurately constructs a three-dimensional urban scene that meets planning requirements.
[0055] This application significantly improves the speed and convenience of model loading by quickly responding to user instructions and directly displaying the basic city model resource library on the interface, allowing users to carry out scene construction work more efficiently. Furthermore, this application generates a basic scene framework based on the scene theme and area range parameters in the scene assembly instructions, which not only lays a solid foundation for the subsequent model layout, but also effectively improves the efficiency of the entire scene construction process. In addition, this application obtains the semantic tags of the scene model and guides the model layout according to the spatial layout requirements corresponding to these semantic tags, ensuring the reasonable distribution of the model in the geometric space while also making it functionally and logically consistent with the actual scene requirements. Finally, the scene model is automatically laid out in the basic scene framework according to the spatial layout requirements, which can quickly complete the reasonable placement of the model, greatly reduce manual intervention, improve the efficiency of scene construction, and effectively reduce the risk of errors caused by human factors.
[0056] It should be noted that the execution entity of this embodiment can be a computing service device with data processing, network communication, and program execution functions, such as a computer, or an electronic device capable of implementing the above functions, a three-dimensional city scene construction system, etc. The following uses the three-dimensional city scene construction system as an example to illustrate this embodiment and the following embodiments.
[0057] The three-dimensional city scene construction method of the first embodiment proposed in this application can be found in Figure 1 The method includes steps S10 to S40:
[0058] Step S10: In response to the scene assembly instruction, the basic city model resource library is displayed on the scene assembly interface, and the scene model is initialized and loaded according to the received model resources.
[0059] It should be noted that scene assembly instructions refer to scene creation requests triggered by the user through the interactive interface. The basic city model resource library is a collection of pre-built scene models containing various urban elements such as buildings, roads, and greenery. It provides the model resources required to build 3D city scenes. Initial loading refers to loading the corresponding model instances into the scene based on the model resources selected by the user and setting their initial positions.
[0060] In this embodiment, each scene model in the basic city model resource library is accompanied by semantic tags and geometric feature parameters. The basic city model resource library can be filtered by model category or searched by keywords, helping users quickly find the model resources needed to build three-dimensional city scenes. During initial loading, the scene model is converted into a voxel grid representation in the scene coordinate system based on the model identifier and geometric feature parameters of the selected scene model. Then, a copy of the model is generated through instantiation technology. Each instance achieves differentiated rendering through independent transformation matrices (position, rotation, scale) and material parameters, and establishes an association with the spatial scene coordinate system.
[0061] Step S20: Generate a basic scene framework according to the scene theme and area range parameters included in the scene assembly instruction.
[0062] It's important to note that a scene theme refers to the functional location of the scene (e.g., commercial district, residential area, city street, etc.), while the region range parameter refers to the user-specified geographic scope of the scene, including spatial constraints such as geographic boundaries and area. The basic scene framework is a three-dimensional spatial skeleton composed of a road grid, terrain, and functional zones.
[0063] In this embodiment, after generating the basic scene framework, you can select the scene parameter category you want to set in the scene property list, such as "Lighting Settings," "Rendering Effects," or "Interaction Logic." Then, based on the selected scene parameter category, you can set specific parameters for the basic scene framework. For example, in "Lighting Settings," you can set parameters such as ambient light intensity, directional light angle, and shadow quality; in "Rendering Effects," you can set parameters such as anti-aliasing, texture filtering, and post-processing effects (such as depth of field bloom); and in "Interaction Logic," you can set the interactive behavior and response events of objects in the scene.
[0064] As a feasible implementation method, a target scenario template is first selected from preset urban planning templates based on the description of the scenario theme. The urban planning template contains key information such as road grid parameters, functional zoning ratios, and terrain feature data. Based on the road grid parameters in the matched urban planning template, a road network consisting of main roads, secondary roads, and branches that complies with urban planning standards is automatically generated. Simultaneously, procedural modeling technology is used to generate the terrain grid. Procedural modeling technology can automatically generate complex terrain structures based on preset algorithms and parameters. Combined with GIS (Geographic Information System) data, the terrain elevation is set to ensure accuracy and authenticity. Furthermore, functional zoning can be achieved through voxelized spatial partitioning. Voxelization is a technique that divides a three-dimensional space into a regular grid, with each voxel representing a spatial unit. The system can assign voxels to different functional areas based on the functional zoning ratio.
[0065] Step S30: Acquire the semantic label of the scene model, and determine the spatial layout requirement of the scene model based on the semantic label.
[0066] It's important to note that semantic labels are metadata that describe the model's functions and attributes (e.g., "Signal - Applicable to two-way four-lane roads - With pedestrian crossing button"). Spatial layout requirements refer to determining the appropriate location of a scene model within the scene, its adjacency with other scene models, spacing thresholds, and orientation restrictions based on its semantic labels. Spatial layout requirements include planning constraints such as spacing, orientation, and adjacency between scene models.
[0067] As a feasible implementation, a pre-built urban planning knowledge base systematically organizes and stores common industry standards, spatial relationship rules, and attribute constraints of various urban elements. A pre-trained semantic analysis model extracts key features from semantic labels. These features are then matched and queried against the urban specification knowledge base to determine the spatial relationship constraints between scenario models.
[0068] In this embodiment, the pre-trained semantic analysis model is trained based on a large amount of annotated data, which includes semantic labels of various urban elements and their corresponding feature descriptions. The semantic analysis model learns how to extract key features from semantic labels through annotated data, such as the model type, function, purpose, size, etc. of the scene model. When receiving the semantic labels of the scene model, the semantic analysis model can quickly identify and extract these key features, and match them with the urban planning knowledge base to determine the specific constraints that the scene model needs to meet in its spatial layout, including the relative position, direction, connection method, etc. between models, to ensure that the spatial relationship between scene models meets the requirements of urban planning.
[0069] This embodiment automatically matches applicable planning constraints by establishing a mapping relationship between feature vectors and knowledge base rules. For example, when the scene model in the semantic tag is identified as "hospital", multiple planning constraints such as "minimum distance between medical facilities and residential areas" and "width requirements for emergency access" are simultaneously associated.
[0070] As a feasible implementation, step S30 includes steps S310 to S320:
[0071] Step S310: performing semantic analysis on the semantic tag to determine the model type of the scene model.
[0072] It should be noted that the model type refers to the specific category of the model determined based on the information in the semantic tag, such as "traffic light," "building," or "road." Semantic analysis uses natural language processing technology to parse the key information in the semantic tag to determine the model type and attributes.
[0073] In this embodiment, natural language processing (NLP) technologies, such as word segmentation, part-of-speech tagging, and named entity recognition, are used to parse the text information in the semantic tags. For example, for the semantic tag "traffic light - applicable to two-way four-lane road - with pedestrian crossing button", word segmentation is first performed to decompose it into word units such as "traffic light", "applicable", "two-way four-lane road", "with", and "pedestrian crossing button". Then, the part of speech of each word unit is determined by part-of-speech tagging, and key entity information such as "traffic light" and "two-way four-lane road" is extracted through named entity recognition. Finally, based on the extracted information, the model type of the scene model is determined to be "traffic light". In addition, pre-trained NLP models, such as BERT or GPT, can also be used to improve the accuracy and efficiency of semantic analysis.
[0074] Step S320: matching a preset layout rule library according to the model type to obtain a spatial layout requirement corresponding to the scene model.
[0075] It should be noted that the layout rule library is a preset rule set that contains the spatial layout requirements corresponding to different model types, such as the minimum spacing, maximum spacing, orientation requirements, adjacency relationships, etc. between different types of scene models.
[0076] In this embodiment, the model type is first matched against the rules in the layout rule library. For example, if the model type is "traffic light," the system searches the layout rule library for rules related to "traffic light." The layout rule library may contain rules such as "traffic lights must be located on both sides of the road."
[0077] Step S40: According to the spatial layout requirements, the scene model is automatically laid out in the basic scene framework to construct a three-dimensional city scene.
[0078] It should be noted that automatic layout refers to placing scene models in target locations that meet semantic and geometric constraints. This embodiment not only considers the semantic properties of the scene models, but also ensures the reasonable distribution of the scene models in the geometric space, avoiding issues such as overlap or unreasonable spacing. At the same time, it ensures that the final scene is visually harmonious and meets the requirements of urban planning standards.
[0079] As a feasible implementation method, an optimization layout method based on genetic algorithm is adopted. First, the basic scene framework is divided into multiple areas, and each area is given different weights according to its function and planning requirements to reflect the priority and applicability of the area. For example, the commercial area may be more suitable for placing high-rise buildings, while the park area is more suitable for placing green spaces and leisure facilities. Then, according to the spatial layout requirements, an initial layout plan is generated for each scene model. Then, a genetic algorithm is used to optimize the initial layout plan by simulating the process of natural selection. Specifically, a "population" of multiple layout plans is generated first, and each layout plan represents a possible scene layout. By evaluating the layout plans, the fitness of each plan is calculated, including the spacing, orientation, adjacency relationship between scene models, and the matching degree between scene models and regional weights. Plans with high fitness are more in line with the spatial layout requirements and are more likely to be selected into the next generation.
[0080] In each generation, the genetic algorithm iterates through selection, crossover, and mutation operations, gradually converging to an optimal or near-optimal layout solution. After the final layout solution is determined, each scene model is placed in its corresponding position and fine-tuned. This fine-tuning process includes adjusting the scene model's orientation, rotation, and scale to ensure that its placement within the scene complies with semantic and geometric constraints.
[0081] Based on the above embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the first embodiment can be referred to the above introduction and will not be described in detail later. Figure 2 In the three-dimensional city scene construction method, step S20 includes steps S210 to S250:
[0082] Step S210: matching a preset urban planning template according to the scene theme, wherein the urban planning template includes road grid parameters, functional zoning ratios, and terrain feature data.
[0083] It's important to note that urban planning templates are pre-designed plans based on different scenario themes. They include information such as road grid parameters, functional zoning ratios, and terrain feature data. Road grid parameters define the layout and distribution of roads, including the location and width of main roads, secondary roads, and branch roads. Functional zoning ratios specify the area proportions of different functional areas (such as residential, commercial, and industrial areas). Terrain feature data describes terrain elevation, slope, and other information.
[0084] Step S220: generating an initial terrain grid based on the area range parameters, and performing elevation processing on the initial terrain grid according to the terrain feature data.
[0085] It's important to note that the region parameters define the scene's geographic boundaries and area. The initial terrain mesh is a three-dimensional grid generated based on the region parameters. It can also be considered a regularized base surface model, representing the scene's terrain structure. Elevation processing involves adjusting the height values of the terrain mesh based on terrain feature data to reflect the actual terrain's undulations and variations.
[0086] As a feasible implementation method, a quadtree spatial partitioning algorithm is used to generate terrain grids with adaptive accuracy. Sparse grids are used in flat areas, and complex terrain areas are automatically encrypted.
[0087] As another feasible implementation, the scene area is divided into regular grid cells, each representing a terrain point. The initial terrain grid is then subjected to elevation processing based on terrain feature data. This terrain feature data typically comes from GIS data. Using an interpolation algorithm, the elevation information in the GIS data is mapped onto the initial terrain grid, generating a 3D terrain model with actual terrain features.
[0088] Step S230: generating a trunk road network on the initial terrain grid according to the road grid parameters, and dividing the initial terrain grid into different functional zones according to the functional zone ratios.
[0089] It should be noted that the road grid parameters control the topological structure and geometric characteristics of the road, and the functional zoning ratio determines the distribution relationship between residential, commercial, green space and other areas.
[0090] Step S240: automatically generating basic building placeholders and public facility placeholders that meet the attribute characteristics of each functional zone.
[0091] It should be noted that the attributes of functional zoning include information such as the zoning's purpose, building density, and public facility requirements. Basic building placeholders and public facility placeholders are temporary models generated based on the attributes of functional zoning. They represent the location and general shape of future buildings and public facilities.
[0092] As a feasible implementation, the number and type of buildings required for each functional zone can be determined based on its intended use and building density. Then, using procedural modeling technology, basic building placeholders and public facility placeholders can be automatically generated according to pre-set rules. For example, placeholders for multiple residential buildings can be generated for a residential area, while placeholders for a shopping mall and office buildings can be generated for a commercial area. Furthermore, placeholders for public facilities such as parks, schools, and hospitals can be generated based on the needs of the public facilities.
[0093] Step S250: Fusing the trunk road network, the functional zones, the basic building placeholders, and the public facility placeholders with the initial terrain grid to generate the basic scene framework.
[0094] It should be noted that fusion refers to the integration of the main road network, functional zoning, basic building placeholders and public facility placeholders with the initial terrain grid to form a complete scene framework.
[0095] As a feasible implementation, a hierarchical data structure, such as Levels of Detail (LOD), can be used to organize the main road network, functional zones, basic building placeholders, and public facility placeholders into different layers for fusion with the initial terrain mesh. For example, the terrain mesh can be used as the bottom layer, the road network and functional zones as the middle layer, and the building placeholders and public facility placeholders as the top layer.
[0096] Based on the above embodiments of the present application, in the third embodiment of the present application, the same or similar contents as those in the above embodiments can be referred to the above introduction and will not be described in detail later. Figure 3 In the three-dimensional city scene construction method, step S40 includes steps S410 to S440:
[0097] Step S410: Divide the basic scene framework into multiple voxel grids, and construct a scene space topology structure by calculating the occupancy status of each voxel grid.
[0098] It should be noted that a voxel grid is a spatial partitioning method that discretizes three-dimensional space into regular cubic units. Each voxel unit has unique three-dimensional coordinates (x, y, z) that quantify the occupancy of the space. The occupancy status refers to whether the voxel unit is occupied by an existing model (such as a road or placeholder) and is stored as a binary value (0 for free and 1 for occupied). The scene spatial topology is a graph data structure with voxel grids as nodes and adjacent relationships as edges, describing the connectivity and accessibility of each spatial unit in the scene.
[0099] Step S420: According to the spatial layout requirement, candidate placement areas are screened out in the scene space topology structure.
[0100] It should be noted that the candidate placement area is a set of voxel grids that meet the planning constraints in the spatial layout requirements and serves as a potential location for the scene model layout.
[0101] As a feasible implementation method, the spatial layout requirements are converted into graph theory query statements, the scene spatial topology structure is traversed, and spatial relationship reasoning algorithms (such as distance calculation and direction judgment) are used to screen voxel areas that meet the conditions.
[0102] As another feasible implementation, step S420 includes steps S4210 to S4220:
[0103] Step S4210: Generate a space constraint expression according to the planning constraint conditions in the space layout requirements.
[0104] It should be noted that planning constraints refer to the placement rules of the scene model parsed based on the semantic labels of the scene model, which are used to determine the reasonable position of the scene model in the scene, the adjacency relationship with other scene models, the spacing threshold, and orientation restrictions and other location information.
[0105] As a feasible implementation method, regular expressions are used to match the semantic components in planning constraints, and natural language rules are converted into first-order logic expressions through symbolic mapping, for example, .
[0106] Step S4220: traverse the voxel grids in the scene space topology structure, and use a spatial relationship reasoning algorithm to filter out the voxel grids that meet the spatial constraint expression as the candidate placement area.
[0107] It should be noted that the spatial relationship reasoning algorithm is a decision-making process that evaluates constraint satisfaction by analyzing spatial characteristics such as topological connections, direction relationships, and distance relationships between voxels.
[0108] As a feasible implementation, a hybrid spatial index structure based on an R* tree is used to accelerate the traversal process. Specifically, spatial hashing is first used to quickly locate voxel blocks that may satisfy planning constraints. Then, conservative filtering based on interval operations is used to eliminate areas that clearly do not meet the requirements, resulting in candidate voxels. Finally, constraint satisfaction is calculated for each candidate voxel.
[0109] As another feasible implementation, first initialize an empty list of candidate placement areas, and then traverse each voxel grid in the scene space topology. For each voxel grid, use the spatial relationship reasoning algorithm to calculate the spatial relationship between the voxel grid and the surrounding voxel grids, including distance, direction, and adjacency. Then, compare the calculated spatial relationship with the spatial constraint expression to determine whether the voxel grid meets the constraint conditions. If so, the voxel grid is added to the candidate placement area list. During the calculation process, the occupancy status of each voxel grid is checked one by one and evaluated in combination with the spatial constraint expression.
[0110] Step S430: For each candidate placement area, based on the bounding box size of the scene model, calculate a spatial fitness score of the scene model in the candidate placement area.
[0111] It's important to note that the scene model's bounding box is the smallest rectangular box that encloses the model's geometry and is used to quickly estimate the model's size and spatial occupancy. The spatial fit score is a quantitative indicator that comprehensively considers factors such as space utilization, semantic coordination with surrounding elements, and rule compliance. A higher score indicates a more suitable area for placing the corresponding scene model.
[0112] Step S440: selecting the candidate placement area with the highest spatial fitness score as the final placement position of the scene model, splicing the scene model into the target voxel grid corresponding to the final placement position, and constructing a three-dimensional city scene.
[0113] It should be noted that the final placement location refers to the area with the highest spatial fit score among all candidate placement areas, indicating that this area is the most suitable location for the corresponding scene model. Stitching is to place the scene model in the final placement location and integrate it with the target voxel grid to ensure the correct placement of the scene model in the scene.
[0114] As a feasible implementation, step S440 includes steps S4410 to S4430:
[0115] Step S4410: performing collision detection on the candidate placement area with the highest spatial fitness score.
[0116] It should be noted that collision detection involves using computational geometry algorithms to verify whether there is spatial interference or planning constraint violations between the scene model and surrounding existing features. This collision detection not only includes physical geometric overlap and coordinate offsets, but also includes semantically constrained spatial relationships such as planning constraints.
[0117] As a feasible implementation, a collision detection algorithm, such as Bounding Box Detection, is used to compare the bounding box of the scene model with the bounding boxes of other scene models in the target voxel grid to check whether there is geometric overlap or the distance is too close. If there is overlap or the distance is less than the preset minimum safety distance, the collision detection is considered to have failed. For example, for collision detection of two scene models, their Axially Aligned Bounding Box (AABB) or Oriented Bounding Box (OBB) can be calculated, and the SAT (Separating Axis Theorem) algorithm can be used to check whether there is a separating axis to determine whether a collision has occurred.
[0118] As another feasible implementation, a semantic collision detection method based on a rule engine is used. First, the semantic labels of the scene model are parsed to extract information such as the model type, function, and purpose. Then, based on the preset semantic rule library, semantic constraint expressions related to the semantic labels are generated. For example, if the semantic label of a model is "Signal - Applicable to two-way four-lane traffic - With pedestrian crossing button," a spatial constraint expression such as "For all signal light models, the following conditions must be met: Applicable to two-way four-lane traffic, and the signal light must be equipped with a pedestrian crossing button" will be generated.
[0119] Next, the algorithm traverses the target voxel grid to check whether any of the other adjacent scene models have semantic labels that conflict with the current semantic model. If so, the semantic collision check fails. Furthermore, a spatial relationship reasoning algorithm can be incorporated to further evaluate the relative positions and orientations between scene models to ensure they meet semantic constraints. For example, a spatial relationship reasoning algorithm can be used to check whether a park model is directly adjacent to a highway. If so, the semantic collision check fails.
[0120] Step S4420: If the collision detection passes, the scene model is spliced to the target voxel grid.
[0121] It should be noted that the target voxel grid refers to the voxel grid selected as the final placement location for the model in the scene space topology. Stitching involves placing the model into the target voxel grid and integrating it with the surrounding models and environment to ensure the model is correctly placed in the scene.
[0122] As a feasible implementation method, after the collision detection is passed, the position and orientation of the scene model in the target voxel grid are first calculated to ensure that the placement of the scene model complies with the semantic constraints and geometric constraints. Then, the geometric data and attribute information of the model are updated to the target voxel grid to complete the placement of the scene model. During the stitching process, the direction and rotation of the scene model need to be considered to ensure that the placement of the scene model in the scene meets the design requirements. For example, if a scene model is a building, the rotation angle of the scene model needs to be adjusted according to the orientation requirements of the building so that it is aligned with the surrounding roads or other buildings. In this process, geometric transformation algorithms, such as translation and rotation matrices, can be used to adjust the position and orientation of the scene model and integrate the data of the scene model into the target voxel grid.
[0123] Step S4430: If the collision detection fails, the candidate placement area with the second highest score is selected and the collision detection is repeated until the candidate placement area that passes the collision detection is found or all the candidate placement areas are traversed to generate the three-dimensional city scene.
[0124] As a feasible implementation, when the collision check fails, the highest-scoring area is first removed from the candidate placement area list, and then the next highest-scoring area is selected for collision check. If the collision check for the next highest-scoring area passes, the scene model is spliced to the next highest-scoring area. If it still fails, the next highest-scoring area is selected, and this process is repeated until a passing collision check is found or all candidate placement areas have been checked.
[0125] During the traversal process, this embodiment can maintain an ordered list of candidate placement areas so that the area with the next highest score can be quickly selected. For example, a priority queue can be used to store candidate placement areas. Each time, the area with the highest score is taken from the queue for collision detection. If the collision detection fails, it is removed from the queue and the next area with the highest score is processed.
[0126] As another feasible implementation, step S440 includes steps S441 and S442:
[0127] Step S441: When the collision detection of all the candidate placement areas fails, perform at least one of the following operations: generate a collision detection report, mark the collision position and collision type, and provide modification suggestions; or provide a manual adjustment interface to allow the user to adjust the position, rotation angle or scaling of the scene model.
[0128] It should be noted that the conflict detection report records the conflict detection results for all candidate placement areas, including the location, type, and specific cause of the conflict. The modification suggestions provide possible solutions or adjustments based on the conflict detection results to help users resolve conflicts. The manual adjustment interface allows users to manually adjust the model's position, rotation, or scale to resolve collisions.
[0129] As a feasible implementation, when all candidate placement areas fail collision detection, a conflict detection report is first generated. The conflict detection report details the conflict location and conflict type for each candidate placement area, such as "Scene Model A and Scene Model B geometrically overlap at position (10, 20, 30)" or "Scene Model C violates the semantic constraint and is less than 50 meters from the industrial zone."
[0130] Furthermore, the conflict detection report also includes modification suggestions based on the conflict type, such as "It is recommended to move scene model A 10 meters north to resolve the geometric overlap problem" or "It is recommended to move scene model C to a position at least 50 meters away from the industrial area to meet the semantic constraint."
[0131] In addition, this embodiment also provides a manual adjustment interface that allows users to adjust the position, rotation angle, or scale of the scene model. Users can enter specific adjustment parameters through the manual adjustment interface. The system will update the position and status of the modified scene model in real time and re-run collision detection to ensure that the adjusted scene model placement meets the requirements.
[0132] Step S442: splicing the finalized scene model with the target voxel grid to construct a three-dimensional city scene.
[0133] It's important to note that the target voxel grid refers to the voxel grid selected as the final placement location for the model within the scene's spatial topology. Stitching involves placing the model within the target voxel grid and integrating it with the surrounding models and environment to ensure correct placement within the scene. The 3D city scene is the final constructed 3D scene containing all models and layout information.
[0134] Based on the above embodiments of the present application, in the fourth embodiment of the present application, the same or similar contents as those in the above embodiments can be referred to the above introduction and will not be described in detail later. Figure 4 After step S40, the three-dimensional city scene construction method further includes steps S41 to S44:
[0135] Step S41: constructing a scene element graph according to the scene model in the basic scene framework.
[0136] It should be noted that the scene element graph is a data representation method that abstracts various entities in a three-dimensional scene and their relationships into a graph structure, where nodes represent scene elements (such as buildings, roads, and other scene models) and edges represent the spatial or functional relationships between elements.
[0137] As a feasible implementation, a construction method based on an attribute graph model is adopted. First, all scene models in the basic scene framework are traversed, and each model is added as a node to the scene feature graph. Then, using a spatial analysis algorithm, topological relationships between features (such as adjacency, connection, and inclusion) are extracted. These topological relationships are added as edges to the nodes of the corresponding scene models in the scene feature graph. For example, if two building models are adjacent, an edge is added to the scene feature graph connecting the corresponding nodes of the two building models. Each node contains a complete set of geometric feature vectors and semantic attributes.
[0138] Step S42: traverse the scene element graph and identify blank areas in the basic scene frame.
[0139] It should be noted that the blank area refers to the space area in the basic scene frame that has not been occupied by any scene model. The blank area may be due to incomplete model layout and needs to be identified for subsequent filling operations.
[0140] In this embodiment, starting from a node in the scene element graph, a breadth-first search (BFS) or depth-first search (DFS) algorithm is used to traverse all nodes in the scene element graph. During the traversal process, the access status of each node is recorded, and the connection relationship between nodes is checked. If it is found that the nodes in a certain area are not connected to other nodes, or the spatial position in the area is not occupied by any scene model, the area is identified as a blank area.
[0141] Step S43: According to the spatial size of the blank area and the type of surrounding elements, the corresponding scene model is matched from the basic city model resource library to obtain a candidate filling model.
[0142] It should be noted that the spatial dimensions of a blank area refer to its size and shape, which are used to determine the type and size of models suitable for filling the blank area. The surrounding feature type refers to the type of existing scene models surrounding the blank area and is used to determine the functional attributes and filling requirements of the blank area. Candidate filling models are models selected from the basic city model resource library that are suitable for filling the blank area.
[0143] As a feasible implementation method, the bounding box of the blank area is first calculated to determine the spatial dimensions of the blank area. Simultaneously, the existing model types surrounding the blank area are analyzed to determine the functional attributes of the blank area. Then, based on the spatial dimensions and functional attributes of the blank area, a scene model suitable for filling the blank area is matched from the basic city model resource library. For example, if the blank area is located in a triangular plot between two main roads, the area is identified as a traffic blank area, and scene models that meet the spatial dimensions and functional attributes of the area are screened from the basic city model resource library as candidate filling models. For example, a traffic island model is selected as a candidate filling model.
[0144] In this embodiment, scenario models suitable for filling blank areas can be screened from the basic city model library based on their model type, size, and functional attributes. During the screening process, the system compares the bounding box of the scenario model with the bounding box of the blank area to ensure that the size and shape of the scenario model match the blank area. The system also checks the functional attributes of the scenario model to ensure that it meets the functional requirements of the blank area.
[0145] Step S44: splicing the candidate filling models to the blank area to construct the complete three-dimensional city scene.
[0146] In this embodiment, after the candidate filling models are determined, the candidate filling models are placed in the corresponding blank areas and integrated with the surrounding existing scene models to construct a complete three-dimensional city scene.
[0147] An embodiment of the present application provides a three-dimensional city scene construction device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the three-dimensional city scene construction method in the above-mentioned embodiment one.
[0148] Reference below Figure 5 , which shows a schematic diagram of the structure of a 3D city scene construction device suitable for implementing the embodiment of the present application. The 3D city scene construction device in the embodiment of the present application may include various hardware and software components for implementing the 3D city scene construction method. Figure 5The three-dimensional city scene construction device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0149] like Figure 5 As shown, the 3D city scene construction device may include a processing device 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes based on programs stored in a read-only memory (ROM) 1002 or programs loaded from a storage device 1003 into a random access memory (RAM) 1004. RAM 1004 also stores various programs and data required for the operation of the 3D city scene construction device. The processing device 1001, ROM 1002, and RAM 1004 are interconnected via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems may be connected to the I / O interface 1006: an input device 1007, such as a touchscreen, touchpad, or keyboard; an output device 1008, such as a liquid crystal display (LCD), speaker, or vibrator; a storage device 1003, such as a magnetic tape or hard disk; and a communication device 1009. The communication device 1009 can allow the 3D city scene construction device to communicate wirelessly or wired with other devices to exchange data. Although the figure shows a 3D city scene construction device with various systems, it should be understood that it is not required to implement or have all of the systems shown. More or fewer systems may be implemented or provided instead.
[0150] In particular, according to the embodiments disclosed in the present application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, the embodiments disclosed in the present application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program comprising program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via a communication device, or installed from a storage device 1003, or installed from a read-only memory 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are performed.
[0151] The 3D city scene construction device provided in this application, which utilizes the 3D city scene construction method described in the aforementioned embodiment, can resolve the technical issue of 3D city scene modeling failing to consider the semantic relationships between models, leading to incorrect model splicing. Compared to the prior art, the beneficial effects of the 3D city scene construction device provided in this application are the same as those of the 3D city scene construction method described in the aforementioned embodiment. The other technical features of this 3D city scene construction device are the same as those disclosed in the aforementioned embodiment and are not further elaborated here.
[0152] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0153] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
[0154] An embodiment of the present application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, and the computer-readable program instructions are used to execute the three-dimensional city scene construction method in the above embodiment.
[0155] The computer-readable storage medium provided herein may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems, or devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including, but not limited to, wires, optical cables, radio frequency (RF), etc., or any suitable combination thereof.
[0156] The computer-readable storage medium may be included in the three-dimensional city scene construction device; or it may exist independently without being assembled into the three-dimensional city scene construction device.
[0157] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by the three-dimensional city scene construction device, the three-dimensional city scene construction device: responds to the scene assembly instruction, displays the basic city model resource library on the scene assembly interface, and initializes the loading of the scene model based on the received model resources; generates a basic scene framework based on the scene theme and area range parameters contained in the scene assembly instruction; obtains the semantic label of the scene model, and determines the spatial layout requirements of the scene model based on the semantic label; according to the spatial layout requirements, automatically layouts the scene model into the basic scene framework to construct a three-dimensional city scene.
[0158] Computer program code for performing the operations of the present application may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0159] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, program segment or a part of code, and the module, program segment or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system that performs the specified function or operation, or can be implemented by a combination of dedicated hardware and computer instructions.
[0160] The modules described in the embodiments of the present application may be implemented in software or hardware, wherein the name of a module does not necessarily limit the unit itself.
[0161] The computer-readable storage medium provided in this application stores computer-readable program instructions (i.e., a computer program) for executing the aforementioned method for constructing a three-dimensional urban scene. This computer-readable storage medium can address the technical issue of 3D urban scene modeling failing to consider semantic relationships between models, leading to incorrect model splicing. Compared to the prior art, the beneficial effects of the computer-readable storage medium provided in this application are similar to those of the method for constructing a three-dimensional urban scene provided in the aforementioned embodiments and are not further elaborated here.
[0162] An embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the above-mentioned three-dimensional city scene construction method.
[0163] The computer program product provided in this application can address the technical issue of 3D urban scene modeling that fails to consider the semantic relationships between models, leading to incorrect model splicing. Compared to the prior art, the beneficial effects of the computer program product provided in the embodiments of this application are the same as those of the 3D urban scene construction method provided in the aforementioned embodiments, and are not further elaborated here.
[0164] The above are only preferred embodiments of the present application and do not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent processing scope of the present application.
[0165] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or system comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or system. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or system comprising the element.
[0166] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method.
[0167] The above are only preferred embodiments of the present application and do not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A method for constructing a three-dimensional city scene, characterized in that: The three-dimensional city scene construction method comprises: In response to the scene assembly instruction, the basic city model resource library is displayed on the scene assembly interface, and the scene model is initialized and loaded according to the received model resources; Generate a basic scene framework according to the scene theme and area range parameters included in the scene assembly instruction; Acquiring a semantic tag of the scene model, and determining a spatial layout requirement of the scene model based on the semantic tag; According to the spatial layout requirements, the scene model is automatically laid out into the basic scene framework to construct a three-dimensional city scene; The step of automatically laying out the scene model into the basic scene framework according to the spatial layout requirements to construct a three-dimensional city scene includes: Dividing the basic scene framework into a plurality of voxel grids, and constructing a scene space topology structure by calculating the occupancy state of each voxel grid; According to the spatial layout requirements, screening candidate placement areas in the scene space topology structure; For each candidate placement area, calculating a spatial fitness score of the scene model in the candidate placement area based on the bounding box size of the scene model; Selecting the candidate placement area with the highest spatial fitness score as the final placement position of the scene model, splicing the scene model into the target voxel grid corresponding to the final placement position, and constructing a three-dimensional city scene; The step of screening candidate placement areas in the scene space topology structure according to the spatial layout requirements includes: generating a spatial constraint expression according to the planning constraint conditions in the spatial layout requirements; The voxel grids in the scene space topology structure are traversed, and the voxel grids satisfying the spatial constraint expression are screened out as the candidate placement areas using a spatial relationship reasoning algorithm.
2. The three-dimensional city scene construction method according to claim 1, characterized in that: The step of generating a basic scene framework according to the scene theme and area range parameters included in the scene assembly instruction includes: Matching a preset urban planning template according to the scene theme, wherein the urban planning template includes road grid parameters, functional zoning ratios, and terrain feature data; generating an initial terrain grid based on the regional range parameters, and performing elevation processing on the initial terrain grid according to the terrain feature data; Generating a trunk road network on the initial terrain grid according to the road grid parameters, and dividing the initial terrain grid into different functional zones according to the functional zone ratios; Automatically generate basic building placeholders and public facility placeholders that meet the attribute characteristics of each functional zone; The main road network, the functional zones, the basic building placeholders and the public facility placeholders are integrated with the initial terrain grid to generate the basic scene framework.
3. The three-dimensional city scene construction method according to claim 1, characterized in that: The step of obtaining the semantic label of the scene model and determining the spatial layout requirement of the scene model based on the semantic label includes: Performing semantic analysis on the semantic tag to determine the model type of the scene model; A preset layout rule library is matched according to the model type to obtain the spatial layout requirements corresponding to the scene model.
4. The three-dimensional city scene construction method according to claim 1, characterized in that: The step of selecting the candidate placement area with the highest spatial fitness score as the final placement position of the scene model, splicing the scene model into the target voxel grid corresponding to the final placement position, and constructing the three-dimensional city scene includes: Performing collision detection on the candidate placement area with the highest spatial fitness score; If the collision detection passes, splicing the scene model to the target voxel grid; If the collision detection fails, the candidate placement area with the second highest score is selected to repeat the collision detection until the candidate placement area that passes the collision detection is found or all the candidate placement areas are traversed to generate the three-dimensional city scene.
5. The three-dimensional city scene construction method according to claim 4, characterized in that: If the collision detection fails, selecting the candidate placement area with the next highest score and repeating the collision detection until a candidate placement area that passes the collision detection is found or all candidate placement areas are traversed to generate the three-dimensional city scene, the three-dimensional city scene construction method further includes: When the collision detection of all candidate placement areas fails, perform at least one of the following operations: Generate conflict detection reports, mark conflict locations and conflict types, and provide modification suggestions; Alternatively, a manual adjustment interface is provided to allow the user to adjust the position, rotation angle or scaling of the scene model; The finalized scene model is spliced with the target voxel grid to construct a three-dimensional city scene.
6. The three-dimensional city scene construction method according to claim 1, characterized in that: After the step of automatically laying out the scene model into the basic scene framework according to the spatial layout requirements to construct a three-dimensional city scene, the three-dimensional city scene construction method further includes: Constructing a scene element graph according to the scene model in the basic scene framework; Traversing the scene element graph to identify blank areas in the basic scene frame; According to the spatial size of the blank area and the type of surrounding elements, matching the corresponding scene model from the basic city model resource library to obtain a candidate filling model; The candidate filling models are spliced into the blank area to construct the complete three-dimensional city scene.
Citation Information
Patent Citations
Outdoor three-dimensional scene combined construction method based on image content parsing
CN105551084A
Urban scene model layout constraint method based on building codes
CN108550186A
Basic data generation method for intelligent level evaluation of unmanned system
CN119068120A