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

By adjusting the brightness value of underexposed images and merging them again, the problem of halo phenomenon in image fusion is solved, improving image quality and user experience, and is suitable for image photography and video synthesis.

CN112651899BActive Publication Date: 2024-09-03BEIJING XIAOMI PINECONE ELECTRONICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110057189.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-01-15
Publication Date
2024-09-03
Estimated Expiration
2041-01-15

AI Technical Summary

Technical Problem

During the image fusion process, there are invalid large-amplitude gradients in multiple frames of images with different exposures, causing halo phenomena in the fused image and affecting image quality.

Method used

By determining the highlight area in the multi-frame exposure fusion image, calculating the brightness average, and adjusting the brightness value of the underexposed image to merge it with the fusion image again, thereby reducing the halo phenomenon.

Benefits of technology

It effectively reduces the halo phenomenon in the fused image, improves the display effect of the image, is suitable for the fields of image photography and video synthesis, and improves the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112651899B
    Figure CN112651899B
Patent Text Reader

Abstract

The present disclosure is about an image processing method and device, an electronic device, and a storage medium, the method comprising: determining a first highlight area in a first image of multiple exposure frames fused, calculating a first brightness mean of the first highlight area; adjusting the brightness of the underexposed image in the multiple exposure frames fused into the first image to the first brightness mean, generating a second image; determining a weight map of the first image based on the first brightness mean, performing brightness fusion of the second image with the first image based on the weight map of the first image, generating a third image; superimposing color channel information on the third image, and outputting it. The present disclosure realizes the image effect when shooting an image, and is more suitable for the fields of image photography and video synthesis, thereby improving the display effect of the image or video and improving the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to image transformation technology, and in particular to an image processing method and device, electronic equipment, and storage medium. Background Art

[0002] At present, in order to improve the brightness of the captured image, multiple images with different exposures are generally obtained, and the multiple frames of images with different exposures are fused according to the corresponding weights to generate a fused image with better dynamic range, color, noise, details, etc., thereby improving the quality of the captured image and improving the user experience. However, due to the presence of some invalid and large gradients in the multi-frame exposure input images, the fused image will produce a halo phenomenon. Summary of the invention

[0003] The present disclosure provides an image processing method and device, an electronic device, and a storage medium.

[0004] According to a first aspect of an embodiment of the present disclosure, there is provided an image processing method, including:

[0005] Determine a first highlight area in a first image of multiple exposure frames, and calculate a first brightness average of the first highlight area; wherein the first image has a halo phenomenon;

[0006] adjusting the brightness of underexposed images in the multiple frames of exposed images fused into the first image to the first brightness average value to generate a second image;

[0007] determining a weight map of the first image based on the first brightness mean value, and performing brightness fusion of the second image and the first image based on the weight map of the first image to generate a third image;

[0008] Color channel information is superimposed on the third image and the third image is output.

[0009] Preferably, the step of adjusting the brightness of the underexposed images in the multiple frames of exposed images fused into the first image to the first brightness average value to generate the second image includes:

[0010] Determine a second highlight area in the underexposed image, and calculate a second average brightness value of the second highlight area, and a difference between the first average brightness value and the second average brightness value;

[0011] The brightness of the underexposed image is added to the difference value to obtain a brightness value of the second image.

[0012] Preferably, determining a weight map of the first image based on the first brightness mean value includes:

[0013] Determine a weight map of the second image according to the first brightness mean value and brightness values ​​of pixels of the second image;

[0014] The weight map of the first image is determined according to the weight map of the second image.

[0015] Preferably, determining the weight map of the second image according to the first brightness mean value and the brightness values ​​of the pixels of the second image includes: when the second brightness value of the pixels of the second image is greater than or equal to the first brightness mean value, the weight of the second brightness value of the pixels is 1; when the second brightness value is less than the first brightness mean value, calculating the ratio of the square of the difference between the second brightness value of the pixels and the first brightness mean value to a set constant, and setting the weight of the second brightness value of the pixels to the exponent of the inverse of the ratio with e as the base; wherein the weights of the second brightness values ​​of all pixels of the second image constitute the weight map of the second image;

[0016] Determining the weight map of the first image according to the weight map of the second image includes:

[0017] The weight of the first brightness value of the specified pixel point in the first image weight map is 1 minus the weight of the second brightness value corresponding to the specified pixel value in the second image weight map.

[0018] Preferably, the step of performing brightness fusion of the second image and the first image based on the weight map of the first image to generate a third image comprises:

[0019] The first image and the second image are weighted according to the weight map of the first image and the weight value of the second image to obtain the third image.

