Image conversion method, device, equipment and medium

By constructing a correction coefficient prediction model and a four-dimensional lookup table, fast and efficient conversion of SDR data to HDR data is achieved, solving the problems of slow conversion speed and poor image quality, and improving image conversion efficiency and quality.

CN119599895BActive Publication Date: 2025-09-30MALANSHAN AUDIO & VIDEO LABORATORY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411851500.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-16
Publication Date
2025-09-30
Estimated Expiration
2044-12-16

AI Technical Summary

Technical Problem

The conversion speed from SDR data to HDR data in existing technologies is slow and the image quality is poor, resulting in a low popularity of HDR video.

Method used

A correction coefficient prediction model and a four-dimensional lookup table are constructed. The target correction coefficient is predicted by the correction coefficient prediction model, and the normalized RGB color value is looked up in the four-dimensional lookup table to directly generate a high dynamic range image, avoiding unnecessary data calculation.

Benefits of technology

It achieves fast and efficient conversion of SDR data to HDR data while ensuring image quality and solving the problem of abnormal image exposure after conversion.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119599895B_ABST
    Figure CN119599895B_ABST
Patent Text Reader

Abstract

This application discloses an image conversion method, device, electronic device, and computer-readable storage medium. The method includes: obtaining a standard dynamic range image and determining the RGB color values ​​of the standard dynamic range image; using a correction coefficient prediction model to predict the target correction coefficient corresponding to the standard dynamic range image; looking up the RGB color values ​​and the normalized RGB color values ​​corresponding to the target correction coefficient in a four-dimensional lookup table; and using the normalized RGB color values ​​to generate a high dynamic range image corresponding to the standard dynamic range image. The technical solution provided by this application can achieve faster and more efficient conversion of SDR data to HDR data while effectively ensuring image quality.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to an image conversion method, and also to an image conversion device, an electronic device, and a computer-readable storage medium. Background Art

[0002] With advancements in display technology, mainstream monitors now generally support 400 nits of brightness and a P3 color gamut. However, the majority of existing video content is SDR (Standard Dynamic Range) content, with a maximum brightness of 100 nits and an sRGB color gamut, resulting in a dynamic range far below the monitor's specifications. To fully utilize monitor performance and enhance the user experience, there's an urgent need to convert existing SDR content to HDR (High-Dynamic Range). However, this conversion process suffers from slow speeds and exposure artifacts, resulting in a low adoption rate for HDR video.

[0003] Therefore, how to achieve faster and more efficient conversion of SDR data to HDR data while ensuring image quality is an urgent problem to be solved by those skilled in the art. Summary of the Invention

[0004] The purpose of this application is to provide an image conversion method, which can achieve faster and more efficient conversion of SDR data to HDR data while effectively ensuring image quality; another purpose of this application is to provide an image conversion device, electronic device and computer-readable storage medium, all of which have the above-mentioned beneficial effects.

[0005] In a first aspect, the present application discloses an image conversion method, comprising:

[0006] Acquire a standard dynamic range image, and determine RGB color values ​​of the standard dynamic range image;

[0007] Predicting a target correction coefficient corresponding to the standard dynamic range image using a correction coefficient prediction model;

[0008] Searching in a four-dimensional lookup table to obtain a normalized RGB color value corresponding to the RGB color value and the target correction coefficient;

[0009] A high dynamic range image corresponding to the standard dynamic range image is generated using the normalized RGB color values.

[0010] Optionally, the process of constructing the correction coefficient prediction model includes:

[0011] Collect overexposed images, underexposed images, and normally exposed images to generate an image sample set;

[0012] For each image sample in the image sample set, correct the image sample using each gamma correction curve within a preset gamma range to determine an optimal gamma correction curve corresponding to the image sample;

[0013] Converting each of the image samples into a histogram;

[0014] Generating training sample pairs according to each of the histograms and each of the optimal gamma correction curves;

[0015] Construct a convolutional neural network, use each of the training samples to perform model training on the convolutional neural network, and obtain the correction coefficient prediction model.

[0016] Optionally, using a correction coefficient prediction model to predict a target correction coefficient corresponding to the standard dynamic range image includes:

[0017] Performing a histogram conversion on the standard dynamic range image to obtain a target histogram;

[0018] Inputting the target histogram into the correction coefficient prediction model for processing to obtain a target gamma correction curve;

[0019] A target gamma value of the target gamma correction curve is determined, and the reciprocal of the target gamma value is used as a target correction coefficient corresponding to the standard dynamic range image.

[0020] Optionally, the process of constructing the four-dimensional lookup table includes:

[0021] Obtain all RGB color value samples within the global range and all gamma values ​​within the preset gamma range;

[0022] Performing order reduction processing on each of the RGB color value samples according to a preset order to obtain an R color component sample, a G color component sample, and a B color component sample;

