Environment map generation method and device, electronic equipment and storage medium

By acquiring downsampled images and lighting results from high-range dynamic images, a highly adaptable environment map is generated, solving the problems of high computational load and severe noise impact in existing technologies, and achieving efficient lighting effect simulation.

CN121010531APending Publication Date: 2025-11-25BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410650043.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-23
Publication Date
2025-11-25

AI Technical Summary

Technical Problem

Existing technologies suffer from problems such as high computational cost, slow speed, or severe noise when simulating omnidirectional lighting effects, especially when using high-range dynamic panoramic images as light sources.

Method used

By acquiring high-range dynamic images, determining their downsampled images under different model coarsening parameters, and calculating the illumination results of pixels in the downsampled images, an environment map is generated based on the illumination results, adaptively reducing the number of pixels in the illumination simulation calculation and improving computational efficiency.

Benefits of technology

While reducing ambient lighting noise, it improves the speed and efficiency of generating ambient lighting maps, and enhances the realism and adaptability of lighting effects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121010531A_ABST
    Figure CN121010531A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an environment map generation method and device, electronic equipment and a storage medium. The method comprises the following steps: acquiring a high-range dynamic image; determining a downsampling image corresponding to the high-range dynamic image under at least one parameter; determining an illumination result corresponding to at least one pixel point in the downsampling image; and determining an environment map corresponding to the at least one parameter according to the at least one illumination result corresponding to the downsampling image. According to the technical scheme provided by the embodiment of the invention, the speed of generating the environment illumination image can be improved while the noise of the environment illumination image is reduced, and the efficiency of determining the environment illumination image is improved on the whole.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of image processing technology, and in particular to an environment map generation method, apparatus, electronic device, and storage medium. Background Technology

[0002] In the process of rendering 3D models, to demonstrate the realism of the rendered model, it is necessary to simulate the lighting effects from all-around light sources in reality. Currently, the common method to simulate omnidirectional lighting effects is to capture a high-range dynamic panoramic image using a panoramic camera, and then use all or part of the pixels in the high-range dynamic panoramic image as a point light source to simulate the lighting effect.

[0003] However, the above implementation method has the following problems: if all pixels in the high-range dynamic panoramic image are treated as point light sources, the computational load is large and the time consumption is long due to the large number of pixels and the need to perform simulated lighting calculations for each pixel; if some pixels in the high-range dynamic panoramic image are treated as point light sources, the computational load is still too large and the calculation speed is slow if too many pixels are selected; if too few pixels are selected, the noise of the simulated lighting will have a serious impact. Summary of the Invention

[0004] This disclosure provides an environment map generation method, apparatus, electronic device, and storage medium to reduce ambient lighting map noise while increasing the speed of generating ambient lighting maps, thereby improving the overall efficiency of determining ambient lighting maps.

[0005] In a first aspect, embodiments of this disclosure provide an environment map generation method, the method comprising:

[0006] Acquire high-range dynamic images;

[0007] Determine the downsampled image corresponding to the high-range dynamic range image under at least one parameter;

[0008] Determine the illumination result corresponding to at least one pixel in the downsampled image;

[0009] Based on at least one illumination result corresponding to the downsampled image, an environment map corresponding to the at least one parameter is determined.

[0010] Secondly, embodiments of this disclosure also provide an environment map generation apparatus, the apparatus comprising:

[0011] The dynamic image determination module is used to acquire high-range dynamic images;

[0012] The downsampled image determination module is used to determine the downsampled image corresponding to the high-range dynamic image under at least one parameter;

[0013] The illumination result determination module is used to determine the illumination result corresponding to at least one pixel in the downsampled image;

[0014] An environment map determination module is used to determine an environment map corresponding to the at least one parameter based on at least one illumination result corresponding to the downsampled image.

[0015] Thirdly, embodiments of this disclosure also provide an electronic device, the electronic device comprising:

[0016] One or more processors;

[0017] Storage device for storing one or more programs.

[0018] When the one or more programs are executed by the one or more processors, the one or more processors implement the environment graph generation method as described in any of the embodiments of this disclosure.

[0019] Fourthly, embodiments of this disclosure also provide a storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to perform an environment map generation method as described in any of the embodiments of this disclosure.

[0020] The technical solution of this disclosure acquires a high-range dynamic range image, thereby determining a downsampled image corresponding to the high-range dynamic range image under at least one parameter. Further, it determines the illumination result corresponding to at least one pixel in the downsampled image. Based on the at least one illumination result corresponding to the downsampled image, it determines an environment map corresponding to at least one parameter. This solution calculates the minimum resolution required for the high-range dynamic range image under different model coarsening parameters, determines the downsampled image using this minimum resolution, and then applies the downsampled image to simulate illumination effects adapted to the high-range dynamic range image. This adaptively reduces the number of pixels involved in the illumination simulation calculation, thereby reducing noise in the environment map while increasing the speed of generating the environment map, thus improving the overall efficiency of determining the environment map. Attached Figure Description

[0021] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale.