[0020] Preferably, the determining of the first highlight area in the first image of the multi-frame exposure fusion includes:

[0021] Determine the brightness weight value of the pixel points of the underexposed image, determine the area formed by the pixel points in the underexposed image whose brightness weight value is greater than a set threshold as the second highlight area, and determine the area in the first image corresponding to the second highlight area as the first highlight area.

[0022] Preferably, before determining the brightness weight value of the pixel point of the underexposed image, the method further includes:

[0023] The underexposed image is subjected to resolution reduction processing.

[0024] According to a second aspect of an embodiment of the present disclosure, there is provided an image processing apparatus, including:

[0025] A determination unit, configured to determine a first highlight area in a first image obtained by fusion of multiple exposure frames; wherein the first image has a halo phenomenon;

[0026] A calculation unit, configured to calculate a first brightness average of the first highlight area;

[0027] A first generating unit, configured to adjust the brightness of an underexposed image in a plurality of frames of exposed images fused into the first image to the first brightness average value, so as to generate a second image;

[0028] a second generating unit, configured to determine a weight map of the first image based on the first brightness mean value, and perform brightness fusion of the second image and the first image based on the weight map of the first image to generate a third image;

[0029] An output unit is used to superimpose color channel information on the third image and output it.

[0030] Preferably, the first generating unit is further used for:

[0031] Determine a second highlight area in the underexposed image, and calculate a second average brightness value of the second highlight area, and a difference between the first average brightness value and the second average brightness value;

[0032] The brightness of the underexposed image is added to the difference value to obtain a brightness value of the second image.

[0033] Preferably, the second generating unit is further used for:

[0034] Determine a weight map of the second image according to the first brightness mean value and brightness values ​​of pixels of the second image;

[0035] The weight map of the first image is determined according to the weight map of the second image.

[0036] Preferably, the second generating unit is further used for:

[0037] When the second brightness value of a pixel of the second image is greater than or equal to the first brightness mean, the weight of the second brightness value of the pixel is 1; when the second brightness value is less than the first brightness mean, the ratio of the square of the difference between the second brightness value of the pixel and the first brightness mean to a set constant is calculated, and the weight of the second brightness value of the pixel is set to the exponent of the inverse of the ratio with e as the base; wherein the weights of the second brightness values ​​of all pixels of the second image constitute a weight map of the second image;

[0038] Determining the weight map of the first image according to the weight map of the second image includes:

[0039] The weight of the first brightness value of the specified pixel point in the first image weight map is 1 minus the weight of the second brightness value corresponding to the specified pixel value in the second image weight map.

[0040] Preferably, the second generating unit is further used for:

[0041] The first image and the second image are weighted according to the weight map of the first image and the weight value of the second image to obtain the third image.

[0042] Preferably, the determining unit is further used for:

[0043] Determine the brightness weight value of the pixel points of the underexposed image, determine the area formed by the pixel points in the underexposed image whose brightness weight value is greater than a set threshold as the second highlight area, and determine the area in the first image corresponding to the second highlight area as the first highlight area.

[0044] Preferably, the device further comprises:

[0045] The resolution reduction unit is used to reduce the resolution of the underexposed image before determining the brightness weight value of the pixel point of the underexposed image.

[0046] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device, comprising: a processor and a memory for storing processor executable instructions, wherein the processor is configured to execute the steps of the above-mentioned image processing method when calling the executable instructions in the memory.

[0047] According to a fourth aspect of an embodiment of the present disclosure, a non-temporary computer-readable storage medium is provided. When instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the steps of the above-mentioned image processing method.

[0048] The technical solution provided by the embodiments of the present disclosure may have the following beneficial effects:

[0049] In the embodiment of the present disclosure, by determining the highlight area in the underexposed image when the image is fused, adjusting the brightness value of the underexposed image, and then using the underexposed image after the brightness value is adjusted to fuse with the fused image again, the halo phenomenon of the fused image is greatly reduced, and the display effect of the fused image is further improved. The embodiment of the present disclosure achieves the image effect when shooting an image, and is more suitable for the field of image photography and video synthesis, thereby improving the display effect of the image or video and improving the user experience.

[0050] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0052] Figure 1 A schematic diagram of an image processing method flow chart shown in an embodiment of the present disclosure;

[0053] Figure 2 A schematic diagram of an image processing method flow chart shown in an embodiment of the present disclosure;

[0054] Figure 3 A schematic diagram of the synthesis of two frames of images;

[0055] Figure 4 A schematic diagram of the structure of an image processing device according to an embodiment of the present disclosure;

[0056] Figure 5 A block diagram of an electronic device according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0057] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and apparatuses consistent with some aspects of the present disclosure as detailed in the appended claims.