[0023] Arrange and combine all the R color component samples, all the G color component samples, all the B color component samples, and all the gamma values ​​to obtain all index combinations;

[0024] For each index combination, perform gamma correction preprocessing, color gamut conversion processing, inverse tone mapping processing, and inverse electro-optical conversion processing on the index combination in sequence to obtain a normalized RGB color value corresponding to the index combination;

[0025] The four-dimensional lookup table is generated according to each of the index combinations and the normalized RGB color values ​​corresponding to each of the index combinations.

[0026] Optionally, searching a four-dimensional lookup table to obtain a normalized RGB color value corresponding to the RGB color value and the target correction coefficient includes:

[0027] Performing order reduction processing on the RGB color value according to the preset order to obtain an RGB color value index;

[0028] determining a target gamma value corresponding to the target correction coefficient;

[0029] The normalized RGB color value corresponding to the RGB color value index and the target gamma value is obtained by searching in the four-dimensional lookup table.

[0030] Optionally, determining the RGB color values ​​of the standard dynamic range image includes:

[0031] Converting the standard dynamic range image from a YUV format to an RGB format to obtain a format-converted image;

[0032] Determine that the RGB color values ​​of the format-converted image are the RGB color values ​​of the standard dynamic range image;

[0033] Accordingly, generating a high dynamic range image corresponding to the standard dynamic range image using the normalized RGB color values ​​includes:

[0034] Generating an RGB image using the normalized RGB color values;

[0035] The RGB image is converted from RGB format to YUV format to obtain a high dynamic range image corresponding to the standard dynamic range image.

[0036] Optionally, acquire a standard dynamic range image, including:

[0037] Acquire a standard dynamic range video, perform frame processing on the standard dynamic range video, and obtain each standard dynamic range image;

[0038] Accordingly, after generating a high dynamic range image corresponding to the standard dynamic range image using the normalized RGB color values, the method further includes:

[0039] A high dynamic range video corresponding to the standard dynamic range video is generated by utilizing the high dynamic range image corresponding to each of the standard dynamic range images.

[0040] In a second aspect, the present application further discloses an image conversion device, comprising:

[0041] a determination module, configured to obtain a standard dynamic range image and determine RGB color values ​​of the standard dynamic range image;

[0042] A prediction module, configured to predict a target correction coefficient corresponding to the standard dynamic range image using a correction coefficient prediction model;

[0043] A search module, configured to search a four-dimensional lookup table to obtain a normalized RGB color value corresponding to the RGB color value and the target correction coefficient;

[0044] A generating module is used to generate a high dynamic range image corresponding to the standard dynamic range image using the normalized RGB color values.

[0045] In a third aspect, the present application further discloses an electronic device, comprising:

[0046] memory for storing computer programs;

[0047] A processor is configured to implement the steps of any one of the above-mentioned image conversion methods when executing the computer program.

[0048] In a fourth aspect, the present application further discloses a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of any one of the image conversion methods described above are implemented.

[0049] The present application provides an image conversion method, comprising: acquiring a standard dynamic range image and determining RGB color values ​​of the standard dynamic range image; using a correction coefficient prediction model to predict a target correction coefficient corresponding to the standard dynamic range image; searching in a four-dimensional lookup table to obtain normalized RGB color values ​​corresponding to the RGB color values ​​and the target correction coefficient; and using the normalized RGB color values ​​to generate a high dynamic range image corresponding to the standard dynamic range image.

[0050] By applying the technical solution provided in this application, a correction coefficient prediction model and a four-dimensional lookup table are pre-constructed, wherein the correction coefficient prediction model is used to predict the target correction coefficient corresponding to the standard dynamic range image, and the target correction coefficient is used to achieve image correction of the standard dynamic range image, so as to effectively solve the problem of abnormal exposure of the converted image; the four-dimensional lookup table is used to record the correspondence between the image RGB color value and the target correction coefficient and the normalized RGB color value. The normalized RGB color value of the standard dynamic range image can be directly queried by the table lookup method to directly generate the high dynamic range image corresponding to the standard dynamic range image, avoiding unnecessary data calculation, so as to effectively solve the problem of low efficiency in converting SDR data to HDR data. It can be seen that this technical solution can achieve faster and more efficient conversion of SDR data to HDR data, while also effectively ensuring the quality of the converted image.

[0051] The image conversion device, electronic device and computer-readable storage medium provided in this application also have the above-mentioned technical effects, which will not be described in detail in this application. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] In order to more clearly illustrate the technical solutions in the prior art and the embodiments of the present application, the following is a brief introduction to the drawings required for describing the prior art and the embodiments of the present application. Of course, the drawings described below in connection with the embodiments of the present application are only part of the embodiments of the present application. For those skilled in the art, other drawings can be obtained based on the provided drawings without inventive effort, and the obtained other drawings also fall within the scope of protection of the present application.

[0053] Figure 1 A flowchart of an image conversion method provided in this application;

