Image processing method and device, computer device and storage medium

By acquiring and processing multi-exposure images for image fusion, the problems of noise in dark areas and suppression of highlights in HDR image generation are solved, thus improving image quality.

CN116228585BActive Publication Date: 2026-08-25SHANGHAI WINGTECH INFORMATION TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310239454.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-13
Publication Date
2026-08-25
Estimated Expiration
2043-03-13

AI Technical Summary

Technical Problem

Existing HDR image generation methods suffer from high noise in dark areas and poor highlight suppression, which affects image quality.

Method used

By acquiring a normally exposed image of the target object and at least two underexposed images with different exposure levels, filtering and image fusion are performed. A high dynamic range image is generated by using mean filtering and weighting coefficient processing.

Benefits of technology

It effectively preserves image texture details, reduces noise, improves shadow details, and reduces highlights, achieving highlight suppression.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116228585B_ABST
    Figure CN116228585B_ABST
Patent Text Reader

Abstract

The application relates to an image processing method and device, computer equipment and a storage medium. The method comprises the following steps: acquiring a normal exposure image corresponding to a target object and at least two underexposure images with different exposure degrees; performing filtering processing on each underexposure image to obtain a corresponding filtered image; and performing image fusion on the normal exposure image and the filtered image corresponding to each underexposure image to obtain a high dynamic range image corresponding to the target object. The method can better maintain the texture details of the image, reduce noise and suppress highlights.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] Compared to ordinary images, high dynamic range (HDR) images can provide a greater dynamic range and image detail, offering users a better visual experience. As a result, they are widely used in an increasing number of electronic devices, such as in the photography technology of smart terminals.

[0003] Currently, the main method for generating HDR images is to control the exposure time, capture multiple frames of images to collect information on different brightness levels of the scene being photographed, and then synthesize a multi-frame HDR image. However, this technique mainly suffers from problems such as high noise in dark areas and poor suppression of highlights, which affects the final generated HDR image. Summary of the Invention

[0004] Therefore, it is necessary to provide an image processing method, apparatus, computer device, and storage medium that can preserve the texture details and reduce noise of an image, as well as suppress highlights, in order to address the aforementioned technical problems.

[0005] An image processing method, the method comprising:

[0006] Acquire a normally exposed image of the target object, and at least two underexposed images with different exposure levels;

[0007] Each underexposed image is filtered to obtain a corresponding filtered image;

[0008] The normally exposed image and the filtered image corresponding to each of the underexposed images are fused to obtain the high dynamic range image corresponding to the target object.

[0009] In one embodiment, filtering each underexposed image to obtain a corresponding filtered image includes:

[0010] Each underexposed image is subjected to mean filtering to obtain a corresponding mean-filtered image;

[0011] Calculate the weighting coefficient corresponding to each underexposed image based on each underexposed image and its corresponding weighting coefficient threshold;

[0012] Based on the mean-filtered image corresponding to each underexposed image and the normally exposed image, the image is weighted according to the weighting coefficients corresponding to the underexposed image to obtain the corresponding filtered image.

[0013] In one embodiment, calculating the weighting coefficient corresponding to each underexposed image based on each underexposed image and the corresponding weighting coefficient threshold includes:

[0014] Determine the corresponding target region from each of the underexposed images;

[0015] Calculate the average pixel value of the target region based on each pixel and the number of pixels corresponding to the target region;

[0016] Calculate the pixel variance corresponding to the target region based on the average pixel value and each pixel of the target region;

[0017] The weighting coefficients for each underexposed image are determined based on the weighting coefficient threshold and the pixel variance.

[0018] In one embodiment, the weighting coefficient is the ratio of the pixel variance to the sum of the pixel variance and the corresponding weighting coefficient.

[0019] In one embodiment, the step of performing image weighting processing based on the mean-filtered image corresponding to each underexposed image and the normally exposed image, according to the weighting coefficients corresponding to the underexposed image, to obtain the corresponding filtered image includes:

[0020] Each pixel of the mean-filtered image corresponding to each underexposed image is obtained to form a first pixel set; the first pixel set includes multiple first pixels arranged in pixel order.

[0021] Each pixel of the normally exposed image is acquired to form a second pixel set; the second pixel set includes multiple second pixels arranged in pixel order;

[0022] Multiply each of the first pixels by the corresponding weighting coefficient to obtain the first weighting parameter;

[0023] The second pixel corresponding to the pixel order of the first pixel is taken as the target second pixel; the target second pixel is multiplied by the corresponding weighting coefficient to obtain the second weighting parameter;

[0024] Data processing is performed based on each of the first weighting parameters, the corresponding second weighting parameters, and the corresponding first pixel to obtain a filtered image corresponding to the underexposed image.

