Image processing methods, apparatus, electronic devices and storage media, products

By identifying and selectively processing global and local tone mapping of target areas in HDR images, the problem of low image quality in traditional techniques is solved, achieving higher quality image processing results.

CN118015103BActive Publication Date: 2026-11-17XIAN OPPO COMM TECH CORP LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211382160.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-07
Publication Date
2026-11-17
Estimated Expiration
2042-11-07

AI Technical Summary

Technical Problem

Traditional tone mapping techniques cannot effectively target overexposed or underexposed areas when processing HDR images, resulting in lower image quality.

Method used

By identifying target regions in HDR images, a combination of global and local tone mapping is used to specifically process the tone mapping of the target regions, generating high-quality images.

Benefits of technology

It improves tone mapping in HDR images, enhancing overall image quality and detail.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118015103B_ABST
    Figure CN118015103B_ABST
Patent Text Reader

Abstract

This application relates to an image processing method, apparatus, electronic device, storage medium, and product. The method includes: First, identifying a target region from an HDR image of a current scene. Then, when performing global tone mapping on the HDR image, performing global tone mapping on the HDR image based on the target region, thus improving the tone mapping processing effect of the target region. Second, when performing local tone mapping on the global tone mapping result (image G) of the HDR image, performing local tone mapping on the global tone mapping result (image G) of the HDR image based on the target region, thus improving the local tone mapping processing effect of the target region. Ultimately, the tone mapping effect of the HDR image is improved, i.e., the image quality is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] With the rapid development of computer technology, camera imaging technology has also advanced rapidly. Image sensors in cameras can now capture images of nature more realistically, generating High Dynamic Range (HDR) images. While HDR images can more realistically reflect real-world scenes, for the same image size, HDR images have a larger data volume compared to ordinary LDR images. Because of this larger data volume, HDR images often encounter situations where real-world usage scenarios cannot support them during storage, transmission, and display. In such cases, tone mapping technology can be used to compress the HDR image from its high dynamic range to a dynamic range suitable for the actual usage scenario.

[0003] However, using traditional tone mapping techniques to tone map HDR images results in images of lower quality. Summary of the Invention

[0004] This application provides an image processing method, apparatus, electronic device, and computer-readable storage medium that can improve the image quality of images generated after tone mapping.

[0005] On the one hand, an image processing method is provided, the method comprising:

[0006] Identify the target region from the HDR image of the current scene;

[0007] Global tone mapping is performed on the HDR image based on the target region to generate the global tone mapping result of the HDR image;

[0008] Based on the global tone mapping result of the target region, a local tone mapping is performed on the HDR image to generate the target tone mapping result of the HDR image.

[0009] On the other hand, an image processing apparatus is provided, the apparatus comprising:

[0010] The target region identification and acquisition module is used to identify the target region from the HDR image of the current scene;

[0011] A global tone mapping module is used to perform global tone mapping on the HDR image based on the target region, and generate a global tone mapping result for the HDR image;

[0012] The local tone mapping module is used to perform local tone mapping on the global tone mapping result of the HDR image based on the target region, and generate the target tone mapping result of the HDR image.

[0013] On the other hand, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the steps of the image processing method described above.

[0014] On the other hand, a computer-readable storage medium is provided that stores a computer program thereon, which, when executed by a processor, implements the steps of the image processing method described above.

[0015] On the other hand, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps of the image processing method as described above.

[0016] The aforementioned image processing method, apparatus, electronic device, storage medium, and product first identify the target region from an HDR image of the current scene. Then, during global tone mapping of the HDR image, global tone mapping is performed based on the target region, thus improving the tone mapping effect of the target region. Secondly, during local tone mapping of the HDR image's global tone mapping result, local tone mapping is performed based on the target region, thus improving the local tone mapping effect of the target region. Ultimately, this improves the tone mapping effect of the HDR image, i.e., it enhances the image quality. Attached Figure Description

[0017] 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.

[0018] Figure 1 This is an application environment diagram of an image processing method in one embodiment;

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

[0020] Figure 3 for Figure 2 The flowchart shows a method for performing global tone mapping on an HDR image based on the target region to generate the global tone mapping result of the HDR image.

[0021] Figure 4A This is a flowchart illustrating a method for global tone mapping of a human portrait region in one embodiment;

[0022] Figure 4B This is a schematic diagram of a method for global tone mapping of a human portrait area in one embodiment;

[0023] Figure 5 This is a schematic diagram of the brightening curve for global brightening of the portrait area in one embodiment;

[0024] Figure 6 This is a schematic diagram of the contrast enhancement curve for global contrast enhancement processing of the human portrait area in one embodiment;

[0025] Figure 7 A flowchart of an image processing method in another embodiment;

[0026] Figure 8 This is a flowchart illustrating the process of performing local contrast enhancement on the portrait region in the global tone mapping result of an HDR image in one embodiment, generating the result of local contrast enhancement.

[0027] Figure 9 This is a schematic diagram illustrating how the global tone mapping result of an HDR image is divided into multiple non-overlapping image blocks in one embodiment.

[0028] Figure 10 Here is a flowchart of an image processing method in another embodiment;

[0029] Figure 11 This is a schematic diagram illustrating how the target tone mapping result of an HDR image is divided into multiple non-overlapping image blocks in one embodiment.

[0030] Figure 12 This is a schematic diagram of an image processing method in a specific embodiment;

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

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

[0033] 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.

[0034] It is understood that the terms "first," "second," etc., used in this application may be used to describe various elements herein, but these elements are not limited by these terms. These terms are only used to distinguish one element from another. For example, without departing from the scope of this application, a first brightening processing result may be referred to as a second brightening processing result, and similarly, a second brightening processing result may be referred to as a first brightening processing result. Both the first brightening processing result and the second brightening processing result are brightening processing results, but they are not the same brightening processing result.

[0035] Traditional methods use tone mapping to compress HDR images from their high dynamic range to a dynamic range suitable for the actual usage scenario. However, traditional tone mapping treats all areas of the HDR image as equal during tone mapping. Therefore, in some scenarios where HDR images contain overexposed or underexposed areas, traditional tone mapping cannot effectively address these areas. Consequently, tone mapping of HDR images results in lower quality and poor image effects.

[0036] To address the aforementioned problems, a novel image processing method is proposed. Figure 1 This is a schematic diagram illustrating the application environment of an image processing method in one embodiment. For example... Figure 1 As shown, the application environment includes an electronic device 120 and a stylus 140. The electronic device 120 identifies the target region from an HDR image of the current scene; performs global tone mapping on the HDR image based on the target region to generate a global tone mapping result for the HDR image; and performs local tone mapping on the global tone mapping result of the HDR image based on the target region to generate a target tone mapping result for the HDR image. The electronic device 120 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.

[0037] Figure 2 This is a flowchart of an image processing method in one embodiment. The image processing method in this embodiment is designed to run on... Figure 1 The description will be based on an example of an electronic device. Figure 2As shown, the image processing method includes steps 220 to 240, wherein,

[0038] Step 220: Identify the target region from the HDR image of the current scene.

[0039] Here, "current scene" refers to the current shooting scene, and "HDR image of the current scene" refers to the HDR image obtained by shooting and processing the current scene. HDR images, also known as High-Dynamic Range (HDR) images, provide a wider dynamic range and more image detail compared to ordinary images. When synthesizing HDR images, multiple frames are first captured at different exposure levels, and then these frames are combined to create the HDR image.

[0040] However, for images of the same size, HDR images have a larger data volume compared to regular LDR images. Because of this larger data volume, HDR images often encounter situations where real-world usage scenarios cannot support them during storage, transmission, and display. In such cases, tone mapping technology can be used to compress the HDR image from its high dynamic range to a dynamic range suitable for the actual usage scenario.

[0041] When performing tone mapping on an HDR image, the target region is first identified from the HDR image of the current scene. The target region can be a region of interest, such as a subject region or a background region; this application does not limit this. The subject region can be a region obtained from the image through subject identification; for example, the subject region can be any one or more of the following: a human figure region, an animal region, a building region, etc. The background region includes any one or more of the following: a sky region, an ocean region, a beach region, a mountain region, a forest region, etc. This application does not limit this.