[0054] Figure 2 A schematic diagram of a gamma correction curve provided in this application;

[0055] Figure 3 A comparison diagram of an overexposed image before and after correction processing provided by this application;

[0056] Figure 4 A comparison chart of an underexposed image before and after correction processing provided by this application;

[0057] Figure 5 A histogram conversion effect diagram provided by this application;

[0058] Figure 6 This is a conversion effect diagram of an SDR image without gamma correction provided by this application to an HDR image;

[0059] Figure 7 This is a gamma-corrected SDR image to HDR image conversion effect diagram provided by this application;

[0060] Figure 8 A schematic diagram of generating a four-dimensional lookup table provided in this application;

[0061] Figure 9 A flowchart of a video conversion method provided in this application;

[0062] Figure 10 A schematic structural diagram of an image conversion device provided in this application;

[0063] Figure 11 This is a schematic diagram of the structure of an electronic device provided in this application. DETAILED DESCRIPTION

[0064] The core of this application is to provide an image conversion method, which can achieve faster and more efficient conversion of SDR data to HDR data, while also effectively ensuring image quality; another core of this application is to provide an image conversion device, electronic device and computer-readable storage medium, all of which have the above-mentioned beneficial effects.

[0065] In order to describe the technical solutions in the embodiments of the present application more clearly and completely, the technical solutions in the embodiments of the present application will be introduced below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only 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.

[0066] An embodiment of the present application provides an image conversion method.

[0067] Please refer to Figure 1 , Figure 1 This is a flowchart of an image conversion method provided in the present application. The image conversion method may include the following S101 to S104.

[0068] S101: Acquire a standard dynamic range image and determine the RGB color values ​​of the standard dynamic range image.

[0069] This step aims to determine the RGB color values ​​of a standard dynamic range image (hereinafter referred to as an SDR image), including the color values ​​of the R, G, and B channels. Specifically, after obtaining the SDR image, it can be converted to RGB format, thereby determining the RGB color values ​​of the SDR image.

[0070] S102: Utilizing a correction coefficient prediction model to predict target correction coefficients corresponding to the standard dynamic range image.

[0071] This step aims to predict the correction coefficients to obtain the target correction coefficients for the standard dynamic range image. These target correction coefficients are used to correct the SDR image, effectively resolving the issue of abnormal exposure after conversion. This can be achieved based on a pre-created correction coefficient prediction model.

[0072] In one embodiment of the present application, the process of constructing the correction coefficient prediction model may include:

[0073] Collect overexposed images, underexposed images, and normally exposed images to generate an image sample set;

[0074] For each image sample in the image sample set, correct the image sample using each gamma correction curve within a preset gamma range to determine an optimal gamma correction curve corresponding to the image sample;

[0075] Convert each image sample into a histogram;

[0076] Generate training sample pairs according to each histogram and each optimal gamma correction curve;

[0077] Convolutional Neural Networks (CNN) are constructed and trained using various training samples to obtain a correction coefficient prediction model.

[0078] The embodiment of the present application provides a method for constructing a correction coefficient prediction model. As described above, the target correction coefficient is used to achieve image correction of the SDR image to effectively solve the problem of abnormal exposure of the converted image screen. Therefore, the correction coefficient prediction model can be trained using abnormal and normal image exposure data. During the implementation process, a large number of overexposed images, underexposed images, and normally exposed images can be collected to generate a set of image samples; further, for each image sample in the set, each gamma correction curve within a preset gamma range can be used to correct it, so that the optimal gamma correction curve corresponding to the image sample can be determined based on all the correction results, that is, the gamma correction curve that is most suitable for the image sample and can enable the image sample to obtain the optimal picture correction result; thereby, a training sample pair "image sample histogram-optimal gamma correction curve" can be generated to achieve model training, thereby obtaining a correction coefficient prediction model.

[0079] For further information, please refer to Figure 2 , Figure 2 This is a gamma correction curve diagram provided by this application, which provides gamma correction curves corresponding to 33 gamma values. Generally, when the gamma correction value is greater than 1, the highlight part of the image is compressed and the shadow part is expanded. When the gamma correction value is less than 1, the highlight part of the image is expanded and the shadow part is compressed. Figure 3 and Figure 4 , Figure 3 This is a comparison diagram of an overexposed image before and after correction processing provided by this application. Figure 4 This is a comparison diagram of an underexposed image before and after correction provided by the present application. It is obvious that the image after correction is clearer.

[0080] Based on this, the target correction coefficient corresponding to the standard dynamic range image predicted by the correction coefficient prediction model may include:

[0081] Perform histogram conversion on the standard dynamic range image to obtain the target histogram;

[0082] The target histogram is input into the correction coefficient prediction model for processing to obtain the target gamma correction curve;

[0083] A target gamma value of a target gamma correction curve is determined, and the reciprocal of the target gamma value is used as a target correction coefficient corresponding to the standard dynamic range image.