[0025] In one embodiment, the step of processing data based on each of the first weighting parameters, the corresponding second weighting parameters, and the corresponding first pixel to obtain the filtered image corresponding to the underexposed image includes:

[0026] Subtract each second weighted parameter from the corresponding first weighted parameter to obtain the weighted parameter difference;

[0027] The weighted parameter difference is added to the corresponding first pixel to obtain the filtered pixel points in the corresponding pixel order;

[0028] The obtained multiple filtered pixels are arranged in the corresponding pixel order to obtain the filtered image corresponding to the underexposed image.

[0029] In one embodiment, the step of fusing the normally exposed image and the filtered image corresponding to each of the underexposed images to obtain the high dynamic range image corresponding to the target object includes:

[0030] When there are two underexposed images, the pixel count of the high dynamic range image corresponding to the target object is calculated using the following formula:

[0031] Dst(hdr)=Dst1*a+Dst2*b+Ev0*(1-ab)

[0032] Wherein, Dst(hdr) is the pixel of the high dynamic range image; Dst1 and Dst2 refer to the pixel of each underexposed image in the corresponding pixel order; Ev0 refers to the pixel of the normally exposed image; a and b refer to the preset fusion coefficients corresponding to the underexposed image.

[0033] An image processing apparatus, the apparatus comprising:

[0034] The exposure image acquisition module is used to acquire a normally exposed image of the target object, as well as at least two underexposed images with different exposure levels;

[0035] The filtered image determination module is used to perform filtering processing on each of the underexposed images to obtain the corresponding filtered image;

[0036] The high dynamic range image generation module is used to fuse the normally exposed image and the filtered image corresponding to each of the underexposed images to obtain the high dynamic range image corresponding to the target object.

[0037] A computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps of the image processing method described in the above embodiments.

[0038] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the image processing method described in the above embodiments.

[0039] The aforementioned image processing methods, apparatus, computer equipment, and storage media, and electronic devices acquire a normally exposed image of the target object and at least two underexposed images with different exposure levels. Each underexposed image is then filtered to obtain a corresponding filtered image. The normally exposed image and the filtered images corresponding to each underexposed image are then fused to obtain a high dynamic range image of the target object. This solution, by using at least two underexposed images with different exposure levels and performing local statistical and mean filtering on them, can better preserve the texture details of the image. The use of mean filtering also effectively removes image noise. Furthermore, by fusing at least two underexposed images with different exposure levels with a normally exposed image, the dark details of the original image can be greatly improved. Moreover, this solution does not use overexposed images, further significantly reducing the highlight portion; therefore, the resulting high dynamic range image can be used for highlight suppression. Attached Figure Description

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

[0041] Figure 2 This is a flowchart illustrating the image processing steps in one embodiment;

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

[0043] Figure 4 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

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

[0045] like Figure 1 As shown, an image processing method is provided. This embodiment illustrates the application of this method to an electronic device. It is understood that this method can also be applied to a terminal, a server, or a system including both a terminal and a server, and is implemented through interaction between the terminal and the server. In this embodiment, the method includes the following steps:

[0046] Step S102: Obtain the normally exposed image of the target object, and at least two underexposed images with different exposure levels.

[0047] Exposure refers to the amount of light entering the lens and hitting the image sensor during photography, controlled by a combination of aperture, shutter speed, and ISO. Generally, exposure level is used as a metric to measure the degree of image exposure. Exposure level refers to the perceived intensity and duration of light. A properly exposed image is one with zero exposure; an underexposed image is one with negative exposure; and an overexposed image is one with positive exposure.

[0048] Specifically, the electronic device can obtain a normally exposed image of the target object, as well as at least two underexposed images with different exposures, from a server or a third-party application.

[0049] An optical sensor can be incorporated into the electronic device to acquire a normally exposed image of the target object and at least two underexposed images with different exposures. By opening the camera application on the electronic device and displaying the target object on the shooting preview screen, the normally exposed image and at least two underexposed images of the target object can be further acquired.

[0050] In one embodiment, the electronic device can acquire one normally exposed image and two underexposed images with different exposure levels corresponding to the target object. Alternatively, the electronic device can acquire one normally exposed image and two or more underexposed images with different exposure levels corresponding to the target object.

[0051] Step S104: Filter each underexposed image to obtain the corresponding filtered image.

[0052] Filtering primarily reduces image noise, enriches texture details, and effectively suppresses highlights. For example, by separating texture details from a flat background and adjusting the weights of different image regions for image fusion, noise reduction and increased texture detail can be achieved. Filtering can include mean filtering, which has good noise reduction effects but is generally less effective at distinguishing between texture details and a flat background.

