Method and device for generating high dynamic range image, storage medium and electronic equipment
By decoding the standard dynamic range image, the target grayscale map and construct metadata are generated, and fused with the standard dynamic range image and rendered, the problem of device restriction cannot be generated is solved, and the purpose of obtaining HDR images is achieved with low configuration devices, which improves the user experience.
Patent Information
- Application Number
- CN202411736308.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-02-25
AI Technical Summary
In the prior art, due to the limitations of device capabilities, high dynamic range images cannot be generated, and it is difficult to apply them on a large scale on mobile clients, affecting the user experience.
After decoding the standard dynamic range image, a target grayscale map is generated, metadata of the high dynamic range image is constructed, the standard dynamic range image and target grayscale map are fused with the metadata, and the fused data is rendered to obtain a high dynamic range image.
The purpose of obtaining high dynamic range images with low configuration devices is achieved, solving the problem of devices being limited and unable to capture HDR images, and improving user experience.
Smart Images

Figure CN119515699A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing, and in particular to a method, device, storage medium and electronic device for generating high dynamic range images. Background Art
[0002] In the prior art, a High Dynamic Range (HDR) image is an image captured by an advanced camera device or a mobile device with corresponding functions. Generally, devices with lower configurations do not have the ability to capture HDR images, and the images captured are Standard Dynamic Range (SDR) images.
[0003] That is to say, in the prior art, due to the limitation of device capabilities, some devices can only capture SDR images but not HDR images. Summary of the invention
[0004] The present application provides a method, device, storage medium and electronic device for generating a high dynamic range image based on a gain map (GainMap) to solve the technical problem that HDR images are difficult to obtain and cannot be applied on a large scale to mobile clients to improve user experience.
[0005] In a first aspect, the present application provides a method for generating a high dynamic range image, comprising: after decoding a standard dynamic range image, generating a target grayscale image of the standard dynamic range image; constructing metadata of the high dynamic range image; fusing the standard dynamic range image, the target grayscale image and the metadata to obtain fused data; and rendering the fused data to obtain the high dynamic range image.
[0006] In a second aspect, the present application provides a device for generating a high dynamic range image, comprising: a generation module, used to generate a target grayscale image of the standard dynamic range image after decoding the standard dynamic range image; a construction module, used to construct metadata of the high dynamic range image; a fusion module, used to fuse the standard dynamic range image, the target grayscale image and the metadata to obtain fused data; and a rendering module, used to render the fused data to obtain the high dynamic range image.
[0007] As an optional example, the above-mentioned generation module includes: a generation unit, used to set the saturation of the standard dynamic range image to 0 to obtain a grayscale image; set the grayscale image to a target color space; adjust the grayscale image using an adjustment method that matches the target color space to obtain the target grayscale image.
[0008] As an optional example, the target color space is the Generic Gray Gamma 2.2 color space.
[0009] As an optional example, the construction module includes: a construction unit, configured to determine a terminal type of a terminal where the standard dynamic range image is located; and construct the metadata according to the terminal type.
[0010] As an optional example, the construction unit includes: a construction subunit, used to determine the content and format of metadata required by the terminal indicated by the terminal type; and extract data from the standard dynamic range image as the metadata according to the content and format.
[0011] As an optional example, the fusion module includes: a fusion unit, used to call a terminal for processing the standard dynamic range image, write the standard dynamic range image, the target grayscale image and the metadata into an object, and the object outputs the fused data.
[0012] As an optional example, the above-mentioned decoding module includes: an updating unit, used to determine whether the operating system of the terminal where the standard dynamic range image is located includes a first interface; when the operating system does not include the first interface, updating the operating system until the updated operating system includes the first interface; using the first interface to render the fused data to obtain the high dynamic range image.
[0013] In a third aspect, the present application provides an electronic device comprising: at least one communication interface; at least one bus connected to the at least one communication interface; at least one processor connected to the at least one bus; and at least one memory connected to the at least one bus, wherein the memory stores a computer program, and the processor is configured to implement any one of the above-mentioned methods for generating a high dynamic range image when executing the computer program.
[0014] In a fourth aspect, the present application further provides a computer storage medium storing computer executable instructions, wherein the computer executable instructions are used to execute any of the above methods for generating a high dynamic range image in the present application.
[0015] The above technical solution provided by the embodiment of the present application has the following advantages compared with the prior art: after decoding the standard dynamic range image, a target grayscale image of the standard dynamic range image is generated; metadata of the high dynamic range image is constructed; the standard dynamic range image, the target grayscale image and the metadata are fused to obtain fused data; the fused data is rendered to obtain the high dynamic range image based on gain mapping, so that after the device captures the standard dynamic range image, the standard dynamic range image is processed to obtain a high dynamic range image, thereby achieving the purpose of large-scale acquisition of HDR images. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0017] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0018] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.
[0019] Figure 1 A flowchart of a method for generating a high dynamic range image provided by an embodiment of the present application;
[0020] Figure 2 A schematic diagram of a scene of a method for generating a high dynamic range image provided in an embodiment of the present application;
[0021] Figure 3 A flowchart of a method for generating a high dynamic range image provided by an embodiment of the present application;
[0022] Figure 4 A schematic diagram of the structure of a device for generating a high dynamic range image provided in an embodiment of the present application;
[0023] Figure 5 A schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0024] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0025] The disclosure below provides many different embodiments or examples to implement different structures of the present invention. In order to simplify the disclosure of the present invention, the parts and settings of specific examples are described below. Of course, they are only examples, and the purpose is not to limit the present invention. In addition, the present invention can repeat reference numbers and / or letters in different examples. This repetition is for the purpose of simplification and clarity, and does not itself indicate the relationship between the various embodiments and / or settings discussed.
[0026] In order to solve the technical problem in the prior art that HDR images cannot be obtained due to the influence of device performance, the present application provides a method for generating high dynamic range images, which can achieve the purpose of obtaining high dynamic range images by low-configuration devices.
[0027] Figure 1 A flowchart of a method for generating a high dynamic range image provided in an embodiment of the present application. Figure 1 As shown, the method for generating a high dynamic range image includes:
[0028] S102, after decoding the standard dynamic range image, generating a target grayscale image of the standard dynamic range image;
[0029] S104, constructing metadata of the high dynamic range image;
[0030] S106, fusing the standard dynamic range image, the target grayscale image and the metadata to obtain fused data;
[0031] S108, rendering the fused data to obtain the high dynamic range image.
[0032] Optionally, the above-mentioned method for high dynamic range images can be executed by a client, and the client's SDR image can be rendered by the client to be rendered into an HDR image.
[0033] The above-mentioned target grayscale image is a grayscale image obtained by grayscale processing of a standard dynamic range image, i.e., an SDR image. The grayscale image only has three colors: black, white, and gray. The above-mentioned metadata is data that describes data, such as data used to describe the specifications, colors, formats, and other contents of the SDR image. The above-mentioned fusion of the SDR image, the target grayscale image, and the above-mentioned metadata can be to adjust and overlap the SDR image and the target grayscale image according to the description related to the metadata, thereby obtaining fused data. After obtaining the fused data, the fused data is rendered, and the result obtained is regarded as a high dynamic range image, i.e., an HDR image.
[0034] Let's take an example to illustrate. The figure is a schematic diagram of an application scenario. Figure 2 In the present invention, a large number of SDR images are stored on the user terminal, and the SDR images can be processed. The processing process is to first decode the SDR image, generate a target grayscale image of the SDR image, and then construct the metadata of the HDR image, fuse the SDR image, the target grayscale image and the metadata into fused data, and render the fused data to obtain the HDR image.
[0035] Under normal circumstances, a large number of SDR images on the user's terminal cannot be converted into HDR images according to normal methods. If the user has a demand for HDR images, it cannot be realized due to device limitations. In this embodiment, the user can obtain an HDR image by processing the SDR image. Even if the user's device does not have an HDR image, the HDR image can be obtained and displayed.
[0036] The solution provided in the embodiment of the present application generates a target grayscale image of the standard dynamic range image after acquiring the standard dynamic range image; constructs metadata of the high dynamic range image; fuses the standard dynamic range image, the target grayscale image and the metadata to obtain fused data; decodes and renders the fused data to obtain the high dynamic range image, so that after the device captures the standard dynamic range image, the standard dynamic range image is processed to obtain the high dynamic range image, thereby achieving the purpose of large-scale acquisition of HDR images.
[0037] As an optional example, after decoding to a standard dynamic range image, generating a target grayscale image of the standard dynamic range image includes:
[0038] The saturation of the standard dynamic range image is set to 0 to obtain a grayscale image;
[0039] Setting the grayscale image to a target color space;
[0040] The grayscale image is adjusted using an adjustment method that matches the target color space to obtain the target grayscale image.
[0041] In this embodiment, the saturation of the standard dynamic range image can be set to zero to obtain a grayscale image. If the terminal is an Apple system, the grayscale image should be set to the Generic Gray Gamma 2.2 color space and adjusted in this color space. If the terminal is an Android system, there is no need to set the grayscale image to the Generic Gray Gamma 2.2 color space. The grayscale image is the above-mentioned target grayscale image.
[0042] In another example, there may be multiple ways to generate a target grayscale image of an SDR image. The SDR image may be set to different color spaces as required, and then the SDR image may be adjusted in the corresponding color space using the corresponding adjustment method to obtain a target grayscale image. For example, the SDR image is set to the CIE Lab color space defined by the International Commission on Illumination. In this CIE Lab color space, the pixels of the SDR image are composed of a brightness channel and two color channels. In this color space, "L" represents brightness. The larger the value of L, the brighter it is, and the smaller the value, the darker it is. The value range is approximately 0-100. When the value is 0, it represents black, and when the value is 100, it represents white. "a" represents red and green. The evolution of a value from negative to positive is the evolution from green to red. "b" represents blue and yellow. The evolution of b value from negative to positive is the evolution from blue to yellow. When both a and b values are 0, they represent gray, that is, the target grayscale image is obtained.
[0043] Alternatively, set the SDR image to the Luv color space, which is the space of lightness and chroma. For example, white is a bright color, while gray is considered to be a less bright white. In other words, the chroma of white and gray is the same, but the lightness is different. In this color space, "L" represents lightness (brightness), "U" and "V" represent chroma, and the range of chroma is -100 to +100, and the range of lightness is 0 to 100. Adjust the value of L to 0 to get the target grayscale image.
[0044] Alternatively, set the SDR image to the LCh color space. In the LCh color space, "CHROMA" is chromaticity and "C" is used to represent it, that is, the degree of color saturation. "L" stands for lightness and "h" stands for hue, that is, the overall tendency of color. "L", "C" and "h" are the three elements of color. Lightness is the eye's perception of the brightness of the light source and the surface of an object. Brightness not only determines the degree of illumination of an object, but also determines the reflectance coefficient of the surface of the object. Saturation (chroma, freshness) usually refers to the vividness of the color. From a scientific point of view, the vividness of a color depends on the degree of uniformity of the light emitted by this hue. The characteristics of hue are determined by the spectral composition of the light source and the feeling produced by the ratio of radiation of each wavelength reflected by the surface of the colored object on the human eye. It is the qualitative appearance that color can present and the most accurate standard for distinguishing various colors. In the LCh color space, grayscale can be set by adjusting hue and color, such as adjusting "h".
[0045] As an optional example, the target color space is an RGB color space, and the adjustment method matching the target color space is used to adjust the standard dynamic range image to obtain the target grayscale image, including:
[0046] Determine the R value, G value and B value of the standard dynamic range image in the RGB color space;
[0047] The R value, the G value, and the B value are set to be the same.
[0048] In this embodiment, the SDR image can be set to the s-RGB color space. The RGB color space represents the three primary colors R (red), G (green), and B (blue). The color gradation of RGB is 0-255. In this embodiment, the SDR image is set to the s-RGB color space, and the R value, G value, and B value are set to the same, so as to obtain the target grayscale image.
[0049] As an optional implementation, the R value, the G value, and the B value may be set to 128. This situation is specially marked as "absolute neutral gray." The target grayscale image obtained in this situation has a better effect in making an HDT image.
[0050] As another example, the target color space is Generic Gray Gamma 2.2 color space. If the terminal is an Apple system, the grayscale image should be set to Generic Gray Gamma 2.2 color space and adjusted in this color space. If the terminal is an Android system, there is no need to set the grayscale image to Generic Gray Gamma 2.2 color space. The grayscale image is the target grayscale image.
[0051] As an optional example, the metadata for constructing the high dynamic range image includes:
[0052] Determining the terminal type of the terminal where the standard dynamic range image is located;
[0053] The metadata is constructed according to the terminal type.
[0054] In this embodiment, the metadata is data describing data, that is, data describing the HDR image. The metadata can be constructed according to the needs to determine the content of the constructed metadata, that is, which aspects and parts of the HDR image are described. The terminal type of the terminal to render the HDR image can be determined, and different metadata can be constructed according to different terminals. According to different metadata, corresponding HDR images are generated for terminals of different terminal types. For example, for various types of existing mobile phone systems, corresponding metadata can be obtained according to the definition or requirements of their respective systems.
[0055] In the context of HDR images, metadata can be additional information embedded in the image file of the HDR image, which may include shooting date, time, location, camera model, exposure settings, etc. Depending on the terminal type, the demand for metadata is different. Just for example, the Android system may require the shooting date and time in the metadata, and the Apple system may require the camera model and exposure settings in the metadata. This is only for understanding and does not constitute a limitation.
[0056] As an optional example, constructing the metadata according to the terminal type includes:
[0057] Determining the content and format of metadata required by the terminal indicated by the terminal type;
[0058] Data is extracted from the standard dynamic range image as the metadata in accordance with the content and format described above.
[0059] In this embodiment, when constructing metadata, for the terminal types of different terminals, the operating system of the terminal is determined, and the content and format of the metadata are configured according to the different operating systems. According to the terminal type of the terminal to render the HDR image, the content and format of the corresponding metadata are determined, and then the metadata of the HDR image is generated according to the content and format.
[0060] For example, the content may be data describing the type of the terminal for rendering the HDR image, and the format may be a number, where the number 0 represents that the type of the terminal for rendering the HDR image is one type, and the number 1 represents that the type is another type.
[0061] For example, for Apple systems, when constructing metadata, metadata including HDRGainMapVersion and HDRGainMapHeadroom parameters can be constructed. The HDRGainMapVersion parameter allows the application of gain mapping on SDR images to achieve image conversion from SDR to HDR. The HDRGainMapHeadroom parameter is the dynamic range space that can be additionally improved by applying gain mapping on SDR images, which determines the degree of gain in brightness and color. When constructing, set the above two parameters according to the needs of the usage scenario, save them as metadata in XMP format.
[0062] For the Android system, when constructing metadata, construct metadata containing GainMapMin and GainMapMax. GainMapMin and GainMapMax are the gain ranges of pixel values on the image content. When constructing, set them according to the needs of the usage scenario. The above two parameters are saved in XMP format as metadata.
[0063] As an optional example, the above-mentioned standard dynamic range image, the above-mentioned target grayscale image and the above-mentioned metadata are fused to obtain fused data including:
[0064] The target interface of the terminal for processing the standard dynamic range image is called, the standard dynamic range image, the target grayscale image and the metadata are written into an object, and the object outputs the fused data.
[0065] In this embodiment, when the standard dynamic range image, the above-mentioned target grayscale image and the above-mentioned metadata are fused, the SDR image and the target grayscale image can be fused according to the description of the metadata. For example, if the metadata describes the terminal type of the terminal where the SDR image is generated, the SDR image and the target grayscale image should be fused according to the terminal type to obtain an HDR image that conforms to the terminal type. During the fusion, each pixel of the SDR image and the target grayscale image can be fused to obtain each pixel of the new HDR image.
[0066] During fusion, the SDR image and the grayscale image can also be fused according to the relevant description of the metadata. For example, for the above-mentioned Apple system and Android system, the Apple system metadata includes the HDRGainMapVersion and HDRGainMapHeadroom parameters, which indicate the gain mapping version applied to the SDR image and the gain amplitude. Then, the grayscale image can be used to gain the SDR image according to the above gain amplitude to obtain fused data. The metadata for the Android system includes GainMapMin and GainMapMax, which indicate the gain range of the pixel value on the image content. Then, the grayscale image can be used to gain the SDR image within the gain range to obtain an HDR image.
[0067] If the fusion effect is not good, you can also improve the brightness and dynamic range of the fused data. The brightness and dynamic range should be adjusted according to the standards of HDR images, slowly increasing from the standards of SDR images to check the effect.
[0068] As an optional example, rendering the fused data to obtain the high dynamic range image includes:
[0069] Determining whether the operating system of the terminal where the standard dynamic range image is located includes the first interface;
[0070] When the operating system does not include the first interface, updating the operating system until the updated operating system includes the first interface;
[0071] The fused data is rendered using the first interface to obtain the high dynamic range image.
[0072] In this embodiment, after the SDR image, the target grayscale image and the metadata are fused to obtain the fused data, the first interface of the mobile device operating system can be called to render the fused data. The first interface can be a high-level interface of the system. Since the high-level interface may not be equipped in general devices, when using the first interface, it is necessary to determine whether the mobile device operating system is equipped with the first interface. If the mobile device operating system is equipped with the first interface, the first interface is used to render the fused data. If the mobile device operating system is not equipped with the first interface, the operating system of the mobile device is updated and upgraded until it is upgraded to a version including the first interface.
[0073] When the mobile device renders the fused data, the displayed image is an HDR image.
[0074] Figure 3 is a flow chart of this embodiment. Figure 3As shown, this embodiment converts the SDR image into an HDR image. First, the grayscale image is extracted, and the corresponding color space ColorSpace is set for the original SDR image. The saturation is removed in the color space to generate a target grayscale image. Then, metadata MetaData is generated. There are different construction methods for different operating systems of mobile terminals. For example, for the Apple operating system, MetaData data in XMP format containing HDRGainMapVersion and HDRGainMapHeadroom parameters are constructed. For the Android system, MetaData data in XMP format containing parameters such as GainMapMin and GainMapMax are constructed. Then the HDR image is synthesized: the grayscale image height, width, MetaData data and SDR image are synthesized to generate new image data, which is fused data. The fused data is HDR image data that conforms to the GainMap standard. Finally, HDR rendering: use the system advanced application program interface to decode and render the HDR image.
[0075] Figure 4 The following is a schematic diagram of a device for generating a high dynamic range image provided by an embodiment of the present application. Figure 4 As shown, the above-mentioned device for generating a high dynamic range image includes:
[0076] A generating module 402 is used to generate a target grayscale image of the standard dynamic range image after decoding the standard dynamic range image;
[0077] A construction module 404 is used to construct metadata of the high dynamic range image;
[0078] A fusion module 406 is used to fuse the standard dynamic range image, the target grayscale image and the metadata to obtain fused data;
[0079] The rendering module 408 is used to render the above fused data to obtain the above high dynamic range image.
[0080] Optionally, the above-mentioned method for high dynamic range images can be executed by a client, and the client's SDR image can be rendered by the client to be rendered into an HDR image.
[0081] The above-mentioned target grayscale image is a grayscale image obtained by grayscale processing of a standard dynamic range image, i.e., an SDR image. The grayscale image only has three colors: black, white, and gray. The above-mentioned metadata is data that describes data, such as data used to describe the specifications, colors, formats, and other contents of the SDR image. The above-mentioned fusion of the SDR image, the target grayscale image, and the above-mentioned metadata can be to adjust and overlap the SDR image and the target grayscale image according to the description related to the metadata, thereby obtaining fused data. After obtaining the fused data, the fused data is rendered, and the result obtained is regarded as a high dynamic range image, i.e., an HDR image.
[0082] Let's take an example to illustrate. The figure is a schematic diagram of an application scenario. Figure 2 In the present invention, a large number of SDR images are stored on the user terminal, and the SDR images can be processed. The processing process is to first decode the SDR image, generate a target grayscale image of the SDR image, and then construct the metadata of the HDR image, fuse the SDR image, the target grayscale image and the metadata into fused data, and render the fused data to obtain the HDR image.
[0083] Under normal circumstances, a large number of SDR images on the user's terminal cannot be converted into HDR images according to normal methods. If the user has a demand for HDR images, it cannot be realized due to device limitations. In this embodiment, the user can obtain an HDR image by processing the SDR image. Even if the user's device does not have an HDR image, the HDR image can be obtained and displayed.
[0084] The solution provided in the embodiment of the present application generates a target grayscale image of the standard dynamic range image after acquiring the standard dynamic range image; constructs metadata of the high dynamic range image; fuses the standard dynamic range image, the target grayscale image and the metadata to obtain fused data; decodes and renders the fused data to obtain the high dynamic range image, so that after the device captures the standard dynamic range image, the standard dynamic range image is processed to obtain the high dynamic range image, thereby achieving the purpose of large-scale acquisition of HDR images.
[0085] For other examples of this embodiment, please refer to the above examples and will not be described in detail here.
[0086] like Figure 5 As shown, an embodiment of the present application provides an electronic device, including a processor 111, a communication interface 112, a memory 113 and a communication bus 114, wherein the processor 111, the communication interface 112, and the memory 113 communicate with each other through the communication bus 114.
[0087] Memory 113, used for storing computer programs;
[0088] In one embodiment of the present application, the processor 111 is used to implement the method for generating a high dynamic range image provided by any one of the aforementioned method embodiments when executing the program stored in the memory 113 .
[0089] The memory and processor in the above electronic device communicate through the communication bus and the communication interface. The communication bus can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The communication bus can be divided into an address bus, a data bus, a control bus, etc.
[0090] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0091] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0092] A fourth embodiment of the present application provides a computer-readable medium having a non-volatile program code executable by a processor.
[0093] Optionally, in an embodiment of the present application, a computer-readable medium is configured to store program code for a processor to execute the above method.
[0094] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment will not be described in detail here.
[0095] When the embodiments of the present application are specifically implemented, reference may be made to the above-mentioned embodiments, which have corresponding technical effects.
[0096] It is understood that the embodiments described herein may be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit may be implemented in one or more application specific integrated circuits (ASIC), digital signal processors (DSP), digital signal processing devices (DSPD), programmable logic devices (PLD), field programmable gate arrays (FPGA), general purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions of the present application, or a combination thereof.
[0097] For software implementation, the technology of this article can be implemented by a unit that performs the functions of this article. The software code can be stored in a memory and executed by a processor. The memory can be implemented in the processor or outside the processor.
[0098] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0099] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0100] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of modules is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0101] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0102] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0103] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard drives, ROM, RAM, magnetic disks, or optical disks.
[0104] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0105] The above embodiments are only preferred embodiments for fully illustrating the present application, and the protection scope of the present application is not limited thereto. Any equivalent substitution or change made by a person skilled in the art based on the present application is within the protection scope of the present application.
Claims
1. A method for generating a high dynamic range image, characterized in that: include: After decoding the standard dynamic range image, generating a target grayscale image of the standard dynamic range image; Construct metadata for high dynamic range images; Fusing the standard dynamic range image, the target grayscale image and the metadata to obtain fused data; The fused data is rendered to obtain the high dynamic range image based on the gain mapping.
2. The method according to claim 1, characterized in that After decoding the standard dynamic range image, generating a target grayscale image of the standard dynamic range image comprises: The saturation of the standard dynamic range image is set to 0 to obtain a grayscale image; Setting the grayscale image to a target color space; The grayscale image is adjusted using an adjustment method that matches the target color space to obtain the target grayscale image.
3. The method according to claim 2, characterized in that The target color space is Generic Gray Gamma 2.2 color space.
4. The method according to claim 1, characterized in that: The metadata for constructing the high dynamic range image includes: Determining a terminal type of a terminal where the standard dynamic range image is located; The metadata is constructed according to the terminal type.
5. The method according to claim 4, characterized in that The constructing the metadata according to the terminal type includes: determining content and format of metadata required by the terminal indicated by the terminal type; Data is extracted from the standard dynamic range image according to the content and the format as the metadata.
6. The method according to claim 1, characterized in that The fusing the standard dynamic range image, the target grayscale image and the metadata to obtain fused data comprises: A terminal for processing the standard dynamic range image is called, the standard dynamic range image, the target grayscale image and the metadata are written into an object, and the object outputs the fused data.
7. The method according to claim 1, characterized in that The rendering of the fused data to obtain the high dynamic range image comprises: Determining whether the operating system of the terminal where the standard dynamic range image is located includes a first interface; When the operating system does not include the first interface, updating the operating system until the updated operating system includes the first interface; The fused data is rendered using the first interface to obtain the high dynamic range image.
8. A device for generating a high dynamic range image, characterized in that: include: A generating module, used for generating a target grayscale image of the standard dynamic range image after decoding the standard dynamic range image; A construction module for constructing metadata of high dynamic range images; A fusion module, used for fusing the standard dynamic range image, the target grayscale image and the metadata to obtain fused data; A rendering module is used to render the fused data to obtain the high dynamic range image based on gain mapping.
9. An electronic device, characterized in that: include: at least one communication interface; at least one bus connected to the at least one communication interface; at least one processor coupled to the at least one bus; At least one memory connected to the at least one bus, wherein a computer program is stored in the memory, and when the processor executes the computer program, the method for generating a high dynamic range image as described in any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are used to execute the method for generating a high dynamic range image according to any one of claims 1 to 7 of the present application.