[0084] The embodiment of the present application provides a method for predicting the target correction coefficient corresponding to the SDR image using a correction coefficient prediction model. Figures 5 to 7 , Figure 5 A histogram conversion effect diagram provided by this application, Figure 6 This is a conversion effect diagram of an SDR image to an HDR image without gamma correction provided by this application. Figure 7 This application provides a conversion effect diagram of an SDR image to an HDR image after gamma correction. Obviously, this implementation method can effectively solve the problem of overexposure or underexposure of the image.

[0085] S103: Searching in a four-dimensional lookup table to obtain a normalized RGB color value corresponding to the RGB color value and the target correction coefficient.

[0086] This step aims to determine the normalized RGB color values ​​of an SDR image based on a four-dimensional lookup table (hereinafter referred to as a 4D LUT) for use in generating a high dynamic range image (hereinafter referred to as an HDR image) corresponding to the SDR image. Specifically, a 4D LUT can be pre-constructed to record the correspondence between the image RGB color values ​​and the target correction coefficients and the normalized RGB color values. Therefore, the normalized RGB color values ​​of the SDR image can be directly obtained through a table lookup method, so that the HDR image corresponding to the SDR image can be directly generated. This can effectively avoid unnecessary data calculations and effectively solve the problem of low efficiency in converting SDR data to HDR data.

[0087] In one embodiment of the present application, the process of constructing a four-dimensional lookup table may include:

[0088] Get all RGB color value samples within the global range and all gamma values ​​within the preset gamma range;

[0089] Performing order reduction processing on each RGB color value sample according to a preset order to obtain an R color component sample, a G color component sample, and a B color component sample;

[0090] Arrange and combine all R color component samples, all G color component samples, all B color component samples, and all gamma values ​​to obtain all index combinations;

[0091] For each index combination, gamma correction preprocessing, color gamut conversion processing, inverse tone mapping processing, and inverse electro-optical conversion processing are performed on the index combination in sequence to obtain the normalized RGB color value corresponding to the index combination;

[0092] A four-dimensional lookup table is generated according to each index combination and the normalized RGB color value corresponding to each index combination.

[0093] The embodiment of the present application provides a method for constructing a 4D LUT. First, obtain all RGB color value samples within the global range and all gamma values ​​within the preset gamma range, wherein all RGB color value samples within the global range are all possible RGB color values ​​(the value range of each color channel is 0~255), and all gamma values ​​within the preset gamma range are as follows: Figure 2 The gamma values ​​corresponding to the 33 gamma correction curves shown are shown. It can be understood that the data volume of all RGB color value samples in the entire domain is 256×256×256, which is too large a file. Therefore, the data volume can be reduced by reducing the order. For example, the 256-level color value can be scaled to 33 or 64 levels to obtain the color value samples of each color channel, that is, the above-mentioned R color component samples, G color component samples, and B color component samples. Therefore, taking 33 levels and 33 gamma values ​​as an example, 33×33×33×33 index combinations can be obtained by permutation and combination. Furthermore, for each index combination, by sequentially performing the above-mentioned gamma correction preprocessing, color gamut conversion processing, inverse tone mapping processing, and inverse electro-optical conversion processing, the corresponding normalized RGB color value can be obtained. Then, all index combinations and their corresponding normalized RGB color values ​​can generate a 4DLUT. At this point, the construction of the 4D LUT is realized.

[0094] Among them, gamma correction preprocessing, color gamut conversion processing, inverse tone mapping processing, and inverse electro-optical conversion processing can all be achieved through corresponding formula calculations, and this application will not go into details. It should be noted that, precisely because these formula calculations require a large number of multiplication and addition operations, exponential operations, etc., if this operation is performed on each SDR image to obtain an HDR image, the image conversion efficiency will inevitably be reduced due to the huge amount of calculation. Therefore, by establishing a 4D LUT in the above manner, the conversion process from SDR image to HDR image can be achieved directly through table lookup, which effectively avoids a large amount of data calculation and greatly improves the image conversion efficiency.

[0095] Based on this, the normalized RGB color value corresponding to the RGB color value and the target correction coefficient is obtained in the four-dimensional lookup table, which may include:

[0096] Degrade the RGB color value according to a preset order to obtain an RGB color value index;

[0097] Determine the target gamma value corresponding to the target correction coefficient;

[0098] The normalized RGB color value corresponding to the RGB color value index and the target gamma value is obtained in the four-dimensional lookup table.

[0099] The embodiment of the present application provides a method for obtaining a normalized RGB color value corresponding to an RGB color value and a target correction coefficient by searching in a four-dimensional lookup table. Obviously, after completing the reduction processing of the RGB color value, the corresponding normalized RGB color value can be obtained by looking up the table in combination with the corresponding target gamma value.