[0053] Specifically, the electronic device performs mean filtering on each underexposed image to obtain the corresponding mean-filtered image, thereby better reducing noise in the image. Furthermore, since the normally exposed image of the target object has high texture detail information and can effectively distinguish between texture details and flat backgrounds, it is considered to weight the mean-filtered image and the normally exposed image to obtain the filtered image.

[0054] In one embodiment, filtering each underexposed image to obtain a corresponding filtered image includes: performing mean filtering on each underexposed image to obtain a corresponding mean-filtered image; calculating a weighting coefficient for each underexposed image based on each underexposed image and its corresponding weighting coefficient threshold; and performing image weighting processing based on the mean-filtered image corresponding to each underexposed image and the normally exposed image, according to the weighting coefficient corresponding to the underexposed image, to obtain the corresponding filtered image.

[0055] The weighting coefficient threshold can be set based on historical experience. The weighting coefficient is the weighted proportion of the underexposed image, and the weighting coefficient ranges from 0 to 1, or may include both 0 and 1.

[0056] Specifically, the electronic device performs mean filtering on each underexposed image to obtain a corresponding mean-filtered image. Further, it obtains a weighting coefficient threshold for each underexposed image. Based on the obtained weighting coefficient threshold and the corresponding pixels of the underexposed image, it calculates technical indicators that describe the detail regions of the underexposed image by performing local statistics on the pixels of the underexposed image. Then, it determines the weighting coefficient for the corresponding underexposed image based on the calculated technical indicators. Finally, the electronic device performs image weighting processing on the mean-filtered image and the normally exposed image corresponding to each underexposed image, according to the calculated weighting coefficient, to obtain a filtered image.

[0057] In one embodiment, calculating the weighting coefficient corresponding to each underexposed image based on each underexposed image and the corresponding weighting coefficient threshold includes: determining the corresponding target region from each underexposed image; calculating the pixel average value of the target region based on each pixel and the number of pixels in the target region; calculating the pixel variance of the target region based on the pixel average value and each pixel in the target region; and determining the weighting coefficient corresponding to each underexposed image based on the weighting coefficient threshold and the pixel variance.

[0058] Specifically, the electronic device defines a target region from each underexposed image. This target region contains all or most of the texture details of the target object, or it includes all foreground images of the target object, and a square region formed around the foreground images can also be considered as the target region. Further, the electronic device calculates the average pixel value of the target region based on each pixel and the number of pixels corresponding to that target region. For example, assuming the number of pixels is n, and the pixel value at any point in the target region is x... i

[0059] The average pixel value E(x) of the target region can then be calculated using the following formula:

[0060]

[0061] Furthermore, after calculating the average pixel value of the target region, the pixel variance D(x) of the target region is calculated using the following formula:

[0062] D(x)=(x 2 )-(x) 2

[0063] Furthermore, based on historical experience or research and analysis of historical underexposed images, or by training on historical underexposed images using a loss function, different weighting coefficient thresholds are set to determine the weighting coefficient threshold that minimizes the loss function value. This weighting coefficient threshold is denoted as sigma for the underexposed image. The obtained weighting coefficient threshold for each underexposed image is stored in a server or local database and retrieved when needed.

[0064] Furthermore, based on the weighting coefficient threshold corresponding to each underexposed image and the calculated pixel variance, the weighting coefficient k corresponding to each underexposed image is calculated using the following formula:

[0065] k = D(x) / (D(x) + igma)

[0066] Here, sigma can avoid the case where the denominator is 0 in the above formula, and it can also control the size of k. That is, the weighting coefficient is the ratio of the pixel variance to the sum of the pixel variance and the corresponding weighting coefficient; under the same D(x), the larger the sigma, the smaller the K, the stronger the image noise reduction effect, but the weaker the edge preservation effect; the smaller the sigma, the stronger the image edge preservation effect.

[0067] In one embodiment, obtaining a corresponding filtered image by weighting the image according to the weighting coefficient corresponding to the underexposed image based on the mean-filtered image and the normally exposed image corresponding to each underexposed image includes: acquiring each pixel of the mean-filtered image corresponding to each underexposed image to form a first pixel set; the first pixel set includes multiple first pixels arranged in pixel order; acquiring each pixel of the normally exposed image to form a second pixel set; the second pixel set includes multiple second pixels arranged in pixel order; multiplying each first pixel by the corresponding weighting coefficient to obtain a first weighting parameter; taking the second pixel corresponding to the pixel order of the first pixel as the target second pixel; multiplying the target second pixel by the corresponding weighting coefficient to obtain a second weighting parameter; and performing data processing based on each first weighting parameter, the corresponding second weighting parameter, and the corresponding first pixel to obtain the filtered image of the corresponding underexposed image.

