Three-dimensional terrain modeling method, device and equipment and storage medium

By using a trained topographic map generation model, a diffusion model and a quantization decoder, combined with prompts and conditional guidance maps, adaptive 3D terrain modeling was achieved. This solved the problems of high usage threshold and difficulty in local modification in existing technologies, and improved the realism of the modeling and intelligent editing capabilities.

CN121937656APending Publication Date: 2026-04-28SHENZHEN EXPRESSWAY ENG CONSULTANTS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHENZHEN EXPRESSWAY ENG CONSULTANTS CO LTD
Filing Date
2024-08-26
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

Existing technologies cannot adaptively perform refined 3D terrain modeling, have a high barrier to entry, and do not support natural language programming and adaptive local modification of 3D terrain.

Method used

Using a pre-trained topographic map generation model, including a diffusion model and a quantization decoder, it generates a target 3D topographic digital elevation map by inputting prompts, and supports local modifications and the use of condition-guided maps, simplifying the modeling process.

Benefits of technology

It achieves adaptive 3D terrain modeling, lowers the barrier to entry, requires no extensive modeling experience or programming knowledge, supports natural language input and fine-grained, localized modifications to 3D terrain, and enhances the realism of the modeling and intelligent editing capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121937656A_ABST
    Figure CN121937656A_ABST
Patent Text Reader

Abstract

The invention is suitable for the technical field of image processing, and provides a three-dimensional terrain modeling method, device and equipment and a storage medium, and the method comprises the steps: obtaining cue words, inputting the cue words into a trained topographic map generation model, and obtaining a target three-dimensional terrain digital elevation map, the topographic map generation model comprises a diffusion model and a quantization decoder which are connected in sequence, the quantization decoder is used for decoding the RGB image output by the diffusion model into a target three-dimensional topographic digital elevation map, and a target three-dimensional topographic map is generated according to the target three-dimensional topographic digital elevation map, so that three-dimensional topographic modeling can be adaptively carried out by obtaining cue words, and the three-dimensional topographic map generation efficiency is improved. And the scheme is simple to use, and only common natural languages need to be input.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of the application filed with the China National Intellectual Property Administration on August 26, 2024, with application number 202411177188.7 and invention title "Three-dimensional terrain modeling method, apparatus, device and storage medium". Technical Field

[0002] This invention belongs to the field of image processing technology, and in particular relates to a three-dimensional terrain modeling method, apparatus, device and storage medium. Background Technology

[0003] In recent years, numerous fields such as BIM (Building Information Modeling), virtual reality, and digital twins have frequently required large-scale terrain scene displays, with a trend towards greater refinement, realism, scale, and diversity. Traditional terrain generation algorithms, such as quadtree terrain generation algorithms, are only suitable for simple terrains. While GeoMipmap and moving cube algorithms can generate high-precision terrain, they cannot adaptively refine and model diverse terrains such as deserts, grasslands, mountains, and hills. Other complex terrain generation algorithms require users to have extensive modeling experience and to preset complex parameters, raising the barrier to entry and limiting their widespread application. Furthermore, all currently popular terrain generation algorithms do not support prompts, making it impossible to use natural language programming to set details in terrain modeling and generation, nor do they support adaptive local modifications to 3D terrain. Summary of the Invention

[0004] The purpose of this invention is to provide a three-dimensional terrain modeling method, apparatus, device, and storage medium, aiming to solve the problem that existing technologies cannot adaptively perform refined modeling.

[0005] On the one hand, the present invention provides a three-dimensional terrain modeling method, the method comprising the following steps: Get the prompt words; The prompt words are input into a trained topographic map generation model to obtain a target three-dimensional topographic digital elevation map. The topographic map generation model includes a diffusion model and a quantization decoder connected in sequence. The quantization decoder is used to decode the RGB image output by the diffusion model into the target three-dimensional topographic digital elevation map. Generate a target three-dimensional terrain map based on the target three-dimensional terrain digital elevation map.

[0006] Optionally, the training steps of the topographic map generation model include: Obtain an initial training dataset, wherein each initial sample pair in the initial training dataset includes a three-dimensional terrain digital elevation map and a corresponding prompt word; Encode the three-dimensional terrain digital elevation map in each initial sample pair into an RGB image to obtain the target training dataset; The terrain map generation model is trained using the target training dataset to obtain the trained terrain map generation model.