[0100] Based on this, please refer to Figure 8 , Figure 8 This is a schematic diagram of the generation of a four-dimensional lookup table provided in this application (taking 33 levels and 33 gamma values ​​as an example). During the lookup process, the corresponding row number can be generated by combining the input color index (R, G, B) and the gamma value C. Then, the normalized output color value (R1, G1, B1) and the gamma correction coefficient can be found based on the row number. The row number retrieval calculation formula is: row number = R + G × 33 + B × 33 × 33 + C × 33 × 33 × 33, where R, G, and B are the values ​​obtained by taking the modulo 8 of the original color value (before reduction). Specifically, it can include the following two cases:

[0101] (1) The input color index (R, G, B) is an integer multiple of 8:

[0102] For example, if the input (R, G, B) color value is (0, 8, 248), the implementation process for searching through the 4D LUT includes: first, using the prediction result of the correction coefficient prediction module as the gamma value index, assuming it is 0; then reducing the input color value, that is, taking the three color components (R, G, B) and performing a modulo 8 operation on each, to obtain (0, 1, 31). The output result is 0+1×33+31×33×33+0×33×33×33=34881, that is, the (R1, G1, B1) value corresponding to row 34881 is the output normalized RGB color value.

[0103] (2) The input color index (R, G, B) is not an integer multiple of 8:

[0104] For example, if the input (R, G, B) color value is (3, 12, 254), the retrieval process through the 4D LUT includes: first, the prediction result of the correction coefficient prediction module is used as the gamma value index, assuming it is 0; then the input color value is reduced to a certain level, that is, the three color components (R, G, B) are respectively multiplied by 8 and the remainders are calculated to obtain (0, 1, 31) respectively. At the same time, the remainders of the three color components are (3, 4, 6) respectively. The output results need to be calculated according to the following rules:

[0105] The output color R1 component is determined by the R components x1 and x2 in the corresponding lookup results of the two input color indices (0, 1, 31) and (1, 1, 31);

[0106] The output color G1 component is determined by the G components y1 and y2 in the corresponding lookup results of the two input color indices (0, 1, 31) and (0, 2, 31);

[0107] The input color B1 component is determined by the B components z1 and z2 in the corresponding search results of the two input color indices (0, 1, 31) and (0, 1, 32);

[0108] Then we have:

[0109] R1=x1×(8-3) / 8+(3 / 8)×x2;

[0110] G1=y1×(8-4) / 8+(4 / 8)×y2;

[0111] B1=z1×(8-6) / 8+(6 / 8)×z2;

[0112] Then, (R1, G1, B1) is the normalized RGB color value of the output.

[0113] S104: Generate a high dynamic range image corresponding to the standard dynamic range image using the normalized RGB color values.

[0114] This step aims to achieve the final generation of the HDR image corresponding to the SDR image, that is, after obtaining each normalized RGB color value, the normalized RGB color value can be used to generate the HDR image corresponding to the SDR image.

[0115] In one embodiment of the present application, determining the RGB color values ​​of the standard dynamic range image may include: converting the standard dynamic range image from a YUV format to an RGB format to obtain a format-converted image; determining the RGB color values ​​of the format-converted image to be the RGB color values ​​of the standard dynamic range image;

[0116] Accordingly, generating a high dynamic range image corresponding to the standard dynamic range image using normalized RGB color values ​​may include: generating an RGB image using normalized RGB color values; and converting the RGB image from RGB format to YUV format to obtain a high dynamic range image corresponding to the standard dynamic range image.

[0117] It can be understood that in order to obtain the RGB color value of the SDR image, it can be converted from YUV format to RGB format first; then accordingly, in order to generate the final HDR image, it is also necessary to convert the generated image from RGB format back to YUV format to obtain the HDR image corresponding to the SDR image.

[0118] In one embodiment of the present application, obtaining a standard dynamic range image may include: obtaining a standard dynamic range video, performing frame processing on the standard dynamic range video, and obtaining each standard dynamic range image;

[0119] Correspondingly, after generating a high dynamic range image corresponding to the standard dynamic range image using the normalized RGB color values, the method may further include: generating a high dynamic range video corresponding to the standard dynamic range video using the high dynamic range images corresponding to each standard dynamic range image.

[0120] The image conversion method provided in the embodiment of the present application is also applicable to the video conversion process, that is, converting SDR video into HDR video. In this process, it can be achieved by sequentially executing the above steps S101 to S104 for each video frame in the complete video.

