Image processing method and device, electronic equipment and computer readable storage medium

CN117994179BActive Publication Date: 2026-10-23GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211308454.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-25
Publication Date
2026-10-23
Estimated Expiration
2042-10-25

AI Technical Summary

Technical Problem

[0003]然而,传统的图像处理方法,处理后的图像中不同区域之间的颜色过渡不够自然,存在图像处理的准确性较低的问题

Benefits of technology

[0025]上述图像处理方法、装置、电子设备、计算机可读存储介质和计算机程序产品,对第一图像进行色调映射,得到第二图像,对第二图像进行gamma处理,得到第三图像;并且第一图像、第二图像和第三图像的位深度均高于预设位深度,也即在色调映射和gamma处理过程中均对位深度较高的图像进行处理,提高图像的亮度后再进行压缩处理,避免在色调映射和gamma处理的同时中对图像进行压缩处理带来图像信息损失而导致图像不同区域的颜色过渡不自然的问题,可以得到不同区域的颜色过渡更加自然的目标图像,提高了图像处理的准确性。同时,电子设备对较高位深度对应的第三图像进行压缩处理,也可以降低目标图像的存储空间。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117994179B_ABST
    Figure CN117994179B_ABST
Patent Text Reader

Abstract

The application relates to an image processing method and device, electronic equipment and computer readable storage medium. The method comprises the following steps: performing tone mapping on a first image to obtain a second image; the bit depth of the first image and the second image is higher than a preset bit depth; performing gamma processing on the second image to obtain a third image; the bit depth of the third image is higher than the preset bit depth; performing compression processing on the third image to obtain a target image; the bit depth of the target image is lower than or equal to the preset bit depth. The method can improve the accuracy of image processing and obtain a target image with more natural color transition between different regions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of imaging technology, and in particular to an image processing method, apparatus, electronic device, and computer-readable storage medium. Background Technology

[0002] In the image processing workflow, the image typically undergoes processes such as tone mapping, black level compensation, lens shading correction, bad pixel correction, color interpolation, Bayer noise removal, white balance correction, and color correction. The image is then transmitted to the CPU (central processing unit) via the I / O interface for further processing, ultimately outputting the final image.

[0003] However, traditional image processing methods often result in unnatural color transitions between different regions in the processed image, leading to low accuracy in image processing. Summary of the Invention

[0004] This application provides an image processing method, apparatus, electronic device, computer-readable storage medium, and computer program product, which can improve the accuracy of image processing and obtain target images with more natural color transitions between different regions.

[0005] Firstly, this application provides an image processing method. The method includes:

[0006] A tone map is performed on the first image to obtain a second image; the bit depth of both the first image and the second image is higher than a preset bit depth;

[0007] The second image is subjected to gamma processing to obtain a third image; the bit depth of the third image is higher than the preset bit depth.

[0008] The third image is compressed to obtain the target image; the bit depth of the target image is lower than or equal to the preset bit depth.

[0009] Secondly, this application also provides an image processing apparatus. The apparatus includes:

[0010] A tone mapping module is used to perform tone mapping on a first image to obtain a second image; the bit depth of both the first image and the second image is higher than a preset bit depth;

[0011] The gamma module is used to perform gamma processing on the second image to obtain a third image; the bit depth of the third image is higher than the preset bit depth.

[0012] A compression module is used to compress the third image to obtain a target image; the bit depth of the target image is lower than or equal to the preset bit depth.

[0013] Thirdly, this application also provides an electronic device. The electronic device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to perform the following steps:

[0014] A tone map is performed on the first image to obtain a second image; the bit depth of both the first image and the second image is higher than a preset bit depth;

[0015] The second image is subjected to gamma processing to obtain a third image; the bit depth of the third image is higher than the preset bit depth.

[0016] The third image is compressed to obtain the target image; the bit depth of the target image is lower than or equal to the preset bit depth.

[0017] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, performs the following steps:

[0018] A tone map is performed on the first image to obtain a second image; the bit depth of both the first image and the second image is higher than a preset bit depth;

[0019] The second image is subjected to gamma processing to obtain a third image; the bit depth of the third image is higher than the preset bit depth.

[0020] The third image is compressed to obtain the target image; the bit depth of the target image is lower than or equal to the preset bit depth.

[0021] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, performs the following steps:

[0022] A tone map is performed on the first image to obtain a second image; the bit depth of both the first image and the second image is higher than a preset bit depth;

[0023] The second image is subjected to gamma processing to obtain a third image; the bit depth of the third image is higher than the preset bit depth.

[0024] The third image is compressed to obtain the target image; the bit depth of the target image is lower than or equal to the preset bit depth.

[0025] The aforementioned image processing method, apparatus, electronic device, computer-readable storage medium, and computer program product perform tone mapping on a first image to obtain a second image, and gamma processing on the second image to obtain a third image. Furthermore, the bit depth of the first, second, and third images is all higher than a preset bit depth. That is, during tone mapping and gamma processing, the image with the higher bit depth is processed to increase its brightness before compression. This avoids the problem of image information loss and unnatural color transitions in different areas of the image caused by compression during tone mapping and gamma processing. This results in a target image with more natural color transitions in different areas, improving the accuracy of image processing. Simultaneously, compressing the third image corresponding to the higher bit depth also reduces the storage space of the target image. Attached Figure Description

[0026] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0027] Figure 1 This is a flowchart of an image processing method in one embodiment;

[0028] Figure 2 This is a graph of the first gamma parameter in one embodiment;

[0029] Figure 3 This is a flowchart of gamma processing and compression processing in one embodiment;

[0030] Figure 4 This is a schematic diagram of the triangular proportions in one embodiment;

[0031] Figure 5 This is a diagram illustrating the effects of global tone mapping and local tone mapping in one embodiment.

[0032] Figure 6 This is a flowchart of global tone mapping in one embodiment;

[0033] Figure 7 This is a flowchart of local tone mapping in one embodiment;

[0034] Figure 8 Here is a flowchart of image processing in one embodiment;