[0022] Figure 1 This is a schematic flowchart of an environment map generation method provided in an embodiment of the present disclosure;

[0023] Figure 2This is a schematic diagram illustrating the import of high-range dynamic range images according to an embodiment of this disclosure;

[0024] Figure 3 This is a schematic diagram illustrating the implementation process of determining the environment diagram according to the embodiments of this disclosure;

[0025] Figure 4 This is a schematic flowchart illustrating another method for generating an environment map provided in an embodiment of this disclosure;

[0026] Figure 5 This is a schematic flowchart illustrating another method for generating an environment map provided in an embodiment of this disclosure;

[0027] Figure 6 This is a schematic diagram of the structure of an environment map generation device provided in an embodiment of the present disclosure;

[0028] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation

[0029] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.

[0030] It should be understood that the steps described in the method embodiments of this disclosure may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this disclosure is not limited in this respect.

[0031] The term "comprising" and its variations as used herein are open-ended inclusions, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below.

[0032] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are used only to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.

[0033] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".

[0034] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.

[0035] It is understood that before using the technical solutions disclosed in the various embodiments of this disclosure, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this disclosure in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.

[0036] For example, upon receiving a user's active request, a prompt message is sent to the user to explicitly inform them that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the software or hardware, such as the electronic device, application, server, or storage medium performing the operations of this disclosed technical solution, based on the prompt message.

[0037] As an optional but non-limiting implementation, in response to a user's active request, sending a prompt message to the user can be done via a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control allowing the user to choose "agree" or "disagree" to provide personal information to the electronic device.

[0038] It is understood that the above notification and user authorization process are merely illustrative and do not constitute a limitation on the implementation of this disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of this disclosure.

[0039] It is understood that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and related provisions.

[0040] Before introducing this technical solution, we can first illustrate the application scenarios. This technical solution can be applied to any scenario that requires rendering a 3D model and provides data support for simulating omnidirectional lighting effects, such as in live streaming, video playback, or image display, where data support is provided for simulating omnidirectional lighting effects when rendering a 3D model in the scene.

[0041] To more clearly illustrate this technical solution, a specific example will be used to explain its execution process. For instance, multiple model roughness values ​​are pre-defined. The user can select a high-range dynamic image whose lighting environment will be simulated, and determine downsampled images of the high-range dynamic image at different model roughness values. For each downsampled image, the lighting results corresponding to each pixel in the downsampled image are determined. Based on these lighting results, an environment map corresponding to the current roughness parameter is determined. Finally, the environment maps corresponding to the high-range dynamic image at different model roughness values ​​are obtained. When rendering a 3D model, one or more environment maps matching the roughness values ​​of the 3D model can be determined from the previously obtained environment maps based on the roughness values ​​of the 3D model. Based on the lighting data in these environment maps, a 3D model that can simulate omnidirectional lighting effects can be rendered.

[0042] Figure 1 This is a flowchart illustrating an environment map generation method provided in an embodiment of the present disclosure. This embodiment is applicable to any scenario that requires rendering a 3D model and provides data support for simulating omnidirectional lighting effects. The method can be executed by an environment map generation device, which can be implemented in software and / or hardware, or optionally by an electronic device, such as a mobile terminal, a PC, or a server.

[0043] like Figure 1 As shown, the method in this embodiment may specifically include:

[0044] S110, Acquire high-range dynamic images.

[0045] High-range dynamic range (HMR) images are those with a greater exposure dynamic range (i.e., greater contrast between light and dark areas) than ordinary images. Each color channel of an HMR image requires more data bits than a traditional image due to its linear encoding and the need to represent values ​​from 10... -4 Up to 10 8 High dynamic range (HDR) pixels are visible to the human eye and can even exceed that range. They are often represented using 16-bit "halfprecision" or 32-bit floating-point numbers. However, with appropriate transfer functions, some applications can use 10-12 bits to represent luminance and 8 bits to represent chrominance for HDR pixels.

[0046] Specifically, high-range dynamic images can be acquired in real time during the real-time acquisition of high-range dynamic images by the panoramic camera device. Alternatively, pre-acquired high-range dynamic images can be acquired from a preset storage unit. Optionally, one specific implementation method for acquiring high-range dynamic images may include: displaying an image import interface in response to a trigger operation on a first control; and displaying at least one image to be imported in response to a trigger operation on the image import interface, so as to determine and import the high-range dynamic image to be imported based on the trigger operation on at least one image to be imported.

[0047] For an example, see the diagram illustrating the import of high-range dynamic images. Figure 2 When a high-range dynamic image needs to be retrieved from a preset storage unit, the user can trigger the "Import High-Range Dynamic Image" control on the display screen (this control is the first control). After triggering the first control, the image import interface is displayed on the display screen. Then, the user can trigger the "Select Image" control in the image import interface. At this time, at least one image to be imported can be displayed on the display screen, for example, six images to be imported. If the user triggers "Image to be imported 2", then image to be imported 2 can be obtained and used as the high-range dynamic image.

[0048] S120. Determine the downsampled image corresponding to the high-range dynamic image under at least one parameter.