[0068] The first pixel set includes multiple first pixels arranged in a pixel order, where pixel order refers to the arrangement of pixels among all pixels in the corresponding image. For example, an image may contain 3x3 pixels, totaling 9 pixels, labeled A through I. The pixel order can be 1 through 9. The first pixel A has a pixel order of 1, and the last pixel I has a pixel order of 9.

[0069] Accordingly, the set of second pixels includes multiple second pixels arranged in pixel order.

[0070] Specifically, the electronic device acquires each pixel of the mean-filtered image corresponding to each underexposed image, and forms a first set of pixels according to the pixel order of each pixel in the corresponding underexposed image, wherein each pixel in the first set of pixels is called a first pixel; and acquires each pixel of the normally exposed image, and forms a second set of pixels according to the pixel order of each pixel in the normally exposed image, wherein each pixel in the second set of pixels is called a second pixel.

[0071] Furthermore, for each underexposed image, there is a corresponding weighting coefficient. The electronic device multiplies each first pixel with the corresponding weighting coefficient of the underexposed image to obtain the first weighting parameter corresponding to the underexposed image.

[0072] Furthermore, the electronic device takes the second pixel corresponding to the pixel order of the first pixel as the target second pixel, and then multiplies the target second pixel with the weighting coefficient corresponding to the underexposed image to obtain the second weighting parameter; then, the electronic device performs data statistical processing based on the first weighting parameter, the second weighting parameter and the first pixel corresponding to each first pixel to obtain the filtered image of the underexposed image corresponding to the first pixel.

[0073] In one embodiment, data processing based on each first weighting parameter, a corresponding second weighting parameter, and a corresponding first pixel to obtain a filtered image of the corresponding underexposed image includes: subtracting each second weighting parameter from the corresponding first weighting parameter to obtain a weighting parameter difference; adding the weighting parameter difference to the corresponding first pixel to obtain filtered pixels in the corresponding pixel order; and arranging the obtained filtered pixels in the corresponding pixel order to obtain a filtered image of the corresponding underexposed image.

[0074] Specifically, the electronic device subtracts the first weighted parameter from the second weighted parameter to obtain the weighted parameter difference, and then adds the weighted parameter difference to the first pixel to obtain the filtered pixel corresponding to the pixel order position of the first pixel. Then, all the obtained filtered pixels are sorted according to the corresponding pixel order to form a filtered image of the underexposed image corresponding to the first pixel.

[0075] For example, the filtered image Dst of an underexposed image can be calculated using the following formula:

[0076] Dst=Src*k+(1-k)*Avg

[0077] Where Src is the normally exposed image, Avg is the mean-filtered image corresponding to the underexposed image, and k is the weighting coefficient corresponding to the underexposed image.

[0078] In one embodiment, fusing the normally exposed image and the filtered image corresponding to each underexposed image to obtain the high dynamic range image corresponding to the target object includes: when there are two underexposed images, the pixel count of the high dynamic range image corresponding to the target object is calculated using the following formula:

[0079] Dst(hdr)=Dst1*a+Dst2*b+Ev0*(1-ab)

[0080] Where Dst(hdr) is the pixel of the high dynamic range image; Dst1 and Dst2 refer to the pixel sequence of each underexposed image; Ev0 refers to the pixel sequence of the normally exposed image; a and b refer to the preset fusion coefficients of the corresponding underexposed image.

[0081] Step S106: The normally exposed image and the filtered image corresponding to each underexposed image are fused to obtain the high dynamic range image corresponding to the target object.

[0082] Specifically, the electronic device acquires the preset fusion coefficient corresponding to each underexposed image, and further adds the product of the pixels of each underexposed image multiplied by the corresponding preset fusion coefficient to obtain the sum of products; then, the difference of fusion coefficients obtained by subtracting 1 from all preset fusion coefficients is obtained, and the difference of fusion coefficients is multiplied by the pixels corresponding to the normally exposed image to obtain the product; finally, the sum of products obtained above is added to this product to obtain the HRD image.

[0083] In one embodiment, when there are two underexposed images, the pixel count of the high dynamic range image corresponding to the target object is calculated using the following formula:

[0084] Dst(hdr)=Dst1*a+Dst2*b+Ev0*(1-ab)

[0085] Where Dst(hdr) is the pixel of the high dynamic range image; Dst1 and Dst2 refer to the pixel sequence of each underexposed image; Ev0 refers to the pixel of the normally exposed image; a and b refer to the preset fusion coefficients of the corresponding underexposed image.

