Virtual Scene Generation Method, Device, Computer Device, and Storage Medium

By extracting the three-dimensional spatial and distribution data of the real scene, the virtual scene corresponding to the real scene is generated, which solves the problem of high cost and time-consuming in the existing technology, and realizes efficient and accurate virtual scene construction.

CN113066183BActive Publication Date: 2025-07-08TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110466543.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-04-28
Publication Date
2025-07-08
Estimated Expiration
2041-07-08

AI Technical Summary

Technical Problem

The existing technology has the problem of high construction cost and time-consuming construction when building virtual scenes, especially after manual modeling and random generation, it requires a lot of repairs, and the logic is unreasonable.

Method used

By obtaining the three-dimensional spatial data and scene distribution data of the real scene, extracting terrain features and scene object features, generating a three-dimensional terrain model and scene object model, and automatically generating a virtual scene corresponding to the real scene.

Benefits of technology

Efficiently and accurately generate virtual scenes that conform to reality logic, reduce manual intervention, reduce costs and improve generation efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113066183B_ABST
    Figure CN113066183B_ABST
Patent Text Reader

Abstract

This application relates to a virtual scene generation method, apparatus, computer device, and storage medium. The method includes: obtaining three-dimensional spatial data and scene distribution data corresponding to a real scene; extracting terrain features from the three-dimensional spatial data; generating a three-dimensional terrain model according to the terrain features; extracting scene object features of scene objects in the real scene from the scene distribution data; and generating a scene object model corresponding to the scene object features in the three-dimensional terrain model to obtain a virtual scene corresponding to the real scene. Using this method can efficiently and accurately generate a virtual scene similar to the real scene.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer vision technology, and in particular, to a method and device for generating a virtual scene, a computer device, and a storage medium. Background Art

[0002] In computer graphics, a virtual scene refers to a digital scene outlined by a computer through digital communication technology. With the development of graphics technology, various imaginary virtual scenes and simulation environments can be realized by creating virtual scenes. For example, virtual scenes can be applied to various application scenarios such as games and film and television special effects.

[0003] In the related art, either it is necessary to manually model each object in the virtual scene separately, which requires a large amount of human cost to manually construct the virtual scene. Or it is to randomly generate a virtual scene by combining procedural tools according to specified information, such as range and height, etc. The virtual scene generated in this way may have illogical situations and still requires a large amount of human cost to manually repair the virtual scene. Therefore, when using traditional methods to construct a virtual scene, there are problems of high construction cost and long time consumption. Summary of the Invention

[0004] Based on this, in view of the above technical problems, it is necessary to provide a method and device for generating a virtual scene, a computer device, and a storage medium that can efficiently and accurately generate a virtual scene corresponding to the real scene.

[0005] A method for generating a virtual scene, the method includes:

[0006] Obtain three-dimensional space data and scene distribution data corresponding to the real scene;

[0007] Extract terrain features from the three-dimensional space data;

[0008] Generate a three-dimensional terrain model according to the terrain features;

[0009] Extract the scene object features of the scene objects in the real scene from the scene distribution data;

[0010] Generate a scene object model corresponding to the scene object features in the three-dimensional terrain model to obtain a virtual scene corresponding to the real scene.

[0011] A device for generating a virtual scene, the device includes:

[0012] A data acquisition module, configured to acquire three-dimensional space data and scene distribution data corresponding to the real scene;

[0013] A feature extraction module, configured to extract terrain features from the three-dimensional space data;

[0014] A terrain generation module, configured to generate a three-dimensional terrain model according to the terrain features;

[0015] The feature extraction module is further configured to extract scene object features of scene objects in the real scene from the scene distribution data;

[0016] A scene generation module, configured to generate a scene object model corresponding to the scene object features in the three-dimensional terrain model, so as to obtain a virtual scene corresponding to the real scene.

[0017] In one embodiment, the three-dimensional space data includes terrain space data and coverage object space data; the feature extraction module is further configured to extract terrain features from the terrain space data; the terrain generation module is further configured to generate a three-dimensional terrain model according to the terrain features; determine a surface coverage area in the three-dimensional terrain model according to the coverage object space data; generate surface coverage objects in the surface coverage area to obtain a three-dimensional terrain model including surface coverage objects.

[0018] In one embodiment, the feature extraction module is further configured to determine terrain features according to the height difference between adjacent terrain points in the terrain space data; the terrain generation module is further configured to determine, according to the terrain features, terrain types corresponding to each terrain area in the terrain space data; add corresponding surface attribute information to the terrain area according to the terrain types; generate a three-dimensional terrain model according to the terrain space data with the added surface attribute information.

[0019] In one embodiment, the terrain generation module is further configured to determine, in the three-dimensional terrain model, terrain points corresponding to surface coverage points in the coverage object space data; select target surface coverage points according to the height difference between the surface coverage points and the corresponding terrain points; determine an overlapping area between the expansion area and the three-dimensional terrain model; the expansion area is an area expanded based on the target surface coverage points; determine the surface coverage area in the three-dimensional terrain model according to the overlapping area.

[0020] In one embodiment, the terrain generation module is further configured to determine generation parameter information of surface coverage objects in the surface coverage area; generate surface coverage objects in the surface coverage area according to the generation parameter information to obtain a three-dimensional terrain model including surface coverage objects.

[0021] In one embodiment, the feature extraction module is further configured to determine the position and height of a scene object in the real scene in the three-dimensional terrain model based on the scene distribution data; generate three-dimensional scene object data corresponding to the scene object according to the position and the height; and extract the scene object features of the scene object from the three-dimensional scene object data.

[0022] In one embodiment, the feature extraction module is further configured to, if the scene distribution data includes the original position of the scene object in the real scene, determine the position and height of the scene object in the three-dimensional terrain model according to the original position; and if the scene distribution data includes the original position and the original height of the scene object, determine the position and height of the scene object in the three-dimensional terrain model according to the original position and the original height.

[0023] In one embodiment, the scene generation module is further configured to generate an initial scene object model corresponding to the scene object according to the scene object features; add scene object attribute information conforming to the object type to the corresponding initial scene object model according to the object type of the scene object to obtain a scene object model matching the scene object; and add the scene object model to the three-dimensional terrain model to obtain a virtual scene corresponding to the real scene.

[0024] In one embodiment, the scene generation module is further configured to determine the terrain area corresponding to the scene object model in the three-dimensional terrain model; perform smoothing processing on the terrain area to obtain a smoothed terrain area; and add the scene object model to the smoothed terrain area in the three-dimensional terrain model to obtain a virtual scene corresponding to the real scene.

[0025] In one embodiment, the scene generation module is further configured to determine the position area corresponding to the scene object model in the three-dimensional terrain model and the adjacent area of the position area as the terrain area corresponding to the scene object model; update the height value of the position area according to the height difference between the bottom surface of the scene object model and the position area; and perform smoothing processing on the height value of the adjacent area according to the updated height value of the position area to obtain a smoothed terrain area.

[0026] In one embodiment, the virtual scene generation device further includes an alignment processing module, configured to align the scene area corresponding to the scene distribution data with the scene area corresponding to the three-dimensional space data to obtain a scene alignment area; select, from the scene distribution data, the scene distribution data that matches the scene alignment area to obtain the aligned scene distribution data; and the data acquisition module is further configured to acquire the three-dimensional space data corresponding to the real scene and the aligned scene distribution data.

[0027] In one embodiment, the scene distribution data includes point set data corresponding to scene objects; the alignment processing module is further configured to, for a scene object of a first object type, if the complete point set data of the scene object is in the scene alignment area, select the complete point set data from the scene distribution data; if the incomplete point set data of the scene object is in the scene alignment area, exclude the complete point set data corresponding to the scene object from the scene distribution data; for a scene object of a second object type, select the point set data of the scene object in the scene alignment area from the scene distribution data.

[0028] A computer device includes a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0029] Acquire three-dimensional space data and scene distribution data corresponding to a real scene;

[0030] Extract terrain features from the three-dimensional space data;

[0031] Generate a three-dimensional terrain model according to the terrain features;

[0032] Extract scene object features of scene objects in the real scene from the scene distribution data;

[0033] Generate a scene object model corresponding to the scene object features in the three-dimensional terrain model to obtain a virtual scene corresponding to the real scene.

[0034] A computer-readable storage medium stores a computer program thereon, and when the computer program is executed by a processor, the following steps are implemented:

[0035] Acquire three-dimensional space data and scene distribution data corresponding to a real scene;

[0036] Extract terrain features from the three-dimensional space data;

[0037] Generate a three-dimensional terrain model according to the terrain features;

[0038] Extract the scene object features of the scene objects in the real scene from the scene distribution data;

[0039] In the three-dimensional terrain model, generate a scene object model corresponding to the scene object features to obtain a virtual scene corresponding to the real scene.

[0040] A computer program product or computer program, the computer program product or computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium; a processor of the computer device reads the computer instructions from the computer-readable storage medium, and when the processor executes the computer instructions, the following steps are implemented:

[0041] Obtain three-dimensional space data and scene distribution data corresponding to a real scene;

[0042] Extract terrain features from the three-dimensional space data;

[0043] Generate a three-dimensional terrain model according to the terrain features;

[0044] Extract the scene object features of the scene objects in the real scene from the scene distribution data;

[0045] In the three-dimensional terrain model, generate a scene object model corresponding to the scene object features to obtain a virtual scene corresponding to the real scene.

[0046] For the above virtual scene generation method, device, computer device and storage medium, after obtaining the three-dimensional space data and scene distribution data corresponding to the real scene, extract the terrain features from the three-dimensional space data, and automatically generate a three-dimensional terrain model according to the terrain features, thereby being able to efficiently generate a three-dimensional terrain model with the terrain features of the real scene. Then, extract the scene object features of the scene objects in the real scene from the scene distribution data; furthermore, in the three-dimensional terrain model, generate a scene object model corresponding to the scene object features, so as to automatically generate a complete virtual scene corresponding to the real scene. By respectively extracting the terrain features and scene object features from the three-dimensional space data and scene distribution data corresponding to the real scene, and then automatically generating a three-dimensional virtual scene based on the terrain features and scene object features, it is possible to efficiently and accurately automatically generate a virtual scene with the features of the real scene and conforming to the real logic. Description of the Drawings

[0047] Figure 1 It is an application environment diagram of the virtual scene generation method in an embodiment;

[0048] Figure 2 It is a flow diagram of the virtual scene generation method in an embodiment;

[0049] Figure 3 Schematic flowchart of a virtual scene generation method in another embodiment;

[0050] Figure 4 Schematic diagram of generating a three-dimensional terrain model in one embodiment;

[0051] Figure 5 Schematic diagram of generating surface coverage objects in a three-dimensional terrain model in one embodiment;

[0052] Figure 6 Schematic diagram of generating a scene object model in one embodiment;

[0053] Figure 7 Schematic diagram of adding a scene object model to a three-dimensional terrain model in one embodiment;

[0054] Figure 8 Schematic diagram of leveling the terrain area corresponding to the scene object model in one embodiment;

[0055] Figure 9 Schematic diagram of aligning scene distribution data with three-dimensional space data in one embodiment;