[0058] Figure 1 FIG. 1 is a flow chart of an image processing method according to an embodiment of the present disclosure. Figure 1 As shown, the image processing method of the embodiment of the present disclosure includes the following steps:

[0059] S11, determining a first highlight area in a first image obtained by fusing multiple exposure frames, and calculating a first brightness average of the first highlight area.

[0060] Wherein, the first image has a halo phenomenon.

[0061] In the embodiment of the present disclosure, the first image of multi-frame exposure fusion refers to an image that is fused through two or more images with different exposures. The different exposure images may include under-exposed images and may also include over-exposed images. According to the weight values ​​of the brightness of the different exposure images, multiple frame images are fused to generate a fused image.

[0062] In the embodiment of the present disclosure, the image fusion is performed by Laplacian pyramid layer method. There may be more than two images to be fused. First, multiple frames of images are decomposed by Laplacian pyramid layer respectively. The specific method is:

[0063] Constructing a brightness Laplacian pyramid layer for each image in the multiple exposure images. Here, constructing the Laplacian pyramid layer of the image includes:

[0064] Each of the images is downsampled to obtain a Gaussian pyramid layer of each image; specifically, firstly, a Gaussian blur process is performed on the image of the next layer of each image in the multiple exposure images, and then the even rows and columns of the image after Gaussian blur are deleted to obtain a Gaussian pyramid layer of the current layer. The aforementioned Gaussian pyramid layer process is performed on each of the images in sequence for a set number of times, so as to obtain a Gaussian pyramid layer of a set number of layers of each image. For example, according to the accuracy requirements of image processing, any image can be processed with a Gaussian pyramid layer, such as an image can be processed into a Gaussian pyramid layer of 8 layers, 4 layers, 16 layers, etc.

[0065] The current Laplacian pyramid layer of each image is obtained by:

[0066] The Gaussian pyramid layer of the previous layer of the current layer of each image is upsampled to obtain an upsampled layer, and the upsampled layer is Gaussian blurred to obtain a first Gaussian pyramid layer; the current Gaussian pyramid layer of each image is subtracted from the first Gaussian pyramid layer to obtain a current Laplacian pyramid layer; the Laplacian pyramid layers obtained layer by layer are combined to form a Laplacian pyramid corresponding to each image. In other words, the Laplacian pyramid layer is composed of a series of images obtained by subtracting the source image from the image that is first reduced and then enlarged, i.e., the upsampled image. The upsampled processing here includes: mapping the pixel at position (x, y) in the image to be upsampled to the position (2x+1, 2y+1) of the target image, and filling the area in the target image where no pixel is mapped with 0, i.e., upsampling the image to be processed.

[0067] In the embodiment of the present disclosure, after determining the Laplacian pyramid layer for each image in the multiple image frames, a weight is determined for each layer in the Laplacian pyramid layer. These weights constitute a weight pyramid. Obtaining the weight pyramid corresponding to each image in the multiple image frames specifically includes:

[0068] The original weight map corresponding to each image in the multiple frames of images is obtained, and the original weight map of each image is downsampled to obtain the weight map of the second layer of each image; the weight map of the second layer of each image is downsampled again to obtain the weight map of the third layer of each image, until a weight map corresponding to each layer of the Laplacian pyramid of each image is obtained.

[0069] In the disclosed embodiment, fusion weights are also constructed for the Laplacian pyramid layers in the multiple exposure images. When image fusion is performed, fusion is performed layer by layer according to the fusion weights, and then the images fused layer by layer are fused, that is, the Laplacian pyramid layers are multiplied by the weights of their corresponding layers and then superimposed to generate a fused image.

[0070] In the disclosed embodiment, determining a first highlight area in a first image of multiple exposure fusion frames includes: determining an underexposed image fused into the first image, the brightness value of highlight areas such as the sky in the underexposed image being relatively high, and the highlight area needs to be processed accordingly to avoid a halo phenomenon in the fused image; after determining the underexposed image, determining a brightness weight value of pixels when the underexposed image is fused into the first image, determining an area formed by pixels whose brightness weight values ​​of the pixels of the underexposed image are greater than a set threshold as the second highlight area, and determining an area in the first image corresponding to the second highlight area as the first highlight area.