[0007] Optionally, the diffusion model is a diffusion model based on stable diffusion.

[0008] Optionally, the loss function used during the training of the topographic map generation model includes a regularization loss term and a gradient loss term. The regularization loss term is used to measure the similarity between the three-dimensional topographic digital elevation map generated by the topographic map generation model and the real three-dimensional topographic digital elevation map, and the gradient loss term is used to measure the degree of height variation of the topographic structure.

[0009] Optionally, the regularization loss term is calculated using the following formula: ; in, This represents the regularization loss value. This refers to the three-dimensional digital elevation map of the terrain generated by the topographic map generation model. A digital elevation map representing the true three-dimensional terrain.

[0010] Optionally, the gradient loss term is calculated using the following formula: ; ; ; in, This represents the gradient loss value. This represents the gradient value corresponding to pixel [i,j] in the generated RGB image. This represents the gradient value corresponding to pixel [i,j] in a real RGB image. , , These represent the elevation values ​​corresponding to pixels [i+1,j], [i,j], and [i,j+1] in the generated RGB image, respectively. , , These represent the elevation values ​​corresponding to pixels [i+1,j], [i,j], and [i,j+1] in the actual RGB image, respectively.

[0011] Optionally, the step of encoding the three-dimensional terrain digital elevation map in each of the initial sample pairs into an RGB image includes: The three-dimensional terrain digital elevation map in the initial sample pair is subjected to a first quantization encoding to obtain a first channel data map; The second channel data map is obtained by performing a second quantization encoding on the three-dimensional terrain digital elevation map in the initial sample pair based on the first channel data map. The three-dimensional terrain digital elevation map in the initial sample pair is quantized and encoded using the first channel data map and the second channel data map to obtain the third channel data map; The encoded RGB image is obtained based on the first channel data, the second channel data, and the third channel data.

[0012] Optionally, the formula used for the first quantization encoding is: ; ; ; Where H represents any elevation value in the three-dimensional terrain digital elevation map of the initial sample pair, and R represents the R component in the first channel data map corresponding to that elevation value; The formula used for the second quantization encoding is: ; Wherein, G represents the G component in the second channel data map corresponding to the elevation value; The formula used for the third quantization encoding is: ; Wherein, B represents the B component in the third channel data map corresponding to the elevation value; The formula used by the quantization decoder during decoding is: ; ; ; Wherein, R, G, and B represent the R component, G component, and B component of any pixel in the RGB image output by the diffusion model, respectively, and H represents the elevation value corresponding to that pixel in the target three-dimensional terrain digital elevation map.

[0013] Optionally, the step of inputting the prompt words into a trained topographic map generation model to obtain a target three-dimensional topographic digital elevation map further includes: The prompt words are input into the trained terrain map generation model to obtain an initial three-dimensional terrain digital elevation map. Obtain the areas requiring local modification on the initial 3D terrain digital elevation map; The trained topographic map generation model is used to regenerate a three-dimensional digital elevation map of the area, thus obtaining the target three-dimensional digital elevation map of the terrain.

[0014] Optionally, the method further includes: Get locally modified parameters; The step of regenerating a three-dimensional digital elevation map of the region using the trained topographic map generation model further includes: Based on the locally modified parameters, a three-dimensional digital elevation map of the terrain within the region is regenerated using the trained terrain map generation model.

[0015] Optionally, before the step of generating a target three-dimensional terrain map based on the target three-dimensional terrain digital elevation map, the method further includes: Obtain the conditional guidance graph; The prompt words and the conditional guidance map are input into the trained terrain map generation model to obtain the target three-dimensional terrain digital elevation map, wherein the conditional guidance map is used to guide the diffusion model to generate the target three-dimensional terrain digital elevation map.

[0016] On the other hand, the present invention provides a three-dimensional terrain modeling device, the device comprising: The prompt word acquisition unit is used to acquire prompt words; An elevation map generation unit is used to input the prompt words into a trained topographic map generation model to obtain a target 3D topographic digital elevation map. The topographic map generation model includes a diffusion model and a quantization decoder connected in sequence. The quantization decoder is used to decode the RGB image output by the diffusion model into the target 3D topographic digital elevation map. The topographic map generation unit is used to generate a target three-dimensional topographic map based on the target three-dimensional topographic digital elevation map.

[0017] On the other hand, the present invention also provides a three-dimensional terrain modeling device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the method described above.

[0018] On the other hand, the present invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the method described above.