[0049] At least one parameter includes a pre-defined coarsening parameter of the target model to which the high-range dynamic range (HMR) image will be applied. The target model is the structural model to which the HMR image will be applied; for example, the target model includes, but is not limited to, a 3D model with actual physical volume and shape, a model used to construct a scene or background, or a model of a small object. The coarsening parameter of the target model can be understood as a model roughness value, which refers to an attribute used during rendering to describe the smoothness of an object's surface. It simulates the roughness of the object's surface, thereby affecting the reflection and scattering of light on the object's surface. The model roughness value typically ranges from 0 to 1, where 0 represents a completely smooth surface, and 1 represents a completely rough surface, with intermediate values ​​representing different degrees of roughness. In this embodiment, multiple model roughness values ​​with fixed values ​​can be pre-defined. For example, at least one parameter may include model roughness values ​​of 1, 0.8, 0.75, 0.6, 0.51, 0.45, 0.3, 0.24, 0.15, and 0. This solution pre-calculates environment maps corresponding to different model coarse parameters. When applying these environment maps, it enhances the adaptability of lighting effects to the rendering model and improves the realism of lighting effects based on environment maps.

[0050] Among them, the downsampled image is the image obtained by reducing the number of sampling points of a high-range dynamic image.

[0051] In this embodiment, downsampled images of the high-range dynamic image under different model roughness values ​​can be determined. For example, different model roughness values ​​include 1, 0.8, 0.75, 0.6, 0.51, 0.45, 0.3, 0.24, 0.15, and 0. Therefore, a first downsampled image of the high-range dynamic image under a model roughness value of 1, a second downsampled image of the high-range dynamic image under a model roughness value of 0.8, a third downsampled image of the high-range dynamic image under a model roughness value of 0.75, ..., and a tenth downsampled image of the high-range dynamic image under a model roughness value of 0 can be determined.

[0052] It is understandable that the specific implementation method for determining the downsampled image of a high-range dynamic image under various model roughness values ​​is the same. Here, we will take any one of the model roughness values ​​as the current model roughness value as an example for explanation. The specific implementation method for determining the current downsampled image of a high-range dynamic image under the current model roughness value can be as follows: using the normal distribution function and the current model roughness value, determine the normal distribution result under the current model roughness value, and then calculate the target sampling rate corresponding to the normal distribution result (for example, the angle range between the incident light and the reflected light under the current model roughness value can be determined by the normal distribution result, and the target sampling rate can be determined according to the correspondence between the angle range and the image resolution). The high-range dynamic image is then downsampled according to the target sampling rate to obtain the current downsampled image.

[0053] S130. Determine the illumination result corresponding to at least one pixel in the downsampled image.

[0054] At least one pixel may include each pixel in the downsampled image or a preset number of randomly selected pixels.

[0055] The illumination result can be understood as the illumination value. For any pixel, the illumination value can be calculated using the corresponding R channel pixel value, G channel pixel value, and B channel pixel value.

[0056] Specifically, determining the illumination result corresponding to at least one pixel in a downsampled image can include at least the following implementation methods:

[0057] The first implementation method involves using the illumination model formula to calculate the R-channel pixel value, G-channel pixel value, and B-channel pixel value corresponding to the current pixel in each pixel of the downsampled image, thereby obtaining the illumination value corresponding to the current pixel and thus obtaining the illumination result corresponding to each pixel.

[0058] The second implementation method involves randomly selecting a preset number of pixels from the downsampled image, and using the illumination model formula to calculate the three-channel pixel values ​​corresponding to each pixel to obtain the illumination value corresponding to each pixel, thereby obtaining the illumination result corresponding to each pixel.

[0059] The third implementation involves mapping the downsampled image onto the surface of a first 3D model with a geometric shape, for example, mapping the downsampled image onto the surface of a first sphere model; and mapping the high-range dynamic image onto the surface of a second 3D model with a geometric shape, wherein the second 3D model can enclose the first 3D model, for example, mapping the high-range dynamic image onto the surface of a second sphere model, wherein the radius of the second sphere model is larger than that of the first sphere model; taking any pixel in the downsampled image on the first 3D model as the current pixel, using the current pixel as the light source point, and using the normal distribution corresponding to the roughness value of the current model as the ray emission direction, a ray is emitted into the high-range dynamic image on the second 3D model, and the hit pixel in the high-range dynamic image is determined; thereby, based on the pixel value of the hit pixel and the lighting model formula, the lighting result corresponding to the current pixel is calculated. Based on the same method, the lighting result corresponding to each pixel in the downsampled image can be calculated.

[0060] S140. Based on at least one illumination result corresponding to the downsampled image, determine an environment map corresponding to at least one parameter.

[0061] The environment map can be understood as an image that simulates the lighting environment in a high-range dynamic image.

[0062] Specifically, the implementation of determining any environment map can include: determining the size of the environment map based on the size of the downsampled image, and determining the pixel value at each pixel position in the environment map based on at least one lighting result corresponding to the downsampled image, thereby obtaining the environment map.