[0071] In the embodiment of the present disclosure, when determining the second highlight area or the first highlight area, it is not necessary to determine the area of ​​the entire high-pixel image. The image to be processed, such as the aforementioned underexposed image, can be subjected to pixel reduction processing to reduce the resolution of the underexposed image to one-tenth, one-twentieth, or one-hundredth of the original, or the resolution can be reduced to 1 / 4, 1 / 8, 1 / 16, 1 / 32, 1 / 64, 1 / 128, 1 / 512, 1 / 1024, etc., of the original. Taking reducing the resolution to 1 / 4 as an example, one of the original four adjacent pixels in the image can be randomly selected to form a low-resolution image, or the even-numbered pixel rows and even-numbered pixel columns in the image can be removed. In this way, after reducing the resolution, the range of the aforementioned highlight area can still be determined. Although the accuracy is slightly worse, the amount of calculation will be greatly reduced, thereby improving the efficiency of determining the highlight area in the embodiment of the present disclosure.

[0072] After the first highlight region is determined, the brightness average value of the first highlight region, that is, the first brightness average value, is calculated. Here, the arithmetic average value, weighted average value, etc. of the brightness values ​​of all pixels in the first highlight region can be used as the first brightness average value.

[0073] S12: Adjust the brightness of the underexposed images in the multiple frames of exposed images fused into the first image to the first brightness average value, so as to generate a second image.

[0074] In the embodiment of the present disclosure, after the average brightness value of the first highlight area is determined, the brightness of the underexposed image is adjusted to the first brightness average value. In the embodiment of the present disclosure, when the brightness of the underexposed image is adjusted, it is necessary to ensure that the gradient information of the underexposed image after the brightness adjustment remains unchanged. Therefore, in the embodiment of the present disclosure, the brightness of the underexposed image in the multiple frames of exposure images fused into the first image is adjusted to the first brightness average value, including:

[0075] The second highlight area in the underexposed image is determined, that is, the area formed by the pixels whose weight values ​​in the aforementioned pixels exceed the set threshold, and the second brightness mean of the second highlight area is also calculated, and the difference between the first brightness mean and the second brightness mean is calculated; the brightness of the underexposed image is directly added to the difference to be used as the brightness value of the second image. In this way, not only the brightness of the underexposed image is adjusted, but also its gradient information is guaranteed.

[0076] S13. Determine a weight map of the first image based on the first brightness mean value, and perform brightness fusion on the second image and the first image based on the weight map of the first image to generate a third image.

[0077] In the embodiment of the present disclosure, determining the weight map of the first image based on the first brightness mean value includes:

[0078] Determine a weight map of the second image according to the first brightness mean value and brightness values ​​of pixels of the second image;

[0079] The weight map of the first image is determined according to the weight map of the second image.

[0080] Determining the weight map of the second image according to the first brightness mean value and the brightness values ​​of the pixels of the second image includes: when the second brightness value of the pixels of the second image is greater than or equal to the first brightness mean value, the weight of the second brightness value of the pixels is 1; when the second brightness value is less than the first brightness mean value, calculating the ratio of the square of the difference between the second brightness value of the pixels and the first brightness mean value to a set constant, and setting the weight of the second brightness value of the pixels to the exponent of the inverse of the ratio with e as the base; wherein the weights of the second brightness values ​​of all pixels of the second image constitute the weight map of the second image;

[0081] Determining the weight map of the first image according to the weight map of the second image includes:

[0082] The weight of the first brightness value of the specified pixel point in the first image weight map is 1 minus the weight of the second brightness value corresponding to the specified pixel value in the second image weight map.

[0083] Correspondingly, the brightness fusion of the second image and the first image based on the weight map of the first image to generate a third image includes: weighting the first image and the second image according to the weight map of the first image and the weight value of the second image to obtain the third image.

[0084] S14. Superimpose color channel information on the third image and output it.

[0085] In the embodiment of the present disclosure, after the third image after the fusion of the first image and the second image is superimposed with the corresponding color channel information such as UV value, an RGB image is generated, output and displayed. The technical solution of the embodiment of the present disclosure can be applied to scenes such as image shooting or video shooting.

[0086] The essence of the technical solution of the embodiment of the present disclosure is further explained below through specific examples.

[0087] Figure 2 FIG. 1 is a flow chart of an image processing method according to an embodiment of the present disclosure. Figure 2 As shown, in this example, three frames of input images are used for image fusion, and the three frames are respectively an underexposed image ev-, a normally exposed image ev0, and an overexposed image ev+. It should be noted that the present disclosure only uses three frames of images as an example to explain the principle. When the number of input frames is ≥ 2 frames, the same logic can be applied for image fusion processing. Among them, ev represents the exposure value of the image, which is related to the aperture value and shutter speed of the lens. The image processing method of the embodiment of the present disclosure includes the following processing steps:

[0088] Step 1. Input image frame: ev-, ev0, ev+. The corresponding brightness map of the input image frame is y0, y1, y2. In the embodiment of the present disclosure, only the brightness information Y of the image is considered, and the UV channel color information is not considered.