[0035] Figure 9 This is a structural block diagram of an image processing device in one embodiment;

[0036] Figure 10 This is a diagram of the internal structure of an electronic device in one embodiment. Detailed Implementation

[0037] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0038] In one embodiment, such as Figure 1 As shown, an image processing method is provided. This embodiment illustrates the application of this method to an electronic device, which can be a terminal or a server. It is understood that this method can also be applied to a system including both a terminal and a server, and implemented through interaction between the terminal and the server. The terminal can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart in-vehicle devices, smart cars, etc. Portable wearable devices can include smartwatches, smart bracelets, head-mounted devices, etc. The server can be a standalone server or a server cluster consisting of multiple servers.

[0039] In this embodiment, the image processing method includes the following steps:

[0040] Step S102: Perform tone mapping on the first image to obtain the second image; the bit depth of both the first image and the second image is higher than the preset bit depth.

[0041] Tone mapping is a computer graphics technique that approximates the display of high dynamic range images on media with a limited dynamic range. Essentially, tone mapping aims to significantly reduce contrast to bring scene brightness to a displayable range while preserving image details and colors—information crucial for representing the original scene.

[0042] The tone mapping may include at least one of global tone mapping and local tone mapping.

[0043] Bit depth refers to the number of bits a computer uses to represent the colors of a digital image, specifically the number of bits required for each pixel. Computers display colors by using a unit of counting called a "bit" to record the data representing those colors. When this data is recorded in a computer according to a specific arrangement, it forms a computer file of a digital image. A "bit" is the smallest unit in computer memory used to record the color value of each pixel. The richer the colors in an image, the more bits are needed. The number of bits used for each pixel in the computer is called the "bit depth."

[0044] For example, the bit depth of the first image and the second image can be 16-bit, 24-bit, or 32-bit, etc.

[0045] The preset bit depth can be set as needed. For example, the preset bit depth can be 10 bits, and the bit depth of both the first and second images is 16 bits. In this case, the bit depth of both the first and second images is higher than the preset bit depth, indicating that both the first and second images are high-bit images. Here, a 10-bit image means that the value of each pixel in the image can be in the range of 0 to 1023.

[0046] Optionally, the electronic device performs global tone mapping and local tone mapping on the first image sequentially to obtain the second image.

[0047] Step S104: Perform gamma processing on the second image to obtain the third image; the bit depth of the third image is higher than the preset bit depth.

[0048] For example, the bit depth of the third image can be 16-bit, 24-bit, or 32-bit, etc.

[0049] Gamma processing is mainly used for image correction, adjusting images with excessively high or low gray levels to enhance contrast.

[0050] Optionally, the electronic device performs gamma processing on the second image in the gamma module to obtain a third image; the bit depth of the third image is higher than the preset bit depth, and the image brightness of the third image is higher than the image brightness of the second image.

[0051] It is understandable that the first, second, and third images have the same bit depth, meaning that images with the same bit depth are used in both tone mapping and gamma processing.

[0052] For example, if the preset bit depth is 10 bits and the bit depth of the third image is 16 bits, the electronic device can use the following formulas (1)(2)(3) to perform gamma processing on the second image with a bit depth of 16 bits to obtain the third image with a bit depth of 16 bits.

[0053] Routput[i]=Gamma16Bit[Rinput[i]] (1)

[0054] Goutput[i]=Gamma16Bit[Ginput[i]] (2)

[0055] Boutput[i]=Gamma16Bit[Binput[i]] (3)

[0056] Step 106: Compress the third image to obtain the target image; the bit depth of the target image is lower than or equal to the preset bit depth.

[0057] For example, if the preset bit depth is 10 bits and the bit depth of the third image is 16 bits, the electronic device can use the following formulas (4)(5)(6) to compress the third image with a bit depth of 16 bits to obtain a target image with a bit depth of 10 bits.

[0058] Routput[i]=Gamma16Bit[Rinput[i]]>>6 (4)

[0059] Goutput[i]=Gamma16Bit[Ginput[i]]>>6 (5)

[0060] Boutput[i]=Gamma16Bit[Binput[i]]>>6 (6)

[0061] Where Routput[i] is the pixel value of the R (Red) channel in the target image, Gamma16Bit[Rinput[i]] is the pixel value of the R channel in the third image with a bit depth of 16 bits after gamma processing, Goutput[i] is the pixel value of the G (Green) channel in the target image, Gamma16Bit[Ginput[i]] is the pixel value of the G channel in the third image with a bit depth of 16 bits after gamma processing, and Boutput[i] is the pixel value of the target image. The pixel value of the B (Blue) channel is Gamma16Bit[Binput[i]]. Gamma16Bit[Binput[i]] is the pixel value of the B channel in the third image with a bit depth of 16 bits after gamma processing. In Gamma16Bit[Rinput[i]]>>6, 6 is an integer shift operation. >>6 means shifting 6 bits to the right from 16 bits to 10 bits, which is equivalent to dividing by 64. Gamma16Bit[Rinput[i]]>>6 is equivalent to Gamma16Bit[Rinput[i]] divided by 64.

[0062] Understandably, in traditional techniques, image compression during tone mapping or gamma processing can easily cause quantization issues in darker areas of the image, resulting in unnatural color transitions between different regions in the processed image.

[0063] The aforementioned image processing method performs tone mapping on the first image to obtain the second image, and then performs gamma processing on the second image to obtain the third image. Furthermore, the bit depth of the first, second, and third images is all higher than a preset bit depth. This means that the image with the higher bit depth is processed during both tone mapping and gamma processing to increase its brightness before compression. This avoids the problem of image information loss caused by compression during tone mapping and gamma processing, which could lead to unnatural color transitions in different areas of the image. It mitigates the loss of quantization information, resulting in a target image with more natural color transitions in different areas, thus improving the accuracy of image processing. Simultaneously, compressing the third image corresponding to the higher bit depth also reduces the storage space of the target image.