[0056] Figure 10 Schematic flowchart of the overall process of generating a virtual scene in one embodiment;

[0057] Figure 11 Schematic diagram of the interface of a preset editor plugin in one embodiment;

[0058] Figure 12 Schematic diagram of showing the automatic generation of a terrain model based on three-dimensional point cloud data in one embodiment;

[0059] Figure 13 Schematic diagram of the final virtual scene obtained in one embodiment;

[0060] Figure 14 Schematic diagram of re-editing a virtual scene through a visualization editing engine in one embodiment;

[0061] Figure 15 Schematic diagram of the effect of generating a virtual scene step by step in one embodiment;

[0062] Figure 16 Schematic diagram of the effect of a real scene and a virtual scene in one embodiment;

[0063] Figure 17 Structure block diagram of a virtual scene generation device in one embodiment;

[0064] Figure 18 Internal structure diagram of a computer device in one embodiment;

[0065] Figure 19 It is the internal structure diagram of a computer device in another embodiment. Detailed implementation manners

[0066] In order to make the objectives, technical solutions and advantages of the present application clearer and more understandable, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0067] The virtual scene generation method provided by the present application can be applied to a computer device. The computer device can be a terminal or a server. It can be understood that the virtual scene generation method provided by the present application can be applied to a terminal, can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server.

[0068] The virtual scene generation method provided by the present application can be applied to an application environment as Figure 1 shown. Among them, the terminal 102 communicates with the server 104 through a network. Specifically, the terminal 102 can collect or obtain three-dimensional space data and scene distribution data corresponding to the real scene, and send them to the server 104. After the server 104 obtains the three-dimensional space data and scene distribution data corresponding to the real scene, it extracts terrain features from the three-dimensional space data and generates a three-dimensional terrain model according to the terrain features; from the scene distribution data, it extracts the scene object features of the scene objects in the real scene; in the three-dimensional terrain model, it generates a scene object model corresponding to the scene object features to obtain a virtual scene corresponding to the real scene. Then the server 104 can also return the generated virtual scene corresponding to the real scene to the terminal 102 and display the virtual scene in the terminal 102.

[0069] Among them, the terminal 102 can be a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart watch, a smart voice interaction device, a smart home appliance, a vehicle-mounted terminal, etc., but is not limited thereto. The server 104 can be an independent physical server, can also be a server cluster or a distributed system composed of multiple physical servers, and can also be a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The terminal 102 and the server 104 can be directly or indirectly connected through wired or wireless communication methods, and the present application does not make any restrictions here.

[0070] It can be understood that the virtual scene generation methods in the embodiments of the present application adopt cloud technology, artificial intelligence, computer vision technology, etc., and can effectively realize the automatic generation of virtual scenes similar to real scenes. The generated virtual scenes can be applied to various scenarios such as game development, video production, map fields, and transportation fields such as intelligent transportation systems.

[0071] Cloud technology is a hosting technology that unifies a series of resources such as hardware, software, and networks within a wide area network or local area network to achieve data computing, storage, processing, and sharing. Cloud technology is the general term for network technology, information technology, integration technology, management platform technology, application technology, etc. based on the cloud computing business model, which can form a resource pool and be used on demand, flexibly and conveniently. Cloud computing technology will become an important support. The background services of the technical network system require a large amount of computing and storage resources, such as video websites, picture-based websites, and more portal websites. Among them, cloud computing is a computing model that distributes computing tasks on a resource pool composed of a large number of computing devices, enabling various application systems to obtain computing power, storage space, and information services according to needs. The network that provides resources is called the "cloud". The cloud computing resource pool mainly includes: computing devices (virtualized machines, including operating systems), storage devices, and network devices. It can be understood that the virtual scene generation method of the present application can adopt cloud technology to upload the three-dimensional space data and scene distribution data corresponding to the real scene to the cloud platform, and perform computing and processing on the three-dimensional space data and scene distribution data based on cloud computing, so as to efficiently perform three-dimensional reconstruction calculation to obtain a virtual scene corresponding to the real scene.

[0072] Artificial Intelligence (AI) is a theory, method, technology, and application system that uses digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can react in a way similar to human intelligence. Artificial intelligence also studies the design principles and implementation methods of various intelligent machines to enable machines to have the functions of perception, reasoning, and decision-making.

[0073] Computer Vision Technology (CV) Computer vision is a science that studies how to enable machines to "see". More specifically, it refers to machine vision that uses cameras and computers to replace human eyes for tasks such as object recognition, tracking, and measurement, and further performs image processing to make the computer-processed images more suitable for human eye observation or transmission to instrument detection. As a scientific discipline, computer vision researches related theories and technologies, and attempts to establish artificial intelligence systems that can obtain information from images or multi-dimensional data. Computer vision technology usually includes image processing, image recognition, image semantic understanding, image retrieval, OCR, video processing, video semantic understanding, video content / behavior recognition, three-dimensional object reconstruction, 3D technology, virtual reality, augmented reality, simultaneous localization and mapping, etc., and also includes common biometric recognition technologies such as face recognition and fingerprint recognition. It can be understood that the virtual scene generation method of this application is based on computer vision technology to perform three-dimensional object reconstruction on three-dimensional space data and scene distribution data, so as to efficiently and accurately generate a virtual scene corresponding to the real scene.

[0074] The virtual scene generation method of this application can automatically generate a virtual scene similar to the real scene based on the three-dimensional space data and scene distribution data corresponding to the real scene. The generated virtual scene can be a three-dimensional road terrain simulation scene obtained by simulating and restoring scene elements such as road distribution and terrain distribution in the real scene, and can further assist in generating or improving an electronic map, thereby effectively improving the accuracy of the electronic map.

[0075] It can be understood that the generated virtual scene can also be a road simulation scene obtained by simulating the road environment in the real scene, so as to efficiently and accurately automatically generate a three-dimensional road simulation scene that conforms to the real scene. The road simulation scene can be applied to scenarios such as intelligent transportation systems or road traffic systems, and can further assist in vehicle safety control and road collaborative management, fully realizing the effective collaboration between vehicles and roads to ensure traffic safety and traffic efficiency, thereby forming a safe, efficient, and environmentally friendly road traffic system.

[0076] In one embodiment, as Figure 2 shown, a virtual scene generation method is provided. Taking the example that this method is applied to a computer device, the computer device can specifically be Figure 1 a terminal or a server in

[0077] S202, obtain three-dimensional space data and scene distribution data corresponding to the real scene.

[0078] It can be understood that a virtual scene refers to a digital scene outlined by a computer through digital communication technology, including two-dimensional and three-dimensional virtual scenes. Various material forms and spatial relationships in the real world can be realistically simulated by virtualization technology means. Among them, a three-dimensional virtual scene can more beautifully display the form of an object and can also more intuitively display the virtual reality world. For example, the objects in a three-dimensional virtual scene can include at least one of terrain, trees, roads, buildings, etc.

[0079] Among them, a real scene refers to a scene that actually exists in the real world. For example, it can include at least one of a wild area scene, a township area scene, an urban area scene, etc.

[0080] Three-dimensional spatial data can be used to represent the spatial information of scene elements in a real scene area, such as information on the position, form, size distribution, etc. of an object. It is a quantitative description of the positioned objects existing in the real scene and can be used to construct a three-dimensional spatial data model.

[0081] It can be understood that three-dimensional spatial data can specifically be the three-dimensional point set data of spatial points in a real scene, that is, three-dimensional geometric data. Three-dimensional spatial data can specifically include at least one of three-dimensional point cloud data, three-dimensional remote sensing data, photogrammetry data, etc. Among them, three-dimensional point cloud data can be a set of point data obtained by scanning a real scene based on at least one of satellite ray scanning, terrestrial laser scanning, radar scanning, etc. Three-dimensional remote sensing data can be the spatial data of a target obtained by detecting the target based on remote sensing technology. Photogrammetry data can be the information on the position, shape, size, etc. of a measured object collected based on photogrammetry technology.

[0082] Scene distribution data refers to the distribution data of scene elements in a real scene area, such as information on the position and size distribution of an object. Among them, scene distribution data can include two-dimensional data and can also include three-dimensional data. Scene distribution data can specifically include the two-dimensional position distribution information and height information of an object. For example, it can include at least one of geographical data, map data, etc. Among them, the form of scene distribution data can include at least one of numbers, texts, images, and graphics.

[0083] Specifically, the computer device first obtains the pre-collected three-dimensional spatial data and scene distribution data corresponding to the real scene, and then reconstructs a virtual scene that conforms to the real scene based on the three-dimensional spatial data and scene distribution data.

[0084] S204, extract terrain features from the three-dimensional spatial data.

[0085] Among them, terrain refers to the general term for the shape of ground features and landforms, referring to the form of the earth's surface. Specifically, it can refer to various undulating states presented jointly by the fixed objects distributed above the earth's surface. For example, the landforms in geography include basic landform forms such as plains, plateaus, hills, basins, and mountains.

[0086] It can be understood that terrain features refer to the terrain change features in the terrain or the undulating form features of the ground. Terrain features can be used to describe information such as the surface undulation, terrain change, altitude change, the proportion of various terrain regions, and terrain distribution.

[0087] Among them, the three-dimensional space data includes the three-dimensional space data of multiple spatial points. For example, specifically, it can be the three-dimensional coordinate data of spatial points. It can be understood that according to the three-dimensional space data of multiple spatial points, a corresponding three-dimensional model can be constructed.

[0088] Specifically, after the computer device obtains the three-dimensional space data corresponding to the real scene, it extracts features from the three-dimensional space data to extract the terrain features representing the terrain distribution state in the three-dimensional space data. For example, specifically, it can be the terrain change features.

[0089] S206, generate a three-dimensional terrain model according to the terrain features.

[0090] Among them, the three-dimensional terrain model is the framework for establishing the terrain environment in the virtual scene and is the basis for constructing a three-dimensional virtual scene.

[0091] It can be understood that for the three-dimensional point set data of multiple spatial points in the three-dimensional space data, each spatial point can be used as a vertex, and each vertex has corresponding spatial data, such as three-dimensional coordinate data. By connecting each vertex, a three-dimensional terrain grid is generated. Then, a three-dimensional terrain model with terrain features can be generated based on the three-dimensional terrain grid according to the terrain features.

[0092] Specifically, after the computer device extracts the terrain features from the three-dimensional space data, it can generate a corresponding three-dimensional terrain model according to these three-dimensional space data according to the terrain features. Thus, a three-dimensional terrain model with the terrain features of the real scene can be automatically generated.

[0093] S208, extract the scene object features of the scene objects in the real scene from the scene distribution data.

[0094] Among them, a scene object refers to an object in the real scene, such as a building, a road, etc. in the real scene. Scene object features are feature information used to describe at least one of the position, form, distribution, size, object type, etc. of the object.

[0095] After the computer device obtains the scene distribution data, it extracts features from the scene distribution data to extract the scene object features of the scene objects in the real scene. Specifically, the computer device first extracts the scene distribution data corresponding to each scene object from the scene distribution data, and then for each scene object, extracts features such as the position, shape, distribution, size, and object type of the scene object from the scene distribution data to obtain the scene object features of the scene object.

