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

By denoising the multi-frame preview image and fusing it with the current captured image, combined with the multi-frame denoising algorithm, the clarity of the HDR image is improved, and the problem of low image clarity of the traditional HDR algorithm is solved.

CN113781358BActive Publication Date: 2024-11-05GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202111127626.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-26
Publication Date
2024-11-05
Estimated Expiration
2041-09-26

AI Technical Summary

Technical Problem

When synthesising HDR images, the traditional HDR algorithm has low clarity, resulting in more noise in the generated image and cannot be effectively improved.

Method used

By acquiring the multi-frame preview image and the currently captured image, the preview image is denoised using the multi-frame denoising algorithm, and the denoised preview image is fused with the currently captured image to generate an HDR image, combining the multi-frame denoising algorithm to Improve image clarity.

Benefits of technology

While not delaying the user's waiting time, the sharpness of the generated HDR images is significantly improved, solving the problem of low image clarity of traditional HDR algorithms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113781358B_ABST
    Figure CN113781358B_ABST
Patent Text Reader

Abstract

The present application relates to an image processing method and device, an electronic device, and a computer-readable storage medium, which obtain multiple frames of preview images and at least one frame of currently captured image, wherein the exposure of the multiple frames of preview images is different from that of the currently captured image. The multiple frames of preview images are denoised to generate at least one frame of denoised preview image. The at least one frame of denoised preview image and the at least one frame of currently captured image are fused to generate an HDR image. Because the denoised preview image is obtained by processing with a multi-frame denoising algorithm, the multi-frame denoising algorithm is combined with the HDR algorithm in the process of fusion based on the denoised preview image and the currently captured image. Since the multi-frame denoising algorithm can improve the clarity of the image well, the clarity of the ultimately generated HDR image is also improved without delaying the user's waiting time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to image processing, and in particular to an image processing method, device, electronic device and computer-readable storage medium. Background Art

[0002] With the development of electronic devices, more and more users use electronic devices to take pictures. Among them, the HDR algorithm is one of the essential technologies for electronic devices to take pictures, and HDR images can be synthesized through the HDR algorithm.

[0003] HDR images are also called high-dynamic range images (HDR for short). Compared with ordinary images, HDR images can provide more dynamic range and image details. When HDR images can be synthesized through HDR algorithms, multiple frames of images are first obtained at different exposure levels, and then the HDR images are synthesized based on the multiple frames.

[0004] However, due to the traditional HDR algorithm, there is a problem that the synthesized HDR image has low clarity. Summary of the invention

[0005] The embodiments of the present application provide an image processing method, an apparatus, an electronic device, and a computer-readable storage medium, which can improve the clarity of a synthesized HDR image.

[0006] In one aspect, an image processing method is provided, comprising:

[0007] Acquire multiple preview image frames and at least one currently captured image frame, wherein the exposure amounts of the multiple preview image frames are different from the exposure amount of the currently captured image;

[0008] De-noising the multiple preview image frames to generate at least one denoised preview image frame;

[0009] The at least one frame of the denoised preview image and the at least one frame of the currently captured image are fused to generate an HDR image.

[0010] In another aspect, an image processing apparatus is provided, comprising:

[0011] An image acquisition module, used to acquire multiple preview image frames and at least one currently captured image frame, wherein the exposure amounts of the multiple preview image frames are different from the exposure amount of the currently captured image;

[0012] A denoising module, used for denoising the multiple frames of preview images to generate at least one denoised preview image;

[0013] The fusion module is used to fuse the at least one frame of the denoised preview image and the at least one frame of the currently captured image to generate an HDR image.

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

[0015] On the other hand, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the method described above are implemented.

[0016] The above-mentioned image processing method, device, electronic device and computer-readable storage medium first obtain multiple preview images and at least one currently captured image. Since the multiple preview images are images generated before the shutter on the electronic device is triggered, multiple images can be obtained without delaying the user's waiting time. Secondly, the multiple preview images are denoised to generate at least one denoised preview image.

[0017] Because the denoised preview image is obtained by using the multi-frame denoising algorithm, the multi-frame denoising algorithm is combined with the HDR algorithm in the process of fusing the denoised preview image and the current captured image. Since the multi-frame denoising algorithm can improve the clarity of the image, the clarity of the final generated HDR image is also improved without delaying the user's waiting time. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0019] Figure 1 A diagram showing an application environment of an image processing method in an embodiment;

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

[0021] Figure 3 is a flowchart of an image processing method in another embodiment;

[0022] Figure 4 for Figure 2A flowchart of a method for generating an HDR image by fusing at least one denoised preview image and at least one currently captured image;

[0023] Figure 5 A flowchart of a method for determining whether an HDR image has color deviation in one embodiment;

[0024] Figure 6 for Figure 2 A flow chart of a method for performing color compensation on a target channel value of each fused pixel in the HDR image to generate a target HDR image;

[0025] Figure 7 is a flowchart of an image processing method in a specific embodiment;

[0026] Figure 8 is a structural block diagram of an image processing device in one embodiment;

[0027] Fig. 9 is a structural block diagram of an image processing device in another embodiment;

[0028] Fig.10 FIG. 1 is a schematic diagram of the internal structure of an electronic device in an embodiment. DETAILED DESCRIPTION

[0029] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0030] It can be understood that the terms "first", "second", etc. used in the present application can be used in this article to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from another element.

[0031] Figure 1 FIG. 1 is a schematic diagram of an application environment of an image processing method in an embodiment. Figure 1 As shown, the application environment includes an electronic device 120. The electronic device 120 can obtain multiple frames of preview images and at least one frame of currently captured images, and the exposure of the multiple frames of preview images is different from the exposure of the currently captured image; denoise the multiple frames of preview images to generate at least one frame of denoised preview images; fuse at least one frame of denoised preview images and at least one frame of currently captured images to generate an HDR image. Among them, the electronic device 120 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc.

[0032] With the development of electronic devices, more and more users are taking pictures through electronic devices. Among them, the HDR algorithm is one of the indispensable technologies for electronic devices to take pictures. HDR images can be synthesized through the HDR algorithm. HDR images are also called high dynamic range images (High-Dynamic Range, referred to as HDR). Compared with ordinary images, HDR images can provide more dynamic range and image details. When HDR images can be synthesized through the HDR algorithm, it is mainly to first obtain multiple frames of images at different exposures, and then synthesize HDR images based on the multiple frames of images.