[0089] Step 2. Construct the Laplacian pyramid pyrY0, pyrY1, pyrY2 of the brightness Y of the image, calculate the original weights W0, W1, W2 of the three frames of input images according to the weight curve, and construct the weight pyramid pyrW0, pyrW1, pyrW2 based on the weight curve. For the specific construction method, please refer to the relevant description of the above embodiment.

[0090] Figure 3 It is a schematic diagram of the synthesis of two frames of images, such as Figure 3As shown in the figure, the leftmost part of the figure is the input original image. The image to be processed is decomposed by Laplacian pyramid (see the white box and its outer area in the second picture on the left of the figure). Correspondingly, a Gaussian pyramid corresponding to the weight map is constructed (see the white box and its outer area in the third picture on the left of the figure). Then, the weight pyramid is fused with the Laplacian pyramid to obtain the result image. In this example, the processing method of the three frames of images is the same as Figure 3 The processing methods of the two frames of images shown are exactly the same. The image fusion here is to multiply the brightness values ​​of the pixels in the two frames of images by their corresponding weight values ​​and then superimpose them to generate a fused image.

[0091] Step 3. According to the decomposed pyramid, the three frames of image information are fused layer by layer to obtain the fused pyramid image, and then the synthesized image is restored by upsampling layer by layer and superimposing the Laplace information. At this time, the synthesized image may have a halo phenomenon, which is recorded as Y_halo;

[0092] Step 4. In general, the resolution of the original image is as high as 12 to 27M pixels. When obtaining a highlight area such as the sky at a low resolution, the recognition speed is faster. Therefore, in the embodiment of the present disclosure, the high-resolution image to be processed can be reduced in pixels, such as the pixels can be reduced to 1 / 4, 1 / 8, 1 / 16, 1 / 32, 1 / 64, 1 / 128, 1 / 512, 1 / 1024, etc., to facilitate the rapid recognition of the highlight area of ​​the image, which is specifically set according to the processing accuracy and efficiency of the image. The following operations of the embodiment of the present disclosure can be performed on a low-resolution image. According to the pyramid fusion principle, the effective information of the highlight area such as the sky area usually comes from ev-, that is, the weight of the sky area of ​​ev- is very large. By setting a threshold threshold, the area in ev- with a weight value greater than the threshold threshold is determined as a highlight area Ω such as the sky area. In this step, that is, when determining to fuse into an image, the weight value determined for each pixel in ev-, which exceeds the threshold, is determined as a highlight pixel point, and the area composed of the determined highlight pixels is the highlight area Ω.

[0093] Step 5. ev- is consistent with the sky area of ​​the composite image Y_halo, and the brightness mean values ​​mean_y0 and mean_halo of ev- and Y_halo in the highlight area Ω are counted, and the difference in brightness mean values ​​mean_diff = mean_halo – mean_y0 is calculated; the brightness mean value here can be the arithmetic mean, weighted mean, etc.

[0094] Step 6. Adjust the sky brightness mean of ev- to be consistent with the brightness mean of the Y_halo highlight area, and ensure that the gradient information of ev- remains unchanged after brightening. The brightened ev- is recorded as y_lighten=y0+mean_diff;

[0095] Step 7. Construct a weighted Gaussian curve with mean_halo as the mean, y_lut(x) = exp(-(x-mean_halo)×(x-mean_halo) / sigma), x is the current pixel brightness value of the image synthesized with Y_halo, such as ev- after brightening in this example; sigma is an empirical value, which can be set to 2×36×36; exp() represents exponential operation with constant e as the base;

[0096] Step 8. Fuse y_lighten and Y_halo, and calculate the corresponding weight value according to the brightness value at the same pixel coordinate in the image to be fused:

[0097]

[0098] W3=1–W4

[0099] Among them, index is the pixel coordinate, W4 is the brightness value weight of the pixel in y_lighten, and W3 is the brightness value weight of the pixel at the same coordinate position as y_lighten in Y_halo.

[0100] According to the above weights, two frames are fused to obtain the fused image Y_dehalo, which is:

[0101] Y_dehalo=Y_halo×w3+y_lighten×w4,Y_halo[index]>y_lighten[index]

[0102] Step 9. Output the halo-removed image Y_dehalo and superimpose the color channel information to display a normal RGB image.

[0103] The embodiment of the present disclosure determines the highlight area in the underexposed image when fusing the image, adjusts the brightness value of the underexposed image, and then fuses the underexposed image with the fused image again using the adjusted brightness value, thereby greatly reducing the halo phenomenon of the fused image and further improving the display effect of the fused image. The embodiment of the present disclosure achieves the image effect when shooting an image, and is more suitable for the fields of image photography and video synthesis, thereby improving the display effect of the image or video and improving the user experience.