[0096] S210, in the three-dimensional terrain model, generate a scene object model corresponding to the scene object features to obtain a virtual scene corresponding to the real scene.

[0097] Among them, the scene object model refers to the three-dimensional model corresponding to each scene object. For example, if the scene object is a building, a three-dimensional building model can be generated according to the features of the building.

[0098] In one embodiment, the generated three-dimensional terrain model can be a three-dimensional terrain model including the features of the inherent surface objects. Among them, the inherent surface object features refer to the features corresponding to the inherent surface objects; the inherent surface objects refer to the objects originally existing on the terrain surface, such as surface objects and surface covering objects. Based on the surface objects and surface covering objects, a complete three-dimensional terrain model can be obtained.

[0099] By adding a scene object model corresponding to the scene object features in the three-dimensional terrain model, a complete virtual scene corresponding to the real scene can be automatically generated.

[0100] Specifically, after the computer device generates the three-dimensional terrain model, it automatically generates a scene object model corresponding to each scene object according to the scene object features of each scene object in the real scene in the scene distribution data, and adds the scene object model to the corresponding position in the three-dimensional terrain model, thereby obtaining a virtual scene corresponding to the real scene.

[0101] In the above virtual scene generation method, after the computer device obtains the three-dimensional space data and scene distribution data corresponding to the real scene, it extracts the terrain features from the three-dimensional space data and automatically generates a three-dimensional terrain model according to the terrain features, thereby being able to efficiently generate a three-dimensional terrain model with the terrain features of the real scene. Then, from the scene distribution data, it extracts the scene object features of the scene objects in the real scene; furthermore, in the three-dimensional terrain model, it generates a scene object model corresponding to the scene object features, thereby automatically generating a complete virtual scene corresponding to the real scene. By respectively extracting the terrain features and scene object features from the three-dimensional space data and scene distribution data corresponding to the real scene, and then automatically generating a three-dimensional virtual scene based on the terrain features and scene object features, it is possible to efficiently and accurately automatically generate a virtual scene with the features of the real scene and conforming to the real logic.

[0102] In one embodiment, as Figure 3 shown, another virtual scene generation method is provided, including the following steps:

[0103] S302, obtain the three-dimensional space data and scene distribution data corresponding to the real scene; the three-dimensional space data includes terrain space data and coverage object space data;

[0104] S304, extract terrain features from the terrain space data and generate a three-dimensional terrain model according to the terrain features;

[0105] S306, determine the surface coverage area in the three-dimensional terrain model according to the coverage object space data;

[0106] S308, generate surface coverage objects in the surface coverage area to obtain a three-dimensional terrain model including surface coverage objects.

[0107] S310, extract the scene object features of the scene objects in the real scene from the scene distribution data;

[0108] S312, generate a scene object model corresponding to the scene object features in the three-dimensional terrain model including surface coverage objects to obtain a virtual scene corresponding to the real scene.

[0109] The three-dimensional space data in this embodiment may specifically be the space data corresponding to the inherent objects in the real scene. For example, the inherent objects in the real scene include at least one of terrain, vegetation, etc.

[0110] Among them, the terrain spatial data refers to the three-dimensional spatial data corresponding to the terrain points in the real scene. The coverage object spatial data refers to the three-dimensional spatial data corresponding to the surface coverage objects on the terrain surface. The surface coverage object refers to the object covering the terrain surface, which can specifically be the inherent objects on the surface, such as vegetation, trees, etc. The surface coverage area refers to the area covered by the surface coverage objects on the terrain surface.

[0111] The computer device acquires the three-dimensional spatial data and the scene distribution data corresponding to the real scene. Among them, the three-dimensional spatial data includes the terrain spatial data and the coverage object spatial data. It can be understood that both the terrain spatial data and the coverage object spatial data include the corresponding position information, which can specifically be the position information in the same coordinate system.

[0112] Specifically, the computer device first extracts the features of the terrain spatial data and generates an initial three-dimensional terrain model based on the extracted terrain features. Then, the computer device determines the position of the surface coverage object in the three-dimensional terrain model according to the position information corresponding to the coverage object spatial data and the terrain spatial data, so as to determine the surface coverage area of the surface coverage object in the three-dimensional terrain model. Then, the computer device generates the surface coverage object in the surface coverage area, that is, adds the three-dimensional model corresponding to the surface coverage object to the initial three-dimensional terrain model, so as to obtain a three-dimensional terrain model including the surface coverage object.

[0113] The computer device then adds the scene object model corresponding to the scene object features extracted from the scene distribution data to the three-dimensional terrain model including the surface coverage object, so as to automatically generate a virtual scene corresponding to the real scene.

[0114] In this embodiment, by first automatically generating a three-dimensional terrain model including the surface coverage object according to the terrain spatial data and the coverage object spatial data in the three-dimensional spatial data, and then generating the scene object model in the three-dimensional terrain model according to the scene distribution data, a complete virtual scene corresponding to the real scene is efficiently and automatically generated.

[0115] In one embodiment, extracting the terrain features from the terrain spatial data includes: determining the terrain features according to the height difference between adjacent terrain points in the terrain spatial data;

[0116] Generating a three-dimensional terrain model according to the terrain features includes: determining the terrain types corresponding to each terrain area in the terrain spatial data according to the terrain features; adding the corresponding surface attribute information to the terrain area according to the terrain type; generating a three-dimensional terrain model according to the terrain spatial data after adding the surface attribute information.

[0117] It can be understood that the terrain spatial data may include terrain point set data corresponding to multiple terrain points, specifically including the three-dimensional coordinates of the terrain points, and the three-dimensional coordinates can be the coordinates corresponding to the (x, y, z) axes. It can be understood that the computer device can directly generate an initial terrain model using the terrain spatial data, such as a three-dimensional terrain grid.

[0118] The computer device then analyzes the three-dimensional coordinates of adjacent terrain points in the terrain spatial data. For each terrain point, it traverses each terrain point and its adjacent terrain points around it and calculates the height difference. Among them, the height difference refers to the difference in height between two terrain points. Then, based on the height difference, the terrain features between adjacent terrain points are calculated, which can specifically be the terrain change features, such as "slope". The slope is the degree of steepness of the surface unit. Generally, the ratio of the vertical height of the slope surface to the horizontal distance is called the slope or slope ratio.

[0119] Then, the computer device determines the terrain types corresponding to each terrain area in the terrain spatial data according to the terrain features. Specifically, taking the slope feature as an example of the terrain feature, each terrain type is provided with a corresponding slope threshold range.

[0120] The computer device then marks the terrain points with slope values within the same slope threshold range as belonging to the same terrain area corresponding to the corresponding terrain type according to the calculated slope values between adjacent terrain points. Specifically, the formula for calculating the slope value of adjacent terrain points can be:

[0121]

[0122] Among them, slope is the slope value between adjacent terrain points, dpoint_1 and dpoint_2 are the three-dimensional coordinates corresponding to adjacent terrain points respectively. For example, the terrain type corresponding to the terrain area with a slope threshold range value of 10 - 90 can be the slope type; the terrain type corresponding to the terrain area with a slope threshold range value of 0 - 10 can be the flat type.

[0123] Then the computer device adds surface attribute information corresponding to the terrain type to each terrain area. Among them, the surface attribute information refers to the information used to characterize the attributes of the terrain surface, such as material, structural attributes, etc. Among them, the material is a set of attributes representing how the model surface reacts to light, that is, the texture of the object, including information such as texture, color smoothness, transparency, reflectivity, refractive index, and luminosity.

[0124] The computer device adds materials corresponding to the terrain type to each terrain area. For example, it can add a preset sandy soil material to the terrain area of the slope type and a preset grass material to the terrain area of the flat type. In another embodiment, the computer device can add materials of different material categories under the corresponding terrain type for multiple terrain areas of the same terrain type. For example, it can mark change identifiers for multiple terrain areas of the same terrain type, specifically using a random marking method. For example, two terrain areas both belonging to the flat terrain type can be marked as "Flat 1" and "Flat 2", and then two different grass materials are attached to "Flat 1" and "Flat 2" respectively. Thus, the changes in the terrain can be effectively reflected, and a three-dimensional terrain model can be generated efficiently.

[0125] In a specific embodiment, the terrain spatial data can specifically be terrain point cloud data, and the original terrain point cloud data only includes the position information of each terrain point. As Figure 4 shown, it is a schematic diagram of generating a three-dimensional terrain model in an embodiment. After the computer device obtains the original terrain point cloud data 4a, it can first generate an initial terrain 4b based on the original terrain point cloud data. The initial terrain 4b can be directly generated by connecting the original terrain point cloud data. Then, it extracts terrain features 4c based on the terrain point cloud data and marks the terrain types corresponding to each terrain area. Furthermore, it adds the material attribute information corresponding to the terrain type to each terrain area, and then generates a three-dimensional terrain model 4d.

[0126] In this embodiment, after extracting the terrain features from the terrain point cloud data, the material attribute information corresponding to the terrain type is added based on the terrain features. Thus, a three-dimensional terrain model that conforms to the terrain of the real scene can be generated efficiently.

[0127] In an embodiment, determining the surface coverage area in the three-dimensional terrain model according to the coverage object spatial data includes: in the three-dimensional terrain model, determining the terrain points corresponding to the surface coverage points in the coverage object spatial data; selecting target surface coverage points according to the height difference between the surface coverage points and the corresponding terrain points; determining the overlapping area between the expansion area and the three-dimensional terrain model; the expansion area is an area expanded based on the target surface coverage points; and determining the surface coverage area in the three-dimensional terrain model according to the overlapping area.

[0128] It can be understood that the terrain spatial data and the coverage object spatial data are spatial data within the same real scene area, specifically including the three-dimensional coordinates corresponding to the terrain points and the three-dimensional coordinates corresponding to the surface coverage points in the same coordinate system.

[0129] Among them, the topographic points corresponding to the surface coverage points in the coverage object space data refer to the corresponding topographic points with overlapping positions with the surface coverage points. The overlapping position can specifically refer to that the surface coverage point and the topographic point have the same planar position information. For example, both the surface coverage point and the topographic point include corresponding (x, y, z) coordinate information. If the (x, y) coordinate information of the surface coverage point and the topographic point is the same, it means that this topographic point is the corresponding topographic point with an overlapping position with the surface coverage point.

[0130] Among them, the overlapping area refers to the intersection area between the area obtained by expanding the target surface coverage point and the area corresponding to the topographic points in the three-dimensional terrain model.

[0131] After the computer device generates a three-dimensional terrain model based on the terrain space data, it determines the topographic points corresponding to the surface coverage points in the three-dimensional terrain model according to the three-dimensional coordinates corresponding to the topographic points in the terrain space data and the three-dimensional coordinates corresponding to the surface coverage points in the coverage object space data, that is, the topographic points covered by the surface coverage points in the three-dimensional terrain model. Then, according to the height difference between the surface coverage point and the corresponding topographic point, the required target surface coverage points are selected.