[0086] In one embodiment, such as Figure 2 The image processing method is illustrated in the figure. The image obtained by this method includes an underexposed image with an exposure of EV-4, an underexposed image with an exposure of EV-2, and a normally exposed image (exposure of EV0). The sigma of the underexposed image with EV-4 (labeled Src1 in the figure) is set to 300 (i.e., Sigma1 in the figure); the sigma of the underexposed image with EV-2 (labeled Src2 in the figure) is set to 100 (i.e., Sigma2 in the figure); and the sigma of the normally exposed image with EV0 (labeled EV0 in the figure) is set to 0 (i.e., Sigma3 in the figure). The image processing method proposed in this scheme mainly includes the following steps:

[0087] Step 201: Perform mean filtering on the underexposed image of EV-4 to obtain the mean-filtered image Avg1;

[0088] Step 202: Select Src1 as the target region. For each pixel X1(i,j) in the underexposed image Src1 and the corresponding weighting coefficient threshold Sigma1, calculate the pixel variance D1(i,j) and K1(i,j) of each pixel in the target region.

[0089] Step 203: Based on the underexposed image Src1 and the mean-filtered image Avg1, calculate the filtered image Dst1 using the following formula:

[0090] Dst1=Src1*k+(1-k)*Avg1

[0091] Step 204: Perform mean filtering on the underexposed image of EV-2 to obtain the mean-filtered image Avg2;

[0092] Step 205: Select the target region for Src2. For each pixel X2(i,j) in the underexposed image Src2 and the corresponding weighting coefficient threshold Sigma2, calculate the pixel variance D2(i,j) and K2(i,j) of each pixel in the target region.

[0093] Step 206: Based on the underexposed image Src2 and the mean-filtered image Avg2, calculate the filtered image Dst2 using the following formula:

[0094] Dst2=Src2*k+(1-k)*Avg2

[0095] Step 207: Calculate the fused HDR image based on images Dst1, Dst2, and Ev0. The pixel count of the HDR image is calculated using the following formula:

[0096] Dst(hdr)=Dst1*a+Dst2*b+Ev0*(1-ab)

[0097] Where Dst(hdr) is the pixel of the high dynamic range image; Dst1 and Dst2 refer to the pixel sequence of each underexposed image; Ev0 refers to the pixel of the normally exposed image; a and b refer to the preset fusion coefficients of the corresponding underexposed image.

[0098] In the aforementioned image processing method, the electronic device acquires a normally exposed image of the target object and at least two underexposed images with different exposure levels. Each underexposed image is then filtered to obtain a corresponding filtered image. The normally exposed image and the filtered images corresponding to each underexposed image are then fused to obtain a high dynamic range image of the target object. This solution, by using at least two underexposed images with different exposure levels and performing local statistical and mean filtering on them, can better preserve the texture details of the image. The mean filtering also effectively removes image noise. Furthermore, by fusing at least two underexposed images with different exposure levels with a normally exposed image, the dark details of the original image can be significantly improved. Moreover, this solution does not use overexposed images, further reducing the highlight portion; therefore, the resulting high dynamic range image can be used for highlight suppression.

[0099] It should be understood that, although Figure 1-2 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order in which these steps are executed, and they can be performed in other orders. Figure 1-2 At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.

[0100] In one embodiment, such as Figure 3 As shown, an image processing apparatus 300 is provided, including: an exposure image acquisition module 302, a filtered image determination module 304, and a high dynamic range image generation module 306, wherein:

[0101] The exposure image acquisition module 302 is used to acquire a normally exposed image of the target object, as well as at least two underexposed images with different exposure levels.

[0102] The filtered image determination module 304 is used to perform filtering processing on each underexposed image to obtain the corresponding filtered image.

[0103] The high dynamic range image generation module 306 is used to fuse the normally exposed image and the filtered image corresponding to each underexposed image to obtain the high dynamic range image corresponding to the target object.

[0104] In one embodiment, the filtered image determination module is further configured to perform mean filtering on each underexposed image to obtain a corresponding mean-filtered image; calculate the weighting coefficient corresponding to each underexposed image based on each underexposed image and the corresponding weighting coefficient threshold; and perform image weighting processing according to the weighting coefficient corresponding to each underexposed image and the normally exposed image to obtain the corresponding filtered image.

[0105] In one embodiment, the filtered image determination module is further configured to determine the corresponding target region from each underexposed image; calculate the pixel average value of the target region based on each pixel and the number of pixels corresponding to the target region; calculate the pixel variance of the target region based on the pixel average value and each pixel of the target region; and determine the weighting coefficient corresponding to each underexposed image based on the weighting coefficient threshold and the pixel variance corresponding to each underexposed image.

[0106] In one embodiment, the weighting coefficient is the ratio of the pixel variance to the sum of the pixel variance and the corresponding weighting coefficient.