[0121] It can be seen that the image conversion method provided in the embodiment of the present application pre-constructs a correction coefficient prediction model and a four-dimensional lookup table, wherein the correction coefficient prediction model is used to predict the target correction coefficient corresponding to the standard dynamic range image, and the target correction coefficient is used to achieve image correction of the standard dynamic range image, so as to effectively solve the problem of abnormal exposure of the image after conversion; the four-dimensional lookup table is used to record the correspondence between the image RGB color value and the target correction coefficient and the normalized RGB color value, and the normalized RGB color value of the standard dynamic range image can be directly queried by the table lookup method to directly generate the high dynamic range image corresponding to the standard dynamic range image, avoiding unnecessary data calculation, so as to effectively solve the problem of low efficiency in converting SDR data to HDR data. It can be seen that the present technical solution can achieve faster and more efficient conversion of SDR data to HDR data, while also effectively ensuring the quality of the converted image.

[0122] Based on the above embodiments, please refer to Figure 9 , Figure 9 This is a flow chart of a video conversion method provided by this application. The implementation process of the video conversion method is as follows:

[0123] First, the SDR video is decoded into frames of YUV data, and each frame of YUV data is converted into 8-bit RGB data through the YUV to RGB conversion matrix. The RGB data is then input into the correction coefficient prediction model to predict the gamma correction coefficient of the frame image for use in the gamma correction preprocessing module. Figure 9 The dashed line shows the functionality implemented by the 4D LUT. Its input parameters are color values ​​(R, G, B) and gamma correction coefficients, and its output is normalized color values ​​(R1, G1, B1). This implementation integrates the computational processes of four modules—gamma correction preprocessing, color gamut conversion, inverse tone mapping, and PQ domain inverse photoelectric conversion—into a single 4D LUT. This final step's results can be directly retrieved through a table lookup, omitting the computational overhead. Finally, the table output color values ​​(R1, G1, B1) are quantized to 10 bits and converted from RGB to YUV to generate YUV data. This YUV data is then compressed and encoded to produce HDR video.

[0124] An embodiment of the present application provides an image conversion device.

[0125] Please refer to Figure 10 , Figure 10 This is a schematic diagram of the structure of an image conversion device provided in this application. The image conversion device may include:

[0126] Determination module 1, for obtaining a standard dynamic range image and determining the RGB color values ​​of the standard dynamic range image;

[0127] Prediction module 2, used to predict the target correction coefficient corresponding to the standard dynamic range image using the correction coefficient prediction model;

[0128] A search module 3 is used to search the four-dimensional lookup table to obtain the normalized RGB color value corresponding to the RGB color value and the target correction coefficient;

[0129] The generating module 4 is configured to generate a high dynamic range image corresponding to the standard dynamic range image using the normalized RGB color values.

[0130] It can be seen that the image conversion device provided in the embodiment of the present application pre-constructs a correction coefficient prediction model and a four-dimensional lookup table, wherein the correction coefficient prediction model is used to predict the target correction coefficient corresponding to the standard dynamic range image, and the target correction coefficient is used to achieve image correction of the standard dynamic range image, so as to effectively solve the problem of abnormal exposure of the image after conversion; the four-dimensional lookup table is used to record the correspondence between the image RGB color value and the target correction coefficient and the normalized RGB color value, and the normalized RGB color value of the standard dynamic range image can be directly queried by the table lookup method to directly generate the high dynamic range image corresponding to the standard dynamic range image, avoiding unnecessary data calculation, so as to effectively solve the problem of low efficiency in converting SDR data to HDR data. It can be seen that the present technical solution can achieve faster and more efficient conversion of SDR data to HDR data, while also effectively ensuring the quality of the converted image.

[0131] In one embodiment of the present application, the image conversion device may also include a first construction module for collecting overexposed images, underexposed images, and normally exposed images to generate an image sample set; for each image sample in the image sample set, the image sample is corrected using each gamma correction curve within a preset gamma range to determine the optimal gamma correction curve corresponding to the image sample; each image sample is converted into a histogram; training sample pairs are generated according to each histogram and each optimal gamma correction curve; a convolutional neural network is constructed, and the convolutional neural network is trained using each training sample to obtain a correction coefficient prediction model.

[0132] In one embodiment of the present application, the above-mentioned prediction module 2 can be specifically used to perform histogram conversion on the standard dynamic range image to obtain a target histogram; input the target histogram into the correction coefficient prediction model for processing to obtain a target gamma correction curve; determine the target gamma value of the target gamma correction curve, and use the inverse of the target gamma value as the target correction coefficient corresponding to the standard dynamic range image.

[0133] In one embodiment of the present application, the image conversion device may further include a second construction module for obtaining all RGB color value samples within the global range and all gamma values ​​within a preset gamma range; performing order reduction processing on each RGB color value sample according to a preset order to obtain R color component samples, G color component samples, and B color component samples; arranging and combining all R color component samples, all G color component samples, all B color component samples, and all gamma values ​​to obtain all index combinations; for each index combination, performing gamma correction preprocessing, color gamut conversion processing, inverse tone mapping processing, and inverse electro-optical conversion processing on the index combination in turn to obtain a normalized RGB color value corresponding to the index combination; and generating a four-dimensional lookup table according to each index combination and the normalized RGB color value corresponding to each index combination.