[0063] In this embodiment, the number of environment maps corresponds to the number of at least one parameter. For example, the at least one parameter may include 10 different model roughness values: 1, 0.8, 0.75, 0.6, 0.51, 0.45, 0.3, 0.24, 0.15, and 0. Then, an environment map corresponding to each parameter can be determined. That is, 10 environment maps can be determined, including a first environment map corresponding to a model roughness value of 1, a second environment map corresponding to a model roughness value of 0.8, a third environment map corresponding to a model roughness value of 0.75, ..., and a tenth environment map corresponding to a model roughness value of 0.

[0064] Based on the above embodiments, the method further includes: loading and processing a high-range dynamic image based on an asynchronous thread to perform parallel execution of determining the downsampled image and the illumination result corresponding to each pixel in the downsampled image.

[0065] In this embodiment, a high-range dynamic image is loaded through an asynchronous thread, and the downsampled image and the illumination result corresponding to each pixel in the downsampled image are determined separately. Since concurrent processing is achieved through multiple execution paths and in a way that does not block the current thread, the concurrent processing capability and response speed of determining the environment map can be improved, thereby improving the speed of generating the environment map.

[0066] For example, see the schematic diagram of the implementation process for determining the environment graph. Figure 3 Users can select and import a high-range dynamic image by triggering an image selection control. Subsequently, an asynchronous thread loads and processes the high-range dynamic image to determine the downsampled image and the lighting result corresponding to each pixel in the downsampled image, thereby obtaining environment maps corresponding to different coarseness parameters. The specific implementation of determining the environment map corresponding to each coarseness parameter includes: first, determining the downsampled image corresponding to the high-range dynamic image under at least one parameter; then, determining the lighting result corresponding to at least one pixel in the downsampled image; based on the at least one lighting result corresponding to the downsampled image, determining the environment map corresponding to the current parameter; finally, merging the environment maps generated by various asynchronous threads to obtain the environment maps corresponding to different coarseness parameters.

[0067] The technical solution of this disclosure acquires a high-range dynamic range image, thereby determining a downsampled image corresponding to the high-range dynamic range image under at least one parameter. Further, it determines the illumination result corresponding to at least one pixel in the downsampled image. Based on the at least one illumination result corresponding to the downsampled image, it determines an environment map corresponding to at least one parameter. This solution calculates the minimum resolution required for the high-range dynamic range image under different model coarsening parameters, determines the downsampled image using this minimum resolution, and then applies the downsampled image to simulate illumination effects adapted to the high-range dynamic range image. This adaptively reduces the number of pixels involved in the illumination simulation calculation, thereby reducing noise in the environment map while increasing the speed of generating the environment map, thus improving the overall efficiency of determining the environment map.

[0068] Figure 4This is a schematic flowchart illustrating another environment map generation method provided in this embodiment. Based on the above embodiments, this embodiment details how to determine the downsampled image corresponding to a high-range dynamic image under at least one parameter, and how to determine the illumination result corresponding to at least one pixel in the downsampled image. Specific implementation details can be found in the detailed description of this embodiment. Technical features that are the same as or similar to those in the foregoing embodiments will not be repeated here.

[0069] like Figure 4 As shown, the method in this embodiment may specifically include:

[0070] S210, Acquire high-range dynamic images.

[0071] S220. For at least one parameter, determine the normal distribution corresponding to the parameter.

[0072] The normal distribution is used to describe the distribution of normals on a microplane. A microplane is any plane at the microscale that can be described by multiple tiny, perfectly reflective mirrors. These tiny mirrors are called microplanes.

[0073] In this embodiment, at least one parameter may include a pre-defined model roughness value applied to a high-range dynamic image. It is understood that for objects with high roughness values, light will scatter more on the surface, resulting in blurred, diffused, and softened reflections. In contrast, surfaces with low roughness values ​​exhibit sharper and more concentrated reflections. Therefore, for the same type of model, differences in model roughness values ​​will cause differences in normal distribution. In specific implementation, the model roughness value can be used as an input variable, and the normal distribution corresponding to the model roughness value can be calculated using a normal distribution function, where the normal distribution function can be selected from a variety of types.

[0074] S230. Based on the normal distribution, determine the downsampled image corresponding to at least one parameter.

[0075] In this embodiment, for the normal distribution corresponding to a certain model roughness value, the sampling resolution corresponding to the normal distribution result can be calculated. Based on this sampling resolution, the high-range dynamic image can be downsampled to obtain the current downsampled image. The purpose of determining the downsampled image in this embodiment is that, when determining the ambient lighting image corresponding to the high-range dynamic image, using the original high-precision high-range dynamic image for lighting simulation calculations would result in a large computational load and long processing time. Determining the downsampled image of the high-range dynamic image can reduce the computational load of generating the ambient lighting image and improve the computational speed. Furthermore, based on the normal distribution corresponding to the model roughness value, determining the downsampled image corresponding to the model roughness value can obtain downsampled images adapted to different model roughness values, thereby improving the practicality and realism of the ambient lighting image.