[0033] However, due to the traditional HDR algorithm, the input required includes at least two images with different exposure amounts. And generally, after the shutter is pressed, the camera starts to continuously capture multiple frames of images based on exposure parameters corresponding to different exposure amounts, and then synthesizes the multiple frames of images into HDR images. However, in the above-mentioned HDR synthesis process, in order to reduce the user's waiting time, that is, to shorten the time for capturing multiple frames of images, the number of frames of the multiple frames of images captured here is generally small, such as 2 frames, 3 frames, etc. Therefore, based on the HDR image generated by a few frames of images, although the HDR image can provide more dynamic range and image details, the clarity of the HDR image is also low, that is, there are more noise points. In order to solve the problem of low clarity of HDR images synthesized by traditional methods, the present application proposes an image processing method.

[0034] Figure 2 FIG. 1 is a flowchart of an image processing method in an embodiment. The image processing method in this embodiment is executed on Figure 1 The electronic device in the example is used for description. Figure 2 As shown, the image processing method includes steps 210 to 250.

[0035] Step 210, acquiring multiple preview image frames and at least one currently captured image frame, wherein the exposure amounts of the multiple preview image frames are different from the exposure amount of the currently captured image;

[0036] When a user needs to use an electronic device to take a photo, the shooting function of the electronic device can be turned on, and the electronic device can display a shooting interface, which includes a preview area for displaying a preview image. The preview image is an image generated in real time by the electronic device shooting in a specific shooting mode, for example, including the first frame preview image, the second frame preview image, the third frame preview image... the tenth frame preview image... These preview images are stored in a cache, for example, in a preview buffer.

[0037] The electronic device shoots in a specific shooting mode to generate a preview image, where the specific shooting mode includes an exposure parameter. Specifically, the electronic device can continuously shoot at the same or similar exposure to generate multiple frames of preview images. The current shot image refers to the image generated after the shutter on the electronic device is triggered. Here, after the shutter on the electronic device is triggered, at least one frame of the current shot image can be generated under different exposure parameters. For example, the electronic device generates a frame of underexposed image under underexposure parameters, or the electronic device generates a frame of normal exposure image under normal exposure parameters, or the electronic device generates a frame of overexposed image under overexposure parameters. Among them, the current shot image can be 1 frame, 2 frames or 3 frames, etc., and this application does not make specific limitations on this. However, the total shooting time of the current shot image cannot exceed the preset time to avoid the user waiting too long.

[0038] The exposure of the multiple preview images is different from the exposure of the current image. Only in this way can an HDR image be generated based on the multiple preview images and the current image. For example, the exposure of the preview image can be greater than the exposure of the current image, or the exposure of the preview image can be less than the exposure of the current image, which is not specifically limited in this application.

[0039] Then, when generating an HDR image, multiple frames of preview images can be obtained from the buffer first, and then at least one frame of current captured image generated by the electronic device under different exposure parameters can be obtained.

[0040] Step 230: De-noise the multiple preview image frames to generate at least one denoised preview image frame.

[0041] After obtaining multiple preview frames from the buffer, because there are a large number of preview frames and the preview frames are continuously shot at the same or similar exposure, a multi-frame denoising algorithm can be used to denoise the preview frames to generate at least one denoised preview image. For example, a multi-frame denoising algorithm can be used to denoise multiple preview frames to generate one denoised preview image, or multiple denoised preview images can be generated, and this application does not limit this.

[0042] The multi-frame denoising algorithm is used to denoise the multi-frame preview images, and the multi-frame denoising can be achieved by superimposing the multi-frame preview images. Specifically, the weighted average value of the pixel values ​​in the multi-frame preview images can be calculated to generate the denoised preview image.

[0043] Step 250: fuse at least one frame of the denoised preview image and at least one frame of the currently captured image to generate an HDR image.

[0044] After denoising multiple preview image frames and generating at least one denoised preview image frame, the at least one denoised preview image frame and the at least one currently captured image frame can be fused to generate an HDR image. Specifically, the at least one denoised preview image frame and the at least one currently captured image frame can be fused based on a preset fusion weight to generate an HDR image.

[0045] The image processing method of this embodiment first obtains multiple preview images and at least one currently captured image. Since the multiple preview images are images generated before the shutter on the electronic device is triggered, multiple images can be obtained without delaying the user's waiting time. Secondly, the multiple preview images are denoised to generate at least one denoised preview image.

[0046] Because the denoised preview image is obtained by using the multi-frame denoising algorithm, the multi-frame denoising algorithm is combined with the HDR algorithm in the process of fusing the denoised preview image and the current captured image. Since the multi-frame denoising algorithm can improve the clarity of the image, the clarity of the final generated HDR image is also improved without delaying the user's waiting time.

[0047] In one embodiment, Figure 3 As shown, an image processing method is provided, which also includes:

[0048] Step 270: determine whether the HDR image has color deviation.

[0049] Normally, the exposure of the preview images is close to the normal exposure when shooting in the current scene, but it is smaller than the normal exposure. The value corresponding to the exposure can be expressed as EV, where EV is the abbreviation of Exposure Values, which is a quantity reflecting the exposure. The initial definition of exposure is: the exposure when the sensitivity is ISO 100, the aperture factor is F1, and the exposure time is 1 second is defined as 0EV. If the exposure of 0EV is considered to be the normal exposure, then the exposure greater than 0EV can be considered as overexposure, and the exposure less than 0EV can be considered as underexposure. For example, when the exposure increases by one stop (the shutter time is doubled or the aperture is increased by one stop), it is +1EV, and +1EV is considered to be overexposure; when the exposure decreases by one stop (the shutter time is reduced by half or the aperture is reduced by one stop), it is -1EV, and -1EV is considered to be underexposure.