[0104] Figure 4FIG. 1 is a schematic diagram of the structure of an image processing device according to an embodiment of the present disclosure. Figure 4 As shown, the image processing device of the embodiment of the present disclosure includes:

[0105] A determination unit 40 is used to determine a first highlight area in a first image obtained by fusion of multiple exposure frames; wherein the first image has a halo phenomenon;

[0106] A calculation unit 41, configured to calculate a first brightness average of the first highlight area;

[0107] A first generating unit 42 is used to adjust the brightness of the underexposed images in the multiple frames of exposed images fused into the first image to the first brightness average value, so as to generate a second image;

[0108] a second generating unit 43, configured to determine a weight map of the first image based on the first brightness mean value, and perform brightness fusion of the second image and the first image based on the weight map of the first image to generate a third image;

[0109] The output unit 44 is used to superimpose color channel information on the third image and output it.

[0110] As an implementation manner, the first generating unit 42 is further configured to:

[0111] Determine a second highlight area in the underexposed image, and calculate a second average brightness value of the second highlight area, and a difference between the first average brightness value and the second average brightness value;

[0112] The brightness of the underexposed image is added to the difference value to obtain a brightness value of the second image.

[0113] As an implementation manner, the second generating unit 43 is further configured to:

[0114] Determine a weight map of the second image according to the first brightness mean value and brightness values ​​of pixels of the second image;

[0115] The weight map of the first image is determined according to the weight map of the second image.

[0116] As an implementation manner, the second generating unit 43 is further configured to:

[0117] When the second brightness value of a pixel of the second image is greater than or equal to the first brightness mean, the weight of the second brightness value of the pixel is 1; when the second brightness value is less than the first brightness mean, the ratio of the square of the difference between the second brightness value of the pixel and the first brightness mean to a set constant is calculated, and the weight of the second brightness value of the pixel is set to the exponent of the inverse of the ratio with e as the base; wherein the weights of the second brightness values ​​of all pixels of the second image constitute a weight map of the second image;

[0118] Determining the weight map of the first image according to the weight map of the second image includes:

[0119] The weight of the first brightness value of the specified pixel point in the first image weight map is 1 minus the weight of the second brightness value corresponding to the specified pixel value in the second image weight map.

[0120] As an implementation manner, the second generating unit 43 is further configured to:

[0121] The first image and the second image are weighted according to the weight map of the first image and the weight value of the second image to obtain the third image.

[0122] As an implementation manner, the determining unit 40 is further configured to:

[0123] Determine the brightness weight value of the pixel points of the underexposed image, determine the area formed by the pixel points in the underexposed image whose brightness weight value is greater than a set threshold as the second highlight area, and determine the area in the first image corresponding to the second highlight area as the first highlight area.

[0124] As a way to achieve this, Figure 4 Based on the image processing device shown in the figure, the image processing device of the embodiment of the present disclosure further includes:

[0125] Downscaling Unit ( Figure 4 ), which is used to reduce the resolution of the underexposed image.

[0126] In an exemplary embodiment, the determination unit 40, the calculation unit 41, the first generation unit 42, the second generation unit 43 and the output unit 44 can be implemented by one or more central processing units (CPU), graphics processing units (GPU), baseband processors (BP), application-specific integrated circuits (ASIC), digital signal processors (DSP), programmable logic devices (PLD), complex programmable logic devices (CPLD), field programmable gate arrays (FPGA), general-purpose processors, controllers, microcontrollers (MCU), microprocessors, or other electronic components to execute the aforementioned image processing method.

[0127] Regarding the image processing device in the above embodiment, the specific manner in which each module and unit performs operations has been described in detail in the embodiment of the device, and will not be elaborated here.

[0128] Figure 5 is a block diagram of an electronic device 800 according to an exemplary embodiment. Figure 5 As shown, the electronic device 800 supports multi-screen output, and the electronic device 800 may include one or more of the following components: a processing component 802, a memory 804, a power component 806, a multimedia component 808, an audio component 810, an input / output (I / O) interface 812, a sensor component 814, and a communication component 816.

[0129] The processing component 802 generally controls the overall operation of the electronic device 800, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 802 may include one or more modules to facilitate the interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.

[0130] The memory 804 is configured to store various types of data to support operations on the device 800. Examples of such data include instructions for any application or method operating on the electronic device 800, contact data, phone book data, messages, images, videos, etc. The memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0131] The power component 806 provides power to the various components of the electronic device 800. The power component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the electronic device 800.

