Image processing method, device, storage medium and terminal
By acquiring and processing image generation data on mobile terminals, and using ray tracing calculations and hybrid ray tracing algorithms, the problem of low image quality in 3D applications is solved and high-quality image rendering and real-time effects are achieved.
Patent Information
- Application Number
- CN202210254195.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-15
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2042-03-15
AI Technical Summary
The image quality of 3D applications running on mobile terminals is poor, and the existing ray tracing technology requires a huge amount of calculations and cannot be implemented on typical mobile terminals.
By obtaining image generation data, including target scene data and lighting data, it is sent to the data processing engine for ray tracing calculations to obtain image rendering parameters, and image rendering is performed based on these parameters. A hybrid ray tracing algorithm is used to improve the image display effect while taking into account Computing power limitations of mobile terminals.
The image rendering of the ray tracing algorithm is implemented on the mobile terminal, which significantly improves the image quality, ensures real-time rendering effects, and adapts to the computing power limitations of the terminal.
Smart Images

Figure CN114596403B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to an image processing method, device, storage medium and terminal. Background Art
[0002] With the continuous development of mobile terminal technology and the continuous reduction of traffic costs, terminal applications are also showing a flourishing development trend. In particular, some applications that were previously only available on personal computers can now be used on mobile terminals. For example, some game applications that were previously only available on personal computers, especially three-dimensional (3D) game applications, can now be run on mobile terminals.
[0003] However, the image quality of the 3D applications currently running on terminals is poor. Summary of the invention
[0004] The present application provides an image processing method, device, storage medium and terminal, which can improve the display quality of images in mobile terminal applications.
[0005] In a first aspect, the present application provides an image processing method, applied to a mobile terminal, the method comprising:
[0006] Acquiring image generation data, wherein the image generation data includes target scene data and illumination data corresponding to the target scene;
[0007] Sending the image generation data to a data processing engine for ray tracing calculation to obtain a first image rendering parameter;
[0008] The image rendering parameters returned by the data processing engine are received, and image rendering is performed according to the image rendering parameters to obtain a target image.
[0009] Accordingly, a second aspect of the present application provides an image processing device, applied to a mobile terminal, the device comprising:
[0010] An acquisition module, used to acquire image generation data, wherein the image generation data includes target scene data and illumination data corresponding to the target scene;
[0011] A first sending module, used for sending the image generation data to a data processing engine for performing ray tracing calculation to obtain a first image rendering parameter;
[0012] The first receiving module is used to receive the image rendering parameters returned by the data processing engine, and perform image rendering according to the image rendering parameters to obtain a target image.
[0013] In a third aspect, the present application provides an image processing method, which is applied to a mobile terminal and includes:
[0014] receiving image generation data, wherein the image generation data includes target scene data and illumination data corresponding to the target scene;
[0015] Performing ray tracing calculation on the image generation data to obtain image rendering parameters;
[0016] The image rendering parameters are sent to an image processing engine for image rendering to obtain a target image.
[0017] Accordingly, a fourth aspect of the present application provides an image processing device, applied to a mobile terminal, the device comprising:
[0018] A second receiving module, configured to receive image generation data, wherein the image generation data includes target scene data and illumination data corresponding to the target scene;
[0019] A calculation module, used for performing ray tracing calculation on the image generation data to obtain image rendering parameters;
[0020] The second sending module is used to send the image rendering parameters to the image processing engine for image rendering to obtain a target image.
[0021] In a fifth aspect, the present application provides a storage medium having a computer program stored thereon, which, when loaded by a processor of an electronic device, executes the steps of any image processing method provided in the present application.
[0022] In a sixth aspect, the present application further provides an electronic device, comprising a processor and a memory, wherein the memory stores a computer program, and the processor executes the steps of any image processing method provided in the present application by loading the computer program stored in the memory.
[0023] The technical solution provided by the present application is adopted, that is, by acquiring image generation data, the image generation data includes target scene data and illumination data corresponding to the target scene; sending the image generation data to a data processing engine for ray tracing calculation to obtain a first image rendering parameter; receiving the image rendering parameter returned by the data processing engine, and performing image rendering according to the image rendering parameter to obtain a target image. Through this method, a ray tracing algorithm can be used in a mobile terminal to implement image rendering, thereby greatly improving the image quality of the image displayed in the mobile terminal. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0025] Figure 1 It is a flowchart of the image processing method provided in an embodiment of the present application.
[0026] Figure 2 It is another flowchart of the image processing method provided in an embodiment of the present application.
[0027] Figure 3 It is a structural block diagram of the image processing device provided in an embodiment of the present application.
[0028] Figure 4 This is another structural block diagram of the image processing device provided in an embodiment of the present application.
[0029] Figure 5 It is an architecture diagram of the image processing system provided in an embodiment of the present application.
[0030] Figure 6 It is a timing diagram of the image processing method provided in an embodiment of the present application.
[0031] Figure 7 This is the architecture diagram of the data processing engine provided in the embodiment of the present application
[0032] Figure 8 It is a structural block diagram of the terminal provided in an embodiment of the present application. DETAILED DESCRIPTION
[0033] It should be noted that the terms "first", "second" and "third" in this application are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or modules is not limited to the listed steps or modules, but some embodiments also include steps or modules that are not listed, or some embodiments also include other steps or modules inherent to these processes, methods, products or devices.
[0034] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0035] The embodiments of the present application provide an image processing method, device, storage medium, terminal and system, wherein the execution subject of the image processing method may be the image processing device provided in the embodiments of the present application, or an electronic device integrating the image processing device, wherein the image processing device may be implemented in hardware or software. The electronic device may be a mobile terminal. The mobile terminal may be a smart phone, a tablet, a vehicle-mounted terminal or a smart wearable device, etc.
[0036] Please refer to Figure 1 , Figure 1 A schematic diagram of the process of the image processing method provided in the embodiment of the present application is shown in FIG. Figure 1 As shown, the process of the image processing method provided in the embodiment of the present application can be as follows:
[0037] At 110 , image generation data is acquired.
[0038] The following description is made by taking the execution subject of the image processing method as a mobile terminal as an example. More specifically, the execution subject of the image processing method may be an image processing engine in the mobile terminal.
[0039] 3D applications, or 3D software, refer to the display of 3D graphics on the two-dimensional display screen of an electronic device. Unlike the real three-dimensional space in the display world, which has real distance space, the 3D graphics displayed on the display screen of an electronic device only look like the real world. Specifically, the reason why people can enjoy three-dimensional images that look like real objects on the two-dimensional display screen of an electronic device is that the different color grayscales when displayed on the two-dimensional screen of the electronic device cause a visual illusion to the human eye, thereby perceiving the two-dimensional electronic device display screen as a three-dimensional image. The development and use of 3D applications make the output of the application more three-dimensional and realistic, which can greatly enhance the interactive experience with users.
[0040] Among them, the most typical 3D applications are 3D games and 3D animations. In 3D games or 3D animations, the image processing engine can further render the lighting in the environment to obtain shadows, reflections, and refractions that are more in line with the real world. Generally, 3D animations are rendered using offline rendering methods, while 3D games require real-time image rendering based on user operations. 3D animation image rendering can be rendered using ray tracing methods.
[0041] Ray tracing is the first unbiased rendering method. Its basic idea is to send out a ray of light from the viewpoint. When the ray of light intersects the surface of the object, it continues to sample a direction according to the material properties of the surface and sends out another ray of light. This iteration continues until the ray of light hits the light source (or escapes from the scene). Then the Monte Carlo method is used to calculate the contribution of the light as the color value of the pixel. The solution of the integral using the Monte Carlo method is unbiased. As long as the time is long enough, the final image can converge to a correct result. Compared with other image rendering technologies, the ray tracing algorithm can create more realistic light and shadow effects, and can far exceed the effects that people can simulate by imagination.
[0042] However, ray tracing technology has not been applied to 3D games on mobile terminals at present, because the amount of calculation of ray tracing technology is extremely large, and the graphics cards of mobile terminals of all generations over the years are not competent for this task. In this regard, the image processing algorithm provided by this application can be used in mobile terminals to implement image rendering using ray tracing algorithms. The image processing algorithm provided by this application is introduced in detail below.
[0043] First, the image processing engine in the mobile terminal can obtain image generation data, wherein the image generation data may include target scene data and illumination data corresponding to the target scene. Among them, when the image processing method provided by the present application is applied to a 3D game scene, the image processing engine in this embodiment may be an image processing module in the 3D game engine. Among them, the target scene may be a game scene in a 3D game, and the target scene information may include environmental information, object information, and character information. The object information may specifically include the name, position, and vertex coordinates of the object, and similarly, the character information may also include the above-mentioned related data. For each object or character, it may further include information such as the metallicity, roughness, and transparency of the material ball of the object or character.
[0044] The illumination data corresponding to the target scene may specifically include information such as the light source position, light source properties, and light intensity. Among them, the light source properties may include point light sources, surface light sources, parallel light sources, etc. That is, the image generation data provided in this application includes the relevant data required for ray tracing calculations.
[0045] Among them, the image processing engine can be a processing engine that generates image generation data according to the application's running data and the user's interactive data in the application, and processes the image generation data and renders the corresponding application image. Specifically, when the application is a game application, the image processing engine here can be an image processing function module in the game engine, and the game engine here can specifically be a 3D game engine. Acquiring the image generation data can specifically be real-time monitoring of the image generation data generated in the image processing engine. When the image generation data is generated in the image processing engine, the image generation data is extracted from the image processing engine in real time for ray tracing calculation. Alternatively, the image processing engine can send the generated image generation data to the ray tracing calculation engine in real time after detecting that the image generation data has been generated.
[0046] In 120, the image generation data is sent to a data processing engine for ray tracing calculation to obtain a first image rendering parameter.
[0047] Among them, in an embodiment of the present application, a separate data processing engine can also be set in the mobile terminal, and the data processing engine can exist independently of the image processing engine or the 3D game engine, for example, it can be installed in the mobile terminal in the form of a plug-in. The data processing engine has the function of ray tracing calculation, so it can also be called a ray tracing engine. The ray tracing engine can perform ray tracing calculations on the input image generation data to obtain image rendering parameters. That is, when the image processing engine in the mobile terminal obtains the image generation data, it can send the image data to the ray tracing engine. Then, after receiving the image generation data, that is, the aforementioned target scene data and illumination data, the ray tracing engine can further perform ray tracing calculations based on the target scene data and the illumination data, so as to calculate the first image rendering parameters that can render the target image. Among them, the first image rendering parameters can specifically include shadow data, reflection data, refraction data, and ambient light occlusion map texture data, etc. The first image rendering parameters here are conveniently distinguished from the second image rendering parameters in this application.
[0048] Exemplarily, the data processing engine can use the global (world) class, mesh (mesh) class, material (material) class, and scene (scene) class to manage image generation data. Among them, the global class is responsible for managing the mesh class 422, the material class 423, the scene class 424, and determining the ray tracing mode used for ray tracing calculations. The mesh class 422 is responsible for the data management of each object in the target scene. The object data may specifically include the object name, position, and vertex coordinates. The material class 423 is responsible for managing the metalness, roughness, and transparency of the material ball of each object passed in. The scene class 424 is responsible for managing the scene information of the passed in target scene. The underlying calculation class 425 uses the corresponding ray tracing algorithm to perform ray tracing calculations based on the ray tracing mode and various types of information passed in by the global class 421, and outputs image rendering parameters.
[0049] In some embodiments, performing image rendering according to image rendering parameters to obtain a target image includes:
[0050] 1. Obtaining data to be rendered, where the data to be rendered is a second image rendering parameter obtained by rasterizing the image generation data;
[0051] 2. Perform image rendering according to the first image rendering parameter and the second image rendering parameter to obtain a target image.
[0052] Among them, although the image rendering data calculated by the ray tracing algorithm can render images with better display effects, the ray tracing algorithm requires more computing resources and has relatively low computing efficiency. The ray tracing algorithm cannot be used to calculate image rendering parameters in all scenarios.
[0053] Therefore, in the embodiment of the present application, a method using hybrid ray tracing is provided for image processing. Specifically, part of the image generation data can be sent to the ray tracing engine for ray tracing calculation to obtain the first image rendering parameters; the other part of the image generation data can be left in the game engine (i.e., the aforementioned image processing engine) for rasterization calculation to obtain the second image rendering parameters. Then, the first image rendering parameters calculated by the ray tracing engine are merged into the second image rendering parameters for hybrid rendering.
[0054] The use of hybrid ray tracing algorithms for image processing can improve the image display effect to a certain extent, while neutralizing the computing power of the terminal and ensuring the efficiency of image rendering, thereby ensuring the effect of real-time rendering.
[0055] In some embodiments, the image processing method provided by the present application further includes:
[0056] A. determining an image rendering mode according to the target scene data and the illumination data;
[0057] The performing image rendering according to the first image rendering parameter and the second image rendering parameter to obtain a target image includes:
[0058] B. Select corresponding data from the first image rendering parameters and the second image rendering parameters according to the image rendering mode to perform image rendering to obtain a target image.
[0059] Among them, as mentioned above, in different scenarios, different image rendering methods can be used to perform image rendering. Therefore, before performing image rendering, it is necessary to first determine the specific image rendering method. The image rendering methods that can be used in the embodiments of the present application can be divided into rasterization mode, hybrid ray tracing mode and full ray tracing mode. Among them, for different image rendering modes, the computing resources required for the calculation and the corresponding amount of calculation are different; and the image rendering effects corresponding to the image rendering parameters calculated by different image rendering modes are also different.
[0060] Specifically, the rasterization mode is an image rendering mode commonly used in current game engines. This mode requires fewer computing resources, but the display effect of the rendered image is poor, and the 3D realism is lacking. The hybrid ray tracing mode is a method of hybrid rendering using rasterization and ray tracing modes. This method requires higher computing power than the rasterization mode, but the display effect is better than the display effect of the rasterization mode. The full ray tracing mode has higher requirements on computing power, and this mode can also obtain better display effects than the hybrid ray tracing. In an embodiment of the present application, the determination of the image rendering mode can be specifically determined based on the target scene data and lighting data included in the image generation data.
[0061] In some embodiments, determining an image rendering mode according to target scene data and illumination data includes:
[0062] A1. Determine the scene complexity based on the target scene data;
[0063] A2. Obtain the illumination mode corresponding to the illumination data;
[0064] A3. Determine the image rendering mode based on the scene complexity and lighting mode.
[0065] In an embodiment of the present application, the complexity of the scene can be determined based on the target scene data, and the illumination mode corresponding to the illumination data can be determined based on the illumination data. Here, the complexity of the scene can be determined based on parameters such as the number of objects in the scene, and the illumination mode can specifically be a light source type, such as a point light source, a surface light source, a parallel skylight, etc. Among them, for the same image rendering mode, the higher the complexity of the scene and the more complex the illumination mode, the larger the amount of data required to calculate the overall image rendering, and the more computing power resources are consumed. For mobile terminals, their computing power resources are often limited, and under normal circumstances, the computing power resources of mobile terminals are fixed. Then, when the complexity of the scene is higher and the illumination mode is more complex, it is necessary to use an image rendering mode that consumes less computing power resources as much as possible to render the image, so as to ensure that the image can be rendered in real time, and to avoid jamming during the game and affecting the user's gaming experience. If the scene is relatively simple and the illumination mode is not complex, an image rendering mode with better display effect can be used, such as a hybrid ray tracing mode or even a full ray tracing mode.
[0066] In some embodiments, when the image generation data is obtained, the image rendering mode can be determined according to the image generation data. When the image rendering mode is determined to be the rasterization mode, the image generation data may not be sent to the ray tracing engine, but the rasterization calculation may be directly performed in the game engine to obtain the second image rendering parameters, and then the image rendering is performed according to the second image rendering parameters to obtain the target image.
[0067] In some embodiments, the image processing method provided by the present application further includes:
[0068] C. Obtaining data processing capability information of the mobile terminal;
[0069] The image rendering mode is determined according to the scene complexity and lighting mode, including:
[0070] D. Determine the image rendering mode based on scene complexity, lighting pattern, and data processing capability information.
[0071] Among them, in the embodiments of the present application, since the image processing algorithm provided by the present application can be used in various types of mobile terminals, and the computing power of the processors in different mobile terminals is different. Therefore, when determining the image rendering mode, the data processing capability information of the current mobile terminal can be further obtained, that is, the computing power of the mobile terminal is first obtained. After obtaining the computing power of the mobile terminal, the image rendering mode that is most suitable for the current mobile terminal is further determined based on the computing power of the current mobile terminal combined with the scene complexity of the target scene and the lighting mode.
[0072] Among them, the target application interface provided in this embodiment can be a lightweight ray tracing calculation algorithm, which requires lower terminal computing power support than a complete ray tracing algorithm, but can obtain better quality image rendering parameters, thereby generating better quality images.
[0073] In 130, the image rendering parameters returned by the data processing engine are received, and image rendering is performed according to the image rendering parameters to obtain a target image.
[0074] Among them, after the ray tracing engine calculates the image rendering parameters according to the target scene information and lighting information received from the image processing engine, the ray tracing engine can further send these image rendering parameters to the image processing engine for image rendering.
[0075] When the image rendering mode is full ray tracing, the image rendering can be performed only according to the first image rendering parameters returned by the ray tracing engine to obtain the target image. When the image rendering mode is hybrid ray tracing, the target image can be obtained by hybrid rendering according to the first image rendering parameters returned by the ray tracing engine and the second image rendering parameters generated in the game engine.
[0076] The image processing algorithm provided in this application can realize image rendering using a ray tracing algorithm under the computing power limitations of the mobile terminal, thereby greatly improving the image display quality in mobile terminal applications.
[0077] According to the above description, the image processing method provided by the present application obtains image generation data, which includes target scene data and illumination data corresponding to the target scene; sends the image generation data to the data processing engine for ray tracing calculation to obtain the first image rendering parameter; receives the image rendering parameter returned by the data processing engine, and performs image rendering according to the image rendering parameter to obtain the target image. Through this method, the ray tracing algorithm can be used in the mobile terminal to implement image rendering, thereby greatly improving the image quality of the image displayed in the mobile terminal.
[0078] Please refer to Figure 2 , Figure 2 Another flowchart of the image processing method provided in the embodiment of the present application is as follows: Figure 2 As shown, the process of the image processing method provided in the embodiment of the present application can be as follows:
[0079] At 210, image generation data is received.
[0080] The following description is made by taking the execution subject of the image processing method as a mobile terminal as an example. More specifically, the execution subject of the image processing method may be a data processing engine in the mobile terminal. The data processing engine may perform ray tracing calculations on the received image generation data to obtain image rendering parameters, so the data processing engine may also be a ray tracing engine.
[0081] In the embodiment of the present application, the image generation data may be sent to the ray tracing engine by the image processing engine in the mobile terminal, and the image processing engine in the mobile terminal may be an engine that generates the image generation data according to the running data of the application and the interactive data input by the user. Specifically, when the application is a game application, the image processing engine may be a game engine. Specifically, the game engine may be a 3D game engine.
[0082] The image generation data may include target scene data and illumination data corresponding to the target scene. The target scene data may include background data of the scene and object data in the scene, wherein the objects in the scene may be people, animals or other items. The object data in the scene may include information such as the name, coordinates and vertex coordinates of the object, and may also include information such as the metallicity, roughness and transparency of the object. The illumination data may include attribute information of the light source and illumination intensity information, wherein the attribute information of the light source may be point light source, surface light source, movable light source, etc.
[0083] In 220 , ray tracing calculation is performed on the image generation data to obtain image rendering parameters.
[0084] Among them, in the embodiment of the present application, a data processing engine can be additionally configured in addition to the image processing engine of the application, and the data processing engine can be installed in the application in the form of a plug-in, and the application here can specifically be a 3D game application. The data processing engine is used to perform ray tracing calculations on the image generation data received from the image processing engine. Therefore, the data processing engine here can also be called a ray tracing engine.
[0085] In this way, when the image processing engine in the terminal application obtains the image generation data, it can send the image generation data to the aforementioned ray tracing engine for ray tracing calculation. It can be understood that the image generation data here is the data required for ray tracing calculation. After receiving the image generation data sent by the image processing engine, the ray tracing engine can perform calculations based on the image generation data to obtain image rendering parameters.
[0086] In some embodiments, performing ray tracing calculation on the image generation data to obtain image rendering parameters includes:
[0087] determining a target application program interface corresponding to the ray tracing algorithm from an application program interface library;
[0088] The target application program interface is called to perform ray tracing calculations on the target scene data and lighting data to obtain output image rendering parameters.
[0089] In some embodiments, performing ray tracing calculation on the image generation data to obtain image rendering parameters includes:
[0090] 1. Determine the target API corresponding to the ray tracing algorithm from the API library;
[0091] 2. Call the target application program interface to perform ray tracing calculations on the target scene data and lighting data to obtain the output image rendering parameters.
[0092] Among them, in an embodiment of the present application, the ray tracing calculation function can be implemented by calling various application programming interfaces (Application Programming Interface, API) corresponding to the ray tracing algorithm. Specifically, the preset application programming interface library can be obtained first, and the application programming interface library can be specifically Vulkan. Among them, Vulkan is a cross-platform 2D and 3D graphics application programming interface that aims to provide lower central processing unit (CPU) overhead and more direct image processing unit (GPU) control. Then, the target application programming interface corresponding to the ray tracing algorithm can be determined from the application programming interface library. Here, the target application programming interface can be one or more. Furthermore, the target application programming interface can be called to process the target scene data and lighting data to obtain the output image rendering parameters.
[0093] In 230, the image rendering parameters are sent to an image processing engine for image rendering to obtain a target image.
[0094] Among them, after the ray tracing engine calculates the image rendering parameters, it can send the image rendering parameters to the image processing engine for rendering and display. The image processing engine can receive the image rendering parameters returned by the data processing engine (i.e., the ray tracing engine) in real time. That is, after the aforementioned ray tracing engine calculates the image rendering parameters, it will send the image rendering parameters to the image processing engine in real time. After receiving the image rendering parameters, the image processing engine can render the image according to the image rendering parameters to obtain the target image.
[0095] According to the above description, the image processing method provided by the present application receives image generation data, which includes target scene data and illumination data corresponding to the target scene; performs ray tracing calculation on the image generation data to obtain image rendering parameters; and sends the image rendering parameters to the image processing engine for image rendering to obtain the target image. In this way, the image processing method provided by the present application can be equipped with a computing engine for ray tracing calculation outside the image processing engine, which is used to implement ray tracing rendering of images in the mobile terminal, thereby improving the display quality of the image in the mobile terminal.
[0096] Please refer to Figure 3 , Figure 3 FIG. 3 is a schematic diagram of a structure of an image processing device 300 provided in an embodiment of the present application. The image processing device 300 is applied to an electronic device provided in the present application. Figure 3 As shown, the image processing device 300 may include:
[0097] An acquisition module 310 is used to acquire image generation data, where the image generation data includes target scene data and illumination data corresponding to the target scene;
[0098] A first sending module 320, configured to send the image generation data to a data processing engine for performing ray tracing calculation to obtain a first image rendering parameter;
[0099] The rendering module 330 is used to receive the image rendering parameters returned by the data processing engine, and perform image rendering according to the image rendering parameters to obtain a target image.
[0100] Optionally, in one embodiment, the rendering module includes:
[0101] A first acquisition submodule is used to acquire data to be rendered, where the data to be rendered is a second image rendering parameter obtained by rasterizing the image generation data;
[0102] The rendering submodule is used to perform image rendering according to the first image rendering parameter and the second image rendering parameter to obtain a target image.
[0103] Optionally, in one embodiment, the image processing device provided by the present application further includes:
[0104] A determination submodule, used to determine an image rendering mode according to target scene data and illumination data;
[0105] The rendering submodule is also used for:
[0106] According to the image rendering mode, corresponding data is selected from the first image rendering parameter and the second image rendering parameter to perform image rendering to obtain a target image.
[0107] Optionally, in one embodiment, the determining submodule is further used for:
[0108] Determine the scene complexity based on the target scene data;
[0109] Get the lighting mode corresponding to the lighting data;
[0110] Determine the image rendering mode based on the scene complexity and lighting mode.
[0111] Optionally, in one embodiment, the image processing device provided by the present application further includes:
[0112] The second acquisition submodule is used to acquire data processing capability information of the mobile terminal;
[0113] Identify submodules. Also used for:
[0114] The image rendering mode is determined based on the scene complexity, lighting pattern, and data processing capability information.
[0115] It should be noted that the image processing device 300 provided in the embodiment of the present application is different from the image processing device 300 in the above embodiment. Figure 1 The image processing method shown belongs to the same concept, and its specific implementation process is detailed in the above related embodiments, which will not be repeated here.
[0116] According to the above description, the image processing device provided by the present application obtains image generation data through the acquisition module 310, and the image generation data includes target scene data and illumination data corresponding to the target scene; the first sending module 320 sends the image generation data to the data processing engine for ray tracing calculation to obtain the first image rendering parameters; the rendering module 330 receives the image rendering parameters returned by the data processing engine, and performs image rendering according to the image rendering parameters to obtain the target image. Through this method, the ray tracing algorithm can be used in the mobile terminal to implement image rendering, thereby greatly improving the image quality of the image displayed in the mobile terminal.
[0117] Please refer to Figure 4 , Figure 4 FIG. 3 is another structural diagram of an image processing device 300 provided in an embodiment of the present application. The image processing device 300 is applied to the electronic device provided in the present application. Figure 4 As shown, the image processing device 300 may include:
[0118] A second receiving module 340 is used to receive image generation data, where the image generation data includes target scene data and illumination data corresponding to the target scene;
[0119] A calculation module 350, configured to perform ray tracing calculation on the image generation data to obtain image rendering parameters;
[0120] The second sending module 360 is used to send the image rendering parameters to the image processing engine for image rendering to obtain a target image.
[0121] Optionally, in one embodiment, the computing module includes:
[0122] A submodule is determined, which is used to determine a target application program interface corresponding to the ray tracing algorithm from an application program interface library;
[0123] The calculation submodule is used to call the target application program interface to perform ray tracing calculation on the target scene data and the illumination data to obtain output image rendering parameters.
[0124] It should be noted that the image processing device 300 provided in the embodiment of the present application is different from the image processing device 300 in the above embodiment. Figure 2 The image processing method shown belongs to the same concept, and its specific implementation process is detailed in the above related embodiments, which will not be repeated here.
[0125] According to the above description, the image processing device provided by the present application receives image generation data through the receiving module 340, and the image generation data includes target scene data and illumination data corresponding to the target scene; the computing module 350 performs ray tracing calculation on the image generation data to obtain image rendering parameters; the second sending module 360 sends the image rendering parameters to the image processing engine for image rendering to obtain the target image. In this way, the image processing method provided by the present application can be equipped with a computing engine for ray tracing calculation outside the image processing engine, which is used to implement ray tracing rendering of images in the mobile terminal, thereby improving the display quality of the image in the mobile terminal.
[0126] Please refer to Figure 5 , Figure 5 The structure diagram of the image processing system 400 provided in the present application is shown in FIG. 4 , which runs in a mobile terminal. Figure 1 and Figure 2 The image processing method provided in the corresponding embodiment will not be described in detail here. Figure 5 As shown, the image processing system provided by the present application includes at least one image processing engine 410 and at least one data processing engine 420, wherein:
[0127] The data processing engine is used to receive the image generation data sent by the image processing engine, and perform ray tracing calculation on the image generation data to obtain image rendering parameters;
[0128] The image processing engine is used to send image generation data to the data processing engine, and to perform image rendering according to image rendering parameters returned by the data processing engine to obtain a target image.
[0129] See also Figure 6 , Figure 6 The timing interaction diagram of the image processing method provided in the present application, as shown in the figure, the image processing engine 410 obtains image generation data during operation, and then sends the obtained image generation data to the data processing engine 420 for ray tracing calculation, wherein the image generation data may specifically include target scene data and lighting data. After receiving the image generation data, the data processing engine 420 can determine the target ray tracing mode for processing the image generation data according to the target scene data and the computing power information in the mobile terminal, and perform ray tracing calculations on the image generation data according to the target ray tracing mode to obtain image rendering data. Furthermore, the data processing engine 420 sends the image rendering data to the image processing engine 410 for image rendering to obtain the target image. Among them, as Figure 7 As shown, it is an architecture diagram of the data processing engine provided by the embodiment of the present application. As shown in the figure, the data processing engine 420 specifically uses the global (world) class 421, the mesh (mesh) class 422, the material (material) class 423, and the scene (scene) class 424 to manage the data passed in by the image processing engine 410. Among them, the global class 421 is responsible for managing the mesh class 422, the material class 423, the scene class 424 and the ray tracing mode used for determining the ray tracing calculation. The mesh class 422 is responsible for the data management of each object in the target scene passed in by the image processing engine 410. The data of the object may specifically include the object name, position, and vertex coordinates. The material class 423 is responsible for managing the metalness, roughness, and transparency of the material ball of each object passed in. The scene class 424 is responsible for managing the scene information of the target scene passed in. The underlying calculation class 425 adopts the corresponding ray tracing algorithm to perform ray tracing calculations according to the ray tracing mode and various types of information passed in by the global class 421, and outputs the image rendering parameters.
[0130] The present application also provides a storage medium on which a computer program is stored. When the computer program stored therein is executed on a processor of an electronic device provided in the present application, the processor of the electronic device executes any of the steps in the above image processing method suitable for the electronic device. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
[0131] This application also provides a terminal, please refer to Figure 8, the terminal 500 includes a processor 510 and a memory 520 .
[0132] The processor 510 in the embodiment of the present application may be a general-purpose processor, such as an ARM architecture processor.
[0133] The memory 520 stores a computer program, which may be a high-speed random access memory or a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 520 may also include a memory controller to provide the processor 501 with access to the memory 520. The processor 510 executes any of the above image processing methods by executing the computer program in the memory 520, such as:
[0134] Acquire image generation data, the image generation data includes target scene data and illumination data corresponding to the target scene; send the image generation data to a data processing engine for ray tracing calculation to obtain a first image rendering parameter; receive the image rendering parameter returned by the data processing engine, and perform image rendering according to the image rendering parameter to obtain a target image. Alternatively, receive image generation data, the image generation data includes target scene data and illumination data corresponding to the target scene; perform ray tracing calculation on the image generation data to obtain image rendering parameters; send the image rendering parameters to an image processing engine for image rendering to obtain a target image.
[0135] The above is a detailed introduction to an image processing method, device, storage medium, terminal and system provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. An image processing method, characterized in that: The method is applied to a mobile terminal, and the method comprises: Acquiring image generation data, wherein the image generation data includes target scene data and illumination data corresponding to the target scene; The image generation data is sent to a data processing engine for ray tracing calculation to obtain first image rendering parameters, including: the global class of the data processing engine manages the grid class, the material class, the scene class and determines the ray tracing mode used for ray tracing calculation; the data processing engine uses the grid class to manage the data of each object in the target scene, uses the material class to manage the material ball information of each object passed in, and uses the scene class to manage the scene information of the target scene passed in. The underlying calculation class adopts the corresponding ray tracing algorithm according to the ray tracing mode and various types of information passed in by the global class to perform ray tracing calculation and output the first image rendering parameters; wherein the data processing engine is independent of the image processing engine and is installed in the mobile terminal in the form of a plug-in; The first image rendering parameter returned by the data processing engine is received, and image rendering is performed according to the image rendering parameter to obtain a target image.
2. The method according to claim 1, characterized in that: The step of performing image rendering according to the image rendering parameters to obtain a target image includes: Acquire data to be rendered, where the data to be rendered is a second image rendering parameter obtained by performing rasterization calculation on the image generation data; Image rendering is performed according to the first image rendering parameter and the second image rendering parameter to obtain a target image.
3. The method according to claim 2, characterized in that The method further comprises: Determining an image rendering mode according to the target scene data and the illumination data; The performing image rendering according to the first image rendering parameter and the second image rendering parameter to obtain a target image includes: According to the image rendering mode, corresponding data is selected from the first image rendering parameters and the second image rendering parameters to perform image rendering to obtain a target image.
4. The method according to claim 3, characterized in that The determining of the image rendering mode according to the target scene data and the illumination data comprises: Determining the scene complexity according to the target scene data; Obtaining a lighting mode corresponding to the lighting data; An image rendering mode is determined according to the complexity of the scene and the illumination mode.
5. The method according to claim 4, characterized in that The method further comprises: Acquiring data processing capability information of the mobile terminal; Determining an image rendering mode according to the scene complexity and the illumination mode includes: An image rendering mode is determined according to the scene complexity, the illumination mode, and the data processing capability information.
6. An image processing method, characterized in that: The method is applied to a mobile terminal, and the method comprises: receiving image generation data, wherein the image generation data includes target scene data and illumination data corresponding to the target scene; The image generation data is subjected to ray tracing calculation to obtain image rendering parameters, including: the global class of the data processing engine manages the grid class, the material class, the scene class and the ray tracing mode used to determine the ray tracing calculation; the data processing engine uses the grid class to manage the data of each object in the target scene, uses the material class to manage the material ball information of each object passed in, and uses the scene class to manage the scene information of the target scene passed in; the underlying calculation class adopts the corresponding ray tracing algorithm according to the ray tracing mode and various information passed in by the global class to perform ray tracing calculation and output image rendering parameters; wherein the data processing engine is independent of the image processing engine and is installed in the mobile terminal in the form of a plug-in; The image rendering parameters are sent to an image processing engine for image rendering to obtain a target image.
7. The method according to claim 6, characterized in that The step of performing ray tracing calculation on the image generation data to obtain image rendering parameters includes: determining a target application program interface corresponding to the ray tracing algorithm from an application program interface library; The target application program interface is called to perform ray tracing calculation on the target scene data and the illumination data to obtain output image rendering parameters.
8. An image processing device, characterized in that: The device is applied to a mobile terminal, and comprises: An acquisition module, used to acquire image generation data, wherein the image generation data includes target scene data and illumination data corresponding to the target scene; A first sending module, used for sending the image generation data to a data processing engine for performing ray tracing calculation to obtain first image rendering parameters, including: a global class of the data processing engine manages a mesh class, a material class, a scene class, and a ray tracing mode used to determine the ray tracing calculation; the data processing engine uses a mesh class to manage the data of each object in the target scene, uses a material class to manage the material ball information of each object passed in, and uses a scene class to manage the scene information of the target scene passed in; the underlying calculation class uses a corresponding ray tracing algorithm to perform ray tracing calculation according to the ray tracing mode passed in by the global class and various types of information, and outputs the first image rendering parameters; wherein the data processing engine is independent of the image processing engine and is installed in the mobile terminal in the form of a plug-in; The rendering module is used to receive the image rendering parameters returned by the data processing engine, and perform image rendering according to the image rendering parameters to obtain a target image.
9. An image processing device, characterized in that: The device is applied to a mobile terminal, and comprises: A receiving module, configured to receive image generation data, wherein the image generation data includes target scene data and illumination data corresponding to the target scene; A calculation module, used for performing ray tracing calculation on the image generation data to obtain image rendering parameters, including: a global class of a data processing engine manages a mesh class, a material class, a scene class, and a ray tracing mode used to determine the ray tracing calculation; the data processing engine uses a mesh class to manage the data of each object in the target scene, uses a material class to manage the material ball information of each object passed in, and uses a scene class to manage the scene information of the target scene passed in; the underlying calculation class uses a corresponding ray tracing algorithm to perform ray tracing calculation according to the ray tracing mode and various types of information passed in by the global class, and outputs image rendering parameters; wherein the data processing engine is independent of the image processing engine and is installed in the mobile terminal in the form of a plug-in; The second sending module is used to send the image rendering parameters to the image processing engine for image rendering to obtain a target image.
10. A storage medium having a computer program stored thereon, characterized in that: When the computer program is loaded by a processor of an electronic device, the steps in the image processing method according to any one of claims 1 to 5 or claims 6 to 7 are executed.
11. A terminal comprising a processor and a memory, wherein the memory stores a computer program, characterized in that: The processor executes the steps in the image processing method according to any one of claims 1 to 5 or claims 6 to 7 by loading the computer program.
Citation Information
Patent Citations
Hybrid rending apparatus and method
CN101923727A
Web end real-time hybrid rendering method and device combined with ray tracing and computer equipment
CN111340928A