[0019] This invention obtains prompt words and inputs them into a trained topographic map generation model to obtain a target 3D topographic digital elevation map. The topographic map generation model includes a diffusion model and a quantization decoder connected in sequence. The quantization decoder is used to decode the RGB image output by the diffusion model into the target 3D topographic digital elevation map. Based on the target 3D topographic digital elevation map, a target 3D topographic map is generated. Thus, 3D topographic modeling can be adaptively performed by obtaining prompt words. Moreover, this solution is simple to use and does not require users to have extensive modeling experience, programming knowledge, or complex parameter presets. Only ordinary natural language input is needed. Attached Figure Description

[0020] Figure 1 This is a flowchart illustrating the implementation of the three-dimensional terrain modeling method provided in Embodiment 1 of the present invention; Figure 2A It is an initial three-dimensional terrain digital elevation map generated by the terrain map generation model provided in Embodiment 1 of the present invention; Figure 2B This is provided in Embodiment 1 of the present invention. Figure 2A A 3D digital elevation map of the terrain after the local modified areas are marked; Figure 2C This is the method provided in Embodiment 1 of the present invention. Figure 2B The image shows a modified 3D terrain digital elevation map of the localized modified area. Figure 3A This is a conditional guidance diagram provided in Embodiment 1 of the present invention; Figure 3B The method provided in Embodiment 1 of the present invention is as follows: Figure 3A A target 3D terrain digital elevation map is generated as a conditional guidance map; Figure 3C This is based on the embodiment of the present invention. Figure 3B A generated 3D terrain map of a single target; Figure 4 This is a flowchart illustrating the implementation of the terrain map generation model training method provided in Embodiment 2 of the present invention. Figure 5 This is a schematic diagram of the topographic map generation device provided in Embodiment 3 of the present invention; and Figure 6 This is a schematic diagram of the topographic map generation device provided in Embodiment 4 of the present invention. Detailed Implementation

[0021] To make the objectives, technical solutions, and advantages of this invention clearer, the invention 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 merely illustrative and not intended to limit the invention.

[0022] The specific implementation of the present invention will be described in detail below with reference to specific embodiments: Example 1

[0023] Figure 1 The implementation flow of the three-dimensional terrain modeling method provided in Embodiment 1 of the present invention is shown. For ease of explanation, only the parts related to the embodiments of the present invention are shown, and are described in detail below.

[0024] In step S101, the prompt word is obtained.

[0025] This invention is applicable to three-dimensional terrain modeling, that is, the surface morphology can be digitally expressed through three-dimensional modeling. The three-dimensional terrain can be desert, grassland, mountains, hills, etc., and this embodiment does not impose specific limitations. The prompt word can include the type of terrain, such as desert, grassland, mountains, hills, etc. Optionally, the prompt word can also include adjectives related to the type of terrain, such as "arid desert," "boundless grassland," or "precipitous mountains," etc., to facilitate the subsequent setting of details in the three-dimensional terrain map based on the prompt word.

[0026] In step S102, the prompt words are input into the trained topographic map generation model to obtain the target three-dimensional topographic digital elevation map.

[0027] In this embodiment of the invention, the topographic map generation model includes a diffusion model and a quantization decoder connected in sequence. The quantization decoder is used to decode the RGB image output by the diffusion model into a target three-dimensional topographic digital elevation map. The implementation process of the topographic map generation model training method can be referred to the description of Embodiment 2, and will not be repeated in this embodiment.

[0028] In practice, a diffusion model can be used to output an image corresponding to the prompt word. The diffusion model can be a model such as DALL-E3, or optionally a Stable Diffusion model. Taking the stable diffusion model as an example, the text encoder in the stable diffusion model can generate an embedding representation of size [B, k, E] for the prompt word, and then randomly generate noise of size [B, C, H / 8, W / 8]. Based on the U-Net model in the stable diffusion model, algorithms such as DDPM (Denoising Diffusion Probabilistic Models) and DDIM (Denoising Diffusion Implicit Models) are used iteratively and progressively to denoise the image, ultimately recovering the latent variable implicit representation of the image. Finally, an image decoder is used to decode and generate the final RGB image based on the input implicit representation.