[0132] The multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front camera and / or a rear camera. When the device 800 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and the rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

[0133] The audio component 810 is configured to output and / or input audio signals. For example, the audio component 810 includes a microphone (MIC), and when the electronic device 800 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 804 or sent via the communication component 816. In some embodiments, the audio component 810 also includes a speaker for outputting audio signals.

[0134] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.

[0135] The sensor assembly 814 includes one or more sensors for providing various aspects of status assessment for the electronic device 800. For example, the sensor assembly 814 can detect the open / closed state of the device 800, the relative positioning of components, such as the display and keypad of the electronic device 800, and the sensor assembly 814 can also detect the position change of the electronic device 800 or a component of the electronic device 800, the presence or absence of contact between the user and the electronic device 800, the orientation or acceleration / deceleration of the electronic device 800, and the temperature change of the electronic device 800. The sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 814 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0136] The communication component 816 is configured to facilitate wired or wireless communication between the electronic device 800 and other devices. The electronic device 800 can access a wireless network based on a communication standard, such as Wi-Fi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0137] In an exemplary embodiment, the electronic device 800 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to perform the image processing steps of the above-described embodiments.

[0138] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 804 including instructions, and the instructions can be executed by a processor 820 of an electronic device 800 to complete the steps of the image processing method of the above embodiment. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0139] The embodiment of the present disclosure also records a non-transitory computer-readable storage medium. When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the image processing method of the aforementioned embodiment. The method includes:

[0140] Determine a first highlight area in a first image of multiple exposure frames, and calculate a first brightness average of the first highlight area; wherein the first image has a halo phenomenon;

[0141] adjusting the brightness of underexposed images in the multiple frames of exposed images fused into the first image to the first brightness average value to generate a second image;

[0142] determining a weight map of the first image based on the first brightness mean value, and performing brightness fusion of the second image and the first image based on the weight map of the first image to generate a third image;

[0143] Color channel information is superimposed on the third image and the third image is output.

[0144] Preferably, the step of adjusting the brightness of the underexposed images in the multiple frames of exposed images fused into the first image to the first brightness average value to generate the second image includes:

[0145] Determine a second highlight area in the underexposed image, and calculate a second average brightness value of the second highlight area, and a difference between the first average brightness value and the second average brightness value;

[0146] The brightness of the underexposed image is added to the difference value to obtain a brightness value of the second image.

[0147] Preferably, determining a weight map of the first image based on the first brightness mean value includes:

[0148] Determine a weight map of the second image according to the first brightness mean value and brightness values ​​of pixels of the second image;

[0149] The weight map of the first image is determined according to the weight map of the second image.

[0150] Preferably, determining the weight map of the second image according to the first brightness mean value and the brightness values ​​of the pixels of the second image includes: when the second brightness value of the pixels of the second image is greater than or equal to the first brightness mean value, the weight of the second brightness value of the pixels is 1; when the second brightness value is less than the first brightness mean value, calculating the ratio of the square of the difference between the second brightness value of the pixels and the first brightness mean value to a set constant, and setting the weight of the second brightness value of the pixels to the exponent of the inverse of the ratio with e as the base; wherein the weights of the second brightness values ​​of all pixels of the second image constitute the weight map of the second image;

[0151] Determining the weight map of the first image according to the weight map of the second image includes:

[0152] The weight of the first brightness value of the specified pixel point in the first image weight map is 1 minus the weight of the second brightness value corresponding to the specified pixel value in the second image weight map.

[0153] Preferably, the step of performing brightness fusion of the second image and the first image based on the weight map of the first image to generate a third image comprises:

[0154] The first image and the second image are weighted according to the weight map of the first image and the weight value of the second image to obtain the third image.

[0155] Preferably, the determining of the first highlight area in the first image of the multi-frame exposure fusion includes:

[0156] Determine the brightness weight value of the pixel points of the underexposed image, determine the area formed by the pixel points in the underexposed image whose brightness weight value is greater than a set threshold as the second highlight area, and determine the area in the first image corresponding to the second highlight area as the first highlight area.

[0157] Preferably, before determining the brightness weight value of the pixel point of the underexposed image, the method further includes:

[0158] The underexposed image is subjected to resolution reduction processing.