[0042] For example, an artificial intelligence (AI) model can be used to identify the target region from an HDR image of the current scene; however, this application does not limit this to that.

[0043] Step 240: Perform global tone mapping on the HDR image based on the target region to generate the global tone mapping result of the HDR image.

[0044] After identifying the target region from the HDR image of the current scene, global tone mapping can be performed on the HDR image based on the target region. In this way, global tone mapping can be performed on the target region during global tone mapping to generate the global tone mapping result (image G) of the HDR image. Global tone mapping refers to the process of applying the same mapping function to all pixels in the high dynamic range image to map the high dynamic range image to a low dynamic range image.

[0045] For example, global tone mapping can be performed on an HDR image based on at least one of the portrait region, face region, and skin color region to generate the global tone mapping result (image G) of the HDR image.

[0046] For example, global tone mapping of the entire HDR image can be performed based on the pixel values ​​of each pixel within the entire image. Targeted global tone mapping of a specific target region can be achieved by combining the pixel values ​​of each pixel within the target region to determine specific parameters for global tone mapping of that region. Then, global tone mapping is performed specifically on the target region based on these specific parameters. Thus, after performing global tone mapping on the entire HDR image and then performing targeted global tone mapping on the target region, global tone mapping of the HDR image is achieved, generating the global tone mapping result (image G) of the HDR image.

[0047] Step 260: Perform local tone mapping based on the global tone mapping result (image G) of the target region of the HDR image to generate the target tone mapping result (image T) of the HDR image.

[0048] After obtaining the global tone mapping result (image G) of an HDR image, local tone mapping can be performed on it. Local tone mapping refers to referencing the pixel values ​​of surrounding pixels when performing tone mapping on each pixel in the HDR image during the process of mapping a high dynamic range image to a low dynamic range image. Therefore, performing local tone mapping on a HDR image not only improves image contrast but also allows for better processing of image details, thereby increasing image detail information.

[0049] When performing local tone mapping on the global tone mapping result (image G) of an HDR image, local tone mapping can be performed based on the target region. Thus, local tone mapping can be performed on the target region while performing local tone mapping on the global tone mapping result (image G), generating the local tone mapping result (image L) of the HDR image, which is ultimately the target tone mapping result (image T) of the HDR image. Therefore, performing local tone mapping on high dynamic range images not only improves image contrast but also allows for better processing of image details, thereby increasing image detail information.

[0050] For example, local tone mapping can be performed based on the global tone mapping result of the HDR image from at least one of the portrait region, face region, and skin color region to generate the global tone mapping result of the HDR image (image G).

[0051] For example, when performing local tone mapping on the global tone mapping result of an HDR image, targeted local tone mapping can be performed on a target region. This can be achieved by combining the pixel values ​​of each pixel within the target region to determine specific parameters for local tone mapping of that region. Then, based on these specific parameters, targeted local tone mapping can be performed on the target region when performing local tone mapping on the global tone mapping result of the HDR image. Thus, by performing local tone mapping on the entire HDR image and by performing targeted local tone mapping on the target region when performing local tone mapping on the global tone mapping result of the HDR image, local tone mapping of the HDR image is achieved, generating the local tone mapping result of the HDR image (image L).

[0052] In this embodiment, firstly, the target region is identified from the HDR image of the current scene. Then, when performing global tone mapping on the HDR image, global tone mapping is performed based on the target region. This allows for global tone mapping to be performed on the target region during the global tone mapping process, improving the tone mapping effect of the target region. Secondly, when performing local tone mapping on the global tone mapping result (image G) of the HDR image, local tone mapping is performed based on the target region. This allows for local tone mapping to be performed on the target region during the local tone mapping process, improving the local tone mapping effect of the target region. Ultimately, the tone mapping effect of the HDR image is improved, thus improving image quality.

[0053] The previous embodiment described an image processing method that performs global tone mapping on a target region during global tone mapping and local tone mapping on a target region during local tone mapping. This embodiment further describes how, if the target region includes a human figure region, then... Figure 3 As shown, step 240 involves performing global tone mapping on the HDR image based on the target region to generate the global tone mapping result of the HDR image, including:

[0054] Step 242: Perform global tone mapping on the HDR image to generate the initial tone mapping result of the HDR image.

[0055] Here, the target area includes the human figure area, which refers to the area where the human figure outline is located. The human figure area can be determined from the HDR image of the current scene by subject recognition method, or it can be identified from the HDR image of the current scene by artificial intelligence model (AI). Of course, this application does not limit this.

[0056] Therefore, when performing global tone mapping on an HDR image based on the target region to generate the global tone mapping result (image G) of the HDR image, firstly, global tone mapping is performed on the entire HDR image to generate the initial tone mapping result of the HDR image. Since global tone mapping uses the same mapping function to process all pixels in the high dynamic range image, the computational cost is relatively small.

[0057] The following formula is used for global tone mapping:

[0058]

[0059] Where In[i] represents the pixel value of each pixel in the HDR image, and Out[i] represents the pixel value of each pixel in the HDR image after global tone mapping; max The largest pixel value in an HDR image, In min τ is the minimum pixel value in the HDR image, and τ is a tuning parameter that can be obtained experimentally.

[0060] The initial tone mapping result of the HDR image is generated based on the pixel values ​​output after global tone mapping of each pixel in the HDR image.

[0061] Step 244: Perform global tone mapping on the portrait area in the initial tone mapping result to generate the global tone mapping result (image G) of the HDR image.

[0062] After performing global tone mapping on the entire HDR image to generate the initial tone mapping result, the portrait area in the initial tone mapping result can be specifically subjected to global tone mapping. For example, this can be achieved by combining the pixel values ​​of each pixel within the portrait area to determine specific parameters for global tone mapping of the portrait area. Then, global tone mapping is performed specifically on the portrait area based on these specific parameters. Here, formula (1-1) can still be used for global tone mapping, where In[i] is the pixel value of each pixel in the portrait area, and Out[i] is the pixel value output after global tone mapping of each pixel in the portrait area; In max The largest pixel value in the portrait area, In min τ is the smallest pixel value in the portrait area, and τ is an adjustment parameter that can be obtained experimentally.

[0063] The initial tone mapping result of the HDR image is generated based on the pixel values ​​output after global tone mapping of each pixel in the portrait region, and the pixel values ​​of the region other than the portrait region in the initial tone mapping result of the HDR image.

[0064] In this embodiment, if the target area includes a human figure region, when performing global tone mapping on the HDR image based on the target area, firstly, global tone mapping is performed on the HDR image to generate an initial tone mapping result for the HDR image. Since global tone mapping is performed on the entire HDR image, the uniformity and consistency of the overall tone mapping effect in the initial tone mapping result can be guaranteed. Secondly, global tone mapping is performed on the human figure region in the initial tone mapping result to generate the global tone mapping result of the HDR image (image G). This allows for targeted tone mapping of the human figure region, further improving the tone mapping effect of the human figure region.

[0065] The previous embodiment described the process of performing global tone mapping on an HDR image, first performing global tone mapping on the HDR image to generate an initial tone mapping result; then performing global tone mapping on the portrait region in the initial tone mapping result to generate the global tone mapping result of the HDR image (image G). This embodiment further describes performing global tone mapping on the portrait region in the initial tone mapping result to generate the global tone mapping result of the HDR image (image G), including:

[0066] The portrait area in the initial tone mapping result is globally brightened to generate the first brightening result.

[0067] The first brightening process result is subjected to global contrast enhancement to generate the global tone mapping result (image G) of the HDR image.

[0068] Combination Figure 4A The diagram shown is a flowchart illustrating a method for global tone mapping of a portrait region in one embodiment. The method for global tone mapping of a portrait region includes:

[0069] Step 420: Perform global tone mapping on the HDR image to generate the initial tone mapping result of the HDR image;