[0050] Then, the exposure of multiple frames of preview images is close to the normal exposure of 0EV when shooting in the current scene, but is smaller than the normal exposure of 0EV. Denoising is performed on multiple frames of preview images, and the exposure of at least one frame of denoised preview images is still smaller than the normal exposure of 0EV. Assume that the exposure of a frame of current captured image generated after the shutter on the electronic device is triggered is -1EV. Then, in some darker shooting scenes or backlit shooting scenes, the brightness of the generated HDR image is darker based on the denoised preview image with an exposure smaller than the normal exposure of 0EV and the fusion with the current captured image with an exposure of -1EV. In the process of adjusting the brightness of the generated HDR image, the problem of color deviation will arise.

[0051] When judging whether the HDR image has color deviation, for each fused pixel in the HDR image, determine the pixel to be fused with the largest fusion weight when generating the fused pixel. And further determine whether the pixel value of the pixel to be fused is less than the preset pixel value threshold, that is, indirectly determine whether the brightness of the pixel to be fused is darker by determining whether the pixel value of the pixel to be fused is small. Because if the fused pixel is mainly generated based on the fusion of the pixel to be fused with darker brightness, then the probability that the brightness of the fused pixel is also dark is relatively high. Therefore, it is necessary to adjust the brightness of the generated HDR image later, which leads to the problem of color deviation in the HDR image.

[0052] Therefore, it is possible to determine whether the HDR image has color deviation based on whether the pixel value of the pixel to be fused is less than the preset pixel value threshold. If the pixel value of the pixel to be fused is less than the preset pixel value threshold, it is determined that the HDR image has color deviation. If the pixel value of the pixel to be fused is not less than the preset pixel value threshold, it is determined that the HDR image has no color deviation or the color deviation is small.

[0053] Step 290: If yes, color compensation is performed on the target channel value of each fused pixel in the HDR image to generate a target HDR image; the target channel value includes a green channel value.

[0054] If the pixel value of the pixel to be fused is less than the preset pixel value threshold, it is determined that the HDR image has color deviation. Then, it is necessary to perform color compensation on the target channel value of each fused pixel in the HDR image to generate a target HDR image. When performing color compensation, the target channel value of the fused pixel can be color compensated by using the pixel information of each fused pixel, so that the color deviation of the HDR image after color compensation is reduced or there is no color deviation.

[0055] Among them, because the human eye has a high sensitivity to the green channel, the target channel value can be set to include the green channel value. Therefore, when the target channel value of the fused pixel is color compensated by the pixel information of each fused pixel, the green channel value of the fused pixel can be color compensated. Of course, the target channel value can also be set to include not only the green channel value, but also at least one of the red channel, the blue channel, and the full color channel, which is not limited in this application.

[0056] The image processing method in this embodiment first obtains multiple frames of preview images and at least one frame of currently captured image. Since the multiple frames of preview images are images generated by capturing before the shutter on the electronic device is triggered, multiple frames of images can be obtained without delaying the user's waiting time. Secondly, the multiple frames of preview images are denoised to generate at least one frame of denoised preview image. Because the denoised preview image is obtained by processing with a multi-frame denoising algorithm, the multi-frame denoising algorithm is combined with the HDR algorithm in the process of fusing the denoised preview image and the currently captured image. Since the multi-frame denoising algorithm can better improve the clarity of the image, the clarity of the ultimately generated HDR image is also improved without delaying the user's waiting time.

[0057] However, since the exposure of multiple preview images is close to the normal exposure of 0EV when shooting in the current scene, but is smaller than the normal exposure of 0EV, the HDR image generated by fusing at least one denoised preview image and at least one currently shot image needs to be brightness adjusted later, resulting in color deviation in the HDR image. Therefore, it is necessary to determine whether the HDR image has color deviation; if so, color compensation is performed on the target channel value of each fused pixel in the HDR image to generate a target HDR image. In this way, the problem of color deviation of the HDR image generated based on multiple preview images can be solved, so that the color deviation of the HDR image after color compensation is reduced or there is no color deviation.

[0058] In one embodiment, Figure 4 As shown, step 250, fusing at least one frame of the denoised preview image with at least one frame of the currently captured image to generate an HDR image, includes:

[0059] Step 252, determining a set of pixels to be fused from at least one frame of the preview image after denoising and at least one frame of the currently captured image; the set of pixels to be fused includes at least two pixels to be fused at the same position;

[0060] The first pixels in at least one denoised preview image and at least one currently captured image are named frame 1, frame 2, frame 3, ... frame n, respectively. Frame 1 is used as the reference image. For the pixel x1(i,j) to be fused at position (i,j) on frame 1, the pixels x2(i,j), x3(i,j) ... x4(i,j) to be fused at the same position as the pixel x1(i,j) to be fused are determined from frames 2, 3 ... frame n. n Then, the determined pixel set to be fused is {x1(i,j), x2(i,j), x3(i,j)…x n (i,j)}.

[0061] Step 254 , calculating a weighted sum based on the pixel value of each pixel to be fused in the pixel set to be fused and the fusion weight of the pixel to be fused, to generate a pixel value of the fused pixel.

[0062] The pixel set to be fused is {x1(i,j), x2(i,j), x3(i,j)...x n For each pixel to be fused in (i, j)}, obtain the fusion weight of each pixel to be fused. For example, the fusion weight of x1(i, j) is a1, the fusion weight of x2(i, j) is a2, the fusion weight of x3(i, j) is a3, and so on. n The fusion weight of (i,j) is a n Among them, the fusion weights a1, a2, a3...a n The specific data can be dynamically adjusted according to the HDR algorithm and the multi-frame denoising algorithm, and this application does not limit this.

[0063] Then, a weighted sum can be calculated based on the pixel value of each pixel to be fused in the pixel set to be fused and the fusion weight of the pixel to be fused to generate the pixel value of the fused pixel.

[0064] The specific calculation formula is shown in the following formula (1-1):

[0065] y(i,j)=a1 x1(i,j)+a2 x2(i,j)+…+a n x n (i,j) (1-1)

[0066] Among them, y(i,j) represents the pixel value of the fused pixel, x1(i,j), x2(i,j), x3(i,j)...x n (i, j) are the pixel values ​​of the pixels to be fused.

[0067] Step 256 , generating an HDR image based on the pixel values ​​of each fused pixel.