[0064] In one embodiment, the method further includes: obtaining a first gamma parameter corresponding to a preset first bit depth in the image processing flow; the first gamma parameter is used to process image data at the first bit depth, wherein the first bit depth is lower than or equal to a preset bit depth; interpolating the first gamma parameter to obtain a second gamma parameter corresponding to a second bit depth; wherein the second bit depth is higher than the preset bit depth; and performing gamma processing on the second image to obtain a third image, including: performing gamma processing on the second image using the second gamma parameter to obtain a third image.

[0065] The gamma parameter is the parameter used during gamma processing. The first gamma parameter is a preset parameter in the image processing flow used to process image data with the first bit depth, and the second gamma parameter is used to process image data with the second bit depth. For example, the first bit depth can be 10 bits, 8 bits, etc., and the second bit depth can be 16 bits, 24 bits, or 32 bits, etc.

[0066] The first gamma parameter in the image processing flow is a discrete gamma array, which takes as input elements within a 10-bit range and outputs elements within a 10-bit range. For example... Figure 2 The graph shown is a curve of the first gamma parameter, which is output = gamma[i], where i is the first input element (ranging from 0 to 1023) and output is the first output element (ranging from 0 to 1023). For example, 0 = gamma[0], 2 = gamma[1], 4 = gamma[2], 7 = gamma[3], 10 = gamma[4], 15 = gamma[5], ..., 1023 = gamma

[1022] , 1023 = gamma

[1023] .

[0067] It is understandable that in the image signal processing (ISP) process, the bit depth of the image data is usually compressed to the first bit depth during tone mapping. Therefore, a first gamma parameter corresponding to the first bit depth is preset to perform gamma processing on the image data of the first bit depth.

[0068] Optionally, the electronic device acquires a first gamma parameter corresponding to a preset first bit depth in the image processing flow; interpolates the first gamma parameter to obtain a second gamma parameter corresponding to a second bit depth; wherein the second bit depth is the bit depth of the second image; and performs gamma processing on the second image using the second gamma parameter to obtain a third image. It is understood that both the first and third images can be based on the second bit depth.

[0069] For example, the electronic device obtains a preset 10-bit first gamma parameter in the image processing flow, interpolates the 10-bit first gamma parameter to obtain a 16-bit second gamma parameter, and uses the 16-bit second gamma parameter to perform gamma processing on the 16-bit second image to obtain a 16-bit third image. Here, the 10-bit bit depth is lower than or equal to the preset bit depth, and the 16-bit bit depth is higher than the preset bit depth.

[0070] In this embodiment, the electronic device obtains the first gamma parameter corresponding to the first bit depth preset in the image processing flow, interpolates the first gamma parameter to obtain the second gamma parameter corresponding to the second bit depth, and can use the second gamma parameter of the higher bit depth to perform gamma processing on the second image of the same higher bit depth to obtain the third image, thereby improving the accuracy of image processing.

[0071] In one embodiment, such as Figure 3 As shown, the electronic device executes steps S302 to S310:

[0072] Step S302: Obtain a second image with a bit depth of 16 bits; Step S304: Obtain the first gamma parameter corresponding to 10 bits; Step S306: Interpolate the first gamma parameter to 16 bits to obtain the second gamma parameter; Step S308: Perform gamma processing on the second image using the second gamma parameter to obtain the third image; Step S310: Perform compression processing on the third image to obtain the target image with a bit depth of 10 bits.

[0073] In one embodiment, the first depth range corresponding to the first gamma parameter includes at least two pairs of first element pairs, each pair of first element pairs including a first input element and a first output element; interpolating the first gamma parameter to obtain the second gamma parameter corresponding to the second depth includes: multiplying the first input element and the first output element in each pair of first element pairs by the second depth to obtain each pair of second element pairs including a second input element and a second output element; obtaining the interpolation input elements other than the second input elements within the second depth range; for each interpolation input element, determining the interpolation output element of the interpolation input element based on the second element pairs adjacent to the interpolation input element; the second depth range is greater than the first depth range, and the interpolation input element and the interpolation output element constitute a pair of interpolation element pairs; and constructing the second gamma parameter corresponding to the second depth based on each pair of second element pairs and each pair of interpolation element pairs.

[0074] The bit depth range is the range of pixel values ​​corresponding to the bit depth. The first bit depth range is the range of pixel values ​​corresponding to the first bit depth, and the second bit depth range is the range of pixel values ​​corresponding to the second bit depth. For example, if the first bit depth is 10 bits, then the first bit depth range is (0-1023); if the second bit depth is 16 bits, then the second bit depth range is (0-65535).

[0075] The electronic device multiplies the first input element and the first output element of each pair of first element pairs by the second bit depth to obtain each pair of second element pairs including the second input element and the second output element. Taking a first bit depth of 10 bits and a second bit depth of 16 bits as an example, the range of the first bit depth corresponding to the first gamma parameter is (0-1023), and the range of the second bit depth corresponding to the second gamma parameter is (0-65535). The electronic device multiplies the first input element and the first output element of each pair of first element pairs within the first bit depth range (0-1023) corresponding to the first gamma parameter output = gamma[i] by the second bit depth to obtain each pair of second element pairs output × 16 = gamma16Bit[i × 16] including the second input element and the second output element in the second gamma parameter.

[0076] For example, the second element pair can be: 0 = gamma16Bit[0], 2x16 = gamma16Bit[1x16], 4x16 = gamma16Bit[2x16], 7x16 = gamma[3x16], 10x16 = gamma16Bit[4x16], 15x16 = gamma16Bit[5x16], ... 1023x16 = gamma16Bit[1022x16], 1023x16 = gamma16Bit[1023x16].

[0077] It is understandable that the size of the second depth range is larger than that of the first depth range. Therefore, after the electronic device obtains the second element pair, there are still some values ​​in the second depth range that have not been obtained. Therefore, interpolation processing is required to obtain each data in the second depth range to form the second gamma parameter.