[0132] Specifically, the computer device can determine the topographic points corresponding to the surface coverage points in the coverage object space data according to the (x, y) coordinate information in the (x, y, z) coordinate information corresponding to the surface coverage points and the topographic points. It can be understood that the z-axis coordinate information in the three-dimensional coordinates can be used to represent the height information. Then, the computer device calculates the height difference between the surface coverage point and the corresponding topographic point according to the z-axis coordinate information corresponding to the surface coverage point and the topographic point, and determines the surface coverage points whose height differences meet the selection conditions as the target surface coverage points.

[0133] For example, the height difference calculation formula between the surface coverage point and the corresponding topographic point can be as follows:

[0134] foliage[n].height=foliage[n].y - ground(foliage[n].x,foliage[n].z).y;

[0135] Among them, n represents the number of the surface coverage point, and foliage[n] represents the nth surface coverage point; foliage[n].height represents the height difference between the surface coverage point and the corresponding topographic point, that is, the height value of the surface coverage point relative to the corresponding topographic point. foliage[n].y represents the coordinate of the vegetation point n on the y-axis; ground(foliage[n].x, foliage[n].z).y represents the coordinate of the topographic point corresponding to the y-axis with the same x and z axis coordinates as the surface coverage point n.

[0136] Then, the computer device expands each selected target surface coverage point to obtain an expanded area. It can be understood that expansion means continuing to expand and increase on the original basis. The target surface coverage point is expanded, that is, the area of ​​the preset range is expanded based on the target surface coverage point.

[0137] For example, the target ground coverage point is expanded, including at least one of plane expansion, spherical expansion and cone expansion, but not limited thereto. Plane expansion refers to directly expanding the area of ​​a preset range with the target ground coverage point as the center, that is, obtaining the expanded area. Spherical expansion refers to taking each target ground coverage point as the center of the sphere, expanding it into a corresponding spherical model according to a preset expansion parameter, that is, the sphere radius, and the expanded spherical model is the expanded area corresponding to each target ground coverage point. Cone expansion refers to taking each target ground coverage point as the vertex of the cone, and expanding it into a corresponding cone model, such as a cone model, according to preset cone expansion parameters, and the expanded cone model is the expanded area corresponding to each target ground coverage point.

[0138] The computer device further determines the extended area corresponding to the target surface coverage point and the overlapping area with the three-dimensional terrain model, so as to determine the final surface coverage area in the three-dimensional terrain model according to the overlapping area. Specifically, the computer device may determine the terrain area in which the extended area and the three-dimensional terrain model are in the same plane as the overlapping area, that is, the terrain area corresponding to the terrain point having the same (x, y) coordinate information as that corresponding to the extended area is determined as the overlapping area. In another embodiment, if the extended area includes the corresponding (x, y, z) coordinate information, the terrain area corresponding to the terrain point having the same (x, y, z) coordinate information as that corresponding to the extended area may be determined as the overlapping area.

[0139] In one of the embodiments, the computer device may also remove the location area including the scene object in the overlapping area according to the location area corresponding to the scene object in the three-dimensional terrain model in the scene distribution data. Furthermore, the computer device may remove the terrain area in the three-dimensional terrain model whose terrain slope exceeds a preset threshold, such as a terrain area whose terrain slope is greater than 75 degrees, from the overlapping area. The computer device then determines the overlapping area after removing the location area of ​​the scene object and the terrain area whose terrain slope exceeds the preset threshold as the final surface coverage area in the three-dimensional terrain model.

[0140] In this embodiment, since there may be noise in the spatial data of the covered objects corresponding to the real scene, taking the spatial data of the covered objects as the vegetation point cloud data as an example, a vegetation may consist of multiple points. Generating the surface covered objects directly according to the vegetation point cloud data may result in a relatively large number of redundant surface covered objects generated. Therefore, after selecting the target surface covered points based on the height difference between the surface covered points and the corresponding terrain points, the surface covered area in the three-dimensional terrain model is re-determined according to the overlapping area between the extended area corresponding to the target surface covered points and the three-dimensional terrain model, so as to generate the surface covered objects in the surface covered area, thereby being able to generate the surface covered objects that are more similar to the real scene and conform to the distribution logic more accurately.

[0141] In one embodiment, generating the surface covered objects in the surface covered area to obtain a three-dimensional terrain model including the surface covered objects includes: determining the generation parameter information of the surface covered objects in the surface covered area; generating the surface covered objects in the surface covered area according to the generation parameter information to obtain a three-dimensional terrain model including the surface covered objects.

[0142] It can be understood that the generation parameter information of the surface covered objects refers to the parameters used to generate the surface covered objects. For example, it may include at least one parameter information such as the generation quantity, generation position, size of the surface covered objects, distribution form, etc.

[0143] After the computer device determines the surface covered area in the three-dimensional terrain model, it can directly generate the surface covered objects in the surface covered area. Specifically, the computer device can determine the generation parameter information of the surface covered objects in the surface covered area according to a preset generation method. For example, it can determine the generation parameter information of the surface covered objects corresponding to the area size of the surface covered area. In another embodiment, the generation parameter information of the surface covered objects in the surface covered area can also be determined randomly.

[0144] The computer device then determines the generation positions of the surface covered objects in the surface covered area according to the generation parameter information, and obtains the three-dimensional model corresponding to the preset surface covered objects that matches the generation parameter information, and then adds the three-dimensional model of the surface covered objects to the generation positions of the surface covered objects in the surface covered area, so as to obtain a three-dimensional terrain model including the surface covered objects.

[0145] In a specific embodiment, the computer device can generate the surface covered objects in the surface covered area by means of scatter points. That is, determine the generation points and generation parameter information of the surface covered objects in the surface covered area, and then add the three-dimensional model corresponding to the pre-drawn surface covered objects that matches the generation parameter information to the generation points in the surface covered area, so as to obtain a three-dimensional terrain model including the surface covered objects.

[0146] In a specific embodiment, the covered object space data may specifically be covered object point cloud data. For example, taking the covered object point cloud data as vegetation point cloud data, as Figure 5 shown, it is a schematic diagram of generating a surface covered object in a three-dimensional terrain model in an embodiment. After the computer device obtains the original covered object point cloud data 5a, it first calculates the surface covered area 5b in the three-dimensional terrain based on the original covered object point cloud data, and then re-scatters points in the surface covered area 5b to determine the generation points 5c of the surface covered object in the surface covered area. Then, based on the generation points 5c of the surface covered object, a surface covered object is generated in the three-dimensional terrain model, and a three-dimensional terrain model 5d including the surface covered object is obtained.

[0147] In this embodiment, by the overlapping area corresponding to the target surface covered point selected from the covered object space data in the three-dimensional terrain model, the surface covered area in the three-dimensional terrain model is determined, and then the surface covered object is regenerated in the surface covered area, so that a surface covered object similar to the real scene and conforming to the distribution logic can be generated more accurately.

[0148] In an embodiment, from the scene distribution data, the scene object features of the scene objects in the real scene are extracted, including: based on the scene distribution data, determining the position and height of the scene objects in the three-dimensional terrain model in the real scene; generating the three-dimensional scene object data corresponding to the scene objects according to the position and height; and extracting the scene object features of the scene objects from the three-dimensional scene object data.

[0149] It can be understood that the scene distribution data may include the distribution data of scene points in the real scene, or may also include the distribution data of some object structures. For example, the scene distribution data may include at least one of map data or OSM data (OpenStreetMap, open source road and terrain distribution data), etc. The form of the scene distribution data may include any one of image form, array form, and XML (Extensible Markup Language) form, etc.

[0150] Among them, the three-dimensional scene object data corresponding to the scene object may represent the three-dimensional space data corresponding to the scene object. Specifically, the two-dimensional original position data may be included in the scene distribution data.

[0151] After the computer device obtains the scene distribution data, it extracts the distribution data of the scene objects in the real scene from the scene distribution data. Among them, the distribution data includes at least one of the original position and the original height, etc. It can be understood that the height refers to the distance from the ground or the reference plane to a certain place, that is, the distance from the bottom to the top of the object. The original height of the scene object in the real scene is the distance from the bottom to the top of the scene object.

[0152] Specifically, the computer device can extract only the original position in the scene distribution data of the required scene objects. For example, the required scene objects can include at least one of buildings, roads, etc., but are not limited thereto.

[0153] The computer device then determines the position and height of the scene object in the three-dimensional terrain model based on the original position of the scene object. The computer device can also determine the position and height of the scene object in the three-dimensional terrain model based on the original position and the original height of the scene object, thereby obtaining the three-dimensional data of the scene object.

[0154] Then, the computer device generates the three-dimensional space data of the scene object based on the position and height of the scene object in the three-dimensional terrain model. Specifically, it can generate the three-dimensional coordinates corresponding to the scene object. For example, the position and height of the scene object in the three-dimensional terrain model can be converted into three-dimensional point cloud data. Thus, the three-dimensional space data of the scene object in the three-dimensional terrain can be accurately obtained. The computer device then extracts the scene object features of the scene object from the three-dimensional scene object data, specifically including features such as position, size, type, normal, etc., to generate the final three-dimensional scene object model. Thus, a three-dimensional scene object model that matches the scene object in the real scene can be generated quickly and accurately.

[0155] In one embodiment, based on the scene distribution data, determining the position and height of the scene object in the three-dimensional terrain model includes: if the scene distribution data includes the original position of the scene object in the real scene, determining the position and height of the scene object in the three-dimensional terrain model according to the original position; if the scene distribution data includes the original position and the original height of the scene object, determining the position and height of the scene object in the three-dimensional terrain model according to the original position and the original height.

[0156] It can be understood that the scene distribution data can include only the two-dimensional position data of the scene points or the object structure, or can include the two-dimensional position data and the height data of the scene points or the object structure. For example, the scene distribution data can include two-dimensional map data and height data. Among them, the height data can be the height data of each scene point or object structure obtained from the scene distribution database, or can be the height data pre-marked for each scene point or object structure according to the map data.

[0157] Specifically, after the computer device obtains the scene distribution data, if the scene distribution data includes the original positions of scene objects in the real scene, the computer device determines the positions and heights of the scene objects in the three-dimensional terrain model according to the original positions. For example, the computer device can assign corresponding heights to the scene objects according to the object types of the scene objects and the area sizes corresponding to the original positions. Specifically, it can randomly assign heights to the scene objects according to the height ranges corresponding to the object types, or can also assign appropriate heights according to the area sizes.

[0158] If the scene distribution data includes the original positions and original heights of the scene objects, the computer device directly determines the positions and heights of the scene objects in the three-dimensional terrain model according to the original positions and original heights, so as to be able to efficiently and accurately generate a scene object model in the three-dimensional terrain model that conforms to the scene objects in the real scene.

[0159] In one embodiment, in the three-dimensional terrain model, generating a scene object model corresponding to the scene object characteristics to obtain a virtual scene corresponding to the real scene includes: generating an initial scene object model corresponding to the scene object according to the scene object characteristics; adding scene object attribute information conforming to the object type to the corresponding initial scene object model according to the object type of the scene object to obtain a scene object model matching the scene object; and adding the scene object model to the three-dimensional terrain model to obtain a virtual scene corresponding to the real scene.