[0070] Step 440: Based on the portrait region mask map, separate the portrait region from the initial tone mapping result of the HDR image, perform global brightening processing on the portrait region, and generate the first brightening processing result;

[0071] Combination Figure 4B As shown, portrait region segmentation can be performed on the HDR image 402 to obtain a portrait region mask (portrait MASK 404). A portrait segmentation model can be used to segment the HDR image to obtain the portrait region mask. Here, the portrait segmentation model can be a trained artificial intelligence model (AI), or it can be a trained neural network model, etc., which is not limited in this application.

[0072] The portrait region mask is used to extract the region of interest (portrait region) from the initial tone mapping result of the HDR image or the HDR image itself. In the portrait region mask, the pixel value of the pixels in the portrait region is assigned a value of 1, while the pixel value of the pixels in the background region (excluding the portrait region) is assigned a value of 0. As shown in Figure 4, which is a schematic diagram of the portrait region mask in one embodiment, the black area is the background region, and the pixel value of the pixels in the black area is 0; the white area is the portrait region, and the pixel value of the pixels in the white area is 1.

[0073] Then, global tone mapping is performed on the HDR image to generate an initial tone mapping result 406. Next, the portrait region can be separated from the initial tone mapping result of the HDR image based on the portrait region mask, and then global brightening processing is performed on the portrait region to generate a first brightening processing result 408. Here, global brightening processing refers to brightening the pixel values ​​of all pixels in the portrait region in the same way. For example, specific parameters for global brightening processing of the portrait region can be determined by combining the pixel values ​​of each pixel in the portrait region. Then, based on these specific parameters, global brightening processing is performed on the entire portrait region to generate the first brightening processing result.

[0074] Step 460: Perform global contrast enhancement processing on the first brightening processing result to generate the global tone mapping result (image G) of the HDR image.

[0075] The global contrast enhancement processing refers to applying the same contrast enhancement method to all pixels within the portrait area in the first brightening processing result 408. For example, specific parameters for global contrast enhancement of the portrait area can be determined by combining the pixel values ​​of each pixel within the portrait area. Then, based on these specific parameters, global contrast enhancement processing is performed on the entire portrait area in the first brightening processing result 408 to generate a global contrast enhancement result for the portrait area. Finally, the global contrast enhancement result of the portrait area and the initial tone mapping result of the HDR image are synthesized to generate the global tone mapping result of the HDR image (image G 410).

[0076] In this embodiment, firstly, global tone mapping is performed on the HDR image to generate an initial tone mapping result for the HDR image. Based on a portrait region mask, the portrait region is separated from the initial tone mapping result of the HDR image. Then, global brightening processing is performed on the portrait region to generate a first brightening processing result. Secondly, global contrast enhancement processing is performed on the first brightening processing result to generate a global contrast enhancement processing result for the portrait region. Finally, the global contrast enhancement processing result for the portrait region and the initial tone mapping result of the HDR image are synthesized to generate the global tone mapping result of the HDR image (image G). When performing targeted global tone mapping on the portrait region, the brightness and contrast of the portrait region are improved from two dimensions: increasing brightness and enhancing contrast, thereby improving the image quality of the obtained portrait region.

[0077] The previous embodiment described the process of global tone mapping for an HDR image. This embodiment further describes step 440, which involves globally brightening the portrait area in the initial tone mapping result to generate a first brightening result, including:

[0078] Obtain the maximum pixel value and global brightening parameters within the portrait area;

[0079] The pixel values ​​of each pixel in the portrait area are processed based on the maximum pixel value and global brightening parameters to generate the first target pixel value for each pixel.

[0080] Based on the first target pixel value of each pixel, the first brightening result of the portrait area is generated.

[0081] In the process of globally brightening the portrait area in the initial tone mapping result, a preset global brightening formula can be used. This preset formula involves the maximum pixel value within the portrait area and global brightening parameters. Therefore, firstly, the maximum pixel value and global brightening parameters within the portrait area are obtained. Here, the maximum pixel value within the portrait area is `max`, and the global brightening parameters can be the parameters in the preset global brightening formula. For example, the preset global brightening formula can be shown in formula (1-2) below:

[0082]

[0083] Where input[i] is the pixel value of each pixel in the portrait region, output[i] is the pixel value output after global brightening of each pixel in the portrait region; max is the maximum pixel value in the portrait region, and 0.6 is the global brightening parameter, which can be obtained through extensive experimentation. Of course, the global brightening parameter here can also be other values, and this application does not limit it. Here, the brightening curve corresponding to the preset global brightening formula is as follows: Figure 5 As shown, where, Figure 5 The horizontal axis represents the pixel value input[i] of each pixel within the portrait area, and the vertical axis represents the first target pixel value output[i] generated after processing input[i].

[0084] Next, the pixel values ​​of each pixel within the portrait area are processed according to the maximum pixel value and the global brightening parameters. Specifically, the aforementioned preset global brightening formula is used to process the pixel values ​​input[i] of each pixel within the portrait area, generating the first target pixel value output[i] for each pixel. For example, if pixel i is within the portrait mask (i.e., within the portrait area), the aforementioned preset global brightening formula is used to process pixel i; if pixel i is not within the portrait mask (i.e., outside the portrait area), the aforementioned preset global brightening formula is not used to process pixel i.

[0085] Finally, based on the first target pixel value output[i] of each pixel, the first brightening result of the portrait area is generated.

[0086] In this embodiment, when performing global brightening processing on the portrait area in the initial tone mapping result to generate a first brightening processing result, firstly, the maximum pixel value and global brightening parameters within the portrait area are obtained; secondly, the pixel values ​​of each pixel within the portrait area are processed according to the maximum pixel value and global brightening parameters to generate a first target pixel value for each pixel; finally, the first brightening processing result for the portrait area is generated based on the first target pixel values ​​of each pixel. A preset global brightening formula is constructed based on the maximum pixel value and global brightening parameters within the portrait area, thus enabling more accurate global brightening processing. Therefore, performing global brightening processing on the portrait area based on the preset global brightening formula can improve the brightness of the portrait area.

[0087] The foregoing embodiments described the process of global tone mapping for HDR images. This embodiment describes step 460, which involves performing global contrast enhancement processing on the first brightening processing result to generate a global tone mapping result for the HDR image, including:

[0088] From the first brightening process result, obtain the maximum pixel value and global contrast enhancement parameters within the portrait area;

[0089] The pixel values ​​of each pixel in the portrait area are processed based on the maximum pixel value and global contrast enhancement parameters to generate the second target pixel value for each pixel.

[0090] Based on the second target pixel value of each pixel, a global contrast enhancement processing result for the portrait region is generated, and a global tone mapping result for the HDR image is generated based on the global contrast enhancement processing result for the portrait region.

[0091] During the global contrast enhancement process on the first brightening result, the portrait area can be enhanced globally based on a preset global contrast enhancement formula. This preset formula involves the maximum pixel value and global contrast enhancement parameters within the portrait area of ​​the first brightening result. Therefore, firstly, the maximum pixel value and global contrast enhancement parameters within the portrait area of ​​the first brightening result are obtained. Here, the maximum pixel value within the portrait area is Max, and the global contrast enhancement parameters can be parameters from the preset global contrast enhancement formula. For example, the preset global contrast enhancement formula can be as shown in formula (1-3):

[0092]

[0093] Where Input[i] is the pixel value of each pixel in the portrait region, and Output[i] is the pixel value output after global contrast enhancement processing; Max is the maximum pixel value in the portrait region, and 0.02 and 0.98 are global contrast enhancement parameters, which can be obtained through extensive experiments. Of course, the global contrast enhancement parameters here can also be other values, and this application does not limit them. Here, the contrast enhancement curve corresponding to the preset global contrast enhancement formula is as follows: Figure 6 As shown by the solid line, Figure 6 The horizontal axis represents the pixel value Input[i] of each pixel within the portrait area, and the vertical axis represents the first target pixel value Output[i] generated after processing Input[i].