[0078] Optionally, for each interpolation input element, the electronic device determines at least one second element pair adjacent to the interpolation input element, and determines the interpolation output element of the interpolation input element based on at least one second element pair.

[0079] In one alternative implementation, the electronic device may randomly select a second output element from at least one pair of second elements as the interpolation output element of the interpolation input element.

[0080] In another alternative implementation, the electronic device may average the two second output elements of two adjacent pairs of second elements and use the average value as the interpolation output element of the interpolation input element.

[0081] In another alternative implementation, the electronic device determines two adjacent pairs of second elements and, based on the triangular ratio between the pair of interpolation elements to be generated and the two adjacent pairs of second elements, determines the interpolation output element in the pair of interpolation elements to be generated.

[0082] refer to Figure 4 The triangular proportions are shown in formulas (7) and (8):

[0083]

[0084]

[0085] Where output is the interpolation output element in the interpolation element pair to be generated, i is the interpolation input element, output0 is the second output element of the preceding second element pair, i0 is the second input element of the preceding second element pair, output1 is the second output element of the following second element pair, and i1 is the second input element of the following second element pair.

[0086] For example, for interpolation input element 70, the two adjacent second element pairs are 160 = gamma16Bit

[64] and 240 = gamma16Bit

[80] . Then, the interpolation output element corresponding to interpolation input element 70 can be obtained by using the trigonometric ratio relationship:

[0087]

[0088] In this embodiment, the electronic device multiplies the first input element and the first output element in each pair of first element pairs by the second bit depth to obtain each pair of second element pairs including the second input element and the second output element, and interpolates to obtain interpolation element pairs, thereby accurately constructing the second gamma parameter corresponding to the second bit depth, accurately performing gamma processing on the second image, obtaining the third image, and improving the accuracy of image processing.

[0089] In one embodiment, the method further includes: acquiring at least two exposed images obtained by exposure with different exposure parameters, fusing the at least two exposed images to obtain a first image; the bit depth of the exposed images is lower than or equal to a preset bit depth; performing tone mapping on the first image to obtain a second image, including: performing global tone mapping on the first image to obtain an intermediate image; the bit depth of the intermediate image is higher than the preset bit depth; and performing local tone mapping on the intermediate image to obtain the second image.

[0090] Exposure parameters can include, but are not limited to, exposure time, aperture value, and ISO sensitivity. It is understood that electronic devices can obtain images of varying brightness by using different exposure parameters.

[0091] Optionally, the electronic device exposes the image with different exposure parameters to obtain at least two exposure images with different brightness; it then performs HDR (High Dynamic Range Imaging) fusion on the at least two exposure images with different brightness to obtain a first image; it performs global tone mapping on the first image to obtain an intermediate image; and it performs local tone mapping on the intermediate image to obtain a second image. The first image can be an HDR image and is in the RGB color space.

[0092] For example, the bit depth of the exposed images is 10 bits, which is lower than or equal to a preset bit depth. The electronic device performs HDR fusion on at least two exposed images with different brightness to obtain a first image with a bit depth of 16 bits.

[0093] like Figure 5 As shown, after the electronic device performs global tone mapping on the first image, it enhances the contrast of the first image to obtain an intermediate image. Then, it performs local tone mapping on the intermediate image to further enhance the contrast of the image, thus obtaining a second image. The brightness of the first image, the intermediate image, and the second image increases sequentially.

[0094] In this embodiment, the electronic device fuses at least two exposure images with lower bit depths to obtain a first image with a higher bit depth. Then, global tone mapping is performed on the first image with a higher bit depth to obtain an intermediate image with a higher bit depth. Finally, local tone mapping is performed on the intermediate image with a higher bit depth to obtain a second image with a higher bit depth. That is, the higher bit depth image is used for processing in both the global tone mapping and local tone mapping processes. This can avoid the problem of image information loss caused by image compression processing, which leads to unnatural color transitions in different areas of the image and improves the accuracy of image processing.

[0095] In other alternative embodiments, the electronic device may also perform local tone mapping on the first image, and then perform global tone mapping on the locally tone-mapped image to obtain the second image.

[0096] In one embodiment, performing global tone mapping on a first image to obtain an intermediate image includes: converting the first image from RGB color space to grayscale space, and performing global tone mapping on the first image in grayscale space to obtain a global tone-mapped image in grayscale space; dividing the global tone-mapped image in grayscale space by the first image in grayscale space to obtain a global tone mapping gain; and processing the first image in RGB color space based on the global tone mapping gain to obtain an intermediate image in RGB color space.

[0097] The electronic device uses the following formula (9) to convert the first image from the RGB color space to the grayscale space:

[0098] Gray[i]=0.299×R[i]+0.587×B[i]+0.114×G[i] (9)

[0099] Where R[i] is the pixel value of the R (Red) channel in the first image of the RGB color space, B[i] is the pixel value of the B channel in the first image of the RGB color space, G[i] is the pixel value of the G channel in the first image of the RGB color space, and Gray[i] is the pixel value of the first image of the grayscale space.

[0100] The bit depth of the first image in RGB color space, the first image in grayscale space, the global tone mapping image in grayscale space, and the intermediate image in RGB color space are all higher than the preset bit depth.

[0101] The electronic device uses the following formula (10) to perform global tone mapping on the first image in the grayscale space to obtain a global tone-mapped image in the grayscale space:

[0102]

[0103] Where Input[i] is the pixel value of the first image in grayscale space, Output[i] is the pixel value of the global tone-mapped image in grayscale space, max is the maximum pixel value in the first image in grayscale space, min is the minimum pixel value in the first image in grayscale space, and 1000 is the global tone-mapped parameter.

[0104] For example, if the bit depth of the first image in RGB color space, the first image in grayscale space, the global tone map image in grayscale space, and the intermediate image in RGB color space are all 16 bits, then the range of Input[i] is (0-65535), the range of Output[i] is (0-65535), the max is usually 65535, and the min is usually 0 or a small value.