[0076] In this embodiment, the specific implementation of determining the downsampled image corresponding to at least one parameter based on the normal distribution may include: determining the sampling resolution corresponding to the high-range dynamic image based on the normal distribution; and performing sampling processing on the high-range dynamic image based on the sampling resolution to obtain the downsampled image corresponding to at least one parameter.

[0077] In this embodiment, the angle range between the incident and reflected light under the current model roughness value can be determined by the normal distribution results. Based on the correspondence between this angle range and the image resolution, the sampling resolution can be determined. Downsampling of the high-range dynamic image based on the sampling resolution yields the current downsampled image. Using the same determination method, downsampled images corresponding to each model roughness value can be determined. The advantage of this setup is that the key to downsampling high-range dynamic images lies in determining the sampling resolution. If the sampling resolution is too small, it cannot achieve the technical effect of speeding up and improving the generation of ambient lighting images; if the sampling resolution is too large, there will be serious noise issues in the generated ambient lighting images. In this embodiment, the sampling resolution adapted to the current model roughness value is determined by the normal distribution. This sampling resolution can be understood as the minimum sampling resolution that can be used under the current model roughness value. Based on this, for different model roughness values, a minimum sampling resolution that matches each model roughness value can be determined. By using this minimum sampling resolution to determine the downsampled image, the ambient lighting image determined based on the downsampled image can reduce ambient lighting image noise while increasing the speed of generating the ambient lighting image, thereby improving the overall efficiency of determining the ambient lighting image.

[0078] S240. For at least one pixel, determine the input ray based on the normal distribution of the downsampled image to which the pixel belongs and at least one ray emitted from the pixel as a light source.

[0079] The input light rays are the necessary input parameters for calculating the lighting results using the lighting model function.

[0080] In this embodiment, two spherical 3D models with different radii can be pre-configured, namely a first sphere model and a second sphere model, wherein the radius of the second sphere model is larger than that of the first sphere model, and the second sphere model surrounds the first sphere model. The downsampled image is mapped onto the surface of the first sphere model; the original high-range dynamic image is mapped onto the surface of the second sphere model; any pixel in the downsampled image on the first sphere model is taken as the current pixel, and using the current pixel as the light source point, with the normal distribution corresponding to the current model roughness value as the ray emission direction, at least one ray is emitted towards the high-range dynamic image on the second sphere model. These rays can serve as input rays.

[0081] S250. Based on the input light rays and the lighting model, determine the lighting result corresponding to the pixel.

[0082] The lighting results include the illumination values ​​of each pixel. The lighting model is a functional expression for calculating the lighting results, and can include various different types of lighting model functions.

[0083] In this embodiment, after the input light ray is emitted onto the high-range dynamic image on the surface of the second spherical model, at least one hit pixel in the high-range dynamic image can be determined. Then, the pixel value of at least one hit pixel and the input light ray can be used as input variables, and the lighting result corresponding to the current pixel can be calculated using the lighting model formula. Based on the same method, the lighting result corresponding to each pixel in the downsampled image can be calculated. In this embodiment, the lighting result is determined based on the pixel and normal distribution of the downsampled image. The lighting result can be determined from a small number of pixels in the downsampled image. Since the normal distribution is related to the model roughness value, the speed of determining the lighting result can be improved while ensuring the compatibility between the lighting result and the model roughness value, thereby determining a lighting result that conforms to the model roughness value.

[0084] S260. Based on at least one illumination result corresponding to the downsampled image, determine an environment map corresponding to at least one parameter.

[0085] The technical solution of this disclosure, when determining the downsampled image corresponding to a high-range dynamic image under at least one parameter, determines the normal distribution corresponding to the parameter for at least one parameter, and then determines the downsampled image corresponding to at least one parameter based on the normal distribution. Since this solution determines the downsampled image corresponding to the model roughness value based on the normal distribution corresponding to the model roughness value, it can obtain downsampled images adapted to different model roughness values, thereby improving the practicality and realism of the ambient lighting image. When determining the lighting result corresponding to at least one pixel in the downsampled image, for at least one pixel, the input ray is determined based on the normal distribution corresponding to the downsampled image to which the pixel belongs and at least one ray emitted by the pixel as a light source. Then, the lighting result corresponding to the pixel is determined based on the input ray and the lighting model. Since the normal distribution is related to the model roughness value in this solution, the speed of determining the lighting result can be improved while ensuring the adaptability of the lighting result to the model roughness value, thereby determining the lighting result that conforms to the model roughness value.

[0086] Figure 5 This is a schematic flowchart illustrating another environment map generation method provided in this embodiment. Based on the above embodiments, this embodiment details how to apply at least one environment map after it has been determined. For specific implementation details, please refer to the detailed description of the embodiments in this disclosure. Technical features that are the same as or similar to those in the foregoing embodiments will not be repeated here.

[0087] like Figure 5 As shown, the method in this embodiment may specifically include:

[0088] S310, Acquire high-range dynamic images.

[0089] S320. Determine the downsampled image corresponding to the high-range dynamic image under at least one parameter.

