Thin cloud fractal generation method and system for large-area weather environment simulation
Generating diversified single-shape noise maps through bilinear interpolation algorithm and affine transformation, combined with RayMarching technology, solves the problem of single shape of existing simulated thin clouds, achieves more realistic thin cloud simulation and dynamic effects, and enhances the scene sense of reality.
Patent Information
- Application Number
- CN202410870548.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-01
- Publication Date
- 2024-10-08
- Estimated Expiration
- 2044-07-01
AI Technical Summary
The existing simulated thin clouds have a single shape, are difficult to simulate the shape of natural thin clouds, and cannot effectively simulate large-scale clouds and the natural movement of clouds.
A bilinear interpolation algorithm is used to generate multiple single-shape noise maps, and an affine transformation operation is used to generate a two-dimensional dynamic thin cloud image, which is rendered into a three-dimensional thin cloud model using RayMarching technology, and finally integrated with the environmental background image.
The generated thin cloud shapes are more diverse and dynamic, can better simulate the shape of natural thin clouds, and improve the fidelity and simulation effect of the scene.
Smart Images

Figure CN118747718A_ABST
Abstract
Description
Technical Field
[0001] The 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] At present, scene production is widely used in games, film and television production, battlefield environment simulation and other fields. The development of information technology has accelerated the maturity of scene production technology, and people have put forward higher requirements for the simulation quality of virtual environments. As an atmospheric environment that appears very frequently in outdoor scenes, the simulation of volumetric clouds has always been a hot topic in scene production. In the natural environment, thin clouds are widely found at low, medium and high altitudes, and can be divided into stratus clouds, broken stratus clouds, high-level clouds, etc. according to their morphology.
[0003] There are many studies on cloud generation methods in the related technology, but the morphology of simulated clouds is limited, and there are relatively few studies on thin cloud generation for large-area weather environment simulation. The existing cloud simulation methods for large-area weather environment can be roughly divided into model method and RayMarching. Among them, the model method generates basic volume cloud morphology first, and then adds noise to enrich the cloud morphology. The advantage of the model method in generating simulated clouds is that the cloud morphology is easy to control manually, and the disadvantage is that the control of light and shadow changes is complicated, and it is difficult to simulate large-scale clouds. In addition, the model method can only generate static volume clouds and cannot simulate the natural movement of simulated clouds in the scene. RayMarching uses the height field to perform directional integration on the noise texture of the two-dimensional plane to simulate the cloud morphology. Among them, the simulation of cloud morphology by the RayMarching method is mainly based on two-dimensional noise texture. The commonly used noise textures currently include classic random noises such as Perlin noise and cell noise. However, the simulated thin cloud morphology based on classic random noise is relatively simple, and can only complete simple simulated cloud visual effects, which is far from the natural cloud morphology in the real physical wind field.
[0004] Therefore, the existing simulated thin clouds have a relatively simple shape 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 prior art, generate rich thin cloud morphology, and achieve better simulation of natural thin cloud morphology.
[0006] In order to achieve the above object, the present invention adopts the following technical solution:
[0007] In a first aspect, an embodiment of the present invention provides a thin cloud fractal generation method for large-area weather environment simulation, comprising the following steps:
[0008] S10, obtaining an environmental background image to be added with a simulated thin cloud effect, and determining a size of the environmental background image;
[0009] S20, using a bilinear interpolation algorithm to generate a set of N single-shape 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 point coordinates, the random gradient vector, the image value gradient vector and the time parameter vector for each pixel point, performing an affine transformation operation on the pixel point to obtain a mapping coordinate; using the mapping coordinate as an index value to obtain the image value of the n-th simplex noise image at the mapping coordinate, and using the image value to update the image value gradient vector of the plane pixel point coordinate; wherein n∈(1, N);
[0011] S40, returning to step S30 to iterate, 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 direction vector is multiplied by the gradient vector of the corresponding vertex and the sum 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 bilinear interpolation method is used to complete the image values on the planar graph, including:
[0021] The specific calculation method of 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 (v 1 , v 2 ) with an initial value of zero, and a time parameter vector (t 1 , t 2 ) for each pixel point coordinate (x, y) on the plane;
[0027] S302. Perform rotation, scaling, and translation operations on the vector sum (x + a + v 1 + t 1 , y + b + v 2 + t 2 );
[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 the two image values as an image value v1 and another image value v2 of the pixel point coordinate (x, y); the vector (v 1 , v 2 ) updates the image gradient value of the current pixel point coordinate (x, y).
[0029] Further, the step S302 specifically includes:
[0030] 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:
[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 the environmental background image to be added with the simulated thin cloud effect, and determine the size of the environmental background image;
[0035] A generation module, used to generate a set of N single-shape noise images of the same size as the environmental background image by using a bilinear interpolation algorithm, and generate a plane of the same size;
[0036] A calculation module is used to traverse the pixel points on the plane, calculate the sum of the pixel point coordinates, random gradient vector, image value gradient vector and time parameter vector for each pixel point, perform affine transformation operation on it, and obtain mapping coordinates; use the mapping coordinates as index values to obtain the image value of the n-th simplex noise image at the mapping coordinates, and use the image value to update the image value gradient vector of the plane pixel point coordinates; wherein n∈(1, N);
[0037] An affine transformation expansion module is used to return to the calculation module iteration, traverse all pixel points of the plane, and obtain a two-dimensional dynamic thin cloud image; when it is iterated 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, used for rendering the two-dimensional dynamic thin cloud image expanded by affine transformation into a three-dimensional thin cloud model by using RayMarching;
[0039] The 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, used to store 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] It can be seen from the above technical solutions that, 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] Diversified thin cloud morphology: By using a bilinear interpolation algorithm to generate a single-shape noise map with different amplitudes and frequencies, the generated thin cloud morphology is more diverse. Compared with the traditional method based on classical random noise, it can better simulate the morphology of natural thin clouds.
[0047] Dynamic thin cloud effect: By performing affine transformation on the plane and iteratively updating the image value gradient vector corresponding to the plane pixel points, the generation of a two-dimensional dynamic thin cloud image can be achieved. This dynamic effect is closer to the real weather environment and enhances the realism of the scene.
[0048] Rendering into three-dimensional thin cloud model: Using RayMarching technology to render two-dimensional dynamic thin cloud images into three-dimensional thin cloud models, the three-dimensional sense 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 and make the simulation effect more complete and unified.
[0050] Compared with the prior art, the present invention can better simulate the morphology of natural thin clouds, simulate a variety of thin cloud fractal morphologies, generate rich thin cloud morphologies, and simulate directional filamentous clouds; it can achieve dynamic thin cloud effects and be integrated with environmental background images, thus improving the realism and credibility of large-area weather environment simulation. In addition, the generated 3D thin cloud model can be used for 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 drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0052] Figure 1 A flow chart of the thin cloud fractal generation method for large-area weather environment simulation provided by the present invention.
[0053] Figure 2 Schematic diagram of the thin cloud fractal generation method for large-area weather environment simulation provided by the present invention.
[0054] Figure 3 A scene simulation thin cloud image comparison chart provided by the present invention.
[0055] Figure 4 Another scene-simulated thin cloud image comparison diagram provided by the present invention.
[0056] Figure 5 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 be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0058] Embodiment 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 may 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, using a bilinear interpolation algorithm to generate a set of N single-shape noise images of the same size as the environmental background image, and generate a plane of the same size. Wherein, a set of single-shape noise images matching the size of the environmental background image is generated using a bilinear interpolation algorithm, for example, 5 to 10 images. Each single-shape noise image has a different natural texture.
[0062] S30, traverse the pixel points on the plane, calculate the sum of the pixel coordinates, random gradient vector, image value gradient vector and time parameter vector for each pixel point, perform affine transformation operation on it, and 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; wherein n∈(1,N). The affine transformation operation includes, 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 coordinates are 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 coordinates are 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 coordinate p is F 3 (([F 2 ([F 1 (p'),F 1 (p')]+g+s+t),F 2 ([F 1 (p'),F 1 (p')]+g+s+t)]+g+s+t).
[0067] S40, returning to step S30 to iterate, traversing all the pixels of the plane, and obtaining 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; this process includes multiple iterations, such as 5 to 10 times, to ensure the quality and realism of the thin cloud image. The number of iterations is the same as the number of simplex noise images.
[0068] S50. Rendering the two-dimensional dynamic thin cloud image expanded by affine transformation into a three-dimensional thin cloud model using RayMarching; RayMarching is a technology used to render volume data, which 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 the weather environment of a large area. In this way, the thin cloud model can be used in the environmental background image to add a realistic cloud effect to the weather environment of a large area.
[0070] The method generates a set of random simplex noise images, sums the pixel coordinates, gradient vectors, image value gradient vectors, and time parameter vectors, and superimposes the corresponding coordinate image values of the simplex noise image through affine transformation to generate a two-dimensional composite thin cloud dynamic image; 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, simulate a variety of thin cloud fractal morphologies, and generate thin cloud fractals similar to natural thin cloud morphologies for large-area weather environment simulation. It can achieve dynamic thin cloud effects and can be integrated with environmental background images, improving the fidelity and credibility of large-area weather environment simulation.
[0072] For example, suppose there is a natural landscape photo that includes an open sky and some distant mountains. Through the method provided by the present invention, realistic thin clouds can be generated in the sky part, making the whole scene look more real. By appropriately transforming and iteratively updating the simplex noise map, dynamic, three-dimensional thin clouds can be formed in the sky. After being fused with the environmental background image, the whole scene will present a natural and realistic large-area weather environment.
[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. Figure 2 As shown in the figure, for the input environment background image, simulation and fusion processing are carried out in sequence through the following steps:
[0075] (1) Obtain the length and width of the input remote sensing image, where the length is denoted by H and the width is denoted by W.
[0076] (2) Generate a set of N single-shape noise images with the same size as the environment background image using a bilinear interpolation algorithm, and generate a plane with the same size as the environment background image;
[0077] The generation method of a single single-shape noise image is as follows: First, divide the plane image with a length of H and a width of W (or equal proportion) into a number of congruent isosceles right triangles. Secondly, 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 sum of the dot products 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 specific 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 specific 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 (v 1 , v 2 ) with an initial value of zero, and a time parameter vector (t 1 , t 2 ) for the pixel point coordinates (x, y) on the plane. Perform affine transformation operations such as rotation, scaling, and translation on the vector sum (x + a + v 1 + t 1 , y + b + v 2 + t 2 ). 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 specifically as follows:
[0083]
[0084] The rotation matrix, amplitude and offset of the affine transformation of each pixel coordinate are the same.
[0085] The obtained mapping coordinates 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) as an image value v1 of the pixel coordinate (x, y). Repeat the above operation of step (3) to generate another image value v2 of the current pixel coordinate (x, y). Use the two-dimensional vector (v 1 ,v 2 ) updates the image gradient value of the current pixel coordinate (x, y).
[0086] (4) Return to step (3) and iterate, and when the iteration round condition is met, enter 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, the random gradient vector, the image value gradient vector and the time parameter vector, and using the obtained mapping coordinates as index values, sequentially calculating 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, 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 (v 1 ,v 2 ) and the time parameter vector (t 1 ,t 2 ) and add the resulting mapping coordinates (x+a+v 1 +t 1 ,y+b+v 2 +t 2 ) is used as the index value to calculate the sum of the image values of each simplex noise image in step (2) at the mapping coordinate value, as the final image value v of the pixel coordinate (x, y).
[0089] (6) Use affine transformation to expand the two-dimensional dynamic thin cloud image morphology in step (5). Use 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] RayMarching 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 the light. The basic idea is to launch a ray from the position of the camera or observer, and then step by step along this ray to sample the scene. At each step, the ray intersects with the objects in the scene, and then determines the color and transparency of the pixel based on the surface properties at the intersection point (such as color, normal, material, etc.). If the ray does not intersect with any object, it will be traced in the background to finally 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 light, scattering, etc.). RayMarching is usually 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 in 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, their superposition order 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 mixing of images, making image processing and rendering more flexible and realistic.
[0094] The method of the present invention is experimentally compared with the simulated thin cloud image based on Perlin noise. The simulated thin cloud generation method based on Perlin noise is currently the most widely used game volume cloud generation method for large-area weather environments, and is also a noise-based Raymarching volume cloud simulation method like the method of the present invention.
[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 the simulated thin cloud image based on Perlin noise and the thin cloud fractal image for large-area weather environment simulation in scene 1. 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 4This is a comparison of scene 2 showing the simulated thin cloud image based on Perlin noise and the 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 given. By comparison, the thin cloud fractal image for large-area weather environment simulation has a richer and more natural thin cloud morphology.
[0099] Embodiment 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 the environmental background image to be added with the simulated thin cloud effect, and determine the size of the environmental background image;
[0102] A generation module, used to generate a set of N single-shape noise images of the same size as the environmental background image by using a bilinear interpolation algorithm, and generate a plane of the same size;
[0103] A calculation module is used to traverse the pixel points on the plane, calculate the sum of the pixel point coordinates, random gradient vector, image value gradient vector and time parameter vector for each pixel point, perform affine transformation operation on it, and obtain mapping coordinates; use the mapping coordinates as index values to obtain the image value of the n-th simplex noise image at the mapping coordinates, and use the image value to update the image value gradient vector of the plane pixel point coordinates; wherein n∈(1, N);
[0104] An affine transformation expansion module is used to return to the calculation module iteration, traverse all pixel points of the plane, and obtain a two-dimensional dynamic thin cloud image; when it is iterated 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, used for rendering the two-dimensional dynamic thin cloud image expanded by affine transformation into a three-dimensional thin cloud model by using RayMarching;
[0106] The 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] Embodiment 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 will not be described in detail here.
[0111] It should be understood that in this embodiment, the processor may be a central processing unit CPU, and the processor may also be other general-purpose processors, digital signal processors DSP, application-specific integrated circuits ASIC, off-the-shelf 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 the processor may also be any conventional processor, etc.
[0112] The memory may include a read-only memory and a random access memory, and provide 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] In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in a processor or an instruction in the form of software.
[0114] Embodiment 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 thin cloud fractal generation method for large-area weather environment simulation, which is mainly proposed to enrich the thin cloud morphology and generate a virtual meteorological background. In specific implementation, the method proposed by the technical solution of the present invention can be automatically operated by those skilled in the art using computer software technology, and the system device for implementing the method, such as a computer-readable storage medium storing the corresponding computer program of the technical solution of the present invention and a computer device including a computer running the corresponding computer program, should also be within the protection scope of the present invention.
[0117] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0118] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be 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 will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A fractal generation method of thin clouds for large-area weather environment simulation, characterized in that: The following steps are involved: S10, obtaining an environmental background image to be added with a simulated thin cloud effect, and determining a size of the environmental background image; S20, using a bilinear interpolation algorithm to generate a set of N single-shape 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 point coordinates, the random gradient vector, the image value gradient vector and the time parameter vector for each pixel point, performing an affine transformation operation on the pixel point to obtain a mapping coordinate; using the mapping coordinate as an index value to obtain the image value of the n-th simplex noise image at the mapping coordinate, and using the image value to update the image value gradient vector of the plane pixel point coordinate; wherein n∈(1, N); S40, returning to step S30 to iterate, 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 direction vector is multiplied by the gradient vector of the corresponding vertex and the sum 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 in 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 point coordinate (x, y) on the plane; S302, rotating, scaling and translating the sum of the vectors (x+a+v1+t1, y+b+v2+t2); S303, using the obtained mapping coordinates as index values to calculate the sum of the image values of each of the simplex noise images at the mapping coordinate values in turn, and returning two image values as an image value v1 and another image value v2 of the pixel point coordinates (x, y); the vector (v1, v2) updates the image gradient value of the current pixel point 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 in that: include: An acquisition and determination module is used to acquire the environmental background image to be added with the simulated thin cloud effect, and determine the size of the environmental background image; A generation module, used to generate a set of N single-shape noise images of the same size as the environmental background image by using a bilinear interpolation algorithm, and generate a plane of the same size; A calculation module is used to traverse the pixel points on the plane, calculate the sum of the pixel point coordinates, random gradient vector, image value gradient vector and time parameter vector for each pixel point, perform affine transformation operation on it, and obtain mapping coordinates; use the mapping coordinates as index values to obtain the image value of the n-th simplex noise image at the mapping coordinates, and use the image value to update the image value gradient vector of the plane pixel point coordinates; wherein n∈(1, N); An affine transformation expansion module is used to return to the calculation module iteration, traverse all pixel points of the plane, and obtain a two-dimensional dynamic thin cloud image; when it is iterated 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, used for rendering the two-dimensional dynamic thin cloud image expanded by affine transformation into a three-dimensional thin cloud model by using RayMarching; The 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: It includes 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; Memory, used to store 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-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
Method and Apparatus for Pose Planar Constraining on the Basis of Planar Feature Extraction
US20210192271A1
Efficient safety aware path selection and planning for autonomous machine applications
US20210354729A1