[0160] It can be understood that the scene object attribute information is information used to characterize the attributes on the surface of the scene object model, such as information on materials, structural attributes, etc. After adding attribute information to the model surface of the three-dimensional set model of the scene object, a complete scene object model corresponding to each scene object can be obtained.

[0161] After the computer device extracts the scene object characteristics corresponding to the required scene objects from the scene distribution data, it first automatically constructs a corresponding three-dimensional geometric model according to the scene object characteristics. Specifically, the scene object characteristics can include feature information such as the positions, sizes, normals, types, etc. corresponding to each point included in the scene object. The computer device can then generate an initial three-dimensional geometric model, that is, an initial scene object model, according to the scene object characteristics corresponding to each point included in the scene object.

[0162] Then, the computer device adds attribute information corresponding to the object type to each initial scene object model to generate a complete scene object model. For example, by adding corresponding material information to the initial scene object model, a relatively complete scene object model with material attributes can be obtained. The computer device then adds the scene object model to the corresponding position in the three-dimensional scene, and a virtual scene including the scene object can be obtained.

[0163] In a specific embodiment, the scene distribution data includes the planar distribution information of scene objects. For example, taking the scene object as a building, as Figure 6 shown, it is a schematic diagram of generating a scene object model in an embodiment. The computer device obtains the planar distribution information 6a of the building from the scene distribution data, and the planar distribution information includes the position area and height occupied by the building. The computer device then generates a building boundary box 6b corresponding to the building according to the position area and height occupied by the building. For example, by stretching the corresponding height based on the position area occupied by the building, a three-dimensional building boundary box is generated. Among them, the boundary box refers to a rectangular box circumscribed to the scene object. Then, the computer device converts the boundary box corresponding to the building into three-dimensional space data corresponding to the building. For example, it can be converted into corresponding point cloud data 6c, and each point is marked with corresponding scene object features. The scene object features include at least one of position, size, normal, building attributes, etc. Among them, the building attributes include attribute information such as the number of floors, roof, walls, corners, eaves, etc. The computer device can then generate a three-dimensional initial scene object model 6d according to the point cloud data 6c of the building.

[0164] Among them, the planar distribution information of the building can include the distribution information corresponding to multiple points in the plane of the position area occupied by the building, such as two-dimensional coordinate information. When converting the planar distribution information of the building into three-dimensional space data corresponding to the building, each point on the plane can be copied. Specifically, the points can be copied according to the height of the building, so as to obtain the updated point set of the building. For example, the original point set and the copied point set of the building can be named point and dpoint, and these two point sets are placed in the same boundary box geometry, and then the following processing is performed:

[0165] dpoint[n].y = point[n].y + point[n].height;

[0166] Among them, n represents the number of the point in the building point set, dpoint[n].y represents the coordinate of the copied point, point[n].y represents the coordinate of the original point, and point[n].height represents the height information of the original point. By copying points according to the height of the building, the three-dimensional point set data of the building can be obtained.

[0167] For example, the computer device can also use the bounding box processing tool in 3D computer graphics software, such as the bounding box processing tool in Houdini software, to convert geometric bodies of different shapes into evenly distributed point sets. Thus, relatively accurate 3D point set data of the building can be obtained and a building model can be generated. Then, building attribute information and material attribute information are added to the 3D point set data, so as to attach corresponding materials to the building model according to different building attribute information, thereby generating a scene object model that matches the scene object.

[0168] In this embodiment, by converting the two-dimensional plane distribution information and height information in the scene distribution data into corresponding three-dimensional space data, a three-dimensional scene object model corresponding to the scene object can be effectively generated, and thus a virtual scene similar to the real scene can be generated efficiently and accurately.

[0169] In one embodiment, adding the scene object model to the three-dimensional terrain model to obtain a virtual scene corresponding to the real scene includes: determining the terrain area corresponding to the scene object model in the three-dimensional terrain model; performing smoothing processing on the terrain area to obtain a smoothed terrain area; adding the scene object model to the smoothed terrain area in the three-dimensional terrain model to obtain a virtual scene corresponding to the real scene.

[0170] Among them, the terrain area corresponding to the scene object model in the three-dimensional terrain model refers to the position area occupied by the scene object model and the corresponding terrain area in the three-dimensional terrain model.

[0171] It can be understood that the terrain in the terrain area may be uneven terrain. For the terrain in the terrain area corresponding to each complete scene object model, the terrain needs to be flat, that is, the corresponding terrain area needs to be in the same plane. The smoothing process means that the terrain in the terrain area is flattened into the terrain in the same plane.

[0172] Specifically, after the computer device generates the scene object model, during the process of adding the scene object model to the three-dimensional terrain model, first determine the terrain area corresponding to the scene object model in the three-dimensional terrain model and perform smoothing processing on the corresponding terrain area. Specifically, the computer device can perform smoothing processing on the corresponding terrain area according to the three-dimensional space data of the bottom surface of the scene object model, that is, place the terrain points in the corresponding terrain area and the points on the bottom surface of the scene object model in the same plane. For example, the computer device can directly update the three-dimensional space data of the bottom surface of the scene object model to the three-dimensional space data of the terrain points in the corresponding terrain area, so that the terrain points in the terrain area and the points on the bottom surface of the scene object model are in the same plane, thereby obtaining a smoothed terrain area.

[0173] The computer device then adds the scene object model to the smoothed terrain area in the three-dimensional terrain model to obtain a three-dimensional virtual scene corresponding to the real scene.

[0174] In a specific embodiment, as Figure 7 shown, it is a schematic diagram of adding a scene object model to a three-dimensional terrain model in an embodiment. Referring to Figure 7 , taking the scene object as a building as an example, the corresponding scene object model is a building model. If a building model is directly generated in the three-dimensional terrain, a building model 7a that does not fit the terrain height will be obtained. Therefore, the computer device needs to update the height coordinates of the building model and the height coordinates of the corresponding terrain area. For example, the computer device can use a vertical ray method based on the y-axis to obtain height information 7b, and further smooth the terrain area corresponding to the building model in the three-dimensional terrain model to level the corresponding terrain area 7c. For example, the terrain area corresponding to one of the building models in the three-dimensional terrain model is terrain area 7c1.

[0175] Specifically, the computer device can cache the terrain point cloud data and building point set data corresponding to the terrain. First, according to the y-axis coordinate information in the building point set data of each building, the building points at the bottom of each building are obtained, that is, the building points with the smallest y coordinate value are traversed and found, and the remaining building points with y not equal to this value are deleted. For example, the building point with the smallest y coordinate value selected can be named flatbuilding, and an empty attribute height is added to the building point flatbuilding to store the updated height of the building point flatbuilding.

[0176] Based on the expression of the y-axis ray method, it can be specifically as follows:

[0177] flatbuilding[n].height = flatbuilding[n].y - ground maxY (flatbuilding[n].x, flatbuilding

[0178] [n].z).y;

[0179] Among them, flatbuilding[n] represents the building point at the bottom of the selected building, flatbuilding[n].height represents the updated height value of the building point flatbuilding, and ground maxY (x, z) represents the terrain point with the largest y value at the x and z axis coordinates of x and z respectively for the terrain point. ground maxY(flatbuilding[n].x, flatbuilding[n].z).y represents the y - coordinate value of the terrain point with the largest y - value among the terrain points having the same x - and z - axis coordinates as the building point flatbuilding[n].

[0180] For each point on the bottom surface of the building, the following processing is performed on each terrain point in the corresponding terrain area:

[0181] ground(flatbuilding[n].x, flatbuilding[n].z).y = flatbuilding[n].height;

[0182] Where ground(flatbuilding[n].x, flatbuilding[n].z).y represents the updated y - coordinate value of each terrain point in the terrain area.

[0183] Then for each building point of the building, the following processing is performed on all points:

[0184] Building[n].y = Building[n].y - flatbuilding[n].height;

[0185] Where Building[n].y represents the y - coordinate value of building point n of the building model, that is, the y - coordinate values of all building points in the building model are updated, so as to move the whole building to the leveled ground, thereby obtaining a smoothed terrain area and generating a building model 7d that fits the terrain height.

[0186] In this embodiment, by smoothing the terrain area corresponding to the scene object model in the three - dimensional terrain model during the process of adding the scene object model to the three - dimensional terrain model, the bottom surface and height of the scene object model can be accurately matched and fitted to the corresponding terrain area.

[0187] In one embodiment, determining the terrain area corresponding to the scene object model in the three - dimensional terrain model includes: determining the position area corresponding to the scene object model in the three - dimensional terrain model and its adjacent areas as the terrain area corresponding to the scene object model; smoothing the terrain area to obtain a smoothed terrain area, including: updating the height value of the position area according to the height difference between the bottom surface of the scene object model and the position area; smoothing the height values of the adjacent areas according to the updated height value of the position area to obtain a smoothed terrain area.

[0188] Among them, the position area corresponding to the scene object model in the three-dimensional terrain model, that is, in the three-dimensional terrain model, the area corresponding to the terrain on the same plane as the scene object model. It can be understood that the adjacent area of the position area refers to the peripheral area of the position area. For example, it can be the peripheral area at a preset distance from the position area.

[0189] It can be understood that after smoothing the terrain area corresponding to the scene object model one by one, there may be a height difference between the smoothed terrain area and the surrounding adjacent areas. Therefore, the computer device can smooth the terrain area corresponding to the scene object model and the surrounding adjacent areas.

[0190] Specifically, the computer device determines the position area corresponding to the scene object model in the three-dimensional terrain model and the adjacent area of the position area as the terrain area that needs to be smoothed corresponding to the scene object model. The computer device first updates the height value of the position area according to the height difference between the bottom surface of the scene object model and the position area. For example, the computer device can update the y coordinate value of the bottom surface of the scene object model to the y coordinate value corresponding to the terrain point with the largest y coordinate value in the position area, and then update the y coordinate value of each terrain point in the position area to the updated y coordinate value of the bottom surface of the scene object model, so as to obtain the smoothed position area.

[0191] Then, the computer device further smooths the adjacent area of the position area according to the updated y coordinate value of the position area. For example, the y coordinate values of the terrain points in the adjacent area can be weighted and smoothed according to a preset weight, so as to smoothly transition the position area and the corresponding adjacent area.

[0192] Specifically, as Figure 8As shown, it is a schematic diagram of leveling the terrain area corresponding to the scene object model in an embodiment. Among them, the rectangular area is the position area 8a corresponding to the scene object model in the three-dimensional terrain model. The area in the oval area except the position area 8a is the adjacent area 8b to the position area 8a. Among them, the adjacent area 8b can be divided into multiple sub-areas according to a preset ratio, that is, sub-areas 8b1, 8b2, and 8b3, and corresponding smoothing weights are assigned to each sub-area. For example, taking the smoothing weight of the position area 8a as 1, the smoothing weight corresponding to the sub-area 8b1 can be 0.8, the smoothing weight corresponding to the sub-area 8b2 can be 0.6, and the smoothing weight corresponding to the sub-area 8b3 can be 0.4. After smoothing the position area 8a, then weighted smoothing processing is performed on multiple sub-areas in the adjacent area 8b according to the assigned smoothing weights. For example, if the position area 8a is the height value after 100% smoothing and the smoothing weight is 0.8, it means the final height value of the corresponding terrain point after smoothing * 0.8 + the original terrain point height value * 0.2. By performing weighted smoothing processing on the adjacent area, the height after leveling the adjacent area will be weighted and fused with the original terrain, so as to effectively achieve the effect of smooth transition.

