Tone mapping method, device, computer equipment and storage medium
By using the target tone mapping algorithm and the combination of guided filter parameters and brightness compression parameters in the process of HDR video to SDR tone mapping, the problem of not being able to ensure both display effect and time domain stability in the prior art is solved, and better display effect and stability are achieved.
Patent Information
- Application Number
- CN202311441116.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-01
- Publication Date
- 2025-03-11
- Estimated Expiration
- 2043-11-01
AI Technical Summary
In the prior art, when HDR video is tone mapping to SDR, display effect and time domain stability cannot be guaranteed at the same time.
A tone mapping method is provided, by determining a target tone mapping algorithm that matches the mapping requirements, data conversion is performed on the original image data in the video to be processed, and data processing is performed based on the guide filtering parameters and brightness compression parameters of the previous frame to ensure time domain stability and improve display effect.
While ensuring time domain stability, the display effect of HDR video to SDR is improved, and the video frame is dynamically adjusted to adapt to the display capabilities of different devices.
Smart Images

Figure CN117395383B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of display technology, and in particular to a tone mapping method, apparatus, computer equipment, storage medium and computer program product. Background Art
[0002] High Dynamic Range (HDR) technology is one of the key technologies for ultra-high-definition video services. Compared with Standard Dynamic Range (SDR), HDR video has higher resolution, larger dynamic range, wider color gamut and higher frame rate, and can simultaneously present rich details in bright and dark areas, which is closer to the visual effect of the human eye. The scope of HDR technology is very wide, involving multiple links such as video content production, acquisition, processing, transmission, and display. In terms of content display, the dynamic range of HDR content can reach up to 0.00005-10000nit, but not all display devices can meet the requirements. The DisplayHDR certification launched by the American Video Electronics Standards Association VESA divides HDR display devices into 5 levels, HDR400, HDR500, HDR600, HDR1000 and HDR1400, where the number represents the peak brightness that the device can support. Generally, the peak brightness of HDR video is 1000nit, so it is necessary to map the content of HDR video to the range that the display device can support. Currently, for video tone mapping applications, the commonly used global tone mapping algorithm will cause the video frames, which mainly contain information about bright and dark areas, to lose a lot of information, affecting the display effect. The local tone mapping algorithm has a high implementation cost and is difficult to ensure stability in the time domain.
[0003] Currently, HDR performs video tone mapping to SDR, which cannot guarantee both display quality and temporal stability. Summary of the invention
[0004] Based on this, it is necessary to provide a tone mapping method, device, computer equipment, computer-readable storage medium and computer program product that can improve the display effect of video tone mapping from HDR to SDR while ensuring time domain stability in response to the above technical problems.
[0005] In a first aspect, the present application provides a tone mapping method, comprising:
[0006] Determine a target tone mapping algorithm that matches the mapping requirement, and perform data conversion on original image data in the video to be processed according to the target tone mapping algorithm to obtain first image data;
[0007] According to a previous frame of image corresponding to the first image data in the video to be processed, obtaining a previous frame of guided filtering parameters and a previous frame of brightness compression parameters corresponding to the previous frame of image;
[0008] Performing data processing on the first image data according to the previous frame guided filtering parameter and the previous frame brightness compression parameter to obtain second image data; the data processing includes at least one of guided filtering and brightness compression;
[0009] According to the target tone mapping algorithm, data conversion is performed on the second image data to obtain target image data; the target image data is used to generate video display content.
[0010] In one embodiment, determining a target tone mapping algorithm that matches a mapping requirement includes:
[0011] Determine the target color gamut and target color accuracy according to mapping requirements;
[0012] When the target color gamut is within the first color gamut range and the target color accuracy is less than the first color accuracy threshold, the single-channel algorithm is used as the target tone mapping algorithm; the single-channel algorithm is used to process and compress the RGB three channels using the same coefficient;
[0013] When the target color gamut is within the second color gamut range and the target color accuracy is less than the second color accuracy threshold, the three-channel algorithm is used as the target tone mapping algorithm; the three-channel algorithm is used to process and compress the RGB three channels separately.
[0014] In one of the embodiments, when the target tone mapping algorithm is a single-channel algorithm, data conversion is performed on the original image data in the processed video according to the target tone mapping algorithm to obtain the first image data, including:
[0015] Performing electro-optical conversion on the original image data to convert the RGB three-channel grayscale value of the original image data into the RGB three-channel brightness value;
[0016] According to the brightness values of the RGB three channels, obtain the first relative brightness value corresponding to the single channel;
[0017] The first relative brightness value is converted from the linear space to the logarithmic space to obtain the first image data.
[0018] In one of the embodiments, when the target tone mapping algorithm is a single-channel algorithm, performing data conversion on the second image data according to the target tone mapping algorithm to obtain the target image data includes:
[0019] Convert the second image data from the logarithmic space to the linear space to obtain a second relative brightness value corresponding to a single channel;
[0020] Obtaining a pixel scaling factor according to a ratio of the first relative brightness value to the second relative brightness value;
[0021] Obtain third image data according to the product of the pixel scaling factor and the brightness value of the RGB three channels;
[0022] The third image data is subjected to color gamut conversion and photoelectric conversion to obtain target image data.
[0023] In one of the embodiments, when the target tone mapping algorithm is a three-channel algorithm, data conversion is performed on the original image data in the processed video according to the target tone mapping algorithm to obtain the first image data, including:
[0024] Performing electro-optical conversion on the original image data to convert the RGB three-channel grayscale value of the original image data into the RGB three-channel brightness value;
[0025] The brightness values of the three RGB channels are converted from the linear space to the logarithmic space to obtain the first image data.
[0026] In one of the embodiments, when the target tone mapping algorithm is a three-channel algorithm, performing data conversion on the second image data according to the target tone mapping algorithm to obtain the target image data includes:
[0027] Convert the second image data from the logarithmic space to the linear space to obtain fourth image data;
[0028] The fourth image data is subjected to color gamut conversion and photoelectric conversion to obtain target image data.
[0029] In one embodiment, the first image data is processed according to the previous frame guide filter parameter and the previous frame brightness compression parameter to obtain the second image data, including:
[0030] Performing guided filtering on the first image data according to the guided filtering parameters of the previous frame, and decomposing the first image data into a base layer and a detail layer;
[0031] Obtain the maximum value of the base layer of the base layer, and perform time domain smoothing on the brightness compression parameter of the previous frame and the maximum value of the base layer;
[0032] The base layer is subtracted from the maximum value of the base layer after time domain smoothing to obtain a base layer difference, the base layer difference is multiplied by the brightness compression parameter of the previous frame after time domain smoothing, and the product is added to the detail layer to obtain the second image data.
[0033] In one embodiment, the method further comprises:
[0034] According to the first image data, obtaining a current frame maximum value and a current frame minimum value;
[0035] When the current frame maximum value and the current frame minimum value are not equal, obtaining the current frame guided filtering parameter corresponding to the first image data according to the current frame maximum value and the current frame minimum value;
[0036] The base layer minimum value of the base layer is obtained, and the current frame brightness compression parameter corresponding to the first image data is obtained according to the base layer maximum value and the base layer minimum value.
[0037] In one embodiment, the method further comprises:
[0038] When the maximum value of the current frame is equal to the minimum value of the current frame, the initialization guided filtering parameters are used as the guided filtering parameters of the current frame, and the initialization brightness compression parameters are used as the brightness compression parameters of the current frame.
[0039] In a second aspect, the present application also provides a tone mapping device, comprising:
[0040] A first conversion module is used to determine a target tone mapping algorithm that matches the mapping requirement, and perform data conversion on the original image data in the video to be processed according to the target tone mapping algorithm to obtain first image data;
[0041] A parameter acquisition module, used for acquiring a previous frame guided filtering parameter and a previous frame brightness compression parameter corresponding to the previous frame image according to the previous frame image corresponding to the first image data in the video to be processed;
[0042] A data processing module, used for performing data processing on the first image data according to the previous frame guide filtering parameter and the previous frame brightness compression parameter to obtain the second image data; the data processing includes at least one of the guide filtering and the brightness compression;
[0043] The second conversion module is used to perform data conversion on the second image data according to a target tone mapping algorithm to obtain target image data; the target image data is used to generate video display content.
[0044] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0045] Determine a target tone mapping algorithm that matches the mapping requirement, and perform data conversion on original image data in the video to be processed according to the target tone mapping algorithm to obtain first image data;
[0046] According to a previous frame image corresponding to the first image data in the video to be processed, obtaining a previous frame guided filtering parameter and a previous frame brightness compression parameter corresponding to the previous frame image;
[0047] Performing data processing on the first image data according to the previous frame guided filtering parameter and the previous frame brightness compression parameter to obtain second image data; the data processing includes at least one of guided filtering and brightness compression;
[0048] According to the target tone mapping algorithm, data conversion is performed on the second image data to obtain target image data; the target image data is used to generate video display content.
[0049] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:
[0050] Determine a target tone mapping algorithm that matches the mapping requirement, and perform data conversion on original image data in the video to be processed according to the target tone mapping algorithm to obtain first image data;
[0051] According to a previous frame of image corresponding to the first image data in the video to be processed, obtaining a previous frame of guided filtering parameters and a previous frame of brightness compression parameters corresponding to the previous frame of image;
[0052] Performing data processing on the first image data according to the previous frame guided filtering parameter and the previous frame brightness compression parameter to obtain second image data; the data processing includes at least one of guided filtering and brightness compression;
[0053] According to the target tone mapping algorithm, data conversion is performed on the second image data to obtain target image data; the target image data is used to generate video display content.
[0054] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:
[0055] Determine a target tone mapping algorithm that matches the mapping requirement, and perform data conversion on original image data in the video to be processed according to the target tone mapping algorithm to obtain first image data;
[0056] According to a previous frame of image corresponding to the first image data in the video to be processed, obtaining a previous frame of guided filtering parameters and a previous frame of brightness compression parameters corresponding to the previous frame of image;
[0057] Performing data processing on the first image data according to the previous frame guided filtering parameter and the previous frame brightness compression parameter to obtain second image data; the data processing includes at least one of guided filtering and brightness compression;
[0058] According to the target tone mapping algorithm, data conversion is performed on the second image data to obtain target image data; the target image data is used to generate video display content.
[0059] The above tone mapping method, device, computer equipment, storage medium and computer program product determine the target tone mapping algorithm that matches the mapping requirements, perform data conversion on the original image data in the video to be processed according to the target tone mapping algorithm to obtain the first image data; obtain the previous frame guide filter parameters and the previous frame brightness compression parameters corresponding to the previous frame image according to the previous frame image corresponding to the first image data in the video to be processed; perform data processing on the first image data according to the previous frame guide filter parameters and the previous frame brightness compression parameters to obtain the second image data; the data processing includes at least one of the guide filter and the brightness compression; perform data conversion on the second image data according to the target tone mapping algorithm to obtain the target image data; the target image data is used to generate the video display content. It is able to dynamically adjust each frame of the video, and improve the display effect of video tone mapping from HDR to SDR while ensuring the stability of the time domain. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0061] Figure 1 A diagram showing an application environment of a tone mapping method in an embodiment;
[0062] Figure 2 is a flowchart of a tone mapping method in one embodiment;
[0063] Figure 3 A schematic diagram of a process of mapping HDR to SDR in an embodiment;
[0064] Figure 4 A schematic diagram of an ACES tone mapping curve in one embodiment;
[0065] Figure 5 A schematic diagram of a flow chart of a single-channel algorithm in one embodiment;
[0066] Figure 6 A schematic diagram of a three-channel algorithm in one embodiment;
[0067] Figure 7 A schematic diagram of the direct display effect of HDR content in one embodiment;
[0068] Figure 8 A schematic diagram of ACES tone mapping effect in one embodiment;
[0069] Fig. 9A schematic diagram of the effect of a single-channel algorithm in an embodiment;
[0070] Fig.10 A schematic diagram of the effect of a three-channel algorithm in one embodiment;
[0071] Fig.11 A schematic diagram of a mean filter calculation unit in an embodiment;
[0072] Fig.12 is a schematic diagram of a halo effect in an embodiment;
[0073] Fig.13 is a schematic diagram of a side window filter in one embodiment;
[0074] Fig.14 A simplified schematic diagram of a side window filter in one embodiment;
[0075] Fig.15 is a structural block diagram of a tone mapping device in one embodiment;
[0076] Fig.16 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0077] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0078] The tone mapping method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. Among them, the terminal 102 can be but is not limited to various personal computers, laptops, smart phones, tablets, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server 104 can be implemented with an independent server or a server cluster consisting of multiple servers.
[0079] In an exemplary embodiment, Figure 2 As shown, a tone mapping method is provided, which is applied to Figure 1 The terminal 102 in the example is used as an example to illustrate, including the following steps 202 to 208. Among them:
[0080] Step 202 : determining a target tone mapping algorithm that matches the mapping requirement, and performing data conversion on the original image data in the video to be processed according to the target tone mapping algorithm to obtain first image data.
[0081] The video to be processed refers to the HDR video, and the original image data refers to each frame of the video to be processed. The basic process of mapping HDR content to SDR is as follows: Figure 3 As shown in the figure, the role of tone mapping is to map HDR content to the SDR range. Inappropriate tone mapping will cause a large amount of important information in the original image to be lost, such as global and local contrast and details of bright and dark areas, affecting the final display effect and even causing serious distortion problems. Compared with image tone mapping, video tone mapping is more complex and has higher requirements, so it is impossible to simply apply the image tone algorithm directly to video processing. First of all, the video has time domain characteristics, and the algorithm needs to ensure stability in the time domain, otherwise there will be problems with inter-frame flicker. Secondly, the resolution of HDR video is large and the frame rate is high, so the algorithm cannot be too complex to meet the performance requirements. Finally, it is necessary to ensure the processing quality of the video spatial domain picture. Therefore, video tone mapping is mostly implemented using a global tone mapping curve.
[0082] Tone mapping can be divided into global tone mapping and local tone mapping. In actual use, there are also global and local uses. Global tone mapping uses the same mapping function for all pixels in the image, and local tone mapping uses different mapping functions for pixels in different spatial positions. Compared with local tone mapping, global tone mapping is simpler, faster in calculation, and more stable in algorithm, but the effect is not as good as local tone mapping, and more contrast and details will be lost. Take the ACES tone mapping curve as an example, Figure 4 As shown in the figure, it can be seen that the curve will compress the output brightness range occupied by the dark and bright areas to ensure the display effect of most of the information in the middle area. If each frame of the video uses the same curve for global tone mapping, it will cause the video frames with mainly bright and dark area information to lose a lot of information, affecting the display effect, and it is difficult to ensure stability in the time domain using the local tone mapping algorithm.
[0083] Optionally, two tone mapping algorithms, a single-channel algorithm and a three-channel algorithm, are pre-configured. The single-channel version of the algorithm compresses RGB (red, green, and blue channels) with the same coefficient, so when compressing the brightness range, the color gamut range will not be compressed. The advantage is that it can better maintain the bright colors of the picture, maintain the accuracy of the color, and avoid the problem of undersaturation, but there is a problem of oversaturation of the color. The three-channel version of the algorithm processes and compresses RGB separately, so when compressing the brightness range, the color gamut range will be compressed at the same time. The advantage is that more color information can fall into the target color gamut range, retain more picture content, and avoid the problem of oversaturation of color, but there are problems of whitening and undersaturation of the picture. The two algorithms are suitable for different application scenarios. For example, the single-channel version of the algorithm is suitable for scenarios with a large target color gamut range and high color accuracy requirements; the three-channel version of the algorithm is suitable for scenarios that need to support a smaller color gamut range and low color accuracy requirements. In actual application, it is necessary to comprehensively consider multiple factors, such as whether the input data is original video data, the requirements for color accuracy, the color gamut range of the display device that needs to be supported, the cost limit of implementation, whether it affects the processing of other modules, etc.
[0084] In a feasible implementation, the target color gamut and target color accuracy are determined according to the mapping requirements; when the target color gamut is within the first color gamut range and the target color accuracy is less than the first color accuracy threshold, the single-channel algorithm is used as the target tone mapping algorithm; the single-channel algorithm is used to process and compress the three RGB channels using the same coefficient; when the target color gamut is within the second color gamut range and the target color accuracy is less than the second color accuracy threshold, the three-channel algorithm is used as the target tone mapping algorithm; the three-channel algorithm is used to process and compress the three RGB channels separately. The first color gamut range is larger than the second color gamut range, and the first color accuracy threshold is smaller than the second color accuracy threshold.
[0085] The single-channel algorithm performs electro-optical conversion on the original image data to convert the RGB three-channel grayscale value of the original image data into the RGB three-channel brightness value; according to the RGB three-channel brightness value, the first relative brightness value corresponding to the single channel is obtained; the first relative brightness value is converted from the linear space to the logarithmic space to obtain the first image data.
[0086] The three-channel algorithm performs electro-optical conversion on the original image data to convert the RGB three-channel grayscale values of the original image data into RGB three-channel brightness values; the RGB three-channel brightness values are converted from linear space to logarithmic space to obtain the first image data.
[0087] Step 204 , according to the previous frame image corresponding to the first image data in the video to be processed, obtain the previous frame guided filtering parameters and the previous frame brightness compression parameters corresponding to the previous frame image.
[0088] Optionally, each time a frame of image in the video to be processed is processed, the guided filtering parameters and brightness compression parameters corresponding to the frame of image are calculated and stored for use in processing the first image data of the next frame of image.
[0089] Step 206, performing data processing on the first image data according to the previous frame guided filtering parameters and the previous frame brightness compression parameters to obtain second image data; the data processing includes at least one of guided filtering and brightness compression.
[0090] Optionally, guided filtering is performed on the first image data according to the guided filtering parameters of the previous frame, and the first image data is decomposed into a base layer and a detail layer; the base layer maximum value of the base layer is obtained, and the brightness compression parameters of the previous frame and the base layer maximum value are time-domain smoothed; the base layer maximum value after time-domain smoothing is subtracted from the base layer to obtain a base layer difference, the base layer difference is multiplied by the brightness compression parameters of the previous frame after time-domain smoothing, and the product is added to the detail layer to obtain the second image data.
[0091] Step 208 , performing data conversion on the second image data according to a target tone mapping algorithm to obtain target image data; the target image data is used to generate video display content.
[0092] Among them, the target image data refers to the display image data of the SDR video, and the generated video is an SDR video.
[0093] Optionally, the single-channel algorithm converts the second image data from the logarithmic space to the linear space to obtain a second relative brightness value corresponding to the single channel; obtains a pixel scaling factor based on the ratio of the first relative brightness value to the second relative brightness value; obtains third image data based on the product of the pixel scaling factor and the RGB three-channel brightness values; performs color gamut conversion and photoelectric conversion on the third image data to obtain target image data.
[0094] The three-channel algorithm converts the second image data from the logarithmic space to the linear space to obtain the fourth image data; and performs color gamut conversion and photoelectric conversion on the fourth image data to obtain the target image data.
[0095] In the above tone mapping method, by determining the target tone mapping algorithm that matches the mapping requirements, the original image data in the processed video is converted according to the target tone mapping algorithm to obtain the first image data; according to the previous frame image corresponding to the first image data in the processed video, the previous frame guide filter parameters and the previous frame brightness compression parameters corresponding to the previous frame image are obtained; according to the previous frame guide filter parameters and the previous frame brightness compression parameters, the first image data is processed to obtain the second image data; the data processing includes at least one of the guide filter and the brightness compression; according to the target tone mapping algorithm, the second image data is converted to obtain the target image data; the target image data is used to generate the video display content. It is possible to dynamically adjust each frame of the video, and improve the display effect of video tone mapping from HDR to SDR while ensuring the stability of the time domain.
[0096] In one embodiment, the first case is to determine that the target tone mapping algorithm is a single-channel algorithm, and steps 202 to 208 include: converting the grayscale value of the RGB three-channel into a three-channel brightness value based on the electro-optical conversion function. Calculate the relative brightness value Y of the single channel from the brightness value of the RGB three-channel. Convert the relative brightness value Y from the linear space to the logarithmic space. Perform guided filtering, brightness compression and normalization operations on the relative brightness Y in the logarithmic space. The parameters of the guided filtering and brightness compression are calculated based on the maximum and minimum values of the previous frame. The time domain stability of the algorithm is ensured by performing time domain smoothing and range limitation on the parameters. Convert the processing result from the logarithmic space back to the linear space. According to the ratio of the input to the output before and after the relative brightness Y processing, the scaling coefficient of the brightness value of each pixel is obtained. Finally, the scaling coefficient is multiplied by the brightness value of the RGB three-channel to obtain the tone mapping result. After the tone mapping is completed, the color gamut conversion and photoelectric conversion operations are performed to obtain the SDR display content.
[0097] The single-channel algorithm processing flow is as follows: Figure 5 As shown, the original image data is first electro-optically converted to convert the RGB three-channel grayscale values of the original image data into RGB three-channel brightness values; based on the RGB three-channel brightness values, the first relative brightness values corresponding to the single channel are obtained; the first relative brightness values are converted from the linear space to the logarithmic space to obtain the first image data.
[0098] According to the first image data, the current frame maximum value and the current frame minimum value are obtained; when the current frame maximum value and the current frame minimum value are not equal, the current frame guided filter parameters corresponding to the first image data are obtained according to the current frame maximum value and the current frame minimum value; the base layer minimum value of the base layer is obtained, and the current frame brightness compression parameters corresponding to the first image data are obtained according to the base layer maximum value and the base layer minimum value. When the current frame maximum value and the current frame minimum value are equal, the initialization guided filter parameters are used as the current frame guided filter parameters, and the initialization brightness compression parameters are used as the current frame brightness compression parameters.
[0099] According to the guided filtering parameters of the previous frame, guided filtering is performed on the first image data to decompose the first image data into a base layer and a detail layer; the base layer maximum value of the base layer is obtained, and the brightness compression parameters of the previous frame and the base layer maximum value are time-domain smoothed; the base layer maximum value after time-domain smoothing is subtracted from the base layer to obtain a base layer difference, the base layer difference is multiplied by the brightness compression parameters of the previous frame after time-domain smoothing, and the product is added to the detail layer to obtain the second image data.
[0100] The second image data is converted from the logarithmic space to the linear space to obtain the second relative brightness value corresponding to the single channel; the pixel scaling factor is obtained according to the ratio of the first relative brightness value to the second relative brightness value; the third image data is obtained according to the product of the pixel scaling factor and the brightness values of the RGB three channels; the third image data is subjected to color gamut conversion and photoelectric conversion to obtain the target image data.
[0101] The second case is to determine that the target tone mapping algorithm is a three-channel algorithm. The process of the three-channel version of the algorithm is basically the same as the single-channel version. The difference is that the RGB three-channel brightness value needs to be transferred to the logarithmic space for guided filtering, brightness compression and normalization operations. The processing result is the result of tone mapping. Steps 202 to 208 include: converting the RGB three-channel grayscale value into a three-channel brightness value based on the electro-optical conversion function. Convert the RGB three-channel brightness value from the linear space to the logarithmic space. Perform guided filtering, brightness compression and normalization operations on the RGB three-channel brightness values in the logarithmic space. The parameters of guided filtering and brightness compression are calculated based on the maximum and minimum values of the previous frame, and the three channels jointly count a set of maximum and minimum values. The parameters are smoothed in the time domain and the range is limited to ensure the time domain stability of the algorithm. The processing results of the RGB three-channel are converted from the logarithmic space back to the linear space to obtain the tone mapping result. After the tone mapping is completed, the color gamut conversion and photoelectric conversion operations are performed to obtain the SDR display content.
[0102] The three-channel algorithm processing flow is as follows Figure 6As shown, the original image data is electro-optically converted to convert the RGB three-channel grayscale values of the original image data into RGB three-channel brightness values; the RGB three-channel brightness values are converted from linear space to logarithmic space to obtain first image data.
[0103] According to the first image data, the current frame maximum value and the current frame minimum value are obtained; when the current frame maximum value and the current frame minimum value are not equal, the current frame guided filter parameters corresponding to the first image data are obtained according to the current frame maximum value and the current frame minimum value; the base layer minimum value of the base layer is obtained, and the current frame brightness compression parameters corresponding to the first image data are obtained according to the base layer maximum value and the base layer minimum value. When the current frame maximum value and the current frame minimum value are equal, the initialization guided filter parameters are used as the current frame guided filter parameters, and the initialization brightness compression parameters are used as the current frame brightness compression parameters.
[0104] According to the guided filtering parameters of the previous frame, guided filtering is performed on the first image data to decompose the first image data into a base layer and a detail layer; the base layer maximum value of the base layer is obtained, and the brightness compression parameters of the previous frame and the base layer maximum value are time-domain smoothed; the base layer maximum value after time-domain smoothing is subtracted from the base layer to obtain a base layer difference, the base layer difference is multiplied by the brightness compression parameters of the previous frame after time-domain smoothing, and the product is added to the detail layer to obtain the second image data.
[0105] The second image data is converted from the logarithmic space to the linear space to obtain the fourth image data; and the fourth image data is subjected to color gamut conversion and photoelectric conversion to obtain the target image data.
[0106] It can be seen that the single-channel version of the algorithm uses the same coefficient to process the brightness values of the RGB channels, while the three-channel version processes the RGB channels separately, which makes the two versions of the algorithm produce different results. Figure 7 This is the effect picture of the HDR original content being displayed directly without any processing. Figure 8 This is the effect of using the ACES tone mapping curve. Fig. 9 This is the effect diagram of the single-channel algorithm. Fig.10 This is the effect diagram of the three-channel algorithm.
[0107] In this embodiment, both algorithms do not require complex statistical information, only the maximum and minimum values of the video frame. The maximum and minimum values can be directly stored in the register, and do not need to be written to the memory cache, which is convenient for fast switching of the video stream. The calculation process after the algorithm is improved is more suitable for hardware implementation. The two algorithms can be used for GPU projects and OLED projects, and play a more important role in OLED projects. The reason is that when supporting HDR10+ and Dolby Vision, the GPU has a Driver, which makes it easier to obtain the matedata of the video, and the CPU can be used to calculate the tone mapping curve of each frame. It is more difficult for OLED to obtain the matedata of the video, and there is no Driver to help calculate the curve of each frame, so it is difficult for OLED to support HDR10+ and Dolby Vision using the GPU method. And because the HDR content input by OLED is not necessarily video content, for a fixed global tone mapping curve, most OLED products on the market set the curve more conservatively, so customers have put forward requirements for high-quality HDR effects. This algorithm can adaptively and dynamically adjust the brightness range when matedata is missing, and only needs to configure the maximum and minimum values when there is matedata, which is more suitable for the requirements of OLED projects for HDR10+ and Dolby Vision functions.
[0108] In one embodiment, the specific method of guiding filtering includes:
[0109] First, the electro-optical conversion function is used to convert the grayscale of the image into a linear brightness value, which can be achieved through a lookup table. For the single-channel version of the algorithm, it is necessary to calculate the overall relative brightness value of the pixel based on the linear brightness value of RGB, and then perform a logarithmic operation on the relative brightness Y and convert it to a logarithmic space, as shown in formula (1). The conversion to the logarithmic space is also achieved through a lookup table. The three-channel version of the algorithm needs to convert all RGB brightness to a logarithmic space, so the logarithmic operation and the electro-optical conversion table can be combined.
[0110] Y=log(0.2126*R luma +0.7152*G luma +0.0722*B luma )#(1)
[0111] Then, the guided filter is used to process the single-channel Y or three-channel RGB brightness in logarithmic space. The basic assumption of the guided filter is that the filter output is a local linear transformation of the guided map. Assume that the output image is q, the guided map is I, and for any position k in the image, the filter window is w k ,but
[0112]
[0113] In order to make the output image q and the input image p roughly the same locally, there is an optimization goal to minimize the mean square error between q and p.
[0114]
[0115] Where ∈ is a configuration constant that plays a role in avoiding division by zero and adjusting a and b. Then k and b k Find the partial derivative.
[0116]
[0117]
[0118] Make a k and b k The partial derivative is equal to 0, so we can solve for a k and b k .
[0119]
[0120] b k =f mean (p)-a k f mean (I)#(6)
[0121]
[0122]
[0123]
[0124] a k (f mean (I 2 )+∈-f mean (I)·f mean (I)) = f mean (I·p)-f mean (I)·f mean (p)
[0125]
[0126] Thus, the algorithm steps of the guided filter are obtained, and a and b can be calculated according to the guided image I and the input image p.
[0127] Var I =f mean (I·I)-f mean (I)·f mean (I)#(8)
[0128] CovIp =f mean (I·p)-f mean (I)·f mean (P)#(9)
[0129]
[0130] b=f mean (p)-a·f mean (I)#(11)
[0131] where f mean represents mean filtering, ∈ can be fixed as a constant or dynamically adjusted according to the maximum and minimum values of the input image. The calculation method is shown in formula (12).
[0132]
[0133] Since the guide image I and the input image p are the same, both are relative brightness images Y or brightness images RGB, the calculation steps of a and b can be simplified to
[0134]
[0135] b Y / R / g / B =(1-a Y / R / G / B )·f mean ((Y / R / G / B))#(14)
[0136] For 4K resolution videos, the original image tone mapping algorithm based on bilateral filtering requires a filtering range of 271x271. Although after replacing the bilateral filter with the guided filter, the Gaussian filter can be replaced with the mean filter which is easier to implement in hardware, it is still very difficult to implement such a large-scale mean filter. The solution is to reduce the height of the mean filter window, for example, change 271x271 to 271x3 to ensure a large scale of filtering in a single direction. Then, by utilizing the feature that the intermediate parameters of the mean filter operation can be shared, the large-scale mean filter is converted into an accumulation operation. While ensuring that each clock can output the result, there is no need to set the multiplier according to the filter size. The calculation process is as follows: Fig.11 As shown in the figure, only the multiplication and addition operations of three pixels in the vertical direction need to be calculated each time, and the multiplication and addition results are cached in sequence. Each output result only needs to be added and subtracted in sequence. In this way, the size of the filter is only related to the cache space and has nothing to do with the number of multipliers.
[0137] After calculating the coefficients a and b, the formula for guiding the filter to calculate the output image q using the coefficients a and b is shown in equation (15).
[0138] q=f mean (a)·I+f mean (b)#(15)
[0139] There are 3 options here:
[0140] The first one keeps the steps of the guided filtering algorithm and uses mean filtering on coefficients a and b with the same filter size as before.
[0141] The second method reduces the implementation cost by not using mean filtering on coefficients a and b and directly using q = a·I + b to calculate the output image.
[0142] The third method uses a simplified side window filter [3] instead of the mean filter to filter a and b.
[0143] The difference between these three schemes lies in the suppression of the halo phenomenon around the high-contrast edges in the image. Fig.12 As shown in the figure, Figure a is the result of not using mean filtering for coefficients a and b, and Figure b is the result of using mean filtering. It can be seen that using mean filtering can suppress the halo phenomenon, while the simplified side window filter can suppress the halo phenomenon to a greater extent. The side window filter is composed of filters in 8 directions. Fig.13 It is a side window filter with a filter kernel size of 3x3. Use 8 filters to process the coefficients a and b at each position, calculate 8 results, select the result with the smallest absolute difference in brightness value with the corresponding position of the original image as the output of the current position, and traverse all positions to obtain the output image q.
[0144] Since the large-size 8-directional side window filter is too expensive to implement, it can be simplified to a side window filter in the left and right directions, such as Fig.14 As shown in the figure. The simplified side window filter can share the intermediate values of the filtering calculation, and only a set of vertical multipliers is needed. The left and right directions retained by the simplified side window filter are adapted to the filter kernel shape of the mean filter. For high-contrast boundaries, the simplified side window filter can try to avoid the value range of coefficients a and b spanning two areas with large contrast, thereby suppressing the halo phenomenon to a greater extent.
[0145] In one embodiment, a specific method of ensuring time domain stability includes:
[0146] After the luminance map is processed by guided filtering, the base layer base is obtained, which is equivalent to q. The luminance map minus the base layer can obtain the detail layer detail, which is equivalent to pq. The base layer minus the maximum value of the base layer is multiplied by the compression factor comp_factor, and then the detail layer is added to obtain the compressed luminance map. The calculation process is shown in formula (16).
[0147] detail Y / R / G / B =logluma Y / R / G / B -base Y / R / G / B
[0148]
[0149] out=(base-max(base))·comp_factor+detail#(16)
[0150] The compression factor is calculated based on the maximum and minimum values of the base layer, and the size of the compression factor can be adjusted by configuring the parameter comp_factor_config. When the maximum and minimum values of the base layer are equal, it means that the current frame is a pure color transition frame, and all parameters are initialized at this time. From formula (13), it can be seen that the method of compressing the brightness range of this algorithm is to only compress the range of the base layer and ensure the range of the detail layer. Because the subtraction of logarithmic space corresponds to the division of linear space, subtracting the maximum value after compression of the base layer can achieve normalization of the result.
[0151] It can be seen that the key parameters that affect the final brightness compression degree are the maximum value and compression coefficient of the base layer. Ensuring the temporal stability of these two parameters can ensure the temporal stability of the final result of the algorithm. The method to ensure the temporal stability of parameters is parameter temporal smoothing and parameter range limitation.
[0152] Parameter temporal smoothing means that the update of key parameters needs to be updated smoothly frame by frame based on the difference between the updated value and the current value, so as to avoid the problem of flickering between frames. The calculation process is shown in formula (17). The amplitude of parameter update per frame can be adjusted by configuring the parameter update_config.
[0153] comp_factor+=(comp_factor new -comp_factor)*update_config#(17)
[0154] Parameter range limitation means limiting the update range of key parameters by configuring the maximum and minimum values of key parameters. When the same maximum and minimum values are configured, the key parameters are limited to fixed values. At this time, the same parameters are used to adjust each frame of the video, and the algorithm degenerates into a global tone mapping algorithm.
[0155] Balance dynamic processing and temporal stability by adjusting configuration parameters. You can also directly configure key parameters based on the video's matedata to control the algorithm processing effect.
[0156] Finally, an exponential operation is performed on the compressed brightness image to convert it from logarithmic space back to linear space. For the single-channel version of the algorithm, it is necessary to calculate the scaling factor of the pixel based on the ratio of the relative brightness Y before and after, and then use the scaling factor to uniformly process the RGB linear brightness value of the pixel to obtain the tone mapping result. The calculation formula is shown in formula (18). The three-channel version of the algorithm converts the RGB brightness back to linear space to obtain the tone mapping result.
[0157] factor=Y out / Y in
[0158] luma R / G / B =luma R / G / B *factor#(18)
[0159] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0160] Based on the same inventive concept, the embodiment of the present application also provides a tone mapping device for implementing the tone mapping method involved above. The implementation solution provided by the device to solve the problem is similar to the implementation solution recorded in the above method, so the specific limitations in one or more tone mapping device embodiments provided below can refer to the limitations of the tone mapping method above, and will not be repeated here.
[0161] In an exemplary embodiment, Fig.15 As shown, a tone mapping device 1500 is provided, comprising: a first conversion module 1501, a parameter acquisition module 1502, a data processing module 1503 and a second conversion module 1504, wherein:
[0162] The first conversion module 1501 is used to determine a target tone mapping algorithm that matches the mapping requirement, and perform data conversion on the original image data in the video to be processed according to the target tone mapping algorithm to obtain first image data.
[0163] The parameter acquisition module 1502 is used to acquire the previous frame guided filtering parameters and the previous frame brightness compression parameters corresponding to the previous frame image according to the previous frame image corresponding to the first image data in the video to be processed.
[0164] The data processing module 1503 is used to perform data processing on the first image data according to the previous frame guided filtering parameters and the previous frame brightness compression parameters to obtain second image data; the data processing includes at least one of guided filtering and brightness compression.
[0165] The second conversion module 1504 is used to perform data conversion on the second image data according to a target tone mapping algorithm to obtain target image data; the target image data is used to generate video display content.
[0166] In one embodiment, the first conversion module 1501 is also used to determine the target color gamut and target color accuracy according to the mapping requirements; when the target color gamut is within the first color gamut range and the target color accuracy is less than the first color accuracy threshold, the single-channel algorithm is used as the target tone mapping algorithm; the single-channel algorithm is used to process and compress the three RGB channels using the same coefficient; when the target color gamut is within the second color gamut range and the target color accuracy is less than the second color accuracy threshold, the three-channel algorithm is used as the target tone mapping algorithm; the three-channel algorithm is used to process and compress the three RGB channels separately.
[0167] In one embodiment, the first conversion module 1501 is also used to perform electro-optical conversion on the original image data when the target tone mapping algorithm is a single-channel algorithm, so as to convert the RGB three-channel grayscale values of the original image data into RGB three-channel brightness values; according to the RGB three-channel brightness values, obtain the first relative brightness value corresponding to the single channel; convert the first relative brightness value from the linear space to the logarithmic space to obtain the first image data.
[0168] In one embodiment, the second conversion module 1504 is also used to convert the second image data from the logarithmic space to the linear space when the target tone mapping algorithm is a single-channel algorithm, so as to obtain a second relative brightness value corresponding to the single channel; obtain a pixel scaling factor according to the ratio of the first relative brightness value to the second relative brightness value; obtain third image data according to the product of the pixel scaling factor and the RGB three-channel brightness value; perform color gamut conversion and photoelectric conversion on the third image data to obtain target image data.
[0169] In one embodiment, the first conversion module 1501 is also used to perform electro-optical conversion on the original image data when the target tone mapping algorithm is a three-channel algorithm, so as to convert the RGB three-channel grayscale values of the original image data into RGB three-channel brightness values; and convert the RGB three-channel brightness values from linear space to logarithmic space to obtain first image data.
[0170] In one embodiment, the second conversion module 1504 is also used to convert the second image data from the logarithmic space to the linear space to obtain the fourth image data when the target tone mapping algorithm is a three-channel algorithm; perform color gamut conversion and photoelectric conversion on the fourth image data to obtain the target image data.
[0171] In one embodiment, the data processing module 1503 is also used to perform guided filtering on the first image data according to the guided filtering parameters of the previous frame, and decompose the first image data into a base layer and a detail layer; obtain the base layer maximum value of the base layer, and perform time domain smoothing on the brightness compression parameters of the previous frame and the base layer maximum value; subtract the base layer maximum value after time domain smoothing from the base layer to obtain a base layer difference, multiply the base layer difference by the brightness compression parameters of the previous frame after time domain smoothing, and add the product to the detail layer to obtain the second image data.
[0172] In one embodiment, the data processing module 1503 is also used to obtain the current frame maximum value and the current frame minimum value based on the first image data; when the current frame maximum value and the current frame minimum value are not equal, obtain the current frame guided filtering parameters corresponding to the first image data according to the current frame maximum value and the current frame minimum value; obtain the base layer minimum value of the base layer, and obtain the current frame brightness compression parameters corresponding to the first image data according to the base layer maximum value and the base layer minimum value.
[0173] In one embodiment, the data processing module 1503 is further used to use the initialization guided filtering parameters as the current frame guided filtering parameters and the initialization brightness compression parameters as the current frame brightness compression parameters when the current frame maximum value and the current frame minimum value are equal.
[0174] Each module in the tone mapping device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0175] In an exemplary embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as shown in FIG. Fig.16As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface, the display unit and the input device are connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a tone mapping method is implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.
[0176] Those skilled in the art will understand that Fig.16 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0177] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.
[0178] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0179] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0180] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0181] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0182] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0183] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A tone mapping method, characterized in that: The method comprises: Determine a target tone mapping algorithm that matches the mapping requirement, and perform data conversion on original image data in the video to be processed according to the target tone mapping algorithm to obtain first image data; The method for determining a target tone mapping algorithm that matches the mapping requirement includes: determining a target color gamut and a target color accuracy according to the mapping requirement; when the target color gamut is within a first color gamut range and the target color accuracy is less than a first color accuracy threshold, using a single-channel algorithm as the target tone mapping algorithm; the single-channel algorithm is used to process and compress the three RGB channels using the same coefficient; when the target color gamut is within a second color gamut range and the target color accuracy is less than a second color accuracy threshold, using a three-channel algorithm as the target tone mapping algorithm; the three-channel algorithm is used to process and compress the three RGB channels respectively; According to a previous frame of image corresponding to the first image data in the video to be processed, obtaining a previous frame of guided filtering parameters and a previous frame of brightness compression parameters corresponding to the previous frame of image; Performing data processing on the first image data according to the previous frame guided filtering parameter and the previous frame brightness compression parameter to obtain second image data; the data processing includes at least one of guided filtering and brightness compression; According to the target tone mapping algorithm, data conversion is performed on the second image data to obtain target image data; the target image data is used to generate video display content.
2. The method according to claim 1, characterized in that When the target tone mapping algorithm is a single-channel algorithm, performing data conversion on the original image data in the processed video according to the target tone mapping algorithm to obtain the first image data includes: Performing electro-optical conversion on the original image data to convert the RGB three-channel grayscale values of the original image data into RGB three-channel brightness values; According to the brightness values of the RGB three channels, a first relative brightness value corresponding to a single channel is obtained; The first relative brightness value is converted from a linear space to a logarithmic space to obtain the first image data.
3. The method according to claim 2, characterized in that When the target tone mapping algorithm is a single-channel algorithm, performing data conversion on the second image data according to the target tone mapping algorithm to obtain target image data includes: Convert the second image data from the logarithmic space to the linear space to obtain a second relative brightness value corresponding to a single channel; Obtaining a pixel scaling factor according to a ratio of the first relative brightness value to the second relative brightness value; Acquire third image data according to the product of the pixel scaling factor and the RGB three-channel brightness value; The third image data is subjected to color gamut conversion and photoelectric conversion to obtain the target image data.
4. The method according to claim 1, characterized in that: When the target tone mapping algorithm is a three-channel algorithm, performing data conversion on the original image data in the processed video according to the target tone mapping algorithm to obtain the first image data includes: Performing electro-optical conversion on the original image data to convert the RGB three-channel grayscale values of the original image data into RGB three-channel brightness values; The brightness values of the three RGB channels are converted from a linear space to a logarithmic space to obtain the first image data.
5. The method according to claim 4, characterized in that When the target tone mapping algorithm is a three-channel algorithm, performing data conversion on the second image data according to the target tone mapping algorithm to obtain target image data includes: Convert the second image data from the logarithmic space to the linear space to obtain fourth image data; The fourth image data is subjected to color gamut conversion and photoelectric conversion to obtain the target image data.
6. The method according to claim 1, characterized in that The step of performing data processing on the first image data according to the previous frame guided filtering parameter and the previous frame brightness compression parameter to obtain the second image data comprises: Performing guided filtering on the first image data according to the guided filtering parameter of the previous frame, and decomposing the first image data into a base layer and a detail layer; Obtaining a base layer maximum value of the base layer, and performing time domain smoothing processing on the previous frame brightness compression parameter and the base layer maximum value; The base layer is subtracted from the base layer maximum value after time domain smoothing to obtain a base layer difference, the base layer difference is multiplied by the brightness compression parameter of the previous frame after time domain smoothing, the product is added to the detail layer to obtain the second image data.
7. The method according to claim 6, characterized in that The method further comprises: According to the first image data, obtaining a current frame maximum value and a current frame minimum value; When the current frame maximum value and the current frame minimum value are not equal, obtaining a current frame guided filtering parameter corresponding to the first image data according to the current frame maximum value and the current frame minimum value; Obtain a base layer minimum value of the base layer, and obtain a current frame brightness compression parameter corresponding to the first image data according to the base layer maximum value and the base layer minimum value.
8. The method according to claim 7, characterized in that The method further comprises: When the current frame maximum value and the current frame minimum value are equal, the initialization guided filtering parameters are used as the current frame guided filtering parameters, and the initialization brightness compression parameters are used as the current frame brightness compression parameters.
9. A tone mapping device, characterized in that: The device comprises: A first conversion module is used to determine a target tone mapping algorithm that matches the mapping requirement, and perform data conversion on the original image data in the video to be processed according to the target tone mapping algorithm to obtain first image data; The first conversion module is further used to determine the target color gamut and the target color accuracy according to the mapping requirements; when the target color gamut is within the first color gamut range and the target color accuracy is less than the first color accuracy threshold, a single-channel algorithm is used as the target tone mapping algorithm; the single-channel algorithm is used to process and compress the RGB three channels using the same coefficient; when the target color gamut is within the second color gamut range and the target color accuracy is less than the second color accuracy threshold, a three-channel algorithm is used as the target tone mapping algorithm; the three-channel algorithm is used to process and compress the RGB three channels respectively; A parameter acquisition module, used for acquiring a previous frame guided filtering parameter and a previous frame brightness compression parameter corresponding to a previous frame image corresponding to the first image data in the video to be processed; A data processing module, configured to perform data processing on the first image data according to the previous frame guided filtering parameter and the previous frame brightness compression parameter to obtain second image data; the data processing includes at least one of guided filtering and brightness compression; The second conversion module is used to perform data conversion on the second image data according to the target tone mapping algorithm to obtain target image data; the target image data is used to generate video display content.
10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 8 are implemented.
11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.
12. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.
Citation Information
Patent Citations
High-quality quick tone mapping method and system
CN107657594A
Signal processing device and image display apparatus including the same
US20200329222A1