[0090] S330. Determine the illumination result corresponding to at least one pixel in the downsampled image.

[0091] S340. Based on at least one illumination result corresponding to the downsampled image, determine an environment map corresponding to at least one parameter.

[0092] S350. Upon receiving instructions from the simulated light source, determine the target parameters of the rendering model to determine at least one environment map to be used based on the target parameters.

[0093] The environment image to be used is the image in the environment map. The simulated light source command is an operational command used to simulate a lighting environment consistent with that in a high-range dynamic image. The rendering model can be a target 3D model selected by the user from at least one selectable 3D model. After the target image is subsequently determined, it needs to be mapped onto the surface of the rendering model.

[0094] The target parameter is the model roughness value corresponding to the rendered model, and can be a value between 0 and 1. In this embodiment, the target parameter can be a model roughness value selected or input by the user through a specific control, or it can be an inherent model roughness value of the rendered model.

[0095] In specific application environment maps, when a user wants to apply a light source to an image that matches the lighting environment in a high-range dynamic range image, they can trigger a pre-configured simulated light source control, which will then generate instructions for the simulated light source. Furthermore, the user can select a rendering model and determine the target model roughness value corresponding to that model; this target model roughness value is the target parameter. At least one environment map corresponds to different model roughness values. Based on the closeness of the target model roughness value to the model roughness values ​​corresponding to each environment map, at least one environment map to be used can be determined from at least one environment map.

[0096] For example, at least one environment map includes a first environment map corresponding to a model roughness value of 1, a second environment map corresponding to a model roughness value of 0.8, a third environment map corresponding to a model roughness value of 0.75, a fourth environment map corresponding to a model roughness value of 0.6, a fifth environment map corresponding to a model roughness value of 0.51, a sixth environment map corresponding to a model roughness value of 0.45, a seventh environment map corresponding to a model roughness value of 0.3, an eighth environment map corresponding to a model roughness value of 0.24, a ninth environment map corresponding to a model roughness value of 0.15, and a tenth environment map corresponding to a model roughness value of 0. If the target parameter, i.e., the target model roughness value, is 0.5, then at least one environment map to be used can be the fifth environment map, the sixth environment map, or both the sixth and fifth environment maps, etc.

[0097] S360. Determine the target image based on at least one environment map to be used.

[0098] In this embodiment, the target image can be one of at least one images to be used, or it can be an image determined based on at least one image to be used. In this embodiment, the environment map to be used corresponding to the target parameters is determined from the environment maps corresponding to different model roughness values. The target image is then determined based on the lighting results of the environment map to be used. This allows for the determination of a target image that meets user needs and has a high degree of compatibility with the rendering model, enhancing the application effect of the environment map and thus improving the user experience.

[0099] Based on the above examples, if at least one environment map to be used is a fifth environment map, then the fifth environment map is the target image, or the target image is obtained by performing specific calculations on the lighting results of the fifth environment map.

[0100] Optionally, at least one environment map to be used includes at least two environment maps to be used. The specific implementation of determining the target image based on at least one environment map to be used may include: interpolating the illumination results of each pixel in the at least two environment maps to be used based on the target parameters to obtain the target image.

[0101] The specific implementation methods of interpolation processing may include, but are not limited to: linear interpolation, polynomial interpolation, quadratic interpolation, spline interpolation, cubic spline interpolation, least squares interpolation, and nearest neighbor interpolation.

[0102] In this embodiment, at least two environment maps to be used can be environment maps corresponding to model roughness values ​​adjacent to the target parameters. For pixels at corresponding pixel positions in the at least two environment maps to be used, interpolation processing can be performed on the pixel values ​​at the current pixel position of each environment map to be used based on the target parameters to obtain the target lighting result corresponding to the current pixel position. Based on obtaining the target pixels at each pixel position, the target image can be obtained. In this way, by interpolating the lighting results of each pixel in at least two environment maps to be used to determine the target image, a target image that fits the target parameters more closely can be determined, improving the realism of the simulated lighting environment in the target image.

[0103] Based on the above example, the target parameter is 0.5, and at least two environment maps to be used are the fifth environment map and the sixth environment map. The model roughness value corresponding to the fifth environment map is 0.51, and the model roughness value corresponding to the sixth environment map is 0.45. The target lighting result for each pixel can be determined by linear interpolation. When determining any target lighting result, the lighting result of the fifth environment map at the current pixel position is A1, and the lighting result of the sixth environment map at the current pixel position is A2. The target lighting result can be S = a × A1 + b × A2. Since 0.5 is closer to 0.51, the weight value a corresponding to 0.51 is greater than the weight value b corresponding to 0.45.

[0104] The technical solution of this disclosure, after determining the environment map corresponding to at least one parameter, determines the target parameters of the rendering model upon receiving the instruction of the simulated light source, and determines at least one environment map to be used based on the target parameters, thereby determining the target image based on the at least one environment map to be used. This solution can determine the environment map to be used corresponding to the target parameters from the environment maps corresponding to different model roughness values, and then determine the target image based on the lighting results of the environment map to be used. This can determine a target image that meets user needs and has a high degree of adaptability to the rendering model, enhancing the application effect of the environment map and thus improving the user experience.