[0193] In one embodiment, the above virtual scene generation method further includes: aligning the scene area corresponding to the scene distribution data with the scene area corresponding to the three-dimensional space data to obtain a scene alignment area; selecting the scene distribution data matching the scene alignment area from the scene distribution data to obtain the aligned scene distribution data; obtaining the three-dimensional space data and scene distribution data corresponding to the real scene, including: obtaining the three-dimensional space data and the aligned scene distribution data corresponding to the real scene.

[0194] Among them, the three-dimensional space data and the scene distribution data are obtained according to the scene area corresponding to the same real scene. For example, it can be the scene area corresponding to the same longitude and latitude information in the real scene, and the three-dimensional space data and the scene distribution data within the range of the scene area corresponding to the longitude and latitude information are respectively obtained.

[0195] It can be understood that the three-dimensional space data and the scene distribution data within the same scene area range may have inconsistent ranges or low consistency. Therefore, the computer device can also perform preprocessing of alignment on the obtained three-dimensional space data and scene distribution data.

[0196] Specifically, after the computer device obtains the three-dimensional space data and scene distribution data corresponding to the real scene, it first aligns the scene area corresponding to the scene distribution data with the scene area corresponding to the three-dimensional space data to obtain the scene alignment area. For example, the acquired scene distribution data may not be completely consistent with the scene area of ​​the three-dimensional space data, and the computer device aligns the scene area corresponding to the scene distribution data with the scene area corresponding to the three-dimensional space data, or aligns the scene area corresponding to the three-dimensional space data with the scene area corresponding to the scene distribution data.

[0197] Then, the computer device selects the scene distribution data that matches the scene alignment area from the scene distribution data to obtain the aligned scene distribution number. That is, based on the scene area corresponding to the three-dimensional space data, the scene distribution data in the scene area is extracted from the scene distribution number, or based on the scene area of ​​the scene distribution data, the three-dimensional space data in the scene area is extracted from the three-dimensional space data, so that the scene area corresponding to the scene distribution data is completely aligned with the scene area corresponding to the three-dimensional space data.

[0198] The computer device then obtains the three-dimensional spatial data and the aligned scene distribution data corresponding to the real scene, so as to further automatically generate a virtual scene corresponding to the real scene more efficiently and accurately based on the three-dimensional spatial data and the aligned scene distribution data.

[0199] In one embodiment, the scene distribution data includes point set data corresponding to the scene object; from the scene distribution data, the scene distribution data that matches the scene alignment area is selected, including: for scene objects of the first object type, if the scene alignment area has complete point set data of the scene object, then the complete point set data is selected from the scene distribution data; if the scene alignment area has incomplete point set data of the scene object, then the complete point set data corresponding to the scene object is removed from the scene distribution data; for scene objects of the second object type, the point set data of the scene object within the scene alignment area is selected from the scene distribution data.

[0200] It can be understood that the point set data corresponding to the scene object means that each scene object is composed of at least one point, and each point includes corresponding distribution information, such as coordinate information and attribute information such as the structure to which it belongs and the object type. Among them, the point set data corresponding to each scene object can be regarded as the corresponding node structure data.

[0201] The computer device aligns the scene area corresponding to the scene distribution data with the scene area corresponding to the three-dimensional space data to obtain the aligned scene alignment area, and then selects the scene distribution data that matches the scene alignment area from the scene distribution data.

[0202] Among them, the matching scene distribution data may refer to the scene distribution data completely within the scene alignment area. The scene objects of the first object type and the scene objects of the second object type may refer to scene objects with different type attributes. Among them, the first object type may refer to scene objects with a relatively small structure or a relatively small occupied area, such as object objects like buildings, vehicles, and stones. The second object type may refer to scene objects with a relatively large structure or a relatively large occupied area, such as object objects like roads, rivers, lakes, and parks.

[0203] Specifically, when the computer device selects the scene distribution data that matches the scene alignment area from the scene distribution data, for the scene objects of the first object type, when there is a complete point set data of the scene object within the scene alignment area, only the complete point set data is selected. For the incomplete point set data of the scene object within the scene alignment area, the complete point set data corresponding to the scene object is excluded from the scene distribution data. That is, only the point set data of the complete scene object within the scene alignment area is selected from the scene distribution data. This can effectively prevent the situation of incomplete scene objects of the first object type.

[0204] For the scene objects of the second object type, usually with a relatively large structure or a relatively large occupied area, the computer device can directly select the point set data of the scene object within the scene alignment area from the scene distribution data. That is, if the scene objects of the second object type are distributed within and outside the scene alignment area, only the partial point set data of the scene object within the scene alignment area is extracted.

[0205] In a specific embodiment, the scene distribution data may be obtained from a preset database. When exporting the scene distribution data, it may not be completely exported according to the determined area, which may lead to uncontrollable data center points. Therefore, there may be a misalignment between the obtained scene distribution data and the three-dimensional space data. Specifically, the computer device can automatically perform alignment processing on the scene distribution data and the three-dimensional space data using a preset script. Among them, the script refers to an executable file written in a specific descriptive language according to a certain format. The preset script in this embodiment is used to automatically perform alignment processing on the scene distribution data and the three-dimensional space data and process redundant data, so that the scene distribution data can be automatically aligned with the three-dimensional space data without manual intervention, thereby improving the alignment processing efficiency of the scene distribution data and the three-dimensional space data.

[0206] Such as Figure 9As shown, it is a schematic diagram of aligning scene distribution data with three-dimensional space data in an embodiment. The computer device can place the schematic diagram 92 corresponding to the original scene distribution data and the scene area box 92a corresponding to the three-dimensional space data in the same plane for area alignment. Specifically, the area where the schematic diagram 92 corresponding to the scene distribution data coincides with the scene area box 92a can be determined as the scene alignment area, that is Figure 9 the area corresponding to the scene area box 92a in. Then, for the aligned scene distribution data and three-dimensional space data 94, the redundant data 94b outside the scene alignment area 94a is removed. Specifically, a preset script 96 can be used to remove the redundant data 94b and automatically align it to obtain the automatically aligned scene distribution data and three-dimensional space data 98.

[0207] Among them, the scene distribution data includes point set data corresponding to scene objects, that is, the structure data of scene objects. The point set data is a combination composed of one or more points. When removing the redundant data 94b outside the scene alignment area 94a, it can be determined whether to delete some point set data or the complete point set data in the point set data of the scene object according to the object type of the scene object.

[0208] Specifically, the computer device traverses the point set data of each scene object in the scene distribution data according to the position information of the scene alignment area 94a, such as longitude and latitude information, and filters out the points outside the scene alignment area 94a. The point is deleted and the structure index to which the point belongs is stored in the corresponding marker array. Then, according to the object type of the scene object, the structure data corresponding to the structure index in the marker array is processed. If the object type of the scene object is the first object type, such as a complete structure like a building, the corresponding structure data is completely deleted. If the object type of the scene object is the second object type, such as a structure like a road, only the points of the road outside the scene alignment area 94a are deleted. This can prevent the occurrence of strange structures such as half-built buildings.

[0209] In a specific embodiment, the computer device can use a preset editor plugin to automatically generate a virtual scene similar to the real scene using the three-dimensional space data and scene distribution data corresponding to the real scene. Among them, the preset editor plugin can be an editor plugin based on a visualization editing engine, such as an editor plugin based on UE4 (Unreal Engine). The editor plugin includes at least one of various tool plugins, such as a building creation tool, a scene creation tool, a ground leveling tool, and a terrain creation tool.

[0210] Such as Figure 10As shown in the figure, it is a schematic diagram of the overall process for generating a virtual scene in an embodiment. After a computer device obtains the three-dimensional space data and scene distribution data corresponding to the real scene, based on the editor plugin 100, first, according to the three-dimensional space data 10a, a terrain model 1002 and a vegetation model 1004 in the terrain model are generated. Then, according to the scene distribution data 10b, a building model 1006 and a road model 1008 are generated in the terrain model 1002, thereby obtaining a virtual scene corresponding to the real scene.

[0211] Specifically, as Figure 11 shown in the figure, it is a schematic diagram of the interface of a preset editor plugin in an embodiment. Taking a computer device as an example of a terminal, the editor plugin is deployed in the terminal, and the interface 110 of the editor plugin is displayed on the terminal. The interface 110 of the editor plugin includes a menu area 112, a scene preview area 114, a creation tool area 116, and a parameter setting area 118, etc. Among them, the creation tool area 116 includes a terrain creation tool 116a, a scene creation tool 116b, a ground leveling tool 116c, a building creation tool 116d, a vegetation creation tool 116e, a road creation tool 116f, and a test tool 116g. Among them, the menu area 112 includes various menu function controls in the editor plugin, such as file selection, editing setting parameter setting, etc. The test tool 116g can be used to perform test processing on the generated partial model or the final virtual scene.

[0212] A user can obtain the three-dimensional space data and scene distribution data corresponding to the real scene through the terminal. Specifically, taking the three-dimensional space data as three-dimensional point cloud data and the scene distribution data as OSM data as an example, the user can add the obtained three-dimensional point cloud data and OSM data to the corresponding tool plugins, and then a corresponding virtual scene will be automatically generated in the editor plugin. For example, the user can first use the terminal to import the three-dimensional point cloud data 1122 into the terrain creation tool 116a. Then, based on the pre-set parameters, a corresponding initial terrain model is automatically generated. Among the generated initial terrain models, there are terrain areas of various terrain types, and each terrain area includes surface attribute information corresponding to the terrain type to which it belongs. For example, material information corresponding to the terrain type to which it belongs is added. As Figure 12 shown in the figure, in the scene preview area 114 of the interface 110 of the editor plugin, a schematic diagram of the initial terrain model automatically generated based on the three-dimensional point cloud data is shown.

[0213] Then, the terminal can further generate surface coverage objects such as tree models in the initial terrain model according to the vegetation creation tool 116e, so as to obtain a three-dimensional terrain model. At the same time, the scene distribution data can also be imported into the scene creation tool 116b, and the scene creation tool 116b can perform preprocessing such as alignment processing on the scene distribution data. Then, based on the scene distribution data, the terminal can generate scene object models such as building models and road models in the three-dimensional terrain model through the building creation tool 116d and the road creation tool 116f. The terminal can also use the ground leveling tool 116c to smooth the terrain areas corresponding to the building models and the road models, and then add the building models and the road models to the smoothed terrain areas in the three-dimensional terrain model, so as to obtain the final virtual scene. As Figure 13 shown, it is a schematic diagram of the final virtual scene obtained in an embodiment.