[0105] Optionally, the electronic device divides each pixel value in the global tone mapping image in the grayscale space by the corresponding pixel value in the first image in the grayscale space to obtain the global tone mapping gain corresponding to each pixel value, and multiplies the global tone mapping gain corresponding to each pixel value by the corresponding pixel value in the first image in the RGB color space to obtain an intermediate image in the RGB color space.

[0106] Furthermore, the electronic device can also multiply the global tone mapping gain by the R pixel value, G pixel value, and B pixel value at the corresponding position in the first image in the RGB color space.

[0107] To maintain data accuracy, the global tone mapping gain can be saved as high-precision floating-point data.

[0108] The electronic device processes the first image in the RGB color space based on the global tone mapping gain using the following formulas (11)(12)(13) to obtain an intermediate image in the RGB color space:

[0109]

[0110]

[0111]

[0112] Where Input[i] is the pixel value of the first image in grayscale space, Output[i] is the pixel value of the global tone map image in grayscale space, Rinput is the pixel value of the R channel in the first image in RGB color space, Routput[i] is the pixel value of the R channel in the intermediate image in RGB color space, Ginput is the pixel value of the G channel in the first image in RGB color space, Goutput[i] is the pixel value of the G channel in the intermediate image in RGB color space, Binput is the pixel value of the B channel in the first image in RGB color space, and Boutput[i] is the pixel value of the B channel in the intermediate image in RGB color space.

[0113] For example, if the bit depth of the first image in RGB color space, the first image in grayscale space, the global tone mapping image in grayscale space, and the intermediate image in RGB color space are all 16 bits, then the range of Input[i] is (0-65535), and the range of Output[i] is (0-65535).

[0114] In this embodiment, the electronic device converts the first image from the RGB color space to the grayscale space and performs global tone mapping on the first image in the grayscale space to obtain a global tone-mapped image in the grayscale space. Dividing the global tone-mapped image in the grayscale space by the first image in the grayscale space yields the global tone mapping gain. This gain value is applied to the first image in the RGB color space without changing the relative relationships between the R, G, and B channel pixel values ​​in the first image in the RGB color space, thus ensuring that the intermediate image in the RGB color space obtained after processing is not color-biased and improving the accuracy of image processing. At the same time, using this method for global tone mapping also saves computational resources.

[0115] In one embodiment, such as Figure 6 As shown, the electronic device acquires at least two 10-bit exposure images in RGB color spaces and inputs them into the HDR fusion module. The HDR fusion module fuses the at least two 10-bit exposure images in RGB color spaces to obtain a 16-bit first image in RGB color space. The 16-bit first image is converted from RGB color space to grayscale space to obtain a 16-bit first image in grayscale space. Global tone mapping is performed on the 16-bit first image in grayscale space to obtain a 16-bit global tone map image in grayscale space. The 16-bit global tone map image in grayscale space is divided by the 16-bit first image in grayscale space to obtain the global tone map gain. The global tone map gain is applied to the R, G, and B values ​​in the 16-bit first image in RGB color space to obtain a 16-bit intermediate image in RGB color space.

[0116] In one embodiment, performing local tone mapping on an intermediate image to obtain a second image includes: converting the intermediate image from the RGB color space to the grayscale space, and performing local tone mapping on the intermediate image in the grayscale space to obtain a locally tone-mapped image in the grayscale space; dividing the locally tone-mapped image in the grayscale space by the intermediate image in the grayscale space to obtain a local tone mapping gain; and processing the intermediate image in the RGB color space based on the local tone mapping gain to obtain a second image in the RGB color space.

[0117] Electronic devices use the following formula (14) to convert intermediate images from RGB color space to grayscale space:

[0118] Gray[i]=0.299×R[i]+0.587×B[i]+0.114×G[i] (14)

[0119] Where R[i] is the pixel value of the R (Red) channel in the intermediate image of the RGB color space, B[i] is the pixel value of the B channel in the intermediate image of the RGB color space, G[i] is the pixel value of the G channel in the intermediate image of the RGB color space, and Gray[i] is the pixel value of the intermediate image of the grayscale space.

[0120] The bit depth of the intermediate image in RGB color space, the intermediate image in grayscale space, the local tone mapping image in grayscale space, and the second image in RGB color space are all higher than the preset bit depth.

[0121] Optionally, the electronic device employs a block histogram equalization method, that is, a local histogram equalization method to perform local tone mapping on the intermediate image in the grayscale space, thereby obtaining a local tone-mapped image in the grayscale space.

[0122] Optionally, the electronic device divides each pixel value of the local tone mapping image in the grayscale space by the pixel value of the corresponding position in the intermediate image of the grayscale space to obtain the local tone mapping gain corresponding to each pixel value, and multiplies the local tone mapping gain corresponding to each pixel value by the pixel value of the corresponding position in the intermediate image of the RGB color space to obtain the second image in the RGB color space.

[0123] Furthermore, the electronic device can also multiply the local tone mapping gain by the R pixel value, G pixel value, and B pixel value at the corresponding position in the intermediate image of the RGB color space.

[0124] To maintain data accuracy, the local tone mapping gain can be saved as high-precision floating-point data.

[0125] The electronic device uses the following formulas (15)(16)(17) to process the intermediate image in the RGB color space based on the local tone mapping gain to obtain the second image in the RGB color space:

[0126]

[0127]

[0128]

[0129] Where Input[i] is the pixel value of the intermediate image in grayscale space, Output[i] is the pixel value of the local tone-mapped image in grayscale space, Rinput is the pixel value of the R channel in the intermediate image in RGB color space, Routput[i] is the pixel value of the R channel in the second image in RGB color space, Ginput is the pixel value of the G channel in the intermediate image in RGB color space, Goutput[i] is the pixel value of the G channel in the second image in RGB color space, Binput is the pixel value of the B channel in the intermediate image in RGB color space, and Boutput[i] is the pixel value of the B channel in the second image in RGB color space.