[0105] Figure 6 This is a schematic diagram of the structure of an environment map generation device provided in an embodiment of the present disclosure, such as... Figure 6 As shown, the device includes: a dynamic image determination module 410, a downsampled image determination module 420, an illumination result determination module 430, and an environment map determination module 440.

[0106] The system includes a dynamic image determination module 410 for acquiring a high-range dynamic image; a downsampled image determination module 420 for determining a downsampled image corresponding to the high-range dynamic image under at least one parameter; an illumination result determination module 430 for determining the illumination result corresponding to at least one pixel in the downsampled image; and an environment map determination module 440 for determining an environment map corresponding to the at least one parameter based on the at least one illumination result corresponding to the downsampled image.

[0107] Based on the above optional technical solutions, optionally, the downsampled image determination module 420 includes: a parameter normal determination unit and a downsampled image determination unit;

[0108] A parameter normal determination unit is used to determine the normal distribution corresponding to the at least one parameter.

[0109] The downsampled image determination unit is used to determine the downsampled image corresponding to the at least one parameter based on the normal distribution.

[0110] Based on the above optional technical solutions, the downsampled image determination unit may optionally include: a sampling rate determination subunit and a downsampled image determination subunit;

[0111] The sampling rate determination subunit is used to determine the sampling resolution corresponding to the high-range dynamic image based on the normal distribution.

[0112] The downsampled image determination subunit is used to sample and process the high-range dynamic image according to the sampling resolution to obtain the downsampled image corresponding to the at least one parameter.

[0113] Based on the above-mentioned optional technical solutions, optionally, the at least one parameter includes a pre-set coarse parameter of the target model applied to the high-range dynamic image.

[0114] Based on the above optional technical solutions, optionally, the illumination result determination module 430 includes: an input ray determination unit and an illumination result determination unit;

[0115] An input ray determination unit is used to determine an input ray for the at least one pixel based on the normal distribution of the downsampled image to which the pixel belongs and at least one ray emitted by the pixel as a light source.

[0116] The illumination result determination unit is used to determine the illumination result corresponding to the pixel based on the input light and the illumination model.

[0117] The illumination result includes the illumination value of the pixel.

[0118] Based on the above-mentioned optional technical solutions, the environment map generation device may also include: an image processing module;

[0119] The image processing module is specifically used to load and process the high-range dynamic image based on an asynchronous thread, so as to perform parallel execution to determine the downsampled image and the illumination result corresponding to each pixel in the downsampled image.

[0120] Based on the above-mentioned optional technical solutions, the optional environmental map generation device may also include:

[0121] The image to be used determination module is used to determine the target parameters of the rendering model when receiving the instruction of the simulated light source, so as to determine at least one environment image to be used based on the target parameters, wherein the environment image to be used is an image in the environment image;

[0122] The target image determination module is used to determine the target image based on the at least one environment image to be used.

[0123] Based on the above optional technical solutions, optionally, the at least one environment map to be used includes at least two environment maps to be used, and the target map determination module is specifically used to interpolate the illumination results of each pixel in the at least two environment maps to be used based on the target parameters to obtain the target image.

[0124] The technical solution of this disclosure acquires a high-range dynamic range image, thereby determining a downsampled image corresponding to the high-range dynamic range image under at least one parameter. Further, it determines the illumination result corresponding to at least one pixel in the downsampled image. Based on the at least one illumination result corresponding to the downsampled image, it determines an environment map corresponding to at least one parameter. This solution calculates the minimum resolution required for the high-range dynamic range image under different model coarsening parameters, determines the downsampled image using this minimum resolution, and then applies the downsampled image to simulate illumination effects adapted to the high-range dynamic range image. This adaptively reduces the number of pixels involved in the illumination simulation calculation, thereby reducing noise in the environment map while increasing the speed of generating the environment map, thus improving the overall efficiency of determining the environment map.

[0125] The environment map generation apparatus provided in this disclosure can execute the environment map generation method provided in any embodiment of this disclosure, and has the corresponding functional modules and beneficial effects of executing the method.

[0126] It is worth noting that the various units and modules included in the above-mentioned device are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be realized; in addition, the specific names of each functional unit are only for easy differentiation and are not used to limit the protection scope of the embodiments of this disclosure.