[0214] In an embodiment, after the terminal generates the final virtual scene by using a preset editor plugin, a common visualization editing engine, such as the UE4 (Unreal Engine) editing engine, can be used to edit the generated virtual scene again. The Unreal Engine includes a Landscape system (i.e., terrain system), a Spline system (i.e., road system), and a Foliage system (i.e., vegetation system), etc. Specifically, the preset editor plugin can be a three-dimensional scene editing program generated based on a common visualization editing engine. Among them, the preset editor plugin can be configured with an interface corresponding to the visualization editing engine, so that the preset editor plugin can be docked with the editing system of the common visualization editing engine, thereby realizing the docking of the production pipeline and secondary editing of the generated virtual scene through the common visualization editing engine.

[0215] As Figure 14 shown, it is a schematic diagram of editing the virtual scene again through the visualization editing engine in an embodiment. After the terminal generates a virtual scene corresponding to the real scene through the preset editor plugin, the visualization editing engine 140 can be used. For example, the terrain system 1402 of the Unreal Engine can be used to edit the terrain model 14a in the virtual scene, the road system 1404 in the Unreal Engine can be used to edit the terrain model 14b in the virtual scene, and the vegetation system 1406 in the Unreal Engine can be used to edit the terrain model 14c in the virtual scene, so as to efficiently perform secondary editing on the virtual scene.

[0216] In a test embodiment, the computer device obtains the three-dimensional space data and scene distribution data corresponding to a real scene with a scene area size of 8 km * 8 km. According to the above virtual scene generation method, the generation time consumed for generating the virtual scene corresponding to the real scene is 20 minutes. As Figure 15 shown, it is a schematic diagram of the effect of generating a virtual scene step by step in an embodiment. Among them, the computer device can first generate a three-dimensional terrain model 15a according to the three-dimensional space data, and then generate a building model 15b and a road model 15c in the three-dimensional terrain model 15a according to the scene distribution data. Then the computer device further generates a vegetation model in the three-dimensional terrain model 15a, thereby obtaining the final virtual scene 15d. By converting the data corresponding to the real scene into position information and then transmitting it to a preset editor plugin, a three-dimensional scene model is generated through the preset editor plugin, and attribute information such as materials is automatically attached, so as to quickly and automatically generate a virtual scene, making the procedural generation efficiency of the virtual scene relatively high and facilitating rapid iteration. Compared with the traditional method of procedurally generating virtual scenes, the time consumed by the virtual scene generation method in this embodiment can be reduced to half, greatly improving the efficiency of automatically generating virtual scenes.

[0217] As Figure 16 shown, it is a schematic diagram of the effects of the real scene and the virtual scene. Among them, the schematic diagram of the real scene can be illustrated by a satellite map or a photographic map, etc. Referring to Figure 16 , the real scene can include scene areas such as a wild scene area and a rural scene area. The real scene can be illustrated by a real scene satellite map. By obtaining the three-dimensional space data and scene distribution data corresponding to the real wild scene area 16a, the top view Figure 16 b of the virtual scene corresponding to the real wild scene area 16a can be generated according to the three-dimensional space data and the scene distribution data. By obtaining the three-dimensional space data and scene distribution data corresponding to the real rural scene area 16c, the top view Figure 16 d of the virtual scene corresponding to the real rural scene area 16c can be generated according to the three-dimensional space data and the scene distribution data. From Figure 16 the comparison diagram of the effects, it can be seen that the generated virtual scene has a high similarity to the real scene and a high degree of restoration of the real scene, accurately restoring the scene distribution in the real scene.

[0218] The present application also provides an application scenario, which is a three-dimensional game scenario, specifically applicable to a three-dimensional game scenario of the open world type. This three-dimensional game scenario applies the above virtual scene generation method. Specifically, in a three-dimensional game scenario of the open world type, there is an open world terrain, where the open world terrain is an open world-style mission space, usually including a very large-scale map corresponding to the open world terrain. Traditional three-dimensional game scenarios are usually generated by combining procedural tools based on manually specified information, such as range and height, relying on randomness to generate the large terrain in the three-dimensional game scenario. However, the terrain generated in this way may not conform to the real logic.

[0219] In this embodiment, the computer device can deploy a preset editor plugin in the game development system, that is, an editor program for making game scenarios. Specifically, the computer device first obtains the three-dimensional space data and scene distribution data corresponding to the real scene, and then extracts the terrain features from the three-dimensional space data through the preset editor plugin, and generates a three-dimensional terrain model according to the terrain features. And from the scene distribution data, extract the scene object features of the scene objects in the real scene. Furthermore, in the three-dimensional terrain model, generate a scene object model corresponding to the scene object features to obtain a three-dimensional virtual game scenario corresponding to the real scene. Thus, a three-dimensional game scenario similar to the real scene and conforming to the real logic can be generated efficiently and accurately.

[0220] The present application also additionally provides an application scenario, which is a three-dimensional environment simulation scenario, such as a traffic road simulation scenario, a tourism environment simulation scenario, a building simulation scenario, etc. This three-dimensional environment simulation scenario applies the above virtual scene generation method. For three-dimensional environment demonstration scenarios in various environments, a virtual scene similar to the real scene can be automatically generated.

[0221] Specifically, the computer device first obtains the three-dimensional space data and scene distribution data corresponding to the real scene within the preset area range, and then extracts the terrain features from the three-dimensional space data and generates a three-dimensional terrain model according to the terrain features. And from the scene distribution data, extract the scene object features of the scene objects in the real scene. Furthermore, in the three-dimensional terrain model, generate a scene object model corresponding to the scene object features to obtain a three-dimensional virtual demonstration scenario corresponding to the real scene. Thus, a three-dimensional environment simulation scenario similar to the real scene and conforming to the real logic can be generated efficiently and accurately.

[0222] Among them, based on the three-dimensional spatial data and scene distribution data corresponding to traffic roads in the real scene, a traffic road simulation scene that conforms to the traffic road distribution in the real scene can be automatically generated. The generated traffic road simulation scene can be used to assist the intelligent transportation system. For example, by displaying the generated traffic road simulation scene on the in-vehicle terminal, it can assist in identifying the current road environment to improve traffic efficiency.

[0223] Based on the three-dimensional spatial data and scene distribution data corresponding to the tourism environment or buildings in the real scene, a tourism environment simulation scene similar to the tourism environment in the real scene and a building simulation scene similar to the buildings in the real scene can be automatically generated. Thus, virtual scenes similar to the scene elements in the real scene can be efficiently and automatically generated, so that the scene environment and scene objects and other scene elements in the real scene can be accurately simulated and restored.

[0224] It should be understood that although Figure 2-3 the steps in the flowchart of Figure 2-3 are shown in sequence according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless there is a clear indication in this article, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover,

[0225] In one embodiment, as Figure 17 shown, a virtual scene generation device 1700 is provided. This device can adopt software modules or hardware modules, or a combination of both to become a part of a computer device. Specifically, the device includes: a data acquisition module 1702, a feature extraction module 1704, a terrain generation module 1706, and a scene generation module 1708, where:

[0226] The data acquisition module 1702 is used to acquire the three-dimensional spatial data and scene distribution data corresponding to the real scene.

[0227] The feature extraction module 1704 is used to extract terrain features from the three-dimensional spatial data.

[0228] The terrain generation module 1706 is used to generate a three-dimensional terrain model according to the terrain features.

[0229] The feature extraction module 1704 is also used to extract the scene object features of the scene objects in the real scene from the scene distribution data.

[0230] A scene generation module 1708, configured to generate a scene object model corresponding to the characteristics of a scene object in a three-dimensional terrain model, so as to obtain a virtual scene corresponding to the real scene.

[0231] In one embodiment, the three-dimensional space data includes terrain space data and coverage object space data; the feature extraction module 1704 is further configured to extract terrain features from the terrain space data; the terrain generation module 1706 is further configured to generate a three-dimensional terrain model according to the terrain features; determine a surface coverage area in the three-dimensional terrain model according to the coverage object space data; generate a surface coverage object in the surface coverage area, so as to obtain a three-dimensional terrain model including the surface coverage object.

[0232] In one embodiment, the feature extraction module 1704 is further configured to determine terrain features according to the height difference between adjacent terrain points in the terrain space data; the terrain generation module 1706 is further configured to determine the terrain type corresponding to each terrain area in the terrain space data according to the terrain features; add corresponding surface attribute information to the terrain area according to the terrain type; generate a three-dimensional terrain model according to the terrain space data after adding the surface attribute information.

[0233] In one embodiment, the terrain generation module 1706 is further configured to determine, in the three-dimensional terrain model, the terrain points corresponding to the surface coverage points in the coverage object space data; select target surface coverage points according to the height difference between the surface coverage points and the corresponding terrain points; determine the overlapping area between the expansion area and the three-dimensional terrain model; the expansion area is an area expanded based on the target surface coverage points; determine the surface coverage area in the three-dimensional terrain model according to the overlapping area.

[0234] In one embodiment, the terrain generation module 1706 is further configured to determine the generation parameter information of the surface coverage object in the surface coverage area; generate a surface coverage object in the surface coverage area according to the generation parameter information, so as to obtain a three-dimensional terrain model including the surface coverage object.

[0235] In one embodiment, the feature extraction module 1704 is further configured to determine the position and height of a scene object in the three-dimensional terrain model in the real scene based on the scene distribution data; generate three-dimensional scene object data corresponding to the scene object according to the position and height; extract the scene object features of the scene object from the three-dimensional scene object data.

[0236] In one embodiment, the feature extraction module 1704 is further configured to, if the scene distribution data includes the original position of the scene object in the real scene, determine the position and height of the scene object in the three-dimensional terrain model according to the original position; if the scene distribution data includes the original position and the original height of the scene object, determine the position and height of the scene object in the three-dimensional terrain model according to the original position and the original height.

[0237] In one embodiment, the scene generation module 1708 is also used to generate an initial scene object model corresponding to the scene object based on the scene object characteristics; add scene object attribute information that conforms to the object type to the corresponding initial scene object model based on the object type of the scene object to obtain a scene object model that matches the scene object; and add the scene object model to the three-dimensional terrain model to obtain a virtual scene corresponding to the real scene.

[0238] In one embodiment, the scene generation module 1708 is also used to determine the terrain area corresponding to the scene object model in the three-dimensional terrain model; smooth the terrain area to obtain a smoothed terrain area; add the scene object model to the smoothed terrain area in the three-dimensional terrain model to obtain a virtual scene corresponding to the real scene.

[0239] In one embodiment, the scene generation module 1708 is further used to determine the position area corresponding to the scene object model in the three-dimensional terrain model, and the adjacent area of ​​the position area, as the terrain area corresponding to the scene object model; update the height value of the position area according to the height difference between the bottom surface of the scene object model and the position area; and smooth the height value of the adjacent area according to the updated height value of the position area to obtain a smoothed terrain area.

[0240] In one embodiment, the above-mentioned virtual scene generation device 1700 also includes an alignment processing module, which is used to align the scene area corresponding to the scene distribution data with the scene area corresponding to the three-dimensional space data to obtain a scene alignment area; from the scene distribution data, select the scene distribution data that matches the scene alignment area to obtain the aligned scene distribution data; the data acquisition module 1702 is also used to obtain the three-dimensional space data corresponding to the real scene and the aligned scene distribution data.