[0068] After obtaining the fused pixels corresponding to the pixels to be fused in the set of pixels to be fused, an HDR image can be generated based on each fused pixel. That is, based on each fused pixel and the position of the fused pixel, an HDR image is generated accordingly. And after the HDR image is generated, if the brightness of the HDR image is too dark or too bright, then it is necessary to adjust the brightness of the HDR image so that the brightness of the HDR image finally generated meets the preset conditions. Among them, the preset conditions include the normal brightness range, which is not limited in this application.

[0069] The image processing method in this embodiment determines a set of pixels to be fused from at least one frame of denoised preview image and at least one frame of currently captured image, wherein the set of pixels to be fused includes at least two pixels to be fused in the same position. A weighted sum is calculated based on the pixel values ​​of each pixel to be fused in the set of pixels to be fused and the fusion weights of the pixels to be fused, and a pixel value of the fused pixel is generated. An HDR image is generated based on the pixel values ​​of each fused pixel. The method realizes the fusion of at least one frame of denoised preview image and at least one frame of currently captured image to generate an HDR image based on a preset fusion weight, so that the generated HDR image can provide more dynamic range and image details.

[0070] In one embodiment, step 270, determining whether the HDR image has color deviation, includes:

[0071] Determine the maximum fusion weight and the second largest fusion weight from the fusion weights of the pixels to be fused;

[0072] Obtain the pixel value of the pixel to be fused corresponding to the maximum fusion weight;

[0073] According to the size relationship between the maximum fusion weight and the second largest fusion weight, and the pixel value of the pixel to be fused corresponding to the maximum fusion weight, it is judged whether there is color deviation in the HDR image.

[0074] Specifically, the fusion weights of the pixels to be fused are a1, a2, a3, ... n , determine the maximum fusion weight and the second largest fusion weight from the fusion weight. Assume a k is the maximum fusion weight, a m is the second largest fusion weight. Then, get a k The corresponding pixel value x of the pixel to be fused k (i,j).

[0075] Then, determine the relationship between the maximum fusion weight and the second largest fusion weight, that is, determine a k with a mFinally, according to the size relationship between the maximum fusion weight and the second largest fusion weight, and the pixel value of the pixel to be fused corresponding to the maximum fusion weight, it is determined whether the HDR image has color deviation. k with a m The size relationship between k The corresponding pixel value x of the pixel to be fused k (i, j), determine whether the fused pixel y(i, j) in the HDR image has color deviation. If it is determined that the fused pixel y(i, j) in the HDR image has color deviation, then it can be concluded that the HDR image has color deviation.

[0076] The image processing method in this embodiment determines whether the HDR image has color deviation from two dimensions: the difference between the largest preset fusion weight and the second largest preset fusion weight, and the pixel value of the pixel to be fused corresponding to the largest fusion weight. This improves the accuracy of determining whether the HDR image has color deviation.

[0077] In one embodiment, Figure 5 As shown, according to the size relationship between the maximum fusion weight and the second largest fusion weight, and the pixel value of the pixel to be fused corresponding to the maximum fusion weight, it is judged whether the HDR image has color deviation, including:

[0078] Step 502, determining whether the difference between the largest preset fusion weight and the second largest preset fusion weight is greater than a first preset difference threshold;

[0079] Step 504: if yes, determine whether the pixel value of the pixel to be fused corresponding to the maximum fusion weight is less than a preset pixel value threshold; if no, proceed to step 508;

[0080] Step 506: If yes, it is determined that the HDR image has color deviation; if no, proceed to step 508;

[0081] Step 508: Determine whether the HDR image has color deviation.

[0082] Specifically, it is determined whether the difference between the largest preset fusion weight and the second largest preset fusion weight is greater than a first preset difference threshold. k with a m Is the difference between a and b greater than a first preset difference threshold? k -a m / a mIs it greater than the first preset difference threshold value T1. The first preset difference threshold value T1 can be set to 0.5 or other values, which is not limited in this application. k -a m / a m If the difference is not greater than the first preset difference threshold T1, it is determined that the fused pixel y(i, j) in the HDR image has no color deviation, and it can be concluded that the HDR image has no color deviation.

[0083] If it is determined that a k -a m / a m If x is greater than the first preset difference threshold T1, it is determined whether the pixel value of the pixel to be fused corresponding to the maximum fusion weight is less than the preset pixel value threshold. k Whether (i, j) is less than a preset pixel value threshold T2. The preset pixel value threshold T2 can be set to 60 or other values, which is not limited in this application.

[0084] If it is determined that x k (i, j) is less than the preset pixel value threshold T2, then it is determined that the fused pixel y(i, j) in the HDR image has color deviation, and it can be concluded that the HDR image has color deviation. k (i, j) is not less than the preset pixel value threshold T2, then it is judged that the fused pixel y(i, j) in the HDR image does not have color deviation, and it can be concluded that the HDR image does not have color deviation.

[0085] The image processing method in this embodiment determines whether the HDR image has color deviation from two dimensions: the difference between the largest preset fusion weight and the second largest preset fusion weight, and the pixel value of the pixel to be fused corresponding to the largest fusion weight. This improves the accuracy of determining whether the HDR image has color deviation.

[0086] In one embodiment, Figure 6 As shown, color compensation is performed on the target channel value of each fused pixel in the HDR image to generate a target HDR image, including:

[0087] Step 620: Obtain a color compensation matrix of the HDR image.

[0088] Specifically, the color compensation matrix refers to the color compensation factor corresponding to the target channel value of each fused pixel in the HDR image, and the matrix generated is arranged in sequence according to the position of the fused pixels in the HDR image.

[0089] When obtaining the color compensation matrix R of the HDR image, the color compensation factor r(i, j) corresponding to the target channel value of each fused pixel can be obtained for each fused pixel in the HDR image. Among them, because the human eye has a high sensitivity to the green channel, the target channel value can be set to include the green channel value. Therefore, when obtaining the color compensation matrix of the HDR image, the color compensation matrix R of the HDR image can be generated based on the color compensation factor r(i, j) corresponding to the green channel value of the fused pixel on the HDR image. Of course, the target channel value can also be set to include not only the green channel value, but also at least one of the red channel, blue channel, and full-color channel, and the present application does not limit this. Then, it is necessary to jointly generate the color compensation matrix of the HDR image based on the color compensation factor corresponding to the green channel value of the fused pixel on the HDR image, the red channel, the blue channel, and at least one of the full-color channels. The present application does not limit this. The generated color compensation matrix R can also be processed, for example, the generated color compensation matrix is ​​subjected to Gaussian smoothing or filtering to generate the color compensation matrix R', and the present application does not limit this.