[0029] Optionally, the formula used by the quantization decoder during decoding is: ; ; ; Here, R, G, and B represent the R, G, and B components of any pixel in the RGB image output by the diffusion model, respectively, and H represents the elevation value corresponding to that pixel in the target 3D terrain digital elevation map. This quantization decoder can represent a very large data range, from -18446744073709551616 to 18446744073709551616, and can also represent both positive and negative numbers. It can represent both low plains and high mountains without losing detailed information.

[0030] Considering that the initial 3D digital elevation map (DEM) generated by the topographic map generation model may not be satisfactory and requires multiple modifications and edits, alternatively, prompts can be input into a trained topographic map generation model to obtain an initial 3D DEM. The areas requiring local modification on this initial DEM can then be identified. The trained topographic map generation model can then regenerate the 3D DEM within these areas to obtain the target 3D DEM, thus achieving local modification of the 3D DEM. Specifically, a mask area drawn by the user can be obtained, representing the local area requiring modification. The 3D DEM within this area is then regenerated based on the topographic map generation model. This process can be repeated until the desired 3D DEM, i.e., the target 3D DEM, is generated. When regenerating the 3D DEM within the area based on the topographic map generation model, the terrain portion requiring modification can be reset to a random number and then re-inputted into the topographic map generation model to output a new result based on the original.

[0031] When making local modifications to a 3D terrain digital elevation map, optionally, local modification parameters can be obtained. Based on these parameters, a trained terrain map generation model can be used to regenerate the 3D terrain digital elevation map of the area, thereby improving the efficiency of local modifications. In practice, parameters such as a redrawing coefficient for local modifications can be set, where a higher redrawing coefficient indicates a greater extent of modification.

[0032] As an example, such as Figure 2A-2C As shown, Figure 2A An initial 3D digital elevation map of the terrain generated for the topographic map generation model; Figure 2B In order to be in Figure 2A On the 3D terrain digital elevation map shown, use the black brush tool to paint over the local modification areas marked on the mask; Figure 2C To Figure 2B The three-dimensional terrain digital elevation map obtained after regenerating the locally modified area is shown.

[0033] Considering that the regenerated or modified 3D terrain digital elevation maps using the above methods still suffer from significant randomness and may not achieve the desired accuracy, alternatively, a conditional guidance map can be obtained. The prompts and the conditional guidance map are then input into a trained terrain map generation model to obtain the target 3D terrain digital elevation map. This allows the generation process of the target 3D terrain digital elevation map to be guided by the conditional guidance map, effectively controlling the approximate terrain structure and achieving intelligent editing and optimization of the 3D terrain. Specifically, the conditional guidance map is used to guide the diffusion model in generating the target 3D terrain digital elevation map.

[0034] Optionally, when the prompt contains terrain type and adjectives related to the terrain type, the terrain map generation model generates a target 3D terrain digital elevation map that matches the terrain type and the adjectives related to the terrain type.

[0035] In step S103, a target three-dimensional terrain map is generated based on the target three-dimensional terrain digital elevation map.

[0036] In this embodiment of the invention, the target 3D terrain digital elevation map can be modeled or rendered to obtain the target 3D terrain map. Specifically, computer graphics software such as Unity or Unreal Engine can be used to draw the target 3D terrain digital elevation map onto a computer screen. Furthermore, some special rendering techniques, such as global illumination, ray tracing, and radiometric lighting algorithms, can be used to enhance the realism and visual effects of the terrain.

[0037] As an example, Figure 3A This is a conditional guidance map used in the process of generating a target 3D terrain digital elevation map. Figure 3B To adopt Figure 3A The target 3D terrain digital elevation map is generated as a conditional guidance map. Figure 3C To render the program Figure 3B The three-dimensional terrain digital elevation map shown is used to draw a near-realistic three-dimensional terrain map of the target.

[0038] In this embodiment of the invention, prompt words are obtained and input into a trained topographic map generation model to obtain a target 3D topographic digital elevation map. The topographic map generation model includes a diffusion model and a quantization decoder connected in sequence. The quantization decoder is used to decode the RGB image output by the diffusion model into the target 3D topographic digital elevation map. The target 3D topographic map is generated based on the target 3D topographic digital elevation map. Thus, 3D topographic modeling can be adaptively performed by obtaining prompt words, and the realism of 3D topographic modeling is greatly improved. In addition, this solution can support adaptive local modification and intelligent editing optimization of 3D topographic terrain. Furthermore, this solution is simple to use and does not require users to have any rich modeling experience, programming knowledge, or complex parameter presets. Only ordinary natural language input is required. Example 2