[0127] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Reference is made below. Figure 7 It illustrates an electronic device suitable for implementing embodiments of the present disclosure (e.g., Figure 7 The diagram below shows the structure of the terminal device or server 500. The terminal device in this embodiment may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), and vehicle terminals (e.g., vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. Figure 7 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.

[0128] like Figure 7As shown, electronic device 500 may include a processing unit (e.g., central processing unit, graphics processor, etc.) 501, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 502 or a program loaded from storage device 508 into random access memory (RAM) 503. The RAM 503 also stores various programs and data required for the operation of electronic device 500. The processing unit 501, ROM 502, and RAM 503 are interconnected via bus 504. An edit / output (I / O) interface 505 is also connected to bus 504.

[0129] Typically, the following devices can be connected to I / O interface 505: input devices 506 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 507 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 508 including, for example, magnetic tapes, hard disks, etc.; and communication devices 509. Communication device 509 allows electronic device 500 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 7 An electronic device 500 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.

[0130] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 509, or installed from a storage device 508, or installed from a ROM 502. When the computer program is executed by the processing device 501, it performs the functions defined in the methods of embodiments of this disclosure.

[0131] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.

[0132] The electronic device provided in this embodiment and the environment map generation method provided in the above embodiments belong to the same inventive concept. Technical details not described in detail in this embodiment can be found in the above embodiments, and this embodiment has the same beneficial effects as the above embodiments.

[0133] This disclosure provides a computer storage medium storing a computer program that, when executed by a processor, implements the environment map generation method provided in the above embodiments.

[0134] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.

[0135] In some implementations, clients and servers can communicate using any currently known or future-developed network protocol such as HTTP (Hypertext Transfer Protocol) and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future-developed networks.

[0136] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.

[0137] The aforementioned computer-readable medium carries one or more programs that, when executed by the electronic device, cause the electronic device to: acquire a high-range dynamic range image; determine a downsampled image corresponding to the high-range dynamic range image under at least one parameter; determine the illumination result corresponding to at least one pixel in the downsampled image; and determine an environment map corresponding to at least one parameter based on the at least one illumination result corresponding to the downsampled image.

[0138] Computer program code for performing the operations of this disclosure can be written in one or more programming languages ​​or a combination thereof, including but not limited to object-oriented programming languages ​​such as Java, Smalltalk, and C++, as well as conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0139] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0140] The units described in the embodiments of this disclosure can be implemented in software or in hardware. The name of a unit does not necessarily limit the unit itself; for example, the first acquisition unit can also be described as "a unit that acquires at least two Internet Protocol addresses".

[0141] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.

[0142] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0143] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.

[0144] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.

[0145] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.

Claims

1. A method for generating an environment map, characterized in that, include: Acquire high-range dynamic images; Determine the downsampled image corresponding to the high-range dynamic range image under at least one parameter; Determine the illumination result corresponding to at least one pixel in the downsampled image; Based on at least one illumination result corresponding to the downsampled image, an environment map corresponding to the at least one parameter is determined.

2. The method according to claim 1, characterized in that, Determining the downsampled image corresponding to the high-range dynamic image under at least one parameter includes: For the at least one parameter, determine the normal distribution corresponding to the parameter; Based on the normal distribution, determine the downsampled image corresponding to the at least one parameter.

3. The method according to claim 2, characterized in that, Determining the downsampled image corresponding to the at least one parameter based on the normal distribution includes: Based on the normal distribution, the sampling resolution corresponding to the high-range dynamic image is determined; The high-range dynamic image is sampled and processed according to the sampling resolution to obtain a downsampled image corresponding to the at least one parameter.

4. The method according to any one of claims 1-3, characterized in that, The at least one parameter includes pre-defined coarse parameters of the target model applied to the high-range dynamic image.

5. The method according to claim 1, characterized in that, Determining the illumination result corresponding to at least one pixel in the downsampled image includes: For the at least one pixel, the input ray is determined based on the normal distribution of the downsampled image to which the pixel belongs, and at least one ray emitted from the pixel as a light source; Based on the input light and the lighting model, determine the lighting result corresponding to the pixel. The illumination result includes the illumination value of the pixel.

6. The method according to claim 1, characterized in that, The method further includes: The high-range dynamic image is loaded and processed using an asynchronous thread to determine the downsampled image and the illumination result corresponding to each pixel in the downsampled image in parallel.

7. The method according to claim 1, characterized in that, The method further includes: Upon receiving an instruction from a simulated light source, target parameters of the rendering model are determined, and at least one environment map to be used is determined based on the target parameters, wherein the environment map to be used is an image in the environment map; Based on the at least one environment map to be used, the target image is determined.

8. The method according to claim 7, characterized in that, The at least one environment map to be used includes at least two environment maps to be used, and the step of determining the target image based on the at least one environment map to be used includes: The target image is obtained by interpolating the illumination results of each pixel in the at least two environment images to be used based on the target parameters.

9. An environmental map generation device, characterized in that, include: The dynamic image determination module is used to acquire high-range dynamic images; The downsampled image determination module is used to determine the downsampled image corresponding to the high-range dynamic image under at least one parameter; The illumination result determination module is used to determine the illumination result corresponding to at least one pixel in the downsampled image; An environment map determination module is used to determine an environment map corresponding to the at least one parameter based on at least one illumination result corresponding to the downsampled image.

10. An electronic device, characterized in that, The electronic device includes: One or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the environment graph generation method as described in any one of claims 1-8.

11. A storage medium containing computer-executable instructions, characterized in that, The computer-executable instructions, when executed by a computer processor, are used to perform the environment map generation method as described in any one of claims 1-8.