[0159] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0160] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. An image processing method, characterized in that: The method comprises: Determine a first highlight area in a first image of multiple exposure frames, and calculate a first brightness average of the first highlight area; wherein the first image has a halo phenomenon; Adjusting the brightness of the underexposed image in the multiple frames of exposure images fused into the first image to the first brightness average value to generate a second image; wherein the gradient information of the second image is consistent with the gradient information of the underexposed image before the brightness adjustment; When the second brightness value of a pixel of the second image is greater than or equal to the first brightness mean, the weight of the second brightness value of the pixel is 1; when the second brightness value is less than the first brightness mean, the ratio of the square of the difference between the second brightness value of the pixel and the first brightness mean to a set constant is calculated, and the weight of the second brightness value of the pixel is set to the exponent of the inverse of the ratio with e as the base; wherein the weights of the second brightness values ​​of all pixels of the second image constitute a weight map of the second image; the weight of the first brightness value of a specified pixel in the weight map of the first image is 1 minus the weight of the second brightness value corresponding to the pixel value of the specified pixel in the weight map of the second image; Performing brightness fusion of the second image and the first image based on the weight map of the first image to generate a third image; Color channel information is superimposed on the third image and the third image is output.

2. The method according to claim 1, characterized in that The step of adjusting the brightness of the underexposed image in the multiple frames of exposed images fused into the first image to the first brightness average value to generate the second image includes: Determine a second highlight area in the underexposed image, and calculate a second average brightness value of the second highlight area, and a difference between the first average brightness value and the second average brightness value; The brightness of the underexposed image is added to the difference value to obtain a brightness value of the second image.

3. The method according to claim 1, characterized in that The step of performing brightness fusion of the second image and the first image based on the weight map of the first image to generate a third image includes: The first image and the second image are weighted according to the weight map of the first image and the weight map of the second image to obtain the third image.

4. The method according to claim 2, characterized in that: The determining of a first highlight area in a first image of multiple exposure fusion frames includes: Determine the brightness weight value of the pixel points of the underexposed image, determine the area formed by the pixel points in the underexposed image whose brightness weight value is greater than a set threshold as the second highlight area, and determine the area in the first image corresponding to the second highlight area as the first highlight area.

5. The method according to claim 4, characterized in that Before determining the brightness weight value of the pixel point of the underexposed image, the method further includes: The underexposed image is subjected to resolution reduction processing.

6. An image processing device, characterized in that: The device comprises: A determination unit, configured to determine a first highlight area in a first image obtained by fusion of multiple exposure frames; wherein the first image has a halo phenomenon; A calculation unit, configured to calculate a first brightness average of the first highlight area; A first generating unit is used to adjust the brightness of the underexposed image in the multiple exposure images fused into the first image to the first brightness mean value, so as to generate a second image; wherein the gradient information of the second image is consistent with the gradient information of the underexposed image before the brightness adjustment; a second generating unit is used to, when the second brightness value of the pixel point of the second image is greater than or equal to the first brightness mean value, the weight of the second brightness value of the pixel point is 1; when the second brightness value is less than the first brightness mean value, calculate the ratio of the square of the difference between the second brightness value of the pixel point and the first brightness mean value to a set constant, and set the weight of the second brightness value of the pixel point to the exponent of the opposite number of the ratio with e as the base; wherein the weights of the second brightness values ​​of all the pixels of the second image constitute a weight map of the second image; the weight of the first brightness value of a specified pixel point in the weight map of the first image is 1 minus the weight of the second brightness value corresponding to the pixel value of the specified pixel point in the weight map of the second image; Performing brightness fusion of the second image and the first image based on the weight map of the first image to generate a third image; An output unit is used to superimpose color channel information on the third image and output it.

7. The device according to claim 6, characterized in that The first generating unit is further configured to: Determine a second highlight area in the underexposed image, and calculate a second average brightness value of the second highlight area, and a difference between the first average brightness value and the second average brightness value; The brightness of the underexposed image is added to the difference value to obtain a brightness value of the second image.

8. The device according to claim 6, characterized in that The second generating unit is further used for: The first image and the second image are weighted according to the weight map of the first image and the weight map of the second image to obtain the third image.

9. The device according to claim 7, characterized in that The determining unit is further configured to: Determine the brightness weight value of the pixel points of the underexposed image, determine the area formed by the pixel points in the underexposed image whose brightness weight value is greater than a set threshold as the second highlight area, and determine the area in the first image corresponding to the second highlight area as the first highlight area.

10. The device according to claim 9, characterized in that The device also includes: The resolution reduction unit is used to reduce the resolution of the underexposed image before determining the brightness weight value of the pixel point of the underexposed image.

11. An electronic device, characterized in that: The electronic device comprises: a processor and a memory for storing processor executable instructions, wherein the processor is configured to execute the steps of the image processing method according to any one of claims 1 to 5 when calling the executable instructions in the memory.

12. A non-transitory computer-readable storage medium, characterized in that: When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the steps of the image processing method as claimed in any one of claims 1 to 5.