[0094] Secondly, the pixel values ​​of each pixel within the portrait area are processed according to the maximum pixel value and the global contrast enhancement parameters. Specifically, the pixel value Input[i] of each pixel within the portrait area is processed using the aforementioned preset global contrast enhancement formula to generate the second target pixel value Output[i] for each pixel. For example, if pixel i is located within the portrait mask (i.e., within the portrait area), the aforementioned preset global contrast enhancement formula is used to process pixel i; if pixel i is not located within the portrait mask (i.e., outside the portrait area), the aforementioned preset global contrast enhancement formula is not used to process pixel i.

[0095] Finally, based on the second target pixel value Output[i] of each pixel, the global contrast enhancement processing result of the portrait region is generated, and the global tone mapping result of the HDR image (image G) is generated based on the global contrast enhancement processing result of the portrait region.

[0096] In this embodiment, when performing global contrast enhancement processing on the first brightening processing result, firstly, the maximum pixel value and global contrast enhancement parameters within the portrait area are obtained from the first brightening processing result; secondly, the pixel values ​​of each pixel within the portrait area are processed according to the maximum pixel value and global contrast enhancement parameters to generate a second target pixel value for each pixel; finally, based on the second target pixel values ​​of each pixel, a global contrast enhancement processing result for the portrait area is generated, and a global tone mapping result (image G) of the HDR image is generated based on the global contrast enhancement processing result for the portrait area. A preset global contrast enhancement formula is constructed based on the maximum pixel value and global contrast enhancement parameters within the portrait area. Therefore, the constructed preset global contrast enhancement formula can more accurately perform global contrast enhancement processing. Consequently, performing global contrast enhancement processing on the portrait area based on the preset global contrast enhancement formula can improve the contrast of the portrait area.

[0097] As described in the foregoing embodiments, if the target region includes a human face region, then when performing global tone mapping on the HDR image based on the target region, firstly, global tone mapping is performed on the HDR image to generate an initial tone mapping result for the HDR image. Secondly, global tone mapping is performed on the human face region in the initial tone mapping result to generate the global tone mapping result (image G) of the HDR image. This embodiment describes that if the target region also includes a skin tone region, such as... Figure 7 As shown, an image processing method is provided, which further includes:

[0098] Step 246: Extract the skin color region from the portrait region of the global tone mapping result of the HDR image;

[0099] Step 248: Perform global tone mapping on the skin color region to generate the target global tone mapping result of the HDR image.

[0100] For example, when performing global tone mapping on an HDR image based on a target region to generate the global tone mapping result of the HDR image, firstly, global tone mapping is performed on the HDR image to generate an initial tone mapping result. Secondly, global tone mapping is performed on the portrait region in the initial tone mapping result to generate the global tone mapping result of the HDR image (image G). Thirdly, the skin tone region is extracted from the portrait region in the global tone mapping result of the HDR image. Finally, global tone mapping is performed on the skin tone region to generate the target global tone mapping result of the HDR image.

[0101] In this context, the skin-colored region refers to the area belonging to the skin within the portrait image. In one implementation, a portrait region segmentation process can be performed on the HDR image to obtain a portrait region mask. This mask can be obtained by segmenting the HDR image using a portrait segmentation model. The portrait region mask is used to extract the region of interest (portrait region) from the initial tone mapping result of the HDR image or the HDR image itself. Therefore, the portrait region can be extracted from the initial tone mapping result of the HDR image or the HDR image based on the portrait mask.

[0102] Furthermore, skin tone region segmentation can be performed on the portrait region of the global tone mapping result of the HDR image to obtain a skin tone region mask. The skin tone region mask is used to extract the region of interest (skin tone region) from the skin tone region. Therefore, the skin tone region can be extracted from the skin tone region of the global tone mapping result of the HDR image based on the skin tone mask.

[0103] Then, global tone mapping can be performed on the skin-tone region to generate the target global tone mapping result for the HDR image. That is, global tone mapping can be performed specifically on the skin-tone region. For example, this can be achieved by combining the pixel values ​​of each pixel within the skin-tone region to determine specific parameters for global tone mapping of the skin-tone region. Then, based on these specific parameters, global tone mapping is performed on the entire skin-tone region using the same method. Here, formula (1-1) can still be used for global tone mapping, where In[i] is the pixel value of each pixel in the skin-tone region, and Out[i] is the pixel value output after global tone mapping of each pixel in the skin-tone region; In max The largest pixel value in the skin color region, In min τ is the minimum pixel value in the skin color region, and τ is an adjustment parameter that can be obtained experimentally.

[0104] The target tone mapping result of the HDR image is generated based on the pixel values ​​output by global tone mapping of each pixel in the skin color region, and the pixel values ​​of the regions other than the skin color region in the global tone mapping result of the HDR image.

[0105] In this embodiment, if the target area includes a human figure region, when performing global tone mapping on the HDR image based on the target area, firstly, global tone mapping is performed on the HDR image to generate an initial tone mapping result for the HDR image. Since global tone mapping is performed on the entire HDR image, the uniformity and consistency of the overall tone mapping effect in the initial tone mapping result can be guaranteed. Secondly, global tone mapping is performed on the human figure region in the initial tone mapping result to generate the global tone mapping result of the HDR image (image G). This allows for targeted tone mapping of the human figure region, further improving the tone mapping effect of the human figure region.

[0106] Next, skin tone regions are further extracted from the portrait region of the global tone mapping result of the HDR image. Finally, global tone mapping is performed on the skin tone regions to generate the target global tone mapping result of the HDR image. This allows for targeted tone mapping of skin tone regions, further improving the tone mapping effect of skin tone regions.

[0107] In one embodiment, step 248, performing global tone mapping on the skin-colored region to generate the target global tone mapping result for the HDR image, includes:

[0108] Perform a global brightening process on the skin-toned areas to generate a second brightening result;

[0109] The second brightening process result is subjected to global contrast enhancement processing to generate the target global tone mapping result of the HDR image.

[0110] For example, a global brightening process is performed on the skin-colored area to generate a second brightening result. Here, global brightening refers to brightening the pixel values ​​of all pixels within the skin-colored area using the same method. For example, specific parameters for globally brightening the skin-colored area can be determined by combining the pixel values ​​of each pixel within the skin-colored area. Then, based on these specific parameters, a targeted global brightening process is performed on the skin-colored area to generate a second brightening result.

[0111] Next, the second brightening result is subjected to global contrast enhancement processing to generate the target global tone mapping result of the HDR image. Global contrast enhancement processing refers to applying the same contrast enhancement method to the pixel values ​​of all pixels within the skin tone region. For example, specific parameters for global contrast enhancement of the skin tone region can be determined by combining the pixel values ​​of each pixel within the skin tone region. Then, based on these specific parameters, targeted global contrast enhancement processing is performed on the skin tone region to generate a global contrast enhancement result for the skin tone region. Finally, the global contrast enhancement result of the skin tone region and the global tone mapping result of the HDR image are synthesized to generate the target global tone mapping result (image G) of the HDR image.

[0112] In this embodiment, a global brightening process is performed on the skin-tone region to generate a second brightening result. Next, a global contrast enhancement process is applied to the second brightening result to generate a global contrast enhancement result for the skin-tone region. Finally, the global contrast enhancement result for the skin-tone region and the global tone mapping result of the HDR image are synthesized to generate the target global tone mapping result (image G) of the HDR image. By performing targeted global tone mapping on the skin-tone region, the brightness and contrast of the skin-tone region are improved from two dimensions: increasing brightness and enhancing contrast, thereby improving the image quality of the obtained skin-tone region.

[0113] The foregoing embodiments described the process of global tone mapping of an HDR image based on a target region. This embodiment further describes step 260: if the target region includes a human figure region, local tone mapping is performed based on the global tone mapping result (image G) of the HDR image to generate a target tone mapping result (image T) for the HDR image, including:

[0114] Local contrast enhancement processing is performed on the portrait area in the global tone mapping result of the HDR image to generate the local contrast enhancement processing result;

