A thin cloud fractal generation method and system for large-area weather environment simulation
By using bilinear interpolation algorithm and RayMarching technology to generate diverse thin cloud forms, the problem of single simulated thin cloud forms in existing technologies is solved, and dynamic simulation of natural thin clouds and realistic simulation of large-area weather environments are achieved.
Patent Information
- Application Number
- CN202410870548.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-01
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2044-07-01
AI Technical Summary
The existing simulated thin cloud forms are relatively simple, making it difficult to simulate the forms of natural thin clouds, and it is impossible to achieve realistic simulation of the weather environment in a large area.
A bilinear interpolation algorithm is used to generate multiple simplex noise images. The image value gradient vector of the pixel point is updated through affine transformation operation. The three-dimensional thin cloud model is rendered in combination with Ray Marching technology and fused with the environmental background image.
The generated thin clouds have diverse shapes and can dynamically simulate natural thin clouds, which improves the realism and credibility of large-area weather environment simulation and enhances the three-dimensionality and realism of the scene.
Smart Images

Figure CN118747718B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of digital image processing, in particular to the technical field of simulated thin cloud generation, and more specifically to a thin cloud fractal generation method and system for large-area weather environment simulation. Background Art
[0002] Currently, scene creation is widely used in fields such as gaming, film and television production, and battlefield simulation. The development of information technology has accelerated the maturity of scene creation technology, placing higher demands on the simulation quality of virtual environments. As an atmospheric environment that frequently appears in outdoor scenes, volumetric cloud simulation has always been a hot topic in scene creation. In natural environments, thin clouds are widely found at low, medium, and high altitudes, and can be divided into stratus, fractus, and altostratus clouds according to their morphology.
[0003] While there has been extensive research on cloud generation methods in the related art, the range of simulated cloud morphologies is limited, and relatively little research has been conducted on thin cloud generation for large-scale weather environment simulations. Existing cloud simulation methods for large-scale weather environments can be broadly categorized into modeling and RayMarching. Modeling methods first generate a basic volumetric cloud morphology and then add noise to enrich the cloud morphology. The advantage of modeling methods for generating simulated clouds is that the cloud morphology is easily controlled. However, their disadvantages are the complexity of controlling light and shadow variations and the difficulty in simulating large-scale clouds. Furthermore, modeling methods can only generate static volumetric clouds and cannot simulate the natural movement of simulated clouds within the scene. RayMarching simulates cloud morphology by directional integration of a two-dimensional noise texture using a height field. RayMarching methods primarily simulate cloud morphology based on two-dimensional noise textures. Commonly used noise textures include classic random noises such as Perlin noise and cellular noise. However, the simulated thin cloud morphology produced by classic random noise is relatively simple, resulting in only a simple simulated cloud visual effect, far from the natural cloud morphology found in real physical wind fields.
[0004] Therefore, the shape of existing simulated thin clouds is relatively simple and cannot simulate the shape of natural thin clouds well. Summary of the Invention
[0005] In view of this, the present invention provides a thin cloud fractal generation method and system for large-area weather environment simulation, which can solve the problem of single simulated thin cloud morphology in the existing technology. The generated thin cloud morphology is rich and can better simulate the morphology of natural thin clouds.
[0006] In order to achieve the above object, the present invention adopts the following technical solutions:
[0007] In a first aspect, an embodiment of the present invention provides a method for generating thin cloud fractals for large-area weather environment simulation, comprising the following steps:
[0008] S10, obtaining an environmental background image to which a simulated thin cloud effect is to be added, and determining a size of the environmental background image;
[0009] S20, using a bilinear interpolation algorithm to generate a set of N simplex noise images of the same size as the environmental background image, and generating a plane of the same size;
[0010] S30, traversing the pixel points on the plane, calculating the sum of the pixel coordinates, random gradient vector, image value gradient vector and time parameter vector for each pixel point, performing an affine transformation operation on the pixel coordinates to obtain mapping coordinates; using the mapping coordinates as index values to obtain the image value of the n-th simplex noise image at the mapping coordinates, and using the image value to update the image value gradient vector of the plane pixel coordinates; wherein n∈(1,N);
[0011] S40, returning to step S30 and iterating, traversing all pixel points on the plane to obtain a two-dimensional dynamic thin cloud image; when iterating N times until the end, applying affine transformation to expand the shape of the final two-dimensional dynamic thin cloud image;
[0012] S50, using RayMarching to render the two-dimensional dynamic thin cloud image expanded by affine transformation into a three-dimensional thin cloud model;
[0013] S60: Fusing the three-dimensional thin cloud model with the environmental background image to generate a thin cloud fractal for large-area weather environment simulation.
[0014] Furthermore, in step S20, the process of generating a single simplex noise image includes:
[0015] Dividing a plane image of the same size or proportion as the environmental background image into a plurality of congruent isosceles right triangles;
[0016] Map the isosceles right triangle lattice to an equilateral triangle lattice, and randomly generate a gradient vector for each vertex of the equilateral triangle
[0017] Traverse all the lattices on the plane, randomly select a point in each lattice, and calculate the direction vector from the point to the three vertices of the lattice
[0018] The sum of the dot product of the direction vector and the gradient vector of the corresponding vertex is taken as an image value of the point on the noise map;
[0019] The image values of the remaining coordinate points on the plane map are completed using bilinear interpolation.
[0020] Further, the image values on the planar graph are completed by using the bilinear interpolation method, including:
[0021] The specific calculation method of the interpolation is as follows:
[0022] I k (x + u, y + v) = (1 - u)(1 - v)I k (x, y) + uvI k (x + 1, y + 1)
[0023] + v(1 - u)I k (x, y + 1) + u(1 - v)I k (x + 1, y)
[0024] The pixel point I k (x + u, y + v) is the k-th pixel point I on the plane k (x, y), I k (x + 1, y), I k (x, y + 1) and I k (x + 1, y + 1) is an interpolation point between them, where 0 < u < 1, 0 < v < 1, x is the row number of the image, and y is the column number of the image.
[0025] Further, the step S30 includes:
[0026] S301. Generate a random gradient vector (a, b), an image value gradient vector (v1, v2) with an initial value of zero, and a time parameter vector (t1, t2) for each pixel point coordinate (x, y) on the plane;
[0027] S302. Perform rotation, scaling, and translation operations on the vector sum (x + a + v1 + t1, y + b + v2 + t2);
[0028] S303. Use the obtained mapped coordinates as index values to calculate the sum of the image values of each simplex noise map at the mapped coordinate values in sequence, and return two image values as an image value v1 and another image value v2 of the pixel point coordinate (x, y); the vector (v1, v2) updates the image gradient value of the current pixel point coordinate (x, y).
[0029] Further, the step S302 specifically includes:
[0030] The transformation method of the vector sum is as follows: Let the rotation matrix of the plane The scaling factor A, the offset b, for the random gradient vector of the pixel point coordinate (x, y) on the plane is (a, b), the operation on the pixel point coordinate (x, y):
[0031]
[0032] (x',y') represents the coordinates of the pixel point after transformation (x,y).
[0033] In a second aspect, the present invention further provides a thin cloud fractal generation system for large-area weather environment simulation, comprising:
[0034] An acquisition and determination module is used to acquire an environmental background image to be added with a simulated thin cloud effect and determine the size of the environmental background image;
[0035] A generation module, configured to generate a set of N simplex noise images of the same size as the environmental background image using a bilinear interpolation algorithm, and to generate a plane of the same size;
[0036] a calculation module configured to traverse the pixels on the plane, calculate the sum of the pixel coordinates, the random gradient vector, the image value gradient vector, and the time parameter vector for each pixel, perform an affine transformation on the pixel coordinates, and obtain a mapping coordinate; use the mapping coordinate as an index value to obtain the image value of the nth simplex noise image at the mapping coordinate, and use the image value to update the image value gradient vector of the plane pixel coordinate; wherein n∈(1,N);
[0037] An affine transformation expansion module is used to return to the calculation module for iteration, traverse all pixel points on the plane, and obtain a two-dimensional dynamic thin cloud image; when it iterates N times until the end, the affine transformation is applied to expand the final shape of the two-dimensional dynamic thin cloud image;
[0038] A rendering module is used to render the two-dimensional dynamic thin cloud image expanded by affine transformation into a three-dimensional thin cloud model using RayMarching;
[0039] A fusion module is used to fuse the three-dimensional thin cloud model with the environmental background image to generate a thin cloud fractal for large-area weather environment simulation.
[0040] In a third aspect, the present invention further provides a computer device comprising a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus;
[0041] Memory for storing computer programs;
[0042] The processor, when used to execute the program stored in the memory, can implement a thin cloud fractal generation method for large-area weather environment simulation as described in any one of the first aspects.
[0043] In a fourth aspect, the present invention further provides a computer-readable storage medium, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the processor executes a thin cloud fractal generation method for large-area weather environment simulation as described in any one of the first aspects.
[0044] The descriptions of the second to fourth aspects of the present invention can refer to the detailed description of the first aspect; and the beneficial effects of the descriptions of the second to fourth aspects can refer to the analysis of the beneficial effects of the first aspect, which will not be repeated here.
[0045] As can be seen from the above technical solution, compared with the prior art, the present invention discloses a thin cloud fractal generation method for large-area weather environment simulation, which has the following advantages:
[0046] Diverse Thin Cloud Morphologies: By using a bilinear interpolation algorithm to generate simplex noise patterns with varying amplitudes and frequencies, the generated thin cloud morphologies are more diverse. Compared to traditional methods based on classical random noise, this method can better simulate the morphology of natural thin clouds.
[0047] Dynamic thin cloud effect: By performing an affine transformation on a plane and iteratively updating the image value gradient vector corresponding to the plane pixel points, a two-dimensional dynamic thin cloud image can be generated. This dynamic effect is closer to the real weather environment and enhances the realism of the scene.
[0048] Rendering into 3D thin cloud model: Using RayMarching technology to render 2D dynamic thin cloud images into 3D thin cloud models, the three-dimensional effect of thin clouds in the scene is more obvious, further improving the realism of the simulation effect.
[0049] Fusion with environmental background images: Fusion of the generated three-dimensional thin cloud model with environmental background images can better meet the needs of large-area weather environment simulation, making the simulation effect more complete and unified.
[0050] Compared to existing technologies, this invention can better simulate natural thin cloud forms, emulating a variety of thin cloud fractal forms. The generated thin cloud forms are richer and can simulate directional filamentous clouds. It can also achieve dynamic thin cloud effects and integrate them with environmental background images, improving the realism and credibility of large-scale weather environment simulations. Furthermore, the generated 3D thin cloud models can be used in the automated production of fused image products. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0052] Figure 1 This is a flow chart of the thin cloud fractal generation method for large-area weather environment simulation provided by the present invention.
[0053] Figure 2 This is a schematic diagram of the thin cloud fractal generation method for large-area weather environment simulation provided by the present invention.
[0054] Figure 3 This is a comparison chart of scene-simulated thin cloud images provided by the present invention.
[0055] Figure 4 This is another comparison chart of simulated thin cloud images in a scene provided by the present invention.
[0056] Figure 5 This is a block diagram of the thin cloud fractal generation system for large-area weather environment simulation provided by the present invention. DETAILED DESCRIPTION
[0057] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0058] Example 1:
[0059] The embodiment of the present invention discloses a thin cloud fractal generation method for large-area weather environment simulation, referring to Figure 1 As shown, the following steps are included:
[0060] S10, obtaining an environmental background image to which a simulated thin cloud effect is to be added, and determining the size of the environmental background image; for example, it can be a remote sensing image, a bird's-eye view, or a landscape picture showing the sky, the ground, and other scenery, and determining its length and width.
[0061] S20. Generate a set of N simplex noise images of the same size as the environmental background image using a bilinear interpolation algorithm, and generate a plane of the same size. The bilinear interpolation algorithm is used to generate a set of N simplex noise images, for example, 5 to 10 images, that match the size of the environmental background image. Each simplex noise image has a different natural texture.
[0062] S30. Traverse the pixels on the plane, calculate the sum of the pixel coordinates, random gradient vector, image value gradient vector, and time parameter vector for each pixel, perform an affine transformation on the pixel coordinates to obtain mapping coordinates; use the mapping coordinates as index values to obtain the image value of the nth simplex noise image at the mapping coordinates, and use the image value to update the image value gradient vector of the plane pixel coordinates; where n∈(1,N). The affine transformation operations include, for example, rotation, scaling, and translation.
[0063] The mathematical representation of this step is as follows: there are N single-shape noise images, the pixel coordinate is denoted as p, the random gradient vector is denoted as g, the image value gradient vector is denoted as s, the time parameter vector is denoted as t, the mapping coordinate is denoted as p', and the operation of obtaining the image value of the nth single-line noise image at p is denoted as F n (p);
[0064] p′=p+g+s+t
[0065] Let N = 3
[0066] The final pixel value v at the plane pixel point coordinate p is F3(([F2([F1(p'),F1(p')]+g+s+t),F2([F1(p'),F1(p')]+g+s+t)]+g+s+t).
[0067] S40. Return to step S30 and iterate, traversing all pixels on the plane to obtain a two-dimensional dynamic thin cloud image. After N iterations, until the end, apply an affine transformation to expand the shape of the final two-dimensional dynamic thin cloud image. This process includes multiple iterations, such as 5 to 10, to ensure the quality and realism of the thin cloud image. The number of iterations is the same as the number of simplex noise maps.
[0068] S50. Rendering the two-dimensional dynamic thin cloud image expanded by affine transformation into a three-dimensional thin cloud model using Ray Marching; Ray Marching is a technology for rendering volume data that can produce realistic three-dimensional effects.
[0069] S60: Fusing the three-dimensional thin cloud model with the environmental background image to generate a thin cloud fractal for simulating a large-area weather environment. This thin cloud model can be used in the environmental background image to add a realistic cloud effect to the weather environment of the large area.
[0070] This method generates a two-dimensional composite thin cloud dynamic image by generating a set of random simplex noise images, summing the pixel coordinates, gradient vectors, image value gradient vectors, and time parameter vectors, and superimposing the corresponding coordinate image values of the simplex noise images through affine transformation. Then, the two-dimensional thin cloud morphology is expanded through affine transformation, and the two-dimensional thin cloud is rendered into a three-dimensional thin cloud using RayMarching technology. Finally, the thin cloud is fused with the input environmental background to generate a thin cloud fractal for large-area weather environment simulation.
[0071] This method can better simulate the morphology of natural thin clouds and a variety of thin cloud fractal forms, generating thin cloud fractals similar to natural thin cloud forms for large-scale weather environment simulation. It can also achieve dynamic thin cloud effects and integrate them with environmental background images, improving the realism and credibility of large-scale weather environment simulation.
[0072] For example, consider a natural landscape photograph featuring an open sky and distant mountains. The method provided by this invention can generate realistic thin clouds in the sky, making the entire scene appear more realistic. By appropriately transforming and iteratively updating the simplex noise map, dynamic, three-dimensional thin clouds can be formed in the sky. When integrated with the background image, the entire scene presents a natural, realistic weather environment over a large area.
[0073] The technical solution of the present invention is described in detail below:
[0074] Take a remote sensing image as the background image to generate thin clouds as an example, refer to Figure 2 As shown in the figure, for the input environment background image, simulation and fusion processing are carried out in the following steps:
[0075] (1) Obtain the length and width of the input remote sensing image, where the length is H and the width is W.
[0076] (2) Generate a set of N simplex noise images with the same size as the background image using a bilinear interpolation algorithm, and generate a plane with the same size as the background image;
[0077] The generation of a single simplex noise image is as follows: First, divide the plane with length H and width W (or the same proportion) into a number of congruent isosceles right triangles. Second, map the plane so that the isosceles right triangle lattice is mapped to an equilateral triangle lattice, and randomly generate a gradient vector for each vertex of the triangle on the plane. Next, select a point and calculate the direction vector from the point to the three vertices of the lattice Traverse all the lattice points on the plane. Calculate the dot product sum of the direction vector and the gradient vector of the corresponding vertex, and use it as an image value v of this point on the noise map. The calculation method is as follows: Then, use the bilinear interpolation method to complete the image values on the plane.
[0078] The specific operation of the bilinear interpolation method is as follows: Assume that the pixel point I k (x + u, y + v) is the k-th pixel point I on the plane k (x, y), I k (x + 1, y), I k (x, y + 1) and I k (x + 1, y + 1) is an interpolation point between them, where 0 < u < 1, 0 < v < 1, x is the row number of the image, and y is the column number of the image. Then the calculation method of the interpolation is as follows:
[0079] I k (x + u, y + v) = (1 - u)(1 - v)I k (x, y) + uvI k (x + 1, y + 1)
[0080] + v(1 - u)I k (x, y + 1) + u(1 - v)I k (x + 1, y)
[0081] (3) Generate a random gradient vector, an image value gradient vector with an initial value of zero, and a time parameter vector for the pixel point coordinates on the plane in step (2). Perform an affine transformation on the sum of the pixel point coordinates, the random gradient vector, the image value gradient vector, and the time parameter vector, and use the obtained mapped coordinates as index values to calculate the sum of the image values of each simplex noise map at the mapped coordinate values in step (2) in sequence, and update the image value gradient vector of the current coordinate value;
[0082] Generate a random gradient vector (a, b), an image value gradient vector (v1, v2) with an initial value of zero, and a time parameter vector (t1, t2) for the pixel point coordinates (x, y) on the plane. Perform affine transformation operations such as rotation, scaling, and translation on the sum of the vectors (x + a + v1 + t1, y + b + v2 + t2). Assume the rotation matrix of the plane Scaling factor A, offset b. For the random gradient vector of the pixel point coordinates (x, y) on the plane being (a, b), the homogeneous transformation method for the pixel point coordinates (x, y) is as follows:
[0083]
[0084] The rotation matrix, amplitude, and offset for the affine transformation of each pixel point coordinate are the same.
[0085] The resulting mapping coordinates are used as index values to sequentially calculate the sum of the image values of each simplex noise image at the mapping coordinate value in step (2), and use this sum as an image value v1 for the pixel coordinate (x, y). Repeat the above operation in step (3) to generate another image value v2 for the current pixel coordinate (x, y), and use the two-dimensional vector (v1, v2) to update the image gradient value of the current pixel coordinate (x, y).
[0086] (4) Return to step (3) and iterate. When the iteration round condition is met, proceed to step (5). The number of iterations is generally 3 to 5 rounds, which is generally the same as the number of simplex noise graphs.
[0087] (5) performing an affine transformation on the sum of the pixel coordinates, random gradient vector, image value gradient vector and time parameter vector, and using the obtained mapping coordinates as index values to sequentially calculate the sum of the image values of each simplex noise image at the mapping coordinate value in step (2) as the image value of the current pixel point, thereby generating a two-dimensional dynamic thin cloud image;
[0088] Among them, the plane pixel coordinates (x, y), random gradient vector (a, b), image gradient value (v1, v2) and time parameter vector (t1, t2) are added, and the resulting mapping coordinates (x+a+v1+t1, y+b+v2+t2) are used as index values to calculate the sum of the image values of each simplex noise image at the mapping coordinate value in step (2) in sequence, as the final image value v of the pixel coordinates (x, y).
[0089] (6) Using affine transformation to expand the two-dimensional dynamic thin cloud image morphology in step (5). Using translation, rotation, scaling, shearing, flipping and other operations in the field of image enhancement to expand the cloud morphology.
[0090] (7) Using RayMarching technology, the two-dimensional dynamic thin cloud image in step (6) is rendered into a three-dimensional thin cloud.
[0091] Ray Marching (ray tracing) is a technique used in computer graphics to render three-dimensional scenes. It determines the color and depth value of each pixel by sampling and interpolating step-by-step along the path of a ray. The basic idea is to launch a ray from the camera or observer's position and then step along this ray to sample the scene. At each step, the ray intersects with an object in the scene, and the color and transparency of the pixel are determined based on the surface properties at the intersection point (such as color, normal, material, etc.). If the ray does not intersect any object, it is traced through the background to ultimately determine the color of the pixel.
[0092] The advantage of RayMarching over traditional rasterization rendering technology is that it can produce more realistic and lifelike effects, especially for scenes with complex optical effects (such as volumetric lighting and scattering). RayMarching is often used to render volumetric data (such as smoke, clouds, water, etc.) or complex geometry. It can generate high-quality images and has good flexibility and scalability.
[0093] (8) Alpha fusion is used to fuse the three-dimensional thin cloud from step (7) with the input remote sensing image to generate a thin cloud fractal for large-area weather environment simulation. In three-dimensional graphics rendering, by sorting the alpha values of different objects, the order in which they are superimposed in the final image can be determined, thereby achieving the correct depth sorting and perspective effect. Alpha fusion technology can realize the synthesis, superposition, and blending of images, making image processing and rendering more flexible and realistic.
[0094] The method presented in this paper was experimentally compared with a simulated thin cloud image based on Perlin noise. This method is currently the most widely used method for generating volumetric clouds in games for large-area weather environments. Like the method presented in this paper, it belongs to the same category of noise-based Raymarching volumetric cloud simulation methods.
[0095] for example Figure 3-4 The input environment background images are high-resolution satellite images taken by the US EO-1 satellite, totaling 5 scenes. The size of the high-resolution satellite images is 512×512.
[0096] Figure 3 This is a comparison of scene 1 showing a simulated thin cloud image based on Perlin noise and a thin cloud fractal image for large-area weather environment simulation. Figure 3 The left half is a simulated thin cloud image based on Perlin noise, and the right half is a thin cloud fractal image for large-area weather environment simulation according to the present invention.
[0097] Figure 4 This is a comparison of scene 2, showing a simulated thin cloud image based on Perlin noise and a thin cloud fractal image for large-area weather environment simulation. Figure 4 The left half is a simulated thin cloud image based on Perlin noise, and the right half is a thin cloud fractal image for large-area weather environment simulation according to the present invention.
[0098] Since the size of the experimental image is large, in order to clearly show the objects in the image, Figure 3 and Figure 4 Only a local area of the experimental image is shown. By comparison, the thin cloud fractal image for large-area weather environment simulation has richer and more natural thin cloud forms.
[0099] Example 2:
[0100] The present invention also provides a thin cloud fractal generation system for large-area weather environment simulation, referring to Figure 5 As shown, including:
[0101] An acquisition and determination module is used to acquire an environmental background image to be added with a simulated thin cloud effect and determine the size of the environmental background image;
[0102] A generation module, configured to generate a set of N simplex noise images of the same size as the environmental background image using a bilinear interpolation algorithm, and to generate a plane of the same size;
[0103] a calculation module configured to traverse the pixels on the plane, calculate the sum of the pixel coordinates, the random gradient vector, the image value gradient vector, and the time parameter vector for each pixel, perform an affine transformation on the pixel coordinates, and obtain a mapping coordinate; use the mapping coordinate as an index value to obtain the image value of the nth simplex noise image at the mapping coordinate, and use the image value to update the image value gradient vector of the plane pixel coordinate; wherein n∈(1,N);
[0104] An affine transformation expansion module is used to return to the calculation module for iteration, traverse all pixel points on the plane, and obtain a two-dimensional dynamic thin cloud image; when it iterates N times until the end, the affine transformation is applied to expand the final shape of the two-dimensional dynamic thin cloud image;
[0105] A rendering module is used to render the two-dimensional dynamic thin cloud image expanded by affine transformation into a three-dimensional thin cloud model using RayMarching;
[0106] A fusion module is used to fuse the three-dimensional thin cloud model with the environmental background image to generate a thin cloud fractal for large-area weather environment simulation.
[0107] The system achieves high-quality, realistic large-area weather environment simulation by combining multiple technologies, and can provide a reliable thin cloud effect generation solution for scene production fields such as virtual environments, games, film and television production, and battlefield environments.
[0108] Example 3:
[0109] The present invention further provides a computer device comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
[0110] When the processor executes the program, the thin cloud fractal generation method for large-area weather environment simulation in Example 1 is implemented. For the sake of brevity, it is not described here in detail.
[0111] It should be understood that in this embodiment, the processor may be a central processing unit (CPU), or may be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), off-the-shelf field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc.
[0112] The memory may include a read-only memory and a random access memory, and provides instructions and data to the processor. A portion of the memory may also include a non-volatile random access memory. For example, the memory may also store information about the device type.
[0113] During implementation, each step of the above method may be completed by an integrated logic circuit of hardware in a processor or by instructions in the form of software.
[0114] Example 4:
[0115] The present invention further provides a computer-readable storage medium, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the processor executes a thin cloud fractal generation method for large-area weather environment simulation as described in any one of the embodiments in Example 1.
[0116] The present invention provides a fractal method for generating thin clouds for large-area weather environment simulation, specifically designed to enrich thin cloud morphology and generate virtual meteorological backgrounds. In specific implementations, the method proposed by this technical solution can be automated using computer software by those skilled in the art. System devices implementing this method, such as computer-readable storage media storing the computer program corresponding to this technical solution and computer equipment running the computer program, are also within the scope of protection of this invention.
[0117] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Reference can be made to the common and similar parts between the various embodiments. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the method description.
[0118] The above description of the disclosed embodiments is intended to enable one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be readily apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention is not limited to the embodiments shown herein but is intended to conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A fractal generation method for thin clouds for large-area weather environment simulation, characterized in that: The following steps are involved: S10, obtaining an environmental background image to which a simulated thin cloud effect is to be added, and determining a size of the environmental background image; S20, using a bilinear interpolation algorithm to generate a set of N simplex noise images of the same size as the environmental background image, and generating a plane of the same size; S30, traversing the pixel points on the plane, calculating the sum of the pixel coordinates, random gradient vector, image value gradient vector and time parameter vector for each pixel point, performing an affine transformation operation on the pixel coordinates to obtain mapping coordinates; using the mapping coordinates as index values to obtain the image value of the n-th simplex noise image at the mapping coordinates, and using the image value to update the image value gradient vector of the plane pixel coordinates; wherein n∈(1,N); S40, returning to step S30 and iterating, traversing all pixel points on the plane to obtain a two-dimensional dynamic thin cloud image; when iterating N times until the end, applying affine transformation to expand the shape of the final two-dimensional dynamic thin cloud image; S50, using RayMarching to render the two-dimensional dynamic thin cloud image expanded by affine transformation into a three-dimensional thin cloud model; S60: Fusing the three-dimensional thin cloud model with the environmental background image to generate a thin cloud fractal for large-area weather environment simulation.
2. The method for generating thin cloud fractals for large-area weather environment simulation according to claim 1, characterized in that: In step S20, the process of generating a single simplex noise image includes: Dividing a plane image of the same size or proportion as the environmental background image into a plurality of congruent isosceles right triangles; Map the isosceles right triangle lattice to an equilateral triangle lattice and randomly generate a gradient vector for each vertex of the equilateral triangle Traverse all the lattices on the plane, randomly select a point in each lattice, and calculate the direction vector from the point to the three vertices of the lattice The sum of the dot product of the direction vector and the gradient vector of the corresponding vertex is taken as an image value of the point on the noise map; The image values of the remaining coordinate points on the plane map are completed using bilinear interpolation.
3. The method for generating thin cloud fractals for large-area weather environment simulation according to claim 2, characterized in that: Use bilinear interpolation to complete the image values on the plane map, including: The interpolation calculation method is as follows: I k (x+u,y+v)=(1-u)(1-v)I k (x,y)+uvI k (x+1,y+1)+v(1-u)I k (x,y+1)+u(1-v)I k (x+1,y) Pixel point I k (x + u, y + v) is the k-th pixel point I on the plane k (x, y), I k (x + 1, y), I k (x, y + 1) and I k An interpolation point between (x + 1, y + 1), where 0 < u < 1, 0 < v < 1, x is the row number of the image, and y is the column number of the image.
4. The method for generating thin cloud fractals for large-area weather environment simulation according to claim 2, characterized in that: The step S30 includes: S301, generating a random gradient vector (a, b), an image value gradient vector (v1, v2) with an initial value of zero, and a time parameter vector (t1, t2) for each pixel coordinate (x, y) on the plane; S302, performing rotation, scaling, and translation operations on the sum of the vectors (x+a+v1+t1, y+b+v2+t2); S303. Use the obtained mapping coordinates as index values to calculate the sum of the image values of each simplex noise image at the mapping coordinate value in sequence, and return the two image values as an image value v1 and another image value v2 of the pixel coordinates (x, y); the vector (v1, v2) updates the image gradient value of the current pixel coordinates (x, y).
5. The method for generating thin cloud fractals for large-area weather environment simulation according to claim 4, characterized in that: The step S302 specifically includes: The transformation of the sum of vectors is as follows: Let the rotation matrix of the plane be Scaling factor A, offset b, the random gradient vector for the pixel coordinates (x, y) on the plane is (a, b), and the operation on the pixel coordinates (x, y) is: (x',y') represents the coordinates of the pixel point after transformation (x,y).
6. A thin cloud fractal generation system for large-area weather environment simulation, characterized by: include: An acquisition and determination module is used to acquire an environmental background image to be added with a simulated thin cloud effect and determine the size of the environmental background image; A generation module, configured to generate a set of N simplex noise images of the same size as the environmental background image using a bilinear interpolation algorithm, and to generate a plane of the same size; a calculation module configured to traverse the pixels on the plane, calculate the sum of the pixel coordinates, the random gradient vector, the image value gradient vector, and the time parameter vector for each pixel, perform an affine transformation on the pixel coordinates, and obtain a mapping coordinate; use the mapping coordinate as an index value to obtain the image value of the nth simplex noise image at the mapping coordinate, and use the image value to update the image value gradient vector of the plane pixel coordinate; wherein n∈(1,N); An affine transformation expansion module is used to return to the calculation module for iteration, traverse all pixel points on the plane, and obtain a two-dimensional dynamic thin cloud image; when it iterates N times until the end, the affine transformation is applied to expand the final shape of the two-dimensional dynamic thin cloud image; A rendering module is used to render the two-dimensional dynamic thin cloud image expanded by affine transformation into a three-dimensional thin cloud model using RayMarching; A fusion module is used to fuse the three-dimensional thin cloud model with the environmental background image to generate a thin cloud fractal for large-area weather environment simulation.
7. A computer device, characterized in that: The processor, the communication interface, the memory and the communication bus are connected to each other via the communication bus. Memory for storing computer programs; The processor, when used to execute the program stored in the memory, can implement a thin cloud fractal generation method for large-area weather environment simulation as described in any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer program instructions, which, when executed by a processor, enable the processor to execute a thin cloud fractal generation method for large-area weather environment simulation according to any one of claims 1 to 5.
Citation Information
Patent Citations
Terrain semantic segmentation method in cross-country environment
CN117893758A
Cloud image simulation method and system for multispectral satellite remote sensing imaging
CN117974487A