[0039] Figure 4 The implementation flow of the training method for the topographic map generation model provided in Embodiment 2 of the present invention is shown. For ease of explanation, only the parts related to the embodiments of the present invention are shown, and are described in detail below.

[0040] In step S201, an initial training dataset is obtained. Each initial sample pair in the initial training dataset includes a three-dimensional terrain digital elevation map and a corresponding prompt word.

[0041] In this embodiment of the invention, the initial training dataset may include a 3D terrain digital elevation map dataset and a corresponding prompt word dataset. When acquiring the 3D terrain digital elevation map dataset, various methods such as remote sensing, laser scanning, and radar detection can be used to collect data on the real 3D terrain structure. After acquiring the real 3D terrain structure, the acquired terrain data can be processed, such as data cleaning, format conversion, and noise reduction. Then, the processed data can be organized into the initial 3D terrain digital elevation map dataset. After organizing the initial 3D terrain digital elevation map dataset, the dataset can be further expanded, for example, by performing various operations such as flipping, rotating, and cropping the 3D terrain digital elevation map to obtain the final 3D terrain digital elevation map dataset.

[0042] After obtaining the 3D terrain digital elevation map dataset, it can be labeled. Labeling methods include manual labeling and machine labeling. For manual labeling, prompts can be added to a single 3D terrain digital elevation map. These prompts can include specific terrain types, such as desert, grassland, mountains, and hills. Furthermore, prompts can include adjectives related to terrain details, such as "arid desert" or "precipitous mountains." For machine labeling, to further enrich the labeled data, the "image-to-text" function of diffusion models such as stable diffusion can be used to generate corresponding prompts for the terrain elevation map.

[0043] In step S202, the three-dimensional terrain digital elevation map in each initial sample pair is encoded into an RGB image to obtain the target training dataset.

[0044] In this embodiment of the invention, to achieve quantization encoding from a 3D terrain digital elevation map to an RGB image, optionally, the 3D terrain digital elevation map in the initial sample pair is subjected to a first quantization encoding to obtain a first channel data map; the 3D terrain digital elevation map in the initial sample pair is subjected to a second quantization encoding based on the first channel data map to obtain a second channel data map; the 3D terrain digital elevation map in the initial sample pair is subjected to a third quantization encoding based on the first channel data map and the second channel data map to obtain a third channel data map; and the encoded RGB image is obtained based on the first channel data map, the second channel data map, and the third channel data map, i.e., the encoded RGB image of the 3D terrain digital elevation map in the initial sample pair is obtained.

[0045] Optionally, the formula used for the first quantization encoding is: ; ; ; Where H represents any elevation value in the 3D terrain digital elevation map of the initial sample pair, and R represents the R component in the first channel data map corresponding to that elevation value. Indicates rounding down; The formula used for the second quantization encoding is: ; Wherein, G represents the G component in the second channel data map corresponding to the elevation value; The formula used for the third quantization encoding is: ; Here, B represents the B component in the third channel data map corresponding to the elevation value. The quantization encoding using the above formula can represent a very large range of data, from -18446744073709551616 to 18446744073709551616. It can also represent both positive and negative numbers, and can represent both low plains and high mountains without losing detailed information.

[0046] In step S203, the topographic map generation model is trained using the target training dataset to obtain a trained topographic map generation model.

[0047] In this embodiment of the invention, the stable diffusion model is used as an example. The stable diffusion model includes a text encoder, an image encoder, and a U-Net model. First, in the encoding first stage, i.e. the encoder_first_stage stage, the input RGB image can be mapped to the latent variable space based on the already trained image encoder. The input image size is [B,C,H,W], and the output implicit expression is [B,C,H / 8,W / 8].

[0048] Secondly, in the learning condition stage, namely the get_learned_conditioning stage, based on the already trained text encoder, the prompt words are encoded into an embedding representation of size [B,K,E], where B represents the batch size used in the calculation, K represents the maximum length of the text encoding, and E represents the size of the embedding dimension.

[0049] Then, in the forward propagation stage, noise is added to the implicit representation of the image in the latent variable space, and the U-Net model is used to estimate and train the noise addition process. The U-Net model also takes the text encoding embedding as input as a condition and uses an attention mechanism to learn the matching relationship between the text and the image. The U-Net model will output the predicted value of the noise, calculate the error between the predicted value and the real noise as the loss, and update the U-Net model parameters during the backpropagation process, while the image encoder and text encoder remain fixed.