[0115] The result of local contrast enhancement processing is used as the target tone mapping result of the HDR image.

[0116] Here, the target area includes the human figure area, which refers to the area where the human figure outline is located. The human figure area can be determined from the HDR image of the current scene by subject recognition method, or it can be identified from the HDR image of the current scene by artificial intelligence model (AI). Of course, this application does not limit this.

[0117] Therefore, when performing local tone mapping on the global tone mapping result (image G) of the HDR image based on the target region to generate the target tone mapping result (image T) of the HDR image, local tone mapping can be specifically performed on the target region in the global tone mapping result (image G) of the HDR image to generate the local tone mapping result (image L) of the HDR image. Then, the local tone mapping result is used as the target tone mapping result (image T) of the HDR image.

[0118] For example, when performing local tone mapping on the global tone mapping result of an HDR image, local tone mapping can be performed specifically on the target region. This can be achieved by combining the pixel values ​​of each pixel within the target region to determine specific parameters for local tone mapping of the target region. Then, based on these specific parameters, local tone mapping can be performed specifically on the target region to generate the local tone mapping result of the HDR image (image L). Finally, the local tone mapping result of the HDR image (image L) is used as the target tone mapping result of the HDR image (image T). The local tone mapping here includes at least one of local brightness processing, local chroma processing, or local contrast enhancement processing, which is not limited in this application.

[0119] If the target region includes a human figure region, then local tone mapping is performed on the global tone mapping result of the HDR image based on the target region to generate the target tone mapping result of the HDR image. This includes: performing local contrast enhancement processing on the human figure region in the global tone mapping result (image G) of the HDR image to generate the local tone mapping result (image L) of the HDR image. Alternatively, local contrast enhancement processing can be performed on the target global tone mapping result of the HDR image obtained by performing global tone mapping on the skin tone region to generate the local tone mapping result (image L) of the HDR image. For example, firstly, the human figure region is separated from the global tone mapping result (image G) of the HDR image based on a human figure region mask. Secondly, local contrast enhancement processing is performed on the human figure region to generate the local tone mapping result (image L) of the HDR image. Here, the human figure region mask can be the human figure region mask obtained by human figure region segmentation processing of the HDR image.

[0120] Local contrast enhancement processing refers to applying histogram equalization to the pixel values ​​in image G to enhance contrast. For example, a first specific parameter for local contrast enhancement of the human image region can be determined by combining the pixel values ​​of each pixel within the human image region of image G, and a second specific parameter for local contrast enhancement of the non-human image region can be determined by combining the pixel values ​​of each pixel within the non-human image region of image G. Then, based on the first specific parameter, targeted local contrast enhancement processing is performed on the human image region to generate a local contrast enhancement result for the human image region; similarly, based on the second specific parameter, targeted local contrast enhancement processing is performed on the non-human image region to generate a local contrast enhancement result for the non-human image region. Finally, the local contrast enhancement results for the human image region and the non-human image region are synthesized to generate a local tone mapping result (image L) of the HDR image, which is then used as the target tone mapping result (image T) of the HDR image.

[0121] In this embodiment, local contrast enhancement processing is performed on the portrait region in the global tone mapping result (image G) of the HDR image to generate a local contrast enhancement result (image L), thus realizing local tone mapping on the global tone mapping result (image G) of the HDR image. Furthermore, performing local contrast enhancement processing on the portrait region in the global tone mapping result (image G) of the HDR image not only improves the contrast of the portrait region in the image but also better processes the details in the portrait region, thereby increasing the image detail information.

[0122] The previous embodiment described the process of performing local contrast enhancement processing on the portrait region in the global tone mapping result (image G) of an HDR image. For example... Figure 8 As shown in the figure, this embodiment further describes performing local contrast enhancement processing on the portrait region in the global tone mapping result (image G) of the HDR image to generate a local contrast enhancement processing result (image L), including:

[0123] Step 820: Divide the global tone mapping result (image G) of the HDR image into blocks to generate multiple image blocks;

[0124] Step 840: Determine the target image block corresponding to the human image region from multiple image blocks;

[0125] Step 860: Histogram equalization is used to perform local contrast enhancement processing on the target image block and the first other image block corresponding to each portrait region, respectively, to generate local contrast enhancement processing results; the first other image block is the image block other than the target image block corresponding to the portrait region in the global tone mapping result of the HDR image.

[0126] For example, when performing local contrast enhancement processing on the human image region within the global tone mapping result (image G) of an HDR image, the spatial characteristics of the image need to be considered. That is, for two pixels with the same gray value but located in different spatial positions, since the gray values ​​of the surrounding pixels may be different, these two pixels will be mapped to different pixel values ​​during local contrast enhancement processing.

[0127] In the process of local contrast enhancement, due to the introduction of spatial characteristics of the image, the global tone mapping result (image G) of the HDR image can be divided into blocks to generate multiple image patches. For example, firstly, the global tone mapping result (image G) of the HDR image can be divided into multiple overlapping or non-overlapping image patches. Then, combined with the portrait region mask, the target image patch corresponding to the portrait region is determined from the multiple image patches. Finally, histogram equalization is used to perform local contrast enhancement processing on the target image patch corresponding to each portrait region and other image patches, that is, histogram equalization is performed independently on each image patch to generate histogram equalized image patches. Among them, other image patches are the image patches in the global tone mapping result (image G) of the HDR image excluding the target image patch. Finally, based on the histogram equalized image patches, the local contrast enhancement result is generated, that is, the local tone mapping result (image L) of the HDR image is generated.

[0128] When performing local contrast enhancement on each image block using histogram equalization, for each image block, firstly, the gray values ​​of the image block are statistically analyzed to generate a corresponding gray-level histogram. Secondly, the image block is optimized based on the gray value distribution characteristics of the gray-level histogram to make its gray-level histogram tend to be uniformly distributed. Here, the histogram equalization intensity can be obtained based on the gray value distribution characteristics, and the gray-level histogram corresponding to the image block is optimized based on the histogram equalization intensity to generate a gray-level histogram that tends to be uniformly distributed. Finally, the gray-level histogram that tends to be uniformly distributed is converted into image blocks, and based on all image blocks, the local contrast enhancement result is obtained, that is, the local tone mapping result of the HDR image (image L).

[0129] Combination Figure 9The diagram illustrates how, in one embodiment, the global tone mapping result (image G) of an HDR image is divided into multiple non-overlapping image blocks. For example, image G is divided into m x n image blocks, and histogram equalization is used to perform local contrast enhancement processing on each image block. Assuming the resolution of image G is 4096x3072, the 4096x3072 image G can be divided into 32x24 image blocks, and then histogram equalization is used to perform local contrast enhancement processing on each image block.

[0130] For each of the m x n image blocks, the initial histogram equalization intensity is preset to k. If an image block i intersects with a human face mask, the initial histogram equalization intensity of the target image block i corresponding to that human face region is increased to 1.2k. For example... Figure 9 As shown, the 8th, 9th, 12th, 13th and 14th image blocks intersect with the human face mask, so the histogram equalization intensity of these image blocks is increased to 1.2k.

[0131] Then, based on the corresponding histogram equalization intensity, the gray-level histogram corresponding to the image patch is optimized to generate a gray-level histogram that tends to be uniformly distributed. Specifically, an initial histogram equalization intensity k is used to optimize the gray-level histograms corresponding to other image patches, and a histogram equalization intensity of 1.2k is used to optimize the gray-level histogram corresponding to the target image patch i. Finally, the uniformly distributed gray-level histograms are converted into image patches, and based on all image patches, the local contrast enhancement processing result is obtained, i.e., the local tone mapping result of the HDR image (image L).

[0132] In this embodiment, the global tone mapping result of the HDR image is divided into blocks to generate multiple image blocks. Then, the target image block corresponding to the portrait region is determined from these multiple image blocks. Finally, histogram equalization is used to perform local contrast enhancement processing on the target image block corresponding to each portrait region and other image blocks, generating the local tone mapping result of the HDR image. The other image blocks are the image blocks in the global tone mapping result of the HDR image excluding the target image block. Histogram equalization is performed independently on each grayscale image block, and different histogram equalization intensities are used for the target image block corresponding to the portrait region; therefore, the contrast of the portrait region can be enhanced.