[0107] In one embodiment, the filtered image determination module is further configured to acquire each pixel of the mean-filtered image corresponding to each underexposed image, forming a first pixel set; the first pixel set includes multiple first pixels arranged in pixel order; acquire each pixel of the normally exposed image, forming a second pixel set; the second pixel set includes multiple second pixels arranged in pixel order; multiply each first pixel by its corresponding weighting coefficient to obtain a first weighting parameter; take the second pixel corresponding to the pixel order of the first pixel as the target second pixel; multiply the target second pixel by its corresponding weighting coefficient to obtain a second weighting parameter; and perform data processing based on each first weighting parameter, the corresponding second weighting parameter, and the corresponding first pixel to obtain the filtered image of the corresponding underexposed image.

[0108] In one embodiment, the filtered image determination module is further configured to subtract each second weighted parameter from the corresponding first weighted parameter to obtain a weighted parameter difference; add the weighted parameter difference to the corresponding first pixel to obtain the filtered pixel in the corresponding pixel order; and arrange the obtained multiple filtered pixel in the corresponding pixel order to obtain the filtered image of the corresponding underexposed image.

[0109] In one embodiment, the high dynamic range image generation module is further configured to calculate the pixel count of the high dynamic range image corresponding to the target object using the following formula when there are two underexposed images:

[0110] Dst(hdr)=Dst1*a+Dst2*b+Ev0*(1-ab)

[0111] Where Dst(hdr) is the pixel of the high dynamic range image; Dst1 and Dst2 refer to the pixel sequence of each underexposed image; Ev0 refers to the pixel of the normally exposed image; a and b refer to the preset fusion coefficients of the corresponding underexposed image.

[0112] The aforementioned image processing apparatus, an electronic device, acquires a normally exposed image of the target object and at least two underexposed images with different exposure levels. It then filters each underexposed image to obtain a corresponding filtered image, and fuses the normally exposed image and the filtered images corresponding to each underexposed image to obtain a high dynamic range image of the target object. This solution, by using at least two underexposed images with different exposure levels and performing local statistical and mean filtering on them, can better preserve the texture details of the image. The use of mean filtering also effectively removes image noise. Furthermore, by fusing at least two underexposed images with different exposure levels with a normally exposed image, the dark details of the original image can be greatly improved. Moreover, this solution does not use overexposed images, further significantly reducing the highlight portion; therefore, the resulting high dynamic range image can be used for highlight suppression.

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

[0114] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 4As shown, the computer device includes a processor, memory, network interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used to communicate with external terminals via a network connection. When the computer program is executed by the processor, it implements an image processing method. The display screen can be a liquid crystal display (LCD) or an e-ink display. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad mounted on the computer device casing, or an external keyboard, touchpad, or mouse.

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

[0116] In one embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to perform the following steps: acquiring a normally exposed image corresponding to a target object, and at least two underexposed images with different exposure levels; filtering each underexposed image to obtain a corresponding filtered image; and fusing the normally exposed image and the filtered images corresponding to each underexposed image to obtain a high dynamic range image corresponding to the target object.

[0117] In one embodiment, when the processor executes the computer program, it further performs the following steps: performing mean filtering on each underexposed image to obtain a corresponding mean-filtered image; calculating the weighting coefficient corresponding to each underexposed image based on each underexposed image and the corresponding weighting coefficient threshold; and performing image weighting processing according to the weighting coefficient corresponding to each underexposed image and the normally exposed image to obtain a corresponding filtered image.

[0118] In one embodiment, when the processor executes the computer program, it further performs the following steps: determining a corresponding target region from each underexposed image; calculating the pixel average value of the target region based on each pixel and the number of pixels corresponding to the target region; calculating the pixel variance of the target region based on the pixel average value and each pixel of the target region; and determining the weighting coefficient corresponding to each underexposed image based on the weighting coefficient threshold and the pixel variance corresponding to each underexposed image.

[0119] In one embodiment, when the processor executes the computer program, it further performs the following steps: acquiring each pixel of the mean-filtered image corresponding to each underexposed image to form a first pixel set; the first pixel set includes multiple first pixels arranged in pixel order; acquiring each pixel of the normally exposed image to form a second pixel set; the second pixel set includes multiple second pixels arranged in pixel order; multiplying each first pixel by its corresponding weighting coefficient to obtain a first weighting parameter; taking the second pixel corresponding to the pixel order of the first pixel as the target second pixel; multiplying the target second pixel by its corresponding weighting coefficient to obtain a second weighting parameter; and performing data processing based on each first weighting parameter, the corresponding second weighting parameter, and the corresponding first pixel to obtain a filtered image corresponding to the underexposed image.