[0130] For example, if the bit depth of the intermediate image in the RGB color space, the intermediate image in the grayscale space, the local tone mapping image in the grayscale space, and the second image in the RGB color space are all 16 bits, then the range of Input[i] is (0-65535), and the range of Output[i] is (0-65535).

[0131] In this embodiment, the electronic device converts the intermediate image from the RGB color space to the grayscale space and performs local tone mapping on the intermediate image in the grayscale space to obtain a locally tone-mapped image in the grayscale space. Dividing the locally tone-mapped image in the grayscale space by the intermediate image in the grayscale space yields the local tone mapping gain. This gain value is applied to the intermediate image in the RGB color space without changing the relative relationships between the R, G, and B channel pixel values ​​in the intermediate image in the RGB color space, thus ensuring that the processed second image in the RGB color space is not color-biased and improving the accuracy of image processing. Simultaneously, using this method for local tone mapping also saves computational resources.

[0132] In one embodiment, such as Figure 7 As shown, the electronic device converts the 16-bit intermediate image in the RGB color space from the RGB color space to the grayscale space, obtaining a 16-bit intermediate image in the grayscale space. It then performs local tone mapping on the 16-bit intermediate image in the grayscale space to obtain a 16-bit local tone mapped image in the grayscale space. The 16-bit local tone mapped image in the grayscale space is divided by the 16-bit intermediate image in the grayscale space to obtain the local tone mapping gain. The local tone mapping gain is then applied to the R, G, and B values ​​in the 16-bit intermediate image in the RGB color space to obtain a 16-bit second image in the RGB color space.

[0133] In one embodiment, performing local tone mapping on an intermediate image in grayscale space to obtain a locally tone-mapped image in grayscale space includes: performing gamma processing on the intermediate image in grayscale space to obtain a grayscale space and gamma-processed intermediate image; performing local tone mapping on the grayscale space and gamma-processed intermediate image to obtain a grayscale space and gamma-processed locally tone-mapped image; and performing inverse gamma processing on the grayscale space and gamma-processed locally tone-mapped image to obtain a grayscale space locally tone-mapped image.

[0134] Among them, the bit depth of the intermediate image in grayscale space, the intermediate image in grayscale space after gamma processing, the local tone mapping image, and the local tone mapping image in grayscale space are all higher than the preset bit depth.

[0135] It is understandable that electronic devices can improve the brightness of an intermediate image in grayscale by performing gamma processing on it. That is, the brightness of the intermediate image in grayscale after gamma processing is higher than that of the intermediate image in grayscale. Then, local tone mapping is performed on the intermediate image in grayscale after gamma processing. The brightness of the image after gamma processing is improved is the final brightness displayed. Performing local tone mapping after the image brightness is improved can enhance the local contrast enhancement effect in the local tone mapping process.

[0136] In one embodiment, compressing the third image to obtain the target image includes: compressing the third image in the gamma module to obtain the target image; or converting the third image from the RGB color space to the YUV color space and then compressing the third image in the YUV color space to obtain the target image.

[0137] Optionally, the second image is subjected to gamma processing in the gamma module to obtain the third image, and the third image is compressed in the gamma module to obtain the target image.

[0138] Optionally, after the electronic device converts the third image from the RGB color space to the YUV color space, it compresses the third image in the YUV color space using the following formulas (18)(19)(20) to obtain the target image.

[0139] Y=(0.299×R+0.587×G+0.114×B)>>6 (18)

[0140] U=(-0.169×R-0.331×G+0.5×B)>>6 (19)

[0141] V=(0.5×R-0.419×G-0.081×B)>>6 (20)

[0142] In the YUV color space, Y represents luminance (or Luma), which is the grayscale value, while U and V represent chrominance (or Chrominance). Their function is to describe the color and saturation of the image and to specify the color of a pixel.

[0143] In this embodiment, compression processing is performed after gamma processing in the gamma module, which can obtain the target image more quickly and avoid the problem of image quantization level; or, after converting the third image from RGB color space to YUV color space, compression processing is performed on the third image in YUV color space, which can obtain the target image more accurately.

[0144] In one embodiment, such as Figure 8 As shown, the electronic device acquires at least two exposed images obtained with different exposure parameters, performs HDR fusion on the at least two exposed images through an HDR fusion module to obtain a 16-bit first image; performs global tone mapping on the 16-bit first image to obtain a 16-bit intermediate image; performs local tone mapping on the 16-bit intermediate image to obtain a 16-bit second image; performs gamma processing on the 16-bit second image through a gamma module to obtain a third image, and performs compression processing on the third image through a gamma module to obtain a 10-bit target image; wherein, 16 bits is higher than a preset bit depth, and 10 bits is lower than or equal to a preset bit depth.

[0145] In one embodiment, an image processing method is also provided, comprising the following steps:

[0146] Step A1: Obtain at least two exposed images obtained with different exposure parameters, and fuse the at least two exposed images to obtain a first image; the bit depth of the exposed images is lower than or equal to a preset bit depth.

[0147] Step A2: Convert the first image from RGB color space to grayscale space, and perform global tone mapping on the first image in grayscale space to obtain a global tone-mapped image in grayscale space; divide the global tone-mapped image in grayscale space by the first image in grayscale space to obtain the global tone mapping gain; process the first image in RGB color space based on the global tone mapping gain to obtain an intermediate image in RGB color space.

[0148] Step A3: Convert the intermediate image from RGB color space to grayscale space; perform gamma processing on the grayscale intermediate image to obtain a grayscale intermediate image after gamma processing; perform local tone mapping on the grayscale intermediate image after gamma processing to obtain a grayscale local tone-mapped image after gamma processing; perform inverse gamma processing on the grayscale local tone-mapped image after gamma processing to obtain a grayscale local tone-mapped image; divide the grayscale local tone-mapped image by the grayscale intermediate image to obtain the local tone-mapped gain; process the RGB color space intermediate image based on the local tone-mapped gain to obtain a second image in RGB color space; the bit depth of each first image, each intermediate image, and each second image is higher than a preset bit depth.