[0133] The foregoing embodiments described an image processing method, including: identifying a target region from an HDR image of a current scene; performing global tone mapping on the HDR image based on the target region to generate a global tone mapping result for the HDR image; and performing local tone mapping on the global tone mapping result of the HDR image based on the target region to generate a target tone mapping result (image T) for the HDR image. This embodiment further describes an image processing method if the target region also includes a face region, further comprising:

[0134] Get the face preview frame from the preview image of the current scene;

[0135] Local contrast enhancement processing is performed on the face region corresponding to the face preview box in the target tone mapping result of the HDR image to generate the final tone mapping result of the HDR image.

[0136] like Figure 10 As shown, the image processing method includes the following steps:

[0137] Step 1010: Identify the human figure region from the HDR image of the current scene;

[0138] Step 1030: Perform global tone mapping on the HDR image based on the portrait area to generate the global tone mapping result of the HDR image;

[0139] Here, global tone mapping is performed on the HDR image to generate the initial tone mapping result of the HDR image; global brightening processing is performed on the portrait area in the initial tone mapping result to generate the first brightening processing result; global contrast enhancement processing is performed on the first brightening processing result to generate the global tone mapping result of the HDR image.

[0140] Based on the global tone mapping result of the HDR image, local tone mapping begins. This local tone mapping of the global tone mapping result of the HDR image includes the following steps:

[0141] Step 1050: Perform local tone mapping on the global tone mapping result of the HDR image based on the portrait region to generate the target tone mapping result (image T) of the HDR image;

[0142] Here, local contrast enhancement processing is performed on the portrait region in the global tone mapping result (image G 1002) of the HDR image to generate a local contrast enhancement processing result; this local contrast enhancement processing result is then used as the target tone mapping result of the HDR image. For example, the global tone mapping result of the HDR image is divided into blocks to generate multiple image blocks. Then, the target image block corresponding to the portrait region is determined from these multiple image blocks. Finally, histogram equalization is used to perform local contrast enhancement processing on the target image block corresponding to each portrait region and the first other image block, respectively, to generate a local contrast enhancement processing result. The first other image block refers to the image blocks in the global tone mapping result of the HDR image excluding the target image block corresponding to the portrait region.

[0143] Step 1070: Obtain the face preview frame from the preview image of the current scene;

[0144] Step 1090: Perform local contrast enhancement processing on the face region corresponding to the face preview box in the target tone mapping result (image T) of the HDR image to generate the final tone mapping result (image U) of the HDR image.

[0145] For example, a face preview bounding box can be obtained from a preview image of the current scene. This preview image can be a preview image displayed on an electronic device when the current scene is captured. Here, the face preview bounding box can be a face recognition bounding box displayed on the preview image. The face recognition bounding box is separated from the preview image to obtain a face region mask. This face region mask is used to extract the region of interest (face region) from the target tone mapping result (image T) of the HDR image. Then, local contrast enhancement processing can be performed on the face region corresponding to the face preview bounding box in the target tone mapping result (image T) of the HDR image to generate a new local contrast enhancement result, which is then used as the final tone mapping result (image U) of the HDR image.

[0146] In this embodiment, local contrast enhancement processing is performed on the face region corresponding to the face preview box in the target tone mapping result (image T) of the HDR image, generating a new local contrast enhancement processing result. This achieves the superposition of local contrast enhancement processing on the face region after performing local contrast enhancement processing on the portrait region, resulting in a better contrast effect for the face region in the new local contrast enhancement processing result. Furthermore, using local contrast enhancement processing to perform local contrast enhancement processing on the face region in the target tone mapping result (image T) not only improves the contrast of the face region in the image but also better processes the details in the face region, thereby increasing image detail information.

[0147] The previous embodiment described the process of further combining the target tone mapping result of the HDR image with local contrast enhancement processing of the face region. This embodiment further describes step 1090, which involves performing local contrast enhancement processing on the face region corresponding to the face preview box in the target tone mapping result of the HDR image to generate the final tone mapping result (image U) of the HDR image, and also includes:

[0148] The target tone mapping result of the HDR image is divided into blocks to generate multiple image blocks;

[0149] Identify the target image block corresponding to the face region from multiple image blocks;

[0150] Histogram equalization is used to perform local contrast enhancement processing on the target image blocks corresponding to each face region and the second other image blocks to generate the final tone mapping result (image U) of the HDR image; the second other image blocks are the image blocks in the target tone mapping result of the HDR image excluding the target image blocks corresponding to the face regions.

[0151] For example, when performing local contrast enhancement processing on the face region within the target tone mapping result (image G) of an HDR image, the spatial characteristics of the image need to be considered. That is, for two pixels with the same gray value but located in different spatial positions, since the gray values ​​of the surrounding pixels may be different, these two pixels will be mapped to different pixel values ​​during local contrast enhancement processing.

[0152] During local contrast enhancement, the spatial characteristics of the image are introduced, allowing the target tone mapping result (image G) of the HDR image to be divided into multiple image blocks. For example, firstly, the target tone mapping result (image G) of the HDR image can be divided into multiple overlapping or non-overlapping image blocks. Then, combined with a face region mask, the target image block corresponding to the face region is determined from the multiple image blocks. Finally, histogram equalization is used to perform local contrast enhancement on the target image blocks corresponding to each face region and the second set of other image blocks. That is, histogram equalization is performed independently on each image block, generating histogram-equalized image blocks. The second set of other image blocks refers to the image blocks in the target tone mapping result (image G) of the HDR image excluding the target image block corresponding to the face region. Finally, based on the histogram-equalized image blocks, a new local contrast enhancement result is generated, which is the final tone mapping result (image U) of the HDR image.

[0153] When performing local contrast enhancement on each image block using histogram equalization, for each image block, firstly, the gray values ​​of the image block are statistically analyzed to generate a corresponding gray-level histogram. Secondly, the image block is optimized based on the gray value distribution characteristics of the gray-level histogram to make its gray-level histogram tend to be uniformly distributed. Here, the histogram equalization intensity can be obtained based on the gray value distribution characteristics, and the gray-level histogram corresponding to the image block is optimized based on the histogram equalization intensity to generate a gray-level histogram that tends to be uniformly distributed. Finally, the gray-level histogram that tends to be uniformly distributed is converted into image blocks, and based on all image blocks, the local contrast enhancement result is obtained, that is, the final tone mapping result (image U) of the HDR image is obtained.

[0154] Combination Figure 11 The diagram illustrates how, in one embodiment, the target tone mapping result (image G) of an HDR image is divided into multiple non-overlapping image blocks. For example, image G is divided into m x n image blocks, and histogram equalization is used to perform local contrast enhancement processing on each image block. Assuming the resolution of image G is 4096x3072, the 4096x3072 image G can be divided into 32x24 image blocks, and then histogram equalization is used to perform local contrast enhancement processing on each image block.

[0155] For each of the m x n image blocks, the initial histogram equalization intensity is preset to k. If an image block i intersects with a face mask, the initial histogram equalization intensity of the target image block i corresponding to that face region is further increased to 1.4k. For example... Figure 11 As shown, the 2nd, 5th, and 8th image blocks intersect with the human face mask, so the histogram equalization intensity of these image blocks is increased to 1.4k.

[0156] Then, based on the corresponding histogram equalization intensity, the gray-level histogram corresponding to the image block is optimized to generate a gray-level histogram that tends to be uniformly distributed. Specifically, the initial histogram equalization intensity k is used to optimize the gray-level histograms corresponding to the second and other image blocks, and a histogram equalization intensity of 1.4k is used to optimize the gray-level histogram corresponding to the target image block i. Finally, the uniformly distributed gray-level histograms are converted into image blocks, and based on all the image blocks, a new local contrast enhancement processing result is obtained, which is the final tone mapping result (image U) of the HDR image.