[0090] In addition, for the case where the fused pixel y(i,j) in the HDR image does not have color deviation, the color compensation factor r(i,j) can be set to 1 for the fused pixel y(i,j) without color deviation, and this application does not limit this. For the case where the fused pixel y(i,j) in the HDR image has color deviation, the color compensation factor r(i,j) can be set not to 1 for the fused pixel y(i,j) with color deviation, and this application does not limit this.

[0091] Step 640, color compensation is performed on the target channel value of each fused pixel in the HDR image based on the color compensation matrix of the HDR image to generate a target HDR image; the color compensation matrix includes color compensation factors corresponding to the target channel value of each fused pixel in the HDR image.

[0092] Because the color compensation matrix refers to the color compensation factor corresponding to the target channel value of each fused pixel in the HDR image, and the generated matrix is ​​arranged in sequence according to the position of the fused pixel in the HDR image, for each fused pixel in the HDR image, the color compensation factor with the same position as the fused pixel is obtained from the color compensation matrix. Based on the color compensation factor and the target channel value of the fused pixel, a new target channel value of the fused pixel is generated.

[0093] Finally, for each fused pixel in the HDR image, a new pixel value of the fused pixel is generated based on the new target channel value of the fused pixel and the other channel values ​​of the fused pixel. Then, based on the new pixel values ​​of each fused pixel, a target HDR image is generated. The target HDR image is the color compensated HDR image.

[0094] The image processing method in this embodiment obtains a color compensation matrix of the HDR image, performs color compensation on the target channel value of each fused pixel in the HDR image based on the color compensation matrix of the HDR image, and generates a target HDR image. Based on the color compensation matrix, color compensation can be performed on an HDR image with color deviation, so that the color deviation of the HDR image finally generated is small or there is no color deviation.

[0095] In one embodiment, obtaining a color compensation matrix of an HDR image includes:

[0096] For each fused pixel in the HDR image, determine the target pixel corresponding to the fused pixel from the denoised preview image and the current captured image; the target pixel is the pixel to be fused corresponding to the maximum fusion weight when generating the fused pixel;

[0097] Determine a color compensation factor of a target channel value of a fused pixel according to pixel information of the target pixel, wherein the pixel information includes at least one of brightness, chroma and saturation;

[0098] A color compensation matrix of the HDR image is generated according to the color compensation factor of the target channel value of each fused pixel.

[0099] Specifically, for each fused pixel in the HDR image, first, determine the target pixel corresponding to the fused pixel from the denoised preview image and the current captured image. That is, determine the pixel to be fused corresponding to the maximum fusion weight from all the pixels to be fused when generating the fused pixel, as the target pixel corresponding to the fused pixel. For example, from the pixels to be fused x1(i,j), x2(i,j), x3(i,j)...x n Determine the maximum fusion weight a in (i,j) k The corresponding pixel to be fused x k (i, j) is used as the target pixel corresponding to the fused pixel.

[0100] Secondly, according to the target pixel x k (i, j), and determine the color compensation factor r(i, j) of the target channel value of the fused pixel. The pixel information includes at least one of brightness, chroma and saturation. For example, assuming that the pixel information includes brightness, the following formula (1-2) can be used:

[0101] r(i,j)=1-α·sk (i,j)·(β / x k (i,j)) (1-2)

[0102] Among them, s k (i,j) is pixel I k The saturation of (i,j), x k (i,j) is pixel I k The brightness of (i, j), α and β are parameters that need to be debugged and calibrated according to the data of the image sensor used by the electronic device.

[0103] Finally, the color compensation factors corresponding to the target channel values ​​of each fused pixel in the HDR image are arranged in sequence according to the positions of the fused pixels in the HDR image to generate a color compensation matrix.

[0104] The image processing method in this embodiment, for each fused pixel in the HDR image, first, determines the pixel to be fused corresponding to the maximum fusion weight from all the pixels to be fused when generating the fused pixel, as the target pixel corresponding to the fused pixel. Secondly, according to at least one of the brightness, chromaticity and saturation of the target pixel, the color compensation factor of the target channel value of the fused pixel is determined. Finally, according to the color compensation factors of the target channel values ​​of each fused pixel, a color compensation matrix of the HDR image is generated. Because the pixel to be fused corresponding to the maximum fusion weight has the greatest impact on the final fused pixel, the color compensation factor is determined based on the pixel to be fused corresponding to the maximum fusion weight. In this way, the color deviation problem of the fused pixel can be solved from the root.

[0105] In one embodiment, color compensation is performed on a target channel value of each fused pixel in the HDR image based on a color compensation matrix of the HDR image to generate a target HDR image, including:

[0106] For each fused pixel in the HDR image, a color compensation factor corresponding to the target channel value of the fused pixel is obtained from the color compensation matrix;

[0107] Performing color compensation on the target channel value of the fused pixel in the HDR image according to the color compensation factor to generate a new pixel value of the fused pixel;

[0108] Based on the new pixel values ​​of each fused pixel, a target HDR image is generated.

[0109] Specifically, because the color compensation matrix refers to the color compensation factor corresponding to the target channel value of each fused pixel in the HDR image, the generated matrix is ​​arranged in sequence according to the position of the fused pixel in the HDR image, so for each fused pixel in the HDR image, the color compensation factor with the same position as the fused pixel is obtained from the color compensation matrix. Based on the color compensation factor and the target channel value of the fused pixel, a new target channel value of the fused pixel is generated. For example, the G channel of the fused image I0 in the RGB domain is G0, which can be calculated using the following formula (1-3):

[0110] g 0` (i,j)=g0(i,j)·r`(i,j) (1-3)