[0050] When training a topographic map generation model, the loss function of the diffusion model can be used. In order to make the generated topographic map more realistic, the calculation of model loss during training can be improved, that is, other loss terms can be added on the basis of the existing loss function. Optionally, the loss function used when training the topographic map generation model also includes a regularization loss term. The regularization loss term is used to measure the similarity between the three-dimensional topographic digital elevation map generated by the topographic map generation model and the real three-dimensional topographic digital elevation map.

[0051] Alternatively, the regularization loss term can be calculated using the following formula: ; in, This represents the regularization loss value. This represents a 3D digital elevation map of the terrain generated by the topographic map generation model. A digital elevation map representing the true three-dimensional terrain.

[0052] Optionally, the loss function used during the training of the topographic map generation model also includes a gradient loss term, which measures the degree of height variation of the terrain structure. In practice, the gradient value can be calculated based on the elevation data, and this gradient calculation process can be implemented using a template convolution operation.

[0053] Alternatively, the gradient loss term can be calculated using the following formula: ; ; ; in, This represents the gradient loss value. This represents the gradient value corresponding to pixel [i,j] in the generated RGB image. This represents the gradient value corresponding to pixel [i,j] in a real RGB image. , , These represent the elevation values ​​corresponding to pixels [i+1,j], [i,j], and [i,j+1] in the generated RGB image, respectively. , , These represent the elevation values ​​corresponding to pixels [i+1,j], [i,j], and [i,j+1] in the actual RGB image, respectively.

[0054] In practice, regularization loss and gradient loss terms can be added to the existing loss function to measure the spatial structure similarity of the topographic map (RGB map) output by the diffusion model, making the gradient information of the terrain more accurate and the generated topographic map (RGB map) more realistic.

[0055] In this embodiment of the invention, an initial training dataset is obtained. Each initial sample pair in the initial training dataset includes a 3D terrain digital elevation map and a corresponding prompt word. The 3D terrain digital elevation map in each initial sample pair is encoded as an RGB image to obtain a target training dataset. The topographic map generation model is trained using the target training dataset to obtain a trained topographic map generation model. Since this scheme adopts a diffusion model based on deep learning, it can use real 3D terrain data as training data. Therefore, the trained topographic map generation model has a significant improvement in the realism of 3D terrain modeling. At the same time, for a variety of terrain structures, only the relevant dataset needs to be input, and the deep learning model can adaptively generate a variety of terrains without manual parameter tuning. Finally, this scheme can also support inputting prompt words to train the model's output, thereby improving the performance of the topographic map generation model in terms of detail. Example 3

[0056] Figure 5 The structure of the three-dimensional terrain modeling device provided in Embodiment 3 of the present invention is shown. For ease of explanation, only the parts related to the embodiments of the present invention are shown, including those parts.

[0057] Prompt word acquisition unit 31 is used to acquire prompt words; The elevation map generation unit 32 is used to input prompt words into a trained topographic map generation model to obtain a target 3D topographic digital elevation map. The topographic map generation model includes a diffusion model and a quantization decoder connected in sequence. The quantization decoder is used to decode the RGB image output by the diffusion model into the target 3D topographic digital elevation map. The topographic map generation unit 33 is used to generate a target three-dimensional topographic map based on the target three-dimensional topographic digital elevation map.

[0058] Optionally, the device further includes: The dataset acquisition unit is used to acquire the initial training dataset. Each initial sample pair in the initial training dataset includes a 3D terrain digital elevation map and a corresponding prompt word. A quantization encoding unit is used to encode the 3D terrain digital elevation map in each initial sample pair into an RGB image, thus obtaining the target training dataset; and The model training unit is used to train the topographic map generation model using the target training dataset to obtain a trained topographic map generation model.

[0059] Optionally, the diffusion model is a stable diffusion-based diffusion model. The loss function used during the training of the topographic map generation model includes a regularization loss term and a gradient loss term. The regularization loss term is used to measure the similarity between the three-dimensional topographic digital elevation map generated by the topographic map generation model and the real three-dimensional topographic digital elevation map, and the gradient loss term is used to measure the degree of height variation of the terrain structure.

[0060] Optionally, the regularization loss term is calculated using the following formula: ; in, This represents the regularization loss value. This represents a 3D digital elevation map of the terrain generated by the topographic map generation model. A digital elevation map representing the true three-dimensional terrain.