[0157] In this embodiment, the target tone mapping result of the HDR image is divided into blocks to generate multiple image blocks. Then, the target image block corresponding to the face region is determined from these multiple image blocks. Finally, histogram equalization is used to perform local contrast enhancement processing on the target image blocks corresponding to each face region and the second set of other image blocks, generating the final tone mapping result (image U) of the HDR image. The second set of other image blocks are the image blocks in the target tone mapping result of the HDR image excluding the target image block corresponding to the face region. Histogram equalization is performed independently on each grayscale image block, and different histogram equalization intensities are used for the target image block corresponding to the face region; therefore, the contrast of the face region can be enhanced.

[0158] In a specific embodiment, such as Figure 12 As shown, an image processing method is provided, including:

[0159] Step 1202: Identify the target region from the HDR image of the current scene; wherein, the target region includes the portrait region and the face region;

[0160] Step 1204: Perform global tone mapping on the HDR image to generate the initial tone mapping result of the HDR image;

[0161] Step 1206: Perform global brightening on the portrait area in the initial tone mapping result to generate the first brightening result;

[0162] Step 1208: Perform global contrast enhancement processing on the first brightening processing result to generate the global tone mapping result of the HDR image.

[0163] Step 1210: Extract the skin color region from the portrait region of the global tone mapping result of the HDR image;

[0164] Step 1212: Perform global brightening on the skin-toned areas to generate the second brightening result;

[0165] Step 1214: Perform global contrast enhancement processing on the second brightening processing result to generate the target global tone mapping result of the HDR image;

[0166] Step 1216: Perform local contrast enhancement processing on the portrait area in the target global tone mapping result of the HDR image to generate a local contrast enhancement processing result, and use the local contrast enhancement processing result as the target tone mapping result of the HDR image.

[0167] Step 1218: Obtain the face preview frame from the preview image of the current scene;

[0168] Step 1220: Perform local contrast enhancement processing on the face region corresponding to the face preview box in the target tone mapping result of the HDR image to generate the final tone mapping result of the HDR image.

[0169] In this embodiment, firstly, the target region is identified from the HDR image of the current scene. Then, when performing global tone mapping on the HDR image, global tone mapping is performed based on the target region. This allows for global tone mapping to be performed on the target region during the global tone mapping process, improving the tone mapping effect of the target region. Secondly, when performing local tone mapping on the global tone mapping result (image G) of the HDR image, local tone mapping is performed based on the target region. This allows for local tone mapping to be performed on the target region during the local tone mapping process, improving the local tone mapping effect of the target region. Ultimately, the tone mapping effect of the HDR image is improved, thus improving image quality.

[0170] When performing targeted global tone mapping on portrait areas, the brightness and contrast of the portrait areas are enhanced by improving both brightness and contrast, thereby improving the image quality of the resulting portrait areas. Similarly, when performing targeted global tone mapping on skin areas, the brightness and contrast of the skin areas are enhanced by improving both brightness and contrast, thereby improving the image quality of the resulting skin areas.

[0171] Furthermore, performing local contrast enhancement processing on the portrait region in the global tone mapping result of the HDR image (image G) not only improves the contrast of the portrait region but also better processes the details within it, thereby increasing image detail information. Similarly, using local contrast enhancement processing on the face region in the target tone mapping result (image T) not only improves the contrast of the face region but also better processes the details within it, thus increasing image detail information.

[0172] It should be understood that although the steps in the flowchart above are shown sequentially as indicated by 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 flowchart above may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.

[0173] In one embodiment, such as Figure 13 As shown, an image processing apparatus 1300 is provided, the apparatus comprising:

[0174] The target region recognition and acquisition module 1320 is used to identify the target region from the HDR image of the current scene;

[0175] The first global tone mapping module 1340 is used to perform global tone mapping on the HDR image based on the target region and generate the global tone mapping result of the HDR image.

[0176] The first local tone mapping module 1360 is used to perform local tone mapping based on the global tone mapping result of the target region of the HDR image, and generate the target tone mapping result of the HDR image.

[0177] In one embodiment, if the target area includes a human figure area, the first global tone mapping module 1340 includes:

[0178] The HDR image global tone mapping unit is used to perform global tone mapping on HDR images and generate the initial tone mapping result of the HDR image.

[0179] The global tone mapping unit for the portrait region is used to perform global tone mapping on the portrait region in the initial tone mapping result to generate the global tone mapping result of the HDR image.

[0180] In one embodiment, the portrait region global tone mapping unit is further configured to perform global brightening processing on the portrait region in the initial tone mapping result to generate a first brightening processing result; and to perform global contrast enhancement processing on the first brightening processing result to generate a global tone mapping result of the HDR image.

[0181] In one embodiment, the portrait region global tone mapping unit is further configured to obtain the maximum pixel value and global brightening parameters within the portrait region; process the pixel values ​​of each pixel within the portrait region according to the maximum pixel value and global brightening parameters to generate a first target pixel value for each pixel; and generate a first brightening processing result for the portrait region based on the first target pixel values ​​of each pixel.

[0182] In one embodiment, the global tone mapping unit for the portrait region is further configured to obtain the maximum pixel value and global contrast enhancement parameters within the portrait region from the first brightening processing result; process the pixel values ​​of each pixel within the portrait region according to the maximum pixel value and global contrast enhancement parameters to generate a second target pixel value for each pixel; generate a global contrast enhancement processing result for the portrait region based on the second target pixel value of each pixel; and generate a global tone mapping result for the HDR image based on the global contrast enhancement processing result for the portrait region.

[0183] In one embodiment, an image processing apparatus 1300 is provided, further comprising:

[0184] The second global tone mapping module is used to extract the skin color region from the portrait region of the global tone mapping result of the HDR image; perform global tone mapping on the skin color region to generate the target global tone mapping result of the HDR image.

[0185] In one embodiment, the second global tone mapping module is further configured to perform global brightening processing on the skin-colored area to generate a second brightening processing result; and to perform global contrast enhancement processing on the second brightening processing result to generate a target global tone mapping result for the HDR image.

[0186] In one embodiment, if the target area includes a human portrait area, the first local tone mapping module 1360 includes:

[0187] The portrait region local contrast enhancement unit is used to perform local contrast enhancement processing on the portrait region in the global tone mapping result of the HDR image, and generate the local contrast enhancement processing result; the local contrast enhancement processing result is used as the target tone mapping result of the HDR image.

[0188] In one embodiment, the local contrast enhancement unit for the portrait region is further configured to divide the global tone mapping result of the HDR image into blocks to generate multiple image blocks; determine the target image block corresponding to the portrait region from the multiple image blocks; and perform local contrast enhancement processing on the target image block and the first other image block corresponding to each portrait region using histogram equalization to generate a local contrast enhancement processing result; the first other image block is the image block in the global tone mapping result of the HDR image excluding the target image block corresponding to the portrait region.

[0189] In one embodiment, if the target area also includes a face area, an image processing device 1300 is provided, which further includes: a second local tone mapping module, used to obtain a face preview frame from a preview image of the current scene; to perform local contrast enhancement processing on the face area corresponding to the face preview frame in the target tone mapping result of the HDR image, and to generate the final tone mapping result of the HDR image.

[0190] In one embodiment, the second local tone mapping module is further configured to divide the target tone mapping result of the HDR image into blocks to generate multiple image blocks; determine the target image block corresponding to the face region from the multiple image blocks; and perform local contrast enhancement processing on the target image block corresponding to each face region and the second other image blocks respectively using histogram equalization to generate the final tone mapping result of the HDR image; the second other image blocks are the image blocks in the target tone mapping result of the HDR image excluding the target image block corresponding to the face region.

[0191] The division of the various modules in the above-described image processing device is merely for illustrative purposes. In other embodiments, the image processing device may be divided into different modules as needed to complete all or part of the functions of the above-described image processing device.