[0149] Step A4: Obtain the first gamma parameter corresponding to the preset first bit depth in the image processing flow; the first gamma parameter is used to process the image data of the first bit depth, and the first bit depth is lower than or equal to the preset bit depth; the first bit depth range corresponding to the first gamma parameter includes at least two pairs of first element pairs, and each pair of first element pairs includes a first input element and a first output element.

[0150] Step A5: Multiply the first input element and the first output element in each pair of first element pairs by the second bit depth to obtain each pair of second element pairs including the second input element and the second output element; obtain the interpolation input elements other than the second input element within the second bit depth range; for each interpolation input element, determine the interpolation output element based on the second element pairs adjacent to the interpolation input element; the second bit depth range is greater than the first bit depth range, and the interpolation input element and the interpolation output element constitute a pair of interpolation elements; based on each pair of second element pairs and each pair of interpolation elements, construct the second gamma parameter corresponding to the second bit depth; the second bit depth is higher than the preset bit depth.

[0151] Step A6: The second image is subjected to gamma processing using the second gamma parameter to obtain the third image; the bit depth of the third image is higher than the preset bit depth.

[0152] Step A7: Compress the third image in the gamma module to obtain the target image; or convert the third image from the RGB color space to the YUV color space, and then compress the third image in the YUV color space to obtain the target image.

[0153] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0154] Based on the same inventive concept, this application also provides an image processing apparatus for implementing the image processing method described above. The solution provided by this apparatus is similar to the implementation scheme described in the above method; therefore, the specific limitations in one or more image processing apparatus embodiments provided below can be found in the limitations of the image processing method described above, and will not be repeated here.

[0155] In one embodiment, such as Figure 9 As shown, an image processing apparatus is provided, including: a tone mapping module 902, a gamma module 904, and a compression module 906, wherein:

[0156] The tone mapping module 902 is used to perform tone mapping on the first image to obtain the second image; the bit depth of both the first image and the second image is higher than the preset bit depth.

[0157] The gamma module 904 is used to perform gamma processing on the second image to obtain the third image; the bit depth of the third image is higher than the preset bit depth.

[0158] Compression module 906 is used to compress the third image to obtain the target image; the bit depth of the target image is lower than or equal to the preset bit depth.

[0159] The aforementioned image processing device performs tone mapping on the first image to obtain the second image, and then performs gamma processing on the second image to obtain the third image. Furthermore, the bit depth of the first, second, and third images is all higher than a preset bit depth. This means that the image with the higher bit depth is processed during both tone mapping and gamma processing to increase its brightness before compression. This avoids the problem of image information loss and unnatural color transitions in different areas of the image caused by compression during tone mapping and gamma processing. This results in a target image with more natural color transitions in different areas, improving the accuracy of image processing. Simultaneously, compressing the third image corresponding to the higher bit depth also reduces the storage space of the target image.

[0160] In one embodiment, the above-described apparatus further includes an interpolation module; the interpolation module is used to obtain a first gamma parameter corresponding to a preset first bit depth in the image processing flow; the first gamma parameter is used to process image data at the first bit depth, where the first bit depth is lower than or equal to a preset bit depth; the first gamma parameter is interpolated to obtain a second gamma parameter corresponding to a second bit depth; the second bit depth is higher than the preset bit depth; the gamma module 904 is further used to perform gamma processing on the second image using the second gamma parameter to obtain a third image.

[0161] In one embodiment, the first depth range corresponding to the first gamma parameter includes at least two pairs of first element pairs, each pair of first element pairs including a first input element and a first output element; the interpolation module is further configured to multiply the first input element and the first output element in each pair of first element pairs by the second depth to obtain each pair of second element pairs including a second input element and a second output element; obtain the interpolation input elements other than the second input elements within the second depth range; for each interpolation input element, determine the interpolation output element of the interpolation input element based on the second element pairs adjacent to the interpolation input element; the second depth range is greater than the first depth range, and the interpolation input element and the interpolation output element constitute a pair of interpolation element pairs; based on each pair of second element pairs and each pair of interpolation element pairs, construct the second gamma parameter corresponding to the second depth.

[0162] In one embodiment, the above-described apparatus further includes a fusion module; the fusion module is used to acquire at least two exposed images obtained by exposure with different exposure parameters, fuse the at least two exposed images to obtain a first image; the bit depth of the exposed images is lower than or equal to a preset bit depth; the tone mapping module 902 is further used to perform global tone mapping on the first image to obtain an intermediate image; the bit depth of the intermediate image is higher than the preset bit depth; and perform local tone mapping on the intermediate image to obtain a second image.

[0163] In one embodiment, the tone mapping module 902 is further configured to convert the first image from the RGB color space to the grayscale space, and perform global tone mapping on the first image in the grayscale space to obtain a global tone mapping image in the grayscale space; divide the global tone mapping image in the grayscale space by the first image in the grayscale space to obtain a global tone mapping gain; and process the first image in the RGB color space based on the global tone mapping gain to obtain an intermediate image in the RGB color space.

[0164] In one embodiment, the tone mapping module 902 is further configured to convert the intermediate image from the RGB color space to the grayscale space, and perform local tone mapping on the intermediate image in the grayscale space to obtain a local tone-mapped image in the grayscale space; divide the local tone-mapped image in the grayscale space by the intermediate image in the grayscale space to obtain a local tone mapping gain; and process the intermediate image in the RGB color space based on the local tone mapping gain to obtain a second image in the RGB color space.

[0165] In one embodiment, the tone mapping module 902 is further configured to perform gamma processing on the intermediate image in grayscale space to obtain an intermediate image in grayscale space after gamma processing; perform local tone mapping on the intermediate image in grayscale space after gamma processing to obtain a local tone mapping image in grayscale space after gamma processing; and perform inverse gamma processing on the local tone mapping image in grayscale space after gamma processing to obtain a local tone mapping image in grayscale space.

[0166] In one embodiment, the compression module 906 is further configured to compress the third image in the gamma module to obtain the target image; or to convert the third image from the RGB color space to the YUV color space and then compress the third image in the YUV color space to obtain the target image.