[0111] Among them, g0(i,j) represents the G0 channel value of the fused pixel, g 0` (i, j) represents the new G0 channel value of the fused pixel. r`(i, j) is the color compensation factor in the color compensation matrix R`.

[0112] Finally, for each fused pixel in the HDR image, a new pixel value of the fused pixel is generated based on the new target channel value of the fused pixel and the other channel values ​​of the fused pixel. Then, based on the new pixel values ​​of each fused pixel, a target HDR image is generated. The target HDR image is the color compensated HDR image.

[0113] The image processing method in this embodiment obtains a color compensation matrix of the HDR image, performs color compensation on the target channel value of each fused pixel in the HDR image based on the color compensation matrix of the HDR image, and generates a target HDR image. Based on the color compensation matrix, color compensation can be performed on an HDR image with color deviation, so that the color deviation of the HDR image finally generated is small or there is no color deviation.

[0114] In one embodiment, acquiring multiple preview image frames and at least one currently captured image frame includes:

[0115] Before generating the currently captured image, controlling the camera to perform exposure at a first preset exposure value to generate multiple frames of preview images;

[0116] The camera is controlled to expose at a second preset exposure to generate at least one frame of currently captured image, wherein the first preset exposure is greater than the second preset exposure.

[0117] Specifically, the electronic device generates a preview image by shooting in a specific shooting mode, where the specific shooting mode includes an exposure parameter. Specifically, the electronic device can continuously shoot at a first preset exposure to generate multiple frames of preview images.

[0118] The currently captured image refers to the image generated after the shutter on the electronic device is triggered. Here, after the shutter on the electronic device is triggered, the camera is controlled to expose at a second preset exposure to generate at least one frame of the currently captured image. For example, the electronic device generates a frame of underexposed image under underexposure parameters, or the electronic device generates a frame of normally exposed image under normal exposure parameters, or the electronic device generates a frame of overexposed image under overexposure parameters. Among them, the currently captured image can be 1 frame, 2 frames or 3 frames, etc., and this application does not make specific limitations on this. However, the total shooting time of the currently captured image cannot exceed the preset time to avoid the user waiting too long.

[0119] And the first preset exposure is greater than the second preset exposure, that is, the first preset exposure for generating multiple frames of preview images is different from the second preset exposure for generating the current captured image. In this way, an HDR image can be generated based on the multiple frames of preview images and the current captured image.

[0120] The image processing method in this embodiment first obtains multiple preview images and at least one currently captured image. Since the multiple preview images are images captured before the shutter on the electronic device is triggered, multiple images can be obtained without delaying the user's waiting time, and the multiple preview images are denoised to generate at least one denoised preview image. Since the multi-frame denoising algorithm can improve the clarity of the image, the clarity of the HDR image finally generated is also improved without delaying the user's waiting time.

[0121] Continuing from the previous embodiment, the first preset exposure is less than the target exposure, and the difference between the first preset exposure and the target exposure is less than a second preset difference threshold; the target exposure is the exposure of a normally exposed image acquired in the current shooting scene;

[0122] The second preset exposure is less than the target exposure, and a difference between the second preset exposure and the target exposure is greater than or equal to a second preset difference threshold.

[0123] In the image processing method of this embodiment, the first preset exposure and the second preset exposure are both less than the target exposure, that is, the multiple-frame preview images and the current captured image are both underexposed images. Among them, the target exposure is the exposure of the normal exposure image obtained in the current shooting scene. And the difference between the first preset exposure and the target exposure is less than the second preset difference threshold, and the difference between the second preset exposure and the target exposure is greater than or equal to the second preset difference threshold. That is, relative to the current captured image, the exposure of the multiple-frame preview images is closer to the normal exposure image, and the exposure of the current captured image is closer to the underexposed image. Therefore, based on the fusion of the multiple-frame preview images that are closer to the normal exposure image and the current captured image that is closer to the underexposed image, the generated HDR image can provide more dynamic range and image details due to the difference in exposure.

[0124] In a specific embodiment, Figure 7 As shown, an image processing method is provided, comprising:

[0125] Step 702, before generating the current captured image, controlling the camera to perform exposure at a first preset exposure value to generate multiple frames of preview images;

[0126] Step 704, controlling the camera to perform exposure at a second preset exposure to generate at least one frame of currently captured image, wherein the first preset exposure is greater than the second preset exposure;

[0127] Step 706, denoising the multiple preview image frames using a multi-frame denoising algorithm to generate at least one denoised preview image frame;

[0128] Step 708, determining a set of pixels to be fused from at least one frame of the preview image after denoising and at least one frame of the currently captured image; the set of pixels to be fused includes at least two pixels to be fused at the same position;

[0129] Step 710, calculating a weighted sum based on the pixel value of each pixel to be fused in the pixel set to be fused and the fusion weight of the pixel to be fused, to generate a pixel value of the fused pixel;

[0130] Step 712, generating an HDR image based on the pixel values ​​of each fused pixel;

[0131] Step 714, performing brightness adjustment on the generated HDR image to generate a brightness adjusted HDR image;

[0132] Step 716, determining the maximum fusion weight and the second largest fusion weight from the fusion weights of the pixels to be fused; obtaining the pixel value of the pixel to be fused corresponding to the maximum fusion weight;

[0133] Step 718, determining whether the difference between the largest preset fusion weight and the second largest preset fusion weight is greater than a first preset difference threshold; if so, proceeding to step 720; if not, proceeding to step 724;

[0134] Step 720, determining whether the pixel value of the pixel to be fused corresponding to the maximum fusion weight is less than a preset pixel value threshold; if so, proceeding to step 722; if not, proceeding to step 724;

[0135] Step 722, determining that the HDR image has color deviation; proceeding to step 726;

[0136] Step 724: Determine whether the HDR image has color deviation.

[0137] Step 726 , color compensation is performed on the green channel value of each fused pixel in the HDR image based on the color compensation matrix of the HDR image to generate a target HDR image.

[0138] The image processing method of this embodiment first obtains multiple preview images and at least one currently captured image. Since the multiple preview images are images generated before the shutter on the electronic device is triggered, multiple images can be obtained without delaying the user's waiting time. Secondly, the multiple preview images are denoised to generate at least one denoised preview image.

[0139] Because the denoised preview image is obtained by using the multi-frame denoising algorithm, the multi-frame denoising algorithm is combined with the HDR algorithm in the process of fusing the denoised preview image and the current captured image. Since the multi-frame denoising algorithm can improve the clarity of the image, the clarity of the final generated HDR image is also improved without delaying the user's waiting time.

[0140] In one embodiment, Figure 8 As shown, an image processing device 800 is provided, comprising:

[0141] An image acquisition module 810 is used to acquire multiple preview image frames and at least one currently captured image frame, wherein the exposure amounts of the multiple preview image frames are different from the exposure amount of the currently captured image;

[0142] A denoising module 830, configured to denoise multiple frames of preview images to generate at least one denoised preview image;

[0143] The fusion module 850 is used to fuse at least one frame of the denoised preview image and at least one frame of the current captured image to generate an HDR image.

[0144] In one embodiment, Fig. 9As shown, an image processing device 800 is provided, further comprising:

[0145] A color deviation determination module 870 is used to determine whether the HDR image has color deviation;

[0146] The color compensation module 890 is used to perform color compensation on the target channel value of each fused pixel in the HDR image to generate a target HDR image; the target channel value includes a green channel value.

[0147] In one embodiment, the fusion module 850 is further used to determine a set of pixels to be fused from at least one frame of denoised preview image and at least one frame of currently captured image; the set of pixels to be fused includes at least two pixels to be fused in the same position; a weighted sum is calculated based on the pixel values ​​of each pixel to be fused in the set of pixels to be fused and the fusion weights of the pixels to be fused to generate a pixel value of the fused pixel; and an HDR image is generated based on the pixel values ​​of each fused pixel.

[0148] In one embodiment, the color deviation judgment module 870 is also used to determine the maximum fusion weight and the second largest fusion weight from the fusion weights of the pixels to be fused; obtain the pixel value of the pixel to be fused corresponding to the maximum fusion weight; and judge whether the HDR image has color deviation based on the size relationship between the maximum fusion weight and the second largest fusion weight and the pixel value of the pixel to be fused corresponding to the maximum fusion weight.

[0149] In one embodiment, the color deviation judgment module 870 is also used to judge whether the difference between the largest preset fusion weight and the second largest preset fusion weight is greater than a first preset difference threshold; if so, it is judged whether the pixel value of the pixel to be fused corresponding to the maximum fusion weight is less than the preset pixel value threshold; if so, it is determined that the HDR image has color deviation.

[0150] In one embodiment, the color compensation module 890 includes:

[0151] A color compensation matrix acquisition unit, used to acquire a color compensation matrix of an HDR image;

[0152] The color compensation unit is used to perform color compensation on the target channel value of each fused pixel in the HDR image based on the color compensation matrix of the HDR image to generate a target HDR image; the color compensation matrix includes color compensation factors corresponding to the target channel value of each fused pixel in the HDR image.

[0153] In one embodiment, a color compensation matrix acquisition unit is used to determine, for each fused pixel in the HDR image, a target pixel corresponding to the fused pixel from a denoised preview image and a currently captured image; the target pixel is a pixel to be fused corresponding to a maximum fusion weight when generating the fused pixel; a color compensation factor of a target channel value of the fused pixel is determined based on pixel information of the target pixel; the pixel information includes at least one of brightness, chroma and saturation; and a color compensation matrix of the HDR image is generated based on the color compensation factor of the target channel value of each fused pixel.

[0154] In one embodiment, a color compensation unit is used to obtain, for each fused pixel in the HDR image, a color compensation factor corresponding to a target channel value of the fused pixel from a color compensation matrix; perform color compensation on the target channel value of the fused pixel in the HDR image according to the color compensation factor to generate a new pixel value of the fused pixel; and generate a target HDR image based on the new pixel values ​​of each fused pixel.

[0155] In one embodiment, the image acquisition module 810 is used to control the camera to expose at a first preset exposure amount to generate multiple frames of preview images before generating the current captured image; control the camera to expose at a second preset exposure amount to generate at least one frame of the current captured image, and the first preset exposure amount is greater than the second preset exposure amount.

[0156] In one embodiment, the first preset exposure is less than the target exposure, and the difference between the first preset exposure and the target exposure is less than a second preset difference threshold; the target exposure is the exposure of a normally exposed image acquired in the current shooting scene; the second preset exposure is less than the target exposure, and the difference between the second preset exposure and the target exposure is greater than or equal to the second preset difference threshold.

[0157] It should be understood that, although the various steps in the above-mentioned flow chart are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the above-mentioned flow chart may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these sub-steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.

[0158] The division of the modules in the above-mentioned image processing device is only for illustration. 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-mentioned image processing device.

[0159] For the specific definition of the image processing device, please refer to the definition of the image processing method above, which will not be repeated here. Each module in the above image processing device can be implemented in whole or in part by software, hardware and a combination thereof. The above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0160] Fig.10 Schematic diagram of the internal structure of an electronic device in an embodiment. The electronic device can be any terminal device such as a mobile phone, a tablet computer, a laptop computer, a desktop computer, a PDA (Personal Digital Assistant), a POS (Point of Sales), a car computer, a wearable device, etc. The electronic device includes a processor and a memory connected via a system bus. Among them, the processor may include one or more processing units. The processor may be a CPU (Central Processing Unit) or a DSP (Digital Signal Processing), etc. The memory may include a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The computer program can be executed by the processor to implement an image processing method provided in each of the following embodiments. The internal memory provides a cache operating environment for the operating system computer program in the non-volatile storage medium.

[0161] The implementation of each module in the image processing device provided in the embodiment of the present application may be in the form of a computer program. The computer program may be run on an electronic device. The program module constituted by the computer program may be stored in a memory of the electronic device. When the computer program is executed by a processor, the steps of the method described in the embodiment of the present application are implemented.

[0162] The embodiment of the present application also provides a computer-readable storage medium, which is one or more non-volatile computer-readable storage media containing computer-executable instructions, and when the computer-executable instructions are executed by one or more processors, the processors execute the steps of the image processing method.

[0163] The embodiment of the present application also provides a computer program product including instructions, which, when executed on a computer, enables the computer to execute the image processing method.

[0164] Any reference to memory, storage, database or other medium 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 an external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as SRAM (Static Random Access Memory), DRAM (Dynamic Random Access Memory), SDRAM (Synchronous Dynamic Random Access Memory), Double Data Rate DDRSDRAM (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).

[0165] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. An image processing method, characterized in that: include: Acquire multiple preview frames and at least one currently captured image, wherein the exposure of the multiple preview frames is different from that of the currently captured image; wherein the multiple preview frames are captured and generated before a shutter on the electronic device is triggered, and stored in a buffer; after the shutter on the electronic device is triggered, the at least one currently captured image is captured under an exposure parameter different from that of the multiple preview frames; the acquiring of the multiple preview frames comprises: acquiring the multiple preview frames from the buffer; De-noising the multiple preview image frames to generate at least one denoised preview image frame; The at least one frame of the denoised preview image and the at least one frame of the currently captured image are fused to generate an HDR image.

2. The method according to claim 1, characterized in that The method further comprises: Determine whether the HDR image has color deviation; If so, color compensation is performed on the target channel value of each fused pixel in the HDR image to generate a target HDR image; the target channel value includes a green channel value.

3. The method according to claim 2, characterized in that The step of fusing the at least one denoised preview image with the at least one currently captured image to generate an HDR image includes: Determine a pixel set to be fused from the at least one frame of the preview image after denoising and the at least one frame of the currently captured image; the pixel set to be fused includes at least two pixels to be fused at the same position; Calculating a weighted sum based on the pixel value of each pixel to be fused in the set of pixels to be fused and the fusion weight of the pixels to be fused, to generate a pixel value of the fused pixel; An HDR image is generated based on the pixel values ​​of each of the fused pixels.

4. The method according to claim 3, characterized in that The determining whether the HDR image has color deviation includes: Determining a maximum fusion weight and a second maximum fusion weight from the fusion weights of the pixels to be fused; Obtaining the pixel value of the pixel to be fused corresponding to the maximum fusion weight; According to the size relationship between the maximum fusion weight and the second largest fusion weight, and the pixel value of the pixel to be fused corresponding to the maximum fusion weight, it is determined whether the HDR image has color deviation.

5. The method according to claim 4, characterized in that The determining whether the HDR image has color deviation according to the magnitude relationship between the maximum fusion weight and the second largest fusion weight and the pixel value of the to-be-fused pixel corresponding to the maximum fusion weight includes: Determining whether a difference between the largest preset fusion weight and the second largest preset fusion weight is greater than a first preset difference threshold; If yes, determining whether the pixel value of the pixel to be fused corresponding to the maximum fusion weight is less than a preset pixel value threshold; If yes, it is determined that the HDR image has color deviation.

6. The method according to claim 2, characterized in that The color compensation is performed on the target channel value of each fused pixel in the HDR image to generate a target HDR image, including: Obtaining a color compensation matrix of the HDR image; The target HDR image is generated by performing color compensation on the target channel value of each fused pixel in the HDR image based on the color compensation matrix of the HDR image; the color compensation matrix includes color compensation factors corresponding to the target channel value of each fused pixel in the HDR image.

7. The method according to claim 6, characterized in that The step of obtaining a color compensation matrix of the HDR image comprises: For each of the fused pixels in the HDR image, a target pixel corresponding to the fused pixel is determined from the denoised preview image and the current captured image; the target pixel is a pixel to be fused corresponding to the maximum fusion weight when generating the fused pixel; Determining a color compensation factor of a target channel value of the fused pixel according to pixel information of the target pixel, wherein the pixel information includes at least one of brightness, chroma and saturation; A color compensation matrix of the HDR image is generated according to the color compensation factor of the target channel value of each fused pixel.

8. The method according to claim 6 or 7, characterized in that: The color compensation is performed on the target channel value of each fused pixel in the HDR image based on the color compensation matrix of the HDR image to generate the target HDR image, including: For each of the fused pixels in the HDR image, obtaining a color compensation factor corresponding to a target channel value of the fused pixel from the color compensation matrix; Performing color compensation on a target channel value of the fused pixel in the HDR image according to the color compensation factor to generate a new pixel value of the fused pixel; The target HDR image is generated based on the new pixel value of each fused pixel.

9. The method according to claim 1, characterized in that: The acquiring of multiple preview image frames and at least one currently captured image frame comprises: Before generating the currently captured image, controlling the camera to perform exposure at a first preset exposure amount to generate the multiple frames of preview images; The camera is controlled to expose at a second preset exposure to generate at least one frame of the current captured image, wherein the first preset exposure is greater than the second preset exposure.

10. The method according to claim 9, characterized in that The first preset exposure is less than the target exposure, and the difference between the first preset exposure and the target exposure is less than a second preset difference threshold; the target exposure is the exposure of a normally exposed image acquired in the current shooting scene; The second preset exposure is less than the target exposure, and a difference between the second preset exposure and the target exposure is greater than or equal to a second preset difference threshold.

11. An image processing device, characterized in that: include: The image acquisition module is used to acquire multiple preview frames and at least one currently captured image, wherein the exposure of the multiple preview frames is different from that of the currently captured image; wherein the multiple preview frames are captured and generated before the shutter on the electronic device is triggered, and stored in a buffer; and after the shutter on the electronic device is triggered, the at least one currently captured image is captured and generated under exposure parameters different from those of the multiple preview frames; the acquiring of the multiple preview frames comprises: acquiring the multiple preview frames from the buffer; A denoising module, used for denoising the multiple frames of preview images to generate at least one denoised preview image; The fusion module is used to fuse the at least one frame of the denoised preview image and the at least one frame of the currently captured image to generate an HDR image.

12. An electronic device comprising a memory and a processor, wherein a computer program is stored in the memory, wherein: When the computer program is executed by the processor, the processor is caused to perform the steps of the image processing method according to any one of claims 1 to 10.

13. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 10 are implemented.

Citation Information

Patent Citations

  • High dynamic range image photographing method, terminal, and computer readable storage medium

    CN107277387A

  • Night scene high dynamic range image generation method and device, and electronic equipment

    CN110611750A

  • Method for correcting high dynamic range synthetic images

    TW201121336A