[0061] Alternatively, the gradient loss term can be calculated using the following formula: ; ; ; in, This represents the gradient loss value. This represents the gradient value corresponding to pixel [i,j] in the generated RGB image. This represents the gradient value corresponding to pixel [i,j] in a real RGB image. , , These represent the elevation values ​​corresponding to pixels [i+1,j], [i,j], and [i,j+1] in the generated RGB image, respectively. , , These represent the elevation values ​​corresponding to pixels [i+1,j], [i,j], and [i,j+1] in the actual RGB image, respectively.

[0062] Optionally, the quantization coding unit is also used for: The three-dimensional terrain digital elevation map in the initial sample pair is first quantized and encoded to obtain the first channel data map; The second channel data map is obtained by performing a second quantization encoding on the three-dimensional terrain digital elevation map in the initial sample pair based on the first channel data map. Based on the first and second channel data maps, the three-dimensional terrain digital elevation maps in the initial sample pair are subjected to third quantization encoding to obtain the third channel data map; The encoded RGB image is obtained based on the data from the first channel, the second channel, and the third channel.

[0063] Optionally, the formula used for the first quantization encoding is: ; ; ; Where H represents any elevation value in the 3D terrain digital elevation map of the initial sample pair, and R represents the R component in the first channel data map corresponding to that elevation value. Indicates rounding down; The formula used for the second quantization encoding is: ; Wherein, G represents the G component in the second channel data map corresponding to the elevation value; The formula used for the third quantization encoding is: ; Where B represents the B component in the third channel data map corresponding to the elevation value.

[0064] The formula used by the quantization decoder during decoding is: ; ; ; Where R, G, and B represent the R, G, and B components of any pixel in the RGB image output by the diffusion model, respectively, and H represents the elevation value corresponding to that pixel in the target 3D terrain digital elevation map.

[0065] Optionally, the topographic map generation unit 33 is also used for: Input the prompt words into the trained terrain map generation model to obtain the initial 3D terrain digital elevation map; Obtain the areas requiring local modification on the initial 3D terrain digital elevation map; The target three-dimensional terrain digital elevation map is obtained by regenerating the three-dimensional terrain digital elevation map of the area using a trained terrain map generation model.

[0066] Optionally, the device further includes: The local modification parameter acquisition unit is used to acquire local modification parameters; The elevation map generation unit is also used to regenerate a three-dimensional digital elevation map of the region based on locally modified parameters and a trained topographic map generation model.

[0067] Optionally, the device further includes: The guide graph acquisition unit is used to acquire conditional guide graphs; The elevation map generation unit is also used to input prompt words and conditional guidance maps into the trained topographic map generation model to obtain the target three-dimensional topographic digital elevation map. The conditional guidance map is used to guide the diffusion model to generate the target three-dimensional topographic digital elevation map.

[0068] In this embodiment of the invention, each unit of the three-dimensional terrain modeling device can be implemented by corresponding hardware or software units. Each unit can be an independent hardware or software unit, or it can be integrated into a single hardware or software unit, which is not intended to limit the invention. Specific implementation methods for each unit of the three-dimensional terrain modeling device can be found in the description of the foregoing method embodiments, and will not be repeated here. Example 4

[0069] Figure 6 The structure of the three-dimensional terrain modeling device provided in Embodiment 4 of the present invention is shown. For ease of explanation, only the parts related to the embodiments of the present invention are shown.

[0070] The three-dimensional terrain modeling device 4 of this embodiment includes a processor 40, a memory 41, and a computer program 42 stored in the memory 41 and executable on the processor 40. When the processor 40 executes the computer program 42, it implements the steps described in the above method embodiments, for example... Figure 1 The steps S101 to S103 are shown. Alternatively, when the processor 40 executes the computer program 42, it implements the functions of each unit in the above-described device embodiments, for example... Figure 5 The functions of units 31 to 33 are shown. Example 5

[0071] In this embodiment of the invention, a computer-readable storage medium is provided, which stores a computer program that, when executed by a processor, implements the steps in the method embodiments described above. For example... Figure 1 The steps S101 to S103 shown are, for example, Figure 4 The steps S201 to S203 are shown. Alternatively, when the computer program is executed by a processor, it implements the functions of each unit in the above-described device embodiments, for example... Figure 5 The functions of units 31 to 33 are shown.