[0134] In one embodiment of the present application, the above-mentioned search module 3 can be specifically used to reduce the RGB color value according to a preset order to obtain an RGB color value index; determine the target gamma value corresponding to the target correction coefficient; and search in a four-dimensional lookup table to obtain the normalized RGB color value corresponding to the RGB color value index and the target gamma value.

[0135] In one embodiment of the present application, the determination module 1 may be specifically configured to convert a standard dynamic range image from a YUV format to an RGB format to obtain a format-converted image; determine that the RGB color values ​​of the format-converted image are the RGB color values ​​of the standard dynamic range image;

[0136] Accordingly, the above-mentioned generating module 4 can be specifically used to generate an RGB image using normalized RGB color values; convert the RGB image from RGB format to YUV format to obtain a high dynamic range image corresponding to the standard dynamic range image.

[0137] In one embodiment of the present application, the determination module 1 may be specifically used to obtain a standard dynamic range video, perform frame processing on the standard dynamic range video, and obtain each standard dynamic range image;

[0138] Correspondingly, the generation module 4 may also be configured to generate a high dynamic range video corresponding to the standard dynamic range video using the high dynamic range images corresponding to the standard dynamic range images after generating the high dynamic range image corresponding to the standard dynamic range image using the normalized RGB color values.

[0139] For an introduction to the apparatus provided in the embodiments of this application, please refer to the above method embodiments, which will not be elaborated in this application.

[0140] An embodiment of the present application provides an electronic device.

[0141] Please refer to Figure 11 , Figure 11 This is a schematic diagram of the structure of an electronic device provided in this application, which may include:

[0142] memory for storing computer programs;

[0143] The processor is configured to implement the steps of any one of the above-mentioned image conversion methods when executing a computer program.

[0144] like Figure 11 FIG. 1 is a schematic diagram of the structure of an electronic device, which may include a processor 10, a memory 11, a communication interface 12, and a communication bus 13. The processor 10, the memory 11, and the communication interface 12 communicate with each other via the communication bus 13.

[0145] In the embodiment of the present application, the processor 10 may be a central processing unit (CPU), an application-specific integrated circuit, a digital signal processor, a field programmable gate array, or other programmable logic devices.

[0146] The processor 10 may call a program stored in the memory 11 . Specifically, the processor 10 may execute operations in the embodiment of the image conversion method.

[0147] The memory 11 is used to store one or more programs. The program may include program code, and the program code includes computer operating instructions. In the embodiment of the present application, the memory 11 stores at least a program for implementing the following functions:

[0148] Obtain a standard dynamic range image and determine the RGB color values ​​of the standard dynamic range image;

[0149] The correction coefficient prediction model is used to predict the target correction coefficient corresponding to the standard dynamic range image;

[0150] Find the normalized RGB color value corresponding to the RGB color value and the target correction coefficient in the four-dimensional lookup table;

[0151] Generates a high dynamic range image corresponding to a standard dynamic range image using normalized RGB color values.

[0152] In one possible implementation, the memory 11 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application required for at least one function, etc.; the data storage area may store data created during use.

[0153] In addition, the memory 11 may include a high-speed random access memory and may also include a non-volatile memory, such as at least one disk storage device or other volatile solid-state storage device.

[0154] The communication interface 12 may be an interface of a communication module, and is used to connect to other devices or systems.

[0155] Of course, it needs to be explained that Figure 11 The structure shown does not constitute a limitation on the electronic device in the embodiment of the present application. In actual applications, the electronic device may include Figure 11 More or fewer components than shown, or combinations of certain components.

[0156] An embodiment of the present application provides a computer-readable storage medium.

[0157] The computer-readable storage medium provided in the embodiment of the present application stores a computer program, and when the computer program is executed by a processor, the steps of any one of the above-mentioned image conversion methods can be implemented.

[0158] The computer-readable storage medium may include: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc., which can store program codes.

[0159] For an introduction to the computer-readable storage medium provided in the embodiments of the present application, please refer to the above method embodiments, and this application will not elaborate on them here.

[0160] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Reference can be made to the common and similar parts between the various embodiments. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the method description.

[0161] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0162] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0163] The technical solution provided by the present application is described in detail above. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only intended to help understand the method and core ideas of the present application. It should be noted that, for those skilled in the art, without departing from the principles of the present application, several improvements and modifications may be made to the present application, and these improvements and modifications also fall within the scope of protection of the present application.

Claims