[0120] In one embodiment, when the processor executes the computer program, it further performs the following steps: subtracting each second weighting parameter from the corresponding first weighting parameter to obtain a weighting parameter difference; adding the weighting parameter difference to the corresponding first pixel to obtain a filtered pixel in the corresponding pixel order; and arranging the obtained multiple filtered pixel points in the corresponding pixel order to obtain a filtered image of the corresponding underexposed image.

[0121] In one embodiment, when the processor executes the computer program, it further performs the following steps: when there are two underexposed images, the pixel count of the high dynamic range image corresponding to the target object is calculated using the following formula:

[0122] Dst(hdr)=Dst1*a+Dst2*b+Ev0*(1-ab)

[0123] Where Dst(hdr) is the pixel of the high dynamic range image; Dst1 and Dst2 refer to the pixel sequence of each underexposed image; Ev0 refers to the pixel of the normally exposed image; a and b refer to the preset fusion coefficients of the corresponding underexposed image.

[0124] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, performs the following steps: acquiring a normally exposed image of a target object and at least two underexposed images with different exposure levels; filtering each underexposed image to obtain a corresponding filtered image; and fusing the normally exposed image and the filtered images corresponding to each underexposed image to obtain a high dynamic range image of the target object.

[0125] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: performing mean filtering on each underexposed image to obtain a corresponding mean-filtered image; calculating the weighting coefficient corresponding to each underexposed image based on each underexposed image and the corresponding weighting coefficient threshold; and performing image weighting processing according to the weighting coefficient corresponding to each underexposed image and the normally exposed image to obtain a corresponding filtered image.

[0126] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: determining a corresponding target region from each underexposed image; calculating the pixel average value of the target region based on each pixel and the number of pixels corresponding to the target region; calculating the pixel variance of the target region based on the pixel average value and each pixel of the target region; and determining the weighting coefficient corresponding to each underexposed image based on the weighting coefficient threshold and the pixel variance corresponding to each underexposed image.

[0127] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: acquiring each pixel of the mean-filtered image corresponding to each underexposed image to form a first pixel set; the first pixel set includes multiple first pixels arranged in pixel order; acquiring each pixel of the normally exposed image to form a second pixel set; the second pixel set includes multiple second pixels arranged in pixel order; multiplying each first pixel by its corresponding weighting coefficient to obtain a first weighting parameter; taking the second pixel corresponding to the pixel order of the first pixel as the target second pixel; multiplying the target second pixel by its corresponding weighting coefficient to obtain a second weighting parameter; and performing data processing based on each first weighting parameter, the corresponding second weighting parameter, and the corresponding first pixel to obtain a filtered image corresponding to the underexposed image.

[0128] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: subtracting each second weighting parameter from the corresponding first weighting parameter to obtain a weighting parameter difference; adding the weighting parameter difference to the corresponding first pixel to obtain a filtered pixel in the corresponding pixel order; and arranging the obtained multiple filtered pixel points in the corresponding pixel order to obtain a filtered image of the corresponding underexposed image.

[0129] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: when there are two underexposed images, the pixel count of the high dynamic range image corresponding to the target object is calculated using the following formula:

[0130] Dst(hdr)=Dst1*a+Dst2*b+Ev0*(1-ab)

[0131] Where Dst(hdr) is the pixel of the high dynamic range image; Dst1 and Dst2 refer to the pixel sequence of each underexposed image; Ev0 refers to the pixel of the normally exposed image; a and b refer to the preset fusion coefficients of the corresponding underexposed image.

[0132] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0133] The aforementioned computer equipment and storage medium, electronic devices acquire a normally exposed image of the target object and at least two underexposed images with different exposure levels. Each underexposed image is then filtered to obtain a corresponding filtered image. The normally exposed image and the filtered images corresponding to each underexposed image are then fused to obtain a high dynamic range image of the target object. This scheme, by using at least two underexposed images with different exposure levels and performing local statistical and mean filtering on them, can better preserve the texture details of the image. The mean filtering also effectively removes image noise. Furthermore, by fusing at least two underexposed images with different exposure levels and a normally exposed image, the dark details of the original image can be greatly improved. Moreover, this scheme does not use overexposed images, further significantly reducing the highlight portion; therefore, the resulting high dynamic range image can be used for highlight suppression.

[0134] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc.

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

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

Claims