[0167] Each module in the aforementioned image processing device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of the electronic device in hardware form or independent of it, or stored in the memory of the electronic device in software form, so that the processor can call and execute the operations corresponding to each module.

[0168] In one embodiment, an electronic device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 10As shown, this electronic device includes a processor, memory, input / output interface, communication interface, display unit, and input device. The processor, memory, and input / output interface are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interface. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage medium. The input / output interface is used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements an image processing method. The display unit is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the electronic device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the electronic device, or external keyboards, touchpads, or mice, etc.

[0169] Those skilled in the art will understand that Figure 10 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the electronic device to which the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements.

[0170] This application also provides a computer-readable storage medium. One or more non-volatile computer-readable storage media containing computer-executable instructions, which, when executed by one or more processors, cause the processors to perform the steps of an image processing method.

[0171] This application also provides a computer program product containing instructions that, when run on a computer, cause the computer to perform an image processing method.

[0172] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data shall comply with the relevant laws, regulations and standards of the relevant countries and regions.

[0173] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0174] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0175] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. An image processing method, characterized in that, include: A tone map is performed on the first image to obtain a second image; the bit depth of both the first image and the second image is higher than a preset bit depth; The second image is subjected to gamma processing to obtain a third image; the bit depth of the third image is higher than the preset bit depth, and the image brightness of the third image is higher than the image brightness of the second image; The third image is compressed to obtain the target image; The bit depth of the target image is lower than or equal to the preset bit depth; The compression process of the third image to obtain the target image includes: The third image is compressed in the gamma module to obtain the target image; or After converting the third image from the RGB color space to the YUV color space, the third image in the YUV color space is compressed to obtain the target image.

2. The method according to claim 1, characterized in that, The method further includes: Obtain the first gamma parameter corresponding to the preset first bit depth in the image processing flow; the first gamma parameter is used to process the image data at the first bit depth, where the first bit depth is lower than or equal to the preset bit depth; Interpolate the first gamma parameter to obtain the second gamma parameter corresponding to the second bit depth; the second bit depth is higher than the preset bit depth; The step of performing gamma processing on the second image to obtain the third image includes: The second image is subjected to gamma processing using the second gamma parameter to obtain the third image.

3. The method according to claim 2, characterized in that, The first depth range corresponding to the first gamma parameter includes at least two pairs of first element pairs, each pair of first element pairs including a first input element and a first output element; the step of interpolating the first gamma parameter to obtain the second gamma parameter corresponding to the second depth includes: Multiply the first input element and the first output element in each pair of the first element pairs by the second bit depth to obtain each pair of the second element pairs including the second input element and the second output element; Obtain interpolation input elements other than the second input element within the second depth range. For each interpolation input element, determine the interpolation output element based on the second element pair adjacent to the interpolation input element. The second depth range is greater than the first depth range, and the interpolation input element and the interpolation output element constitute an interpolation element pair. Based on each pair of second elements and each pair of interpolation elements, the second gamma parameter corresponding to the second depth is constructed.

4. The method according to claim 1, characterized in that, The method further includes: At least two exposed images obtained with different exposure parameters are acquired, and the at least two exposed images are fused to obtain a first image; the bit depth of the exposed images is lower than or equal to a preset bit depth. The step of performing tone mapping on the first image to obtain the second image includes: Global tone mapping is performed on the first image to obtain an intermediate image; the bit depth of the intermediate image is higher than a preset bit depth. The intermediate image is subjected to local tone mapping to obtain the second image.

5. The method according to claim 4, characterized in that, The step of performing global tone mapping on the first image to obtain an intermediate image includes: The first image is converted from RGB color space to grayscale space, and global tone mapping is performed on the first image in grayscale space to obtain a global tone-mapped image in grayscale space. The global tone mapping gain is obtained by dividing the global tone mapping image in the grayscale space by the first image in the grayscale space. The first image in the RGB color space is processed based on the global tone mapping gain to obtain an intermediate image in the RGB color space.

6. The method according to claim 4, characterized in that, The step of performing local tone mapping on the intermediate image to obtain the second image includes: The intermediate image is converted from the RGB color space to the grayscale space, and local tone mapping is performed on the intermediate image in the grayscale space to obtain a locally tone-mapped image in the grayscale space. The local tone mapping gain is obtained by dividing the local tone mapping image in the grayscale space by the intermediate image in the grayscale space. The intermediate image in the RGB color space is processed based on the local tone mapping gain to obtain a second image in the RGB color space.

7. The method according to claim 6, characterized in that, The step of performing local tone mapping on the intermediate image in the grayscale space to obtain a locally tone-mapped image in the grayscale space includes: Gamma processing is performed on the intermediate image in the grayscale space to obtain the intermediate image in grayscale space after gamma processing; Local tone mapping is performed on the intermediate image after gamma processing in the grayscale space to obtain a locally tone-mapped image in the grayscale space after gamma processing. The local tone mapping image in the grayscale space after gamma processing is subjected to inverse gamma processing to obtain a local tone mapping image in the grayscale space.

8. An image processing apparatus, characterized in that, include: The tone mapping module is used to perform tone mapping on the first image to obtain the second image; The bit depth of both the first image and the second image is higher than the preset bit depth; The gamma module is used to perform gamma processing on the second image to obtain a third image; the bit depth of the third image is higher than the preset bit depth, and the image brightness of the third image is higher than the image brightness of the second image; A compression module is used to compress the third image to obtain a target image; the bit depth of the target image is lower than or equal to the preset bit depth; the compression module is also used to compress the third image in the gamma module to obtain the target image; or to convert the third image from the RGB color space to the YUV color space and then compress the third image in the YUV color space to obtain the target image.

9. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the computer program is executed by the processor, the processor performs the steps of the image processing method as described in any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • High dynamic range image fusion method for refrigeration type infrared focal plane detector

    CN109708764A

  • Rapid HDR image tone mapping method

    CN110400269A