Image conversion method and device, equipment and medium
By predicting the target correction coefficient and using the four-dimensional lookup table to generate normalized RGB color values, the problems of slow conversion speed and abnormal picture exposure when converting HDR videos in SDR videos are solved, and fast and efficient image conversion is achieved and image quality is ensured.
Patent Information
- Application Number
- CN202411851500.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-16
- Publication Date
- 2025-03-11
- Estimated Expiration
- 2044-12-16
AI Technical Summary
When converting SDR videos into HDR videos, the conversion speed is slow and the screen exposure is abnormal after conversion, resulting in low popularity of HDR videos.
By obtaining the RGB color value of the standard dynamic range image, using the correction coefficient prediction model to predict the target correction coefficient, searching for the normalized RGB color value corresponding to the RGB color value and the target correction coefficient in the four-dimensional lookup table to generate a high dynamic range image.
It realizes the conversion of SDR data to HDR data faster and more efficiently, while effectively ensuring image quality and avoiding the problem of abnormal picture exposure after conversion.
Smart Images

Figure CN119599895A_ABST
Abstract
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 the improvement of display technology, contemporary mainstream monitors generally support the display standard of 400 nit brightness and P3 color gamut. However, most of the existing videos are SDR (Standard Dynamic Range) videos, that is, the maximum brightness is 100 nits, the color gamut is sRGB color gamut, and the dynamic range is far lower than the display indicators. In order to make full use of the performance of the display and improve the user's sensory experience, it is urgent to convert the existing SDR videos into HDR (High-Dynamic Range) videos. However, there are problems such as slow conversion speed and abnormal exposure of the converted picture during this conversion process, resulting in a low popularity of HDR videos.
[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 technical personnel in this field. Summary of the invention
[0004] The purpose of the present application is to provide an image conversion method, which can realize faster and more efficient conversion of SDR data to HDR data, while also effectively ensuring image quality; another purpose of the present application is to provide an image conversion device, an electronic device and a 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 the RGB color values of the standard dynamic range image;
[0007] The correction coefficient prediction model is used to predict the target correction coefficient corresponding to the standard dynamic range image;
[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] Generate 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, 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;
[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 in 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 value of the standard dynamic range image includes:
[0031] Convert 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 conversion 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] Generate 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, obtain 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 of the standard dynamic range images;
[0038] Correspondingly, after generating the high dynamic range image corresponding to the standard dynamic range image by using the normalized RGB color values, the method further includes:
[0039] The high dynamic range image corresponding to each of the standard dynamic range images is used to generate a high dynamic range video corresponding to the standard dynamic range video.
[0040] In a second aspect, the present application further discloses an image conversion device, comprising:
[0041] A determination module, used for acquiring a standard dynamic range image and determining the RGB color values of the standard dynamic range image;
[0042] A prediction module, used to predict a target correction coefficient corresponding to the standard dynamic range image using a correction coefficient prediction model;
[0043] A search module, used for 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;
[0044] A generating module is used to generate a high dynamic range image corresponding to the standard dynamic range image by 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 used to implement the steps of any one of the image conversion methods described above 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, and 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 the 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 normalized RGB color values corresponding to the RGB color values and the target correction coefficients; and generating a high dynamic range image corresponding to the standard dynamic range image using the normalized RGB color values.
[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 screen; 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 technical solution can achieve faster and more efficient conversion of SDR data to HDR data, and can also effectively guarantee the quality of the converted image.
[0051] An 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 drawings required for use in the description of the prior art and the embodiments of the present application are briefly introduced below. Of course, the drawings described below in relation to the embodiments of the present application are only part of the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without creative work, and the obtained other drawings also belong to the protection scope of the present application.
[0053] Figure 1 A flowchart of an image conversion method provided by 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 the present application;
[0056] Figure 4 A comparison diagram of an underexposed image before and after correction processing provided by the present 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 to an HDR image without gamma correction provided by the present application;
[0059] Figure 7 This is a conversion effect diagram of an SDR image to an HDR image after gamma correction provided by the present application;
[0060] Figure 8 A schematic diagram of generating a four-dimensional lookup table provided in this application;
[0061] Fig. 9 A schematic diagram of a video conversion method provided by this application;
[0062] Fig.10 A schematic diagram of the structure of an image conversion device provided by the present application;
[0063] Fig.11 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, an electronic device and a 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 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 channel, the G channel, and the B channel. Specifically, after obtaining the SDR image, it can be converted into an RGB format, thereby determining the RGB color values of the SDR image.
[0070] S102: using a correction coefficient prediction model to predict a target correction coefficient corresponding to the standard dynamic range image.
[0071] This step aims to achieve correction coefficient prediction, so as 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 SDR image, so as to effectively solve the problem of abnormal exposure of the converted image. In the implementation process, it can be implemented based on the correction coefficient prediction model created in advance.
[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, the image sample is corrected 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) is constructed, and the convolutional neural network model is 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 SDR images 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 data. In the implementation process, a large number of overexposed images, underexposed images, and normally exposed images can be collected to generate an image sample set; 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 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; thus, 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 A gamma correction curve diagram provided for this application 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 dark part is expanded. When the gamma correction value is less than 1, the highlight part of the image is expanded and the dark 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 The comparison diagram of an underexposed image before and after correction provided in the present application shows that the image is clearer after correction.
[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 present application embodiment provides a method for implementing a correction coefficient prediction model to predict the target correction coefficient corresponding to the SDR image. 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 The present 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: Look up 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 the SDR image based on a four-dimensional lookup table (hereinafter referred to as 4D LUT) for generating a high dynamic range image (hereinafter referred to as HDR image) corresponding to the SDR image. Specifically, a 4D LUT can be pre-constructed to record the corresponding relationship 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 queried by the table lookup method, so as to directly generate the HDR image corresponding to the SDR image, which 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 in the global range and all gamma values in 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 turn to obtain a 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 present application embodiment provides a method for constructing a 4D LUT. First, obtain all RGB color value samples in the global range and all gamma values in the preset gamma range, where all RGB color value samples in the global range are all possible RGB color values (the value range of each color channel is 0~255), and all gamma values in the preset gamma range are Figure 2 The gamma values corresponding to the 33 gamma correction curves shown. It can be understood that the data volume of all RGB color value samples in the entire domain is 256×256×256, and the file is too large, so the data volume can be reduced by reducing the order. For example, the 256-order color value can be scaled to 33 or 64 orders 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 orders and 33 gamma values as an example, 33×33×33×33 index combinations can be arranged and combined. Further, for each index combination, the corresponding normalized RGB color value can be obtained by sequentially performing the above-mentioned gamma correction preprocessing, color gamut conversion processing, inverse tone mapping processing, and inverse electro-optical conversion processing. Then, all index combinations and their corresponding normalized RGB color values can generate 4DLUTs. At this point, the construction of 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 of the SDR image to the HDR image can be directly realized by looking up the table, 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] Degrading 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 implementing a four-dimensional lookup table to obtain a normalized RGB color value corresponding to an RGB color value and a target correction coefficient. 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 A schematic diagram of the generation of a four-dimensional lookup table provided in this application (taking 33 orders and 33 gamma values as an example). Then, in the table lookup process, the corresponding row number can be generated by combining the input color index (R, G, B) and the gamma value C, and then the normalized output color value (R1, G1, B1) and the gamma correction coefficient can be found according to the row number. Among them, the retrieval calculation formula for the number of rows is: row number = R + G × 33 + B × 33 × 33 + C × 33 × 33 × 33, where R, G, and B are the values after the modulo calculation 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 of retrieval through 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 lower order, that is, the three color components (R, G, B) are respectively calculated modulo 8 to obtain (0, 1, 31). Then, the output result is 0+1×33+31×33×33+0×33×33×33=34881, that is, the (R1, G1, B1) value corresponding to the 34881 row 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 4D LUT includes: first, the prediction result of the correction coefficient prediction module is used as the gamma value index, which is assumed to be 0; then the input color value is reduced to a certain level, that is, the three color components (R, G, B) are respectively calculated with the modulus of 8 to obtain (0, 1, 31) respectively, and the remainders of the three color components are (3, 4, 6) respectively. The output result needs 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 search 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 search 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 search results corresponding to 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 value 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 conversion image; determining the RGB color value of the format conversion image to be the RGB color value of the standard dynamic range image;
[0116] Accordingly, generating a high dynamic range image corresponding to a standard dynamic range image using normalized RGB color values may include: generating an RGB image using normalized RGB color values; 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 values 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, acquiring a standard dynamic range image may include: acquiring 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 by using the normalized RGB color values, the method may further include: generating a high dynamic range video corresponding to the standard dynamic range video by 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 converted image screen; 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 realize faster and more efficient conversion of SDR data to HDR data, and can also effectively guarantee the quality of the converted image.
[0122] Based on the above embodiments, please refer to Fig. 9 , Fig. 9 The following is a flow chart of a video conversion method provided by the present 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. Fig. 9 The dotted content shown is the function implemented by 4D LUT. The input has four parameters, namely color value (R, G, B) and gamma correction coefficient, and the output is normalized color value (R1, G1, B1). This implementation process integrates the operation process of four modules, namely gamma correction preprocessing, color gamut conversion, inverse tone mapping, and PQ domain inverse photoelectric conversion, into a 4D LUT table. The result of the last step can be directly obtained by looking up the table, omitting the calculation process. Finally, the table output color value (R1, G1, B1) is quantized to 10 bits and RGB to YUV is converted to generate YUV data, and the YUV data is compressed and encoded to generate HDR video.
[0124] An embodiment of the present application provides an image conversion device.
[0125] Please refer to Fig.10 , Fig.10 This is a structural schematic diagram of an image conversion device provided by the present application, and the image conversion device may include:
[0126] Determining module 1, used for acquiring a standard dynamic range image and determining the RGB color value of the standard dynamic range image;
[0127] Prediction module 2, used for predicting the target correction coefficient corresponding to the standard dynamic range image by using the correction coefficient prediction model;
[0128] A search module 3 is used to search in a four-dimensional lookup table to obtain a normalized RGB color value corresponding to the RGB color value and the target correction coefficient;
[0129] The generating module 4 is used to generate a high dynamic range image corresponding to the standard dynamic range image by 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 converted image screen; 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 realize faster and more efficient conversion of SDR data to HDR data, and at the same time can effectively guarantee 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 also include a second construction module for obtaining all RGB color value samples within a global range and all gamma values within a preset gamma range; reducing the order of 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; 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 used to convert the standard dynamic range image from the YUV format to the RGB format to obtain a format conversion image; determine that the RGB color value of the format conversion image is the RGB color value 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 the high dynamic range image corresponding to the standard dynamic range image is generated using the normalized RGB color values.
[0139] For an introduction to the device provided in the embodiments of the present application, please refer to the above method embodiments, and the present application will not elaborate on them here.
[0140] An embodiment of the present application provides an electronic device.
[0141] Please refer to Fig.11 , Fig.11 This is a schematic diagram of the structure of an electronic device provided in this application, and the electronic device may include:
[0142] Memory for storing computer programs;
[0143] A processor, which is used to implement the steps of any one of the above-mentioned image conversion methods when executing a computer program.
[0144] like Fig.11 , which is a schematic diagram of the composition structure of an electronic device, the electronic device 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 all communicate with each other through 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, etc.
[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, which may include program codes, and the program codes include computer operation instructions. In the embodiment of the present application, the memory 11 at least stores programs 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 a 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 should be noted that Fig.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 Fig.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, and other media that 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 the present application will not elaborate on them here.
[0160] The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part 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 composition and steps of each example have been generally described in the above description according to function. 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 to be beyond the scope of this application.
[0162] The steps of the method or algorithm 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 a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, 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. The principle and implementation method of the present application are described in detail using specific examples herein, and the description of the above embodiments is only used to help understand the method and core idea of the present application. It should be pointed out that for ordinary technicians in this technical field, without departing from the principle of the present application, several improvements and modifications can 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 the RGB color values of the standard dynamic range image; The correction coefficient prediction model is used to predict the target correction coefficient corresponding to the standard dynamic range image; 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; A high dynamic range image corresponding to the standard dynamic range image is generated using the normalized RGB color values.
2. The image conversion method according to claim 1, characterized in that: 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; Generate 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, characterized in that: The target correction coefficient corresponding to the standard dynamic range image is predicted by using the 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 2, characterized in that: The construction process of the four-dimensional lookup table includes: Obtain all RGB color value samples within the global range and all gamma values within the preset gamma range; 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; 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; 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; 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.
5. The image conversion method according to claim 4, characterized in that: 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 includes: Performing order reduction processing on 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.
6. The image conversion method according to claim 1, characterized in that: Determining the RGB color value of the standard dynamic range image includes: Convert 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 conversion 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: Generate 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.
7. The image conversion method according to claim 1, characterized in that: Acquire standard dynamic range images, including: Acquire a standard dynamic range video, perform frame processing on the standard dynamic range video, and obtain each of the standard dynamic range images; Correspondingly, after generating the high dynamic range image corresponding to the standard dynamic range image by using the normalized RGB color values, the method further includes: The high dynamic range image corresponding to each of the standard dynamic range images is used to generate a high dynamic range video corresponding to the standard dynamic range video.
8. An image conversion device, characterized in that: include: A determination module, used for acquiring a standard dynamic range image and determining the RGB color values of the standard dynamic range image; A prediction module, used to predict a target correction coefficient corresponding to the standard dynamic range image using a correction coefficient prediction model; A search module, used for 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; A generating module is used to generate a high dynamic range image corresponding to the standard dynamic range image by using the normalized RGB color values.
9. 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 7 when executing the computer program.
10. 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 7 are implemented.
Citation Information
Patent Citations
High-dynamic range video processing method
CN107154059A
Image conversion method and device, terminal, and storage medium
CN108495108A
Display processing method of high dynamic range image and related device
CN113240644A
Video conversion processing method and device, computer readable medium and electronic equipment
CN113518185A
Live video stream conversion method and device, equipment and storage medium
CN115442636A