1. An image processing method, characterized in that, The method includes: Acquire a normally exposed image of the target object, and at least two underexposed images with different exposure levels; Each underexposed image is filtered to obtain a corresponding filtered image; The normally exposed image and the filtered image corresponding to each of the underexposed images are fused to obtain the high dynamic range image corresponding to the target object. The step of filtering each underexposed image to obtain a corresponding filtered image includes: Each underexposed image is subjected to mean filtering to obtain a corresponding mean-filtered image; Calculate the weighting coefficient corresponding to each underexposed image based on each underexposed image and its corresponding weighting coefficient threshold; Based on the mean filtered image corresponding to each underexposed image and the normally exposed image, image weighting processing is performed according to the weighting coefficients corresponding to the underexposed image to obtain the corresponding filtered image; The step of obtaining the corresponding filtered image by performing image weighting processing according to the weighting coefficients corresponding to the underexposed image and the normally exposed image for each underexposed image includes: Each pixel of the mean-filtered image corresponding to each underexposed image is obtained to form a first pixel set; the first pixel set includes multiple first pixels arranged in pixel order. Each pixel of the normally exposed image is acquired to form a second pixel set; the second pixel set includes multiple second pixels arranged in pixel order; Multiply each of the first pixels by the corresponding weighting coefficient to obtain the first weighting parameter; The second pixel corresponding to the pixel order of the first pixel is taken as the target second pixel; the target second pixel is multiplied by the corresponding weighting coefficient to obtain the second weighting parameter; Data processing is performed based on each of the first weighting parameters, the corresponding second weighting parameters, and the corresponding first pixel to obtain a filtered image corresponding to the underexposed image.

2. The method according to claim 1, characterized in that, The step of calculating the weighting coefficient corresponding to each underexposed image based on each underexposed image and the corresponding weighting coefficient threshold includes: Determine the corresponding target region from each of the underexposed images; Calculate the average pixel value of the target region based on each pixel and the number of pixels corresponding to the target region; Calculate the pixel variance corresponding to the target region based on the average pixel value and each pixel in the target region; The weighting coefficients for each underexposed image are determined based on the weighting coefficient threshold and the pixel variance.

3. The method according to claim 2, characterized in that, The weighting coefficient is the ratio of the pixel variance to the sum of the pixel variance and the corresponding weighting coefficient.

4. The method according to claim 1, characterized in that, The step of processing data based on each of the first weighting parameters, the corresponding second weighting parameters, and the corresponding first pixel to obtain the filtered image corresponding to the underexposed image includes: Subtract each second weighted parameter from the corresponding first weighted parameter to obtain the weighted parameter difference; The weighted parameter difference is added to the corresponding first pixel to obtain the filtered pixel points in the corresponding pixel order; The obtained multiple filtered pixels are arranged in the corresponding pixel order to obtain the filtered image corresponding to the underexposed image.

5. The method according to any one of claims 1 to 4, characterized in that, The step of fusing the normally exposed image and the filtered image corresponding to each underexposed image to obtain the high dynamic range image corresponding to the target object includes: When there are two underexposed images, the pixel count of the high dynamic range image corresponding to the target object is calculated using the following formula: Dst(hdr)=Dst1* a+ Dst2*b+ Ev0*(1-ab) in, Dst(hdr) These are the pixels of the high dynamic range image; Dst1 and Dst2 This refers to the pixels in the pixel order corresponding to each of the underexposed images; Ev0 This refers to the pixels in the normally exposed image; a , b These refer to the preset fusion coefficients corresponding to the underexposed image.

6. An image processing apparatus, characterized in that, The device includes: The exposure image acquisition module is used to acquire a normally exposed image of the target object, as well as at least two underexposed images with different exposure levels; The filtered image determination module is used to perform filtering processing on each of the underexposed images to obtain a corresponding filtered image; the filtered image determination module is also used to perform mean filtering processing on each underexposed image to obtain a corresponding mean filtered image; calculate the weighting coefficient corresponding to each underexposed image according to each underexposed image and the corresponding weighting coefficient threshold; and perform image weighting processing according to the weighting coefficient corresponding to each underexposed image and the normally exposed image to obtain the corresponding filtered image. The step of obtaining the corresponding filtered image by performing image weighting processing according to the weighting coefficients corresponding to the underexposed image and the normally exposed image for each underexposed image includes: Each pixel of the mean-filtered image corresponding to each underexposed image is acquired to form a first pixel set; the first pixel set includes multiple first pixels arranged in pixel order; each pixel of the normally exposed image is acquired to form a second pixel set; the second pixel set includes multiple second pixels arranged in pixel order; each first pixel is multiplied by the corresponding weighting coefficient to obtain a first weighting parameter; the second pixel corresponding to the pixel order of the first pixel is taken as the target second pixel; the target second pixel is multiplied by the corresponding weighting coefficient to obtain a second weighting parameter; data processing is performed based on each first weighting parameter, the corresponding second weighting parameter, and the corresponding first pixel to obtain a filtered image corresponding to the underexposed image; a high dynamic range image generation module is used to perform image fusion of the normally exposed image and the filtered image corresponding to each underexposed image to obtain a high dynamic range image corresponding to the target object.

7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 5.

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

Citation Information

Patent Citations

  • Image processing method and device and electronic equipment

    CN111586308A