[0192] For specific limitations regarding the image processing apparatus, please refer to the limitations on the image processing method above, which will not be repeated here. Each module in the aforementioned image processing apparatus can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in hardware or independently of the processor in the computer device, or stored in software in the memory of the computer device, so that the processor can call and execute the operations corresponding to each module.

[0193] Figure 14 This is a schematic diagram of the internal structure of an electronic device in one embodiment. The electronic device can be any terminal device such as a mobile phone, tablet computer, laptop computer, desktop computer, PDA (Personal Digital Assistant), POS (Point of Sales), in-vehicle computer, wearable device, etc. The electronic device includes a processor and a memory connected via a system bus. The processor may include one or more processing units. The processor may be a CPU (Central Processing Unit) or a DSP (Digital Signal Processor), etc. The memory may include a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system and computer programs. The computer programs can be executed by the processor to implement an image processing method provided in the following embodiments. The internal memory provides a cached runtime environment for the operating system computer programs in the non-volatile storage medium.

[0194] The various modules in the image processing apparatus provided in this application embodiment can be implemented in the form of a computer program. This computer program can run on an electronic device. The program modules constituted by this computer program can be stored in the memory of the electronic device. When the computer program is executed by a processor, it implements the steps of the method described in the embodiments of this application.

[0195] 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.

[0196] 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.

[0197] Any references to memory, storage, databases, or other media used in this application may include non-volatile and / or volatile memory. Non-volatile memory may include ROM (Read-Only Memory), PROM (Programmable Read-Only Memory), EPROM (Erasable Programmable Read-Only Memory), EEPROM (Electrically Erasable Programmable Read-Only Memory), or flash memory. Volatile memory may include RAM (Random Access Memory), which is used as external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as SRAM (Static Random Access Memory), DRAM (Dynamic Random Access Memory), SDRAM (Synchronous Dynamic Random Access Memory), Double Data Rate DDR SDRAM (Double Data Rate Synchronous Dynamic Random Access Memory), ESDRAM (Enhanced Synchronous Dynamic Random Access Memory), SLDRAM (Sync Link Dynamic Random Access Memory), RDRAM (Rambus Dynamic Random Access Memory), and DRDRAM (Direct Rambus Dynamic Random Access Memory).

[0198] The above embodiments merely illustrate several implementation methods of this application, and while the descriptions are relatively 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 patent application should be determined by the appended claims.

Claims

1. An image processing method, characterized in that, The method includes: Identify the target region from the HDR image of the current scene; Global tone mapping is performed on the HDR image based on the target region to generate the global tone mapping result of the HDR image; Based on the global tone mapping result of the target region, local tone mapping is performed on the HDR image to generate the target tone mapping result of the HDR image; If the target region includes a human figure region, then the step of performing global tone mapping on the HDR image based on the target region to generate the global tone mapping result of the HDR image includes: Perform global tone mapping on the HDR image to generate the initial tone mapping result of the HDR image; Global tone mapping is performed on the portrait region in the initial tone mapping result to generate the global tone mapping result of the HDR image; If the target area also includes a skin color area, the skin color area is extracted from the portrait area of ​​the global tone mapping result of the HDR image; Global tone mapping is performed on the skin-colored region to generate the target global tone mapping result of the HDR image.

2. The method according to claim 1, characterized in that, The step of performing global tone mapping on the portrait region in the initial tone mapping result to generate the global tone mapping result of the HDR image includes: The portrait area in the initial tone mapping result is globally brightened to generate a first brightening result. The first brightening result is subjected to global contrast enhancement processing to generate the global tone mapping result of the HDR image.

3. The method according to claim 2, characterized in that, The step of globally brightening the portrait area in the initial tone mapping result to generate a first brightening result includes: Obtain the maximum pixel value and global brightening parameters within the portrait area; The pixel values ​​of each pixel in the portrait area are processed according to the maximum pixel value and the global brightening parameters to generate the first target pixel value of each pixel; Based on the first target pixel value of each pixel, a first brightening processing result is generated for the portrait area.

4. The method according to claim 3, characterized in that, The step of performing global contrast enhancement processing on the first brightening processing result to generate the global tone mapping result of the HDR image includes: From the first brightening process result, obtain the maximum pixel value and global contrast enhancement parameters within the portrait area; The pixel values ​​of each pixel in the portrait area are processed according to the maximum pixel value and the global contrast enhancement parameters to generate a second target pixel value for each pixel; Based on the second target pixel value of each pixel, a global contrast enhancement processing result for the portrait region is generated, and a global tone mapping result for the HDR image is generated based on the global contrast enhancement processing result for the portrait region.

5. The method according to claim 1, characterized in that, The step of performing global tone mapping on the skin-colored region to generate the target global tone mapping result of the HDR image includes: The skin-colored area is globally brightened to generate a second brightening result; The second brightening process result is subjected to global contrast enhancement processing to generate the target global tone mapping result of the HDR image.

6. The method according to any one of claims 1-5, characterized in that, If the target region includes a human figure region, the step of performing local tone mapping on the global tone mapping result of the HDR image based on the target region to generate the target tone mapping result of the HDR image includes: The portrait region in the global tone mapping result of the HDR image is subjected to local contrast enhancement processing to generate a local contrast enhancement processing result; The result of the local contrast enhancement processing is used as the target tone mapping result of the HDR image.

7. The method according to claim 6, characterized in that, The step of performing local contrast enhancement processing on the portrait region in the global tone mapping result of the HDR image to generate a local contrast enhancement processing result includes: The global tone mapping result of the HDR image is divided into blocks to generate multiple image blocks; Determine the target image block corresponding to the human figure region from the plurality of image blocks; Histogram equalization is used to perform local contrast enhancement processing on the target image block and the first other image block corresponding to each of the portrait regions, respectively, to generate local contrast enhancement processing results; the first other image block is the image block other than the target image block corresponding to the portrait region in the global tone mapping result of the HDR image.

8. The method according to claim 6, characterized in that, If the target area also includes a face region, the method further includes: Obtain the face preview frame from the preview image of the current scene; The face region corresponding to the face preview box in the target tone mapping result of the HDR image is subjected to local contrast enhancement processing to generate the final tone mapping result of the HDR image.

9. The method according to claim 8, characterized in that, The step of performing local contrast enhancement processing on the face region corresponding to the face preview box in the target tone mapping result of the HDR image to generate the final tone mapping result of the HDR image further includes: The target tone mapping result of the HDR image is divided into blocks to generate multiple image blocks; Determine the target image block corresponding to the face region from the plurality of image blocks; Histogram equalization is used to perform local contrast enhancement processing on the target image blocks corresponding to each face region and the second other image blocks respectively to generate the final tone mapping result of the HDR image; the second other image blocks are the image blocks in the target tone mapping result of the HDR image excluding the target image blocks corresponding to the face regions.

10. An image processing apparatus, characterized in that, The device includes: The target region identification and acquisition module is used to identify the target region from the HDR image of the current scene; The first global tone mapping module is used to perform global tone mapping on the HDR image based on the target region, and generate the global tone mapping result of the HDR image; The local tone mapping module is used to perform local tone mapping on the global tone mapping result of the HDR image based on the target region, and generate the target tone mapping result of the HDR image; If the target area includes a human figure area, then the first global tone mapping module includes: An HDR image global tone mapping unit is used to perform global tone mapping on the HDR image and generate an initial tone mapping result for the HDR image. A global tone mapping unit for portrait regions is used to perform global tone mapping on the portrait regions in the initial tone mapping result to generate the global tone mapping result of the HDR image; The second global tone mapping module is used to extract the skin color region from the portrait region of the global tone mapping result of the HDR image if the target region also includes a skin color region; perform global tone mapping on the skin color region to generate the target global tone mapping result of the HDR image.

11. 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 9.

12. 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 image processing method as described in any one of claims 1 to 9.

13. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the image processing method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Image processing method and device, electronic equipment and storage medium

    CN115187488A

  • Image processing method and device, electronic equipment, storage medium and product

    CN115205168A