[0072] The computer-readable storage medium in embodiments of the present invention may include any entity or device capable of carrying computer program code, a recording medium, such as ROM / RAM, disk, optical disk, flash memory, etc.

[0073] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A three-dimensional terrain modeling method, characterized in that, The method includes: Get the prompt words; The prompt words are input into a trained topographic map generation model to obtain a target three-dimensional topographic digital elevation map. The topographic map generation model includes a diffusion model and a quantization decoder connected in sequence. The quantization decoder is used to decode the RGB image output by the diffusion model into the target three-dimensional topographic digital elevation map. Generate a target three-dimensional terrain map based on the target three-dimensional terrain digital elevation map; The formula used by the quantization decoder during decoding is: ; ; ; Wherein, R, G, and B represent the R component, G component, and B component of any pixel in the RGB image output by the diffusion model, respectively, and H represents the elevation value corresponding to that pixel in the target three-dimensional terrain digital elevation map.

2. The method as described in claim 1, characterized in that, The training steps for the topographic map generation model include: Obtain an initial training dataset, wherein each initial sample pair in the initial training dataset includes a three-dimensional terrain digital elevation map and a corresponding prompt word; Encode the three-dimensional terrain digital elevation map in each initial sample pair into an RGB image to obtain the target training dataset; The terrain map generation model is trained using the target training dataset to obtain the trained terrain map generation model.

3. The method as described in claim 1 or 2, characterized in that, The diffusion model is a diffusion model based on stable diffusion.

4. The method as described in claim 2, characterized in that, The step of encoding the three-dimensional terrain digital elevation map in each of the initial sample pairs into an RGB image includes: The three-dimensional terrain digital elevation map in the initial sample pair is subjected to a first quantization encoding to obtain a first channel data map; The second channel data map is obtained by performing a second quantization encoding on the three-dimensional terrain digital elevation map in the initial sample pair based on the first channel data map. The three-dimensional terrain digital elevation map in the initial sample pair is quantized and encoded using the first channel data map and the second channel data map to obtain the third channel data map; The encoded RGB image is obtained based on the first channel data, the second channel data, and the third channel data.

5. The method as described in claim 4, characterized in that, The formula used for the first quantization encoding is: ; ; ; Where H represents any elevation value in the three-dimensional terrain digital elevation map of the initial sample pair, and R represents the R component in the first channel data map corresponding to that elevation value; The formula used for the second quantization encoding is: ; Wherein, G represents the G component in the second channel data map corresponding to the elevation value; The formula used for the third quantization encoding is: ; Where B represents the B component in the third channel data map corresponding to the elevation value.

6. The method as described in claim 1, characterized in that, The step of inputting the prompt words into a trained topographic map generation model to obtain a target 3D topographic digital elevation map further includes: The prompt words are input into the trained terrain map generation model to obtain an initial three-dimensional terrain digital elevation map. Obtain the areas requiring local modification on the initial 3D terrain digital elevation map; The trained topographic map generation model is used to regenerate a three-dimensional digital elevation map of the area, thus obtaining the target three-dimensional digital elevation map of the terrain.

7. The method as described in claim 1, characterized in that, Before the step of generating a target 3D terrain map based on the target 3D terrain digital elevation map, the method further includes: Obtain the conditional guidance graph; The prompt words and the conditional guidance map are input into the trained terrain map generation model to obtain the target three-dimensional terrain digital elevation map, wherein the conditional guidance map is used to guide the diffusion model to generate the target three-dimensional terrain digital elevation map.

8. A three-dimensional terrain modeling device, characterized in that, The device includes: The prompt word acquisition unit is used to acquire prompt words; An elevation map generation unit is used to input the prompt words into a trained topographic map generation model to obtain a target 3D topographic digital elevation map. The topographic map generation model includes a diffusion model and a quantization decoder connected in sequence. The quantization decoder is used to decode the RGB image output by the diffusion model into the target 3D topographic digital elevation map. A terrain map generation unit is used to generate a target three-dimensional terrain map based on the target three-dimensional terrain digital elevation map; The formula used by the quantization decoder during decoding is: ; ; ; Wherein, R, G, and B represent the R component, G component, and B component of any pixel in the RGB image output by the diffusion model, respectively, and H represents the elevation value corresponding to that pixel in the target three-dimensional terrain digital elevation map.

9. A three-dimensional terrain modeling device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method as described in any one of claims 1 to 7.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1 to 7.