[0241] In one embodiment, the scene distribution data includes point set data corresponding to the scene object; the alignment processing module is also used to, for scene objects of the first object type, if there is complete point set data of the scene object in the scene alignment area, select the complete point set data from the scene distribution data; if there is incomplete point set data of the scene object in the scene alignment area, remove the complete point set data corresponding to the scene object from the scene distribution data; for scene objects of the second object type, select the point set data of the scene object in the scene alignment area from the scene distribution data.

[0242] For the specific limitations of the virtual scene generation device, reference can be made to the limitations of the virtual scene generation method in the foregoing text, which will not be elaborated herein. Each module in the above virtual scene generation device can be implemented in whole or in part by software, hardware, and their combination. The above modules can be embedded in the processor of the computer device in hardware form or independent thereof, or stored in the memory of the computer device in software form, so as to facilitate the processor to call and execute the operations corresponding to the above respective modules.

[0243] In one embodiment, a computer device is provided. The computer device can be a server, and its internal structural diagram can be as Figure 18 shown. The computer device includes a processor, a memory, and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, it implements a virtual scene generation method.

[0244] In one embodiment, another computer device is provided. The computer device can be a terminal, and its internal structural diagram can be as Figure 19 shown. The computer device includes a processor, a memory, a communication interface, a display screen, and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner. The wireless manner can be achieved through WIFI, a carrier network, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a virtual scene generation method. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer covering the display screen, or a button, a trackball, or a touchpad provided on the housing of the computer device, or an external keyboard, a touchpad, or a mouse, etc.

[0245] Those skilled in the art can understand that Figure 18 and Figure 19The structure shown is only a block diagram of some of the structures related to the solution of this application, and does not constitute a limitation on the computer device to which the solution of this application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have a different component layout.

[0246] In one embodiment, a computer device is also provided, including a memory and a processor. A computer program is stored in the memory, and when the processor executes the computer program, the steps in the above method embodiments are implemented.

[0247] In one embodiment, a computer-readable storage medium is provided, storing a computer program, and when the computer program is executed by a processor, the steps in the above method embodiments are implemented.

[0248] In one embodiment, a computer program product or a computer program is provided. The computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device implements the steps in the above method embodiments.

[0249] Those of ordinary skill in the art can understand that all or part of the processes of implementing the methods in the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it may include the processes of the above method embodiments. Among them, any reference to a memory, storage, database, or other medium used in the various embodiments provided in this application may include at least one of non-volatile and volatile memories. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, or optical memory, etc. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.

[0250] The technical features of the above embodiments can be combined arbitrarily. For the sake of concise description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope recorded in this specification.

[0251] The above-described embodiments merely represent several implementation manners of the present application. The description thereof is relatively specific and detailed, but it should not be construed as a limitation on the scope of the invention patent. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all fall within the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the appended claims.

Claims

1. A virtual scene generation method, characterized in that, The method includes: Align the scene area corresponding to the scene distribution data with the scene area corresponding to the three-dimensional space data to obtain a scene alignment area; select the scene distribution data matching the scene alignment area from the scene distribution data to obtain the aligned scene distribution data. The scene distribution data includes the point set data corresponding to the scene object. When removing the redundant data outside the scene alignment area, determine whether to delete some of the point set data or the complete point set data in the point set data of the scene object according to the object type of the scene object. Obtain the three-dimensional space data corresponding to the real scene and the aligned scene distribution data. The scene distribution data refers to the distribution data of the scene elements in the real scene area, and the scene distribution data includes the plane distribution information of the scene object. Extract the terrain features from the three-dimensional space data. Generate a three-dimensional terrain model according to the terrain features. Extract the scene object features of the scene objects in the real scene from the scene distribution data, obtain the plane distribution information of the scene object from the scene distribution data. The plane distribution information includes the position area and height occupied by the scene object. Generate a scene object boundary box corresponding to the scene object according to the position area and height occupied by the scene object. Duplicate each point on the plane according to the height of the scene object to obtain the updated point set of the scene object. Place the original point set and the duplicated point set of the scene object in the same bounding box geometry, so as to convert the scene object boundary box into the three-dimensional space data corresponding to the scene object and mark the corresponding scene object features for the three-dimensional space data. Generate a scene object model corresponding to the scene object features in the three-dimensional terrain model to obtain a virtual scene corresponding to the real scene, including: automatically generate a scene object model corresponding to each scene object according to the scene object features of each scene object in the real scene in the scene distribution data, and add the scene object model to the corresponding position in the three-dimensional terrain model, so as to obtain a virtual scene corresponding to the real scene.

2. The method according to claim 1, wherein The three-dimensional space data includes terrain space data and coverage object space data; the extracting the terrain features from the three-dimensional space data includes: Extract the terrain features from the terrain space data. The generating a three-dimensional terrain model according to the terrain features includes: Generate a three-dimensional terrain model according to the terrain features. Determine the surface coverage area in the three-dimensional terrain model according to the coverage object space data. Generate surface coverage objects in the surface coverage area to obtain a three-dimensional terrain model including surface coverage objects.

3. The method according to claim 2, wherein The extracting the terrain features from the terrain space data includes: Determine the terrain features according to the height difference between adjacent terrain points in the terrain space data. The generating a three-dimensional terrain model according to the terrain features includes: Determine the terrain types corresponding to each terrain area in the terrain space data according to the terrain features. Add the corresponding surface attribute information to the terrain area according to the terrain type. Generate a three-dimensional terrain model according to the terrain space data after adding the surface attribute information.

4. The method according to claim 2, characterized in that, Determining the surface coverage area in the three-dimensional terrain model according to the spatial data of the coverage object includes: In the three-dimensional terrain model, determining the terrain points corresponding to the surface coverage points in the spatial data of the coverage object; Selecting target surface coverage points according to the height difference between the surface coverage points and the corresponding terrain points; Determining the overlapping area between the extended area and the three-dimensional terrain model; the extended area is an area extended based on the target surface coverage points; Determining the surface coverage area in the three-dimensional terrain model according to the overlapping area.

5. The method according to claim 2, characterized in that, Generating a surface coverage object in the surface coverage area to obtain a three-dimensional terrain model including the surface coverage object, including: Determining the generation parameter information of the surface coverage object in the surface coverage area; Generating a surface coverage object in the surface coverage area according to the generation parameter information to obtain a three-dimensional terrain model including the surface coverage object.

6. The method according to claim 1, wherein The scene distribution data includes at least one of map data or open-source road and terrain distribution data.

7. The method according to claim 6, characterized in that Based on the scene distribution data, determining the position and height of the scene object in the real scene in the three-dimensional terrain model, including: If the scene distribution data includes the original position of the scene object in the real scene, determining the position and height of the scene object in the three-dimensional terrain model according to the original position; If the scene distribution data includes the original position and the original height of the scene object, determining the position and height of the scene object in the three-dimensional terrain model according to the original position and the original height.

8. The method according to claim 1, wherein Generating a scene object model corresponding to the characteristics of the scene object in the three-dimensional terrain model to obtain a virtual scene corresponding to the real scene, including: Generating an initial scene object model corresponding to the scene object according to the characteristics of the scene object; Adding scene object attribute information conforming to the object type to the corresponding initial scene object model according to the object type of the scene object to obtain a scene object model matching the scene object; Adding the scene object model to the three-dimensional terrain model to obtain a virtual scene corresponding to the real scene.

9. The method according to claim 8, wherein Adding the scene object model to the three-dimensional terrain model to obtain a virtual scene corresponding to the real scene, including: Determining the terrain area corresponding to the scene object model in the three-dimensional terrain model; Performing smoothing processing on the terrain area to obtain a smoothed terrain area; Adding the scene object model to the smoothed terrain area in the three-dimensional terrain model to obtain a virtual scene corresponding to the real scene.

10. The method according to claim 9, wherein Determining the terrain area corresponding to the scene object model in the three-dimensional terrain model, including: Determining the position area corresponding to the scene object model in the three-dimensional terrain model and the adjacent areas of the position area as the terrain area corresponding to the scene object model; Performing smoothing processing on the terrain area to obtain a smoothed terrain area, including: Update the height value of the position area according to the height difference between the bottom surface of the scene object model and the position area; Smooth the height value of the adjacent area according to the updated height value of the position area to obtain a smoothed terrain area.

11. The method according to claim 1, characterized in that The scene distribution data includes point set data corresponding to scene objects; selecting the scene distribution data matching the scene alignment area from the scene distribution data includes: For a scene object of the first object type, if the complete point set data of the scene object exists in the scene alignment area, select the complete point set data from the scene distribution data; If the incomplete point set data of the scene object exists in the scene alignment area, exclude the complete point set data corresponding to the scene object from the scene distribution data; For a scene object of the second object type, select the point set data of the scene object in the scene alignment area from the scene distribution data.

12. A virtual scene generation device, characterized in that, The device includes: A data acquisition module, configured to align the scene area corresponding to the scene distribution data with the scene area corresponding to the three-dimensional space data to obtain a scene alignment area; select the scene distribution data matching the scene alignment area from the scene distribution data to obtain the aligned scene distribution data. The scene distribution data includes point set data corresponding to scene objects. When removing redundant data outside the scene alignment area, determine whether to delete part of the point set data or the complete point set data in the point set data of the scene object according to the object type of the scene object, and obtain the three-dimensional space data corresponding to the real scene and the aligned scene distribution data. The scene distribution data refers to the distribution data of scene elements in the real scene area, and the scene distribution data includes the plane distribution information of scene objects; A feature extraction module, configured to extract terrain features from the three-dimensional space data; A terrain generation module, configured to generate a three-dimensional terrain model according to the terrain features; The feature extraction module is further configured to extract the scene object features of the scene objects in the real scene from the scene distribution data, obtain the plane distribution information of the scene objects from the scene distribution data. The plane distribution information includes the position area and height occupied by the scene objects. According to the position area and height occupied by the scene objects, generate a scene object boundary box corresponding to the scene object, copy each point on the plane according to the height of the scene object, so as to obtain the updated point set of the scene object, and place the original point set and the copied point set of the scene object in the same boundary box geometry, so as to convert the scene object boundary box into the three-dimensional space data corresponding to the scene object, and mark the corresponding scene object features for the three-dimensional space data; A scene generation module, configured to generate a scene object model corresponding to the scene object features in the three-dimensional terrain model, so as to obtain a virtual scene corresponding to the real scene, including: automatically generating a scene object model corresponding to each scene object according to the scene object features of each scene object in the real scene in the scene distribution data, and adding the scene object model to a corresponding position in the three-dimensional terrain model, thereby obtaining a virtual scene corresponding to the real scene.

13. A computer device, comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, the steps of the method according to any one of claims 1 to 11 are implemented.

14. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, the steps of the method according to any one of claims 1 to 11 are implemented.

Citation Information

Patent Citations

  • Motion simulation and control method and device for agricultural equipment in virtual scene

    CN102194022A

  • Method for building robot simulation drilling system based on reality scene

    CN104484522A