1. An image conversion method, characterized in that: include: Acquire a standard dynamic range image, and determine RGB color values ​​of the standard dynamic range image; Predicting a target correction coefficient corresponding to the standard dynamic range image using a correction coefficient prediction model; Searching in a four-dimensional lookup table to obtain a normalized RGB color value corresponding to the RGB color value and the target correction coefficient; Generating a high dynamic range image corresponding to the standard dynamic range image using the normalized RGB color values; The construction process of the four-dimensional lookup table includes: obtaining all RGB color value samples within the global range and all gamma values ​​within a preset gamma range; performing order reduction processing on each of the RGB color value samples according to a preset order to obtain R color component samples, G color component samples, and B color component samples; permuting and combining all the R color component samples, all the G color component samples, all the B color component samples, and all the gamma values ​​to obtain all index combinations; for each index combination, sequentially performing gamma correction preprocessing, color gamut conversion processing, inverse tone mapping processing, and inverse electro-optical conversion processing on the index combination to obtain a normalized RGB color value corresponding to the index combination; and generating the four-dimensional lookup table according to each of the index combinations and the normalized RGB color values ​​corresponding to each of the index combinations; Searching in a four-dimensional lookup table to obtain the normalized RGB color value corresponding to the RGB color value and the target correction coefficient, includes: reducing the RGB color value according to the preset order to obtain an RGB color value index; determining a target gamma value corresponding to the target correction coefficient; and searching in the four-dimensional lookup table to obtain the normalized RGB color value corresponding to the RGB color value index and the target gamma value.

2. The image conversion method according to claim 1, wherein: The construction process of the correction coefficient prediction model includes: Collect overexposed images, underexposed images, and normally exposed images to generate an image sample set; For each image sample in the image sample set, correct the image sample using each gamma correction curve within a preset gamma range to determine an optimal gamma correction curve corresponding to the image sample; Converting each of the image samples into a histogram; Generating training sample pairs according to each of the histograms and each of the optimal gamma correction curves; Construct a convolutional neural network, use each of the training samples to perform model training on the convolutional neural network, and obtain the correction coefficient prediction model.

3. The image conversion method according to claim 2, wherein: The target correction coefficient corresponding to the standard dynamic range image is predicted using a correction coefficient prediction model, including: Performing a histogram conversion on the standard dynamic range image to obtain a target histogram; Inputting the target histogram into the correction coefficient prediction model for processing to obtain a target gamma correction curve; A target gamma value of the target gamma correction curve is determined, and the reciprocal of the target gamma value is used as a target correction coefficient corresponding to the standard dynamic range image.

4. The image conversion method according to claim 1, wherein: Determining RGB color values ​​of the standard dynamic range image, comprising: Converting the standard dynamic range image from a YUV format to an RGB format to obtain a format-converted image; Determine that the RGB color values ​​of the format-converted image are the RGB color values ​​of the standard dynamic range image; Accordingly, generating a high dynamic range image corresponding to the standard dynamic range image using the normalized RGB color values ​​includes: Generating an RGB image using the normalized RGB color values; The RGB image is converted from RGB format to YUV format to obtain a high dynamic range image corresponding to the standard dynamic range image.

5. The image conversion method according to claim 1, wherein: Acquire standard dynamic range images, including: Acquire a standard dynamic range video, perform frame processing on the standard dynamic range video, and obtain each standard dynamic range image; Accordingly, after generating a high dynamic range image corresponding to the standard dynamic range image using the normalized RGB color values, the method further includes: A high dynamic range video corresponding to the standard dynamic range video is generated by utilizing the high dynamic range image corresponding to each of the standard dynamic range images.

6. An image conversion device, characterized in that: include: a determination module, configured to obtain a standard dynamic range image and determine RGB color values ​​of the standard dynamic range image; A prediction module, configured to predict a target correction coefficient corresponding to the standard dynamic range image using a correction coefficient prediction model; A search module, configured to search a four-dimensional lookup table to obtain a normalized RGB color value corresponding to the RGB color value and the target correction coefficient; A generating module, configured to generate a high dynamic range image corresponding to the standard dynamic range image using the normalized RGB color values; A four-dimensional lookup table construction module is used to obtain all RGB color value samples within a global range and all gamma values ​​within a preset gamma range; perform order reduction processing on each of the RGB color value samples according to a preset order to obtain an R color component sample, a G color component sample, and a B color component sample; perform permutations and combinations on all of the R color component samples, all of the G color component samples, all of the B color component samples, and all of the gamma values ​​to obtain all index combinations; for each index combination, sequentially perform gamma correction preprocessing, color gamut conversion processing, inverse tone mapping processing, and inverse electro-optical conversion processing on the index combination to obtain a normalized RGB color value corresponding to the index combination; and generate the four-dimensional lookup table according to each of the index combinations and the normalized RGB color values ​​corresponding to each of the index combinations; The search module is specifically configured to reduce the RGB color value according to the preset order to obtain an RGB color value index; determining a target gamma value corresponding to the target correction coefficient; The normalized RGB color value corresponding to the RGB color value index and the target gamma value is obtained by searching in the four-dimensional lookup table.

7. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the image conversion method according to any one of claims 1 to 5 when executing the computer program.

8. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the image conversion method according to any one of claims 1 to 5 are implemented.