Image generation method and electronic equipment
By performing quality assessment and dynamic weight allocation on multi-exposure image sequences, the HDR image quality problem caused by the fixed weight strategy is solved, and the image detail and color performance are improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-27
- Publication Date
- 2026-04-07
AI Technical Summary
In existing technologies, fixed weight strategies are prone to causing loss of image detail and distortion of light and shadow when generating HDR images, resulting in low HDR image quality.
By evaluating the quality of multi-exposure image sequences, dynamically determining the weight of each image, and performing image fusion based on the evaluation results, HDR images are generated.
It improves the detail richness, color fidelity and dynamic range of HDR images, and avoids detail loss and light and shadow distortion caused by fixed or improper weight allocation.
Smart Images

Figure CN121815090A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, specifically to image generation methods and electronic devices. Background Technology
[0002] In the field of image processing, when shooting a scene with a large dynamic range, such as an outdoor landscape that simultaneously contains a bright sky and deep shadows, traditional single-exposure images struggle to retain rich details in both highlights and shadows. HDR (High Dynamic Range) shooting technology aims to expand the dynamic range, allowing the image to retain more details in both bright and dark areas, making the image closer to the real world as seen by the human eye, with more vibrant colors and higher contrast.
[0003] In existing technologies, a fixed-weight strategy is typically used to fuse a set of images with different exposure times to obtain an HDR image. This method is prone to problems such as loss of image detail and distortion of light and shadow due to improper weight allocation, resulting in low quality HDR images. Summary of the Invention
[0004] The purpose of this application is to provide an image generation method and electronic device that can adaptively determine the weight of an image based on its quality, thereby making the weight allocation more reasonable and improving the quality of HDR images.
[0005] In a first aspect, embodiments of this application provide an image generation method, the method comprising: acquiring a multi-exposure image sequence; wherein, each image in the multi-exposure image sequence corresponds to a different exposure time; performing a quality assessment on each image in the multi-exposure image sequence to obtain a quality assessment result; determining a first weight for each image in the multi-exposure image sequence based on the quality assessment result; and fusing the images in the multi-exposure image sequence based on the first weight to generate an HDR image.
[0006] Secondly, embodiments of this application provide an image generation apparatus, comprising: an acquisition unit for acquiring a multi-exposure image sequence, wherein each image in the multi-exposure image sequence corresponds to a different exposure time; an evaluation unit for performing quality evaluation on each image in the multi-exposure image sequence to obtain a quality evaluation result; a determination unit for determining a first weight for each image in the multi-exposure image sequence based on the quality evaluation result; and a fusion unit for fusing the images in the multi-exposure image sequence based on the first weight to generate an HDR image.
[0007] Thirdly, embodiments of this application provide an electronic device including a processor and a memory, wherein the memory stores programs or instructions executable on the processor, and the programs or instructions, when executed by the processor, implement the steps of the method described in the first aspect.
[0008] Fourthly, embodiments of this application provide a readable storage medium on which a computer program is stored, and when executed by a processor, the computer program implements the steps of the method described in the first aspect above.
[0009] Fifthly, embodiments of this application provide a chip, the chip including a processor and a communication interface, the communication interface being coupled to the processor, the processor being used to run programs or instructions to implement the method described in the first aspect.
[0010] In a sixth aspect, embodiments of this application provide a computer program product stored in a storage medium, which is executed by at least one processor to implement the method described in the first aspect.
[0011] In this embodiment, the quality of each image in the multi-exposure image sequence is first evaluated to obtain the quality evaluation result. Then, based on the quality evaluation result, a first weight is determined for each image in the multi-exposure image sequence. Finally, based on the first weight, the images in the multi-exposure image sequence are fused to generate an HDR image. In the above process, by evaluating the quality of each image in the multi-exposure image sequence and adaptively determining the first weight of each image based on the quality evaluation result, the weight allocation is no longer fixed or based on a single indicator, but can dynamically and accurately reflect the quality advantages of each image. Image fusion based on this ensures that high-quality images contribute more when synthesizing HDR images, thereby significantly improving the overall detail richness, color fidelity, and dynamic range of the generated HDR image. This avoids problems such as detail loss and light and shadow distortion caused by fixed or improper weight allocation, thus improving the quality of the HDR image. Attached Figure Description
[0012] Figure 1 This is a flowchart of the image generation method provided in the embodiments of this application; Figure 2 This is a flowchart of the image generation method provided in the embodiments of this application; Figure 3 This is a schematic diagram of the structure of the image generation apparatus provided in the embodiments of this application; Figure 4 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application; Figure 5 This is a schematic diagram of the hardware structure of an electronic device suitable for implementing the embodiments of this application. Detailed Implementation
[0013] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.
[0014] The terms "first," "second," etc., used in this application's specification are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such terms can be used interchangeably where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class, without limiting the number of objects; for example, a first object can be one or more. Furthermore, in the specification, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects have an "or" relationship.
[0015] The image generation method and apparatus provided in this application will be described in detail below with reference to the accompanying drawings, through specific embodiments and application scenarios.
[0016] Please refer to Figure 1 This document illustrates one of the flowcharts of the image generation method provided in this application embodiment. The image generation method provided in this application embodiment can be applied to electronic devices. In practice, the aforementioned electronic devices can be smartphones, tablets, laptops, wearable devices, etc.
[0017] The image generation method provided in this application includes the following steps: Step 101: Obtain a multi-exposure image sequence, wherein each image in the multi-exposure image sequence corresponds to a different exposure time.
[0018] In this embodiment, a multi-exposure image sequence refers to a set of images captured continuously at different exposure times in the same shooting scene and at a fixed camera position. The aim is to cover the complete brightness range of the shooting scene, from the darkest shadows to the brightest highlights, providing the raw data basis for HDR synthesis.
[0019] The number of images in a multi-exposure image sequence can be preset as needed, for example, it can be three images or five images, etc.; it can also be adaptively set according to the shooting scene, which is not limited here.
[0020] In practice, users can launch the camera app on their electronic devices and set it to HDR image shooting mode. When the user clicks the shutter button or inputs a shooting command via voice, a series of images captured consecutively at different exposure times can be obtained to produce a multi-exposure image sequence.
[0021] Step 102: Perform quality assessment on each image in the multi-exposure image sequence to obtain the quality assessment results.
[0022] In this embodiment, quality assessment refers to the process of quantitatively analyzing the quality of an image in specific attributes using computer algorithms, specifically the process of analyzing at least one quality indicator. The quality assessment result is the output of the above quality assessment process, containing the quantitative result of the above at least one quality indicator, and can be represented in the form of a set or vector, etc., to characterize the quality level of the image being assessed in at least one dimension.
[0023] In practice, quality assessment can be performed on the entire image; it can also be performed on a local area of the image, such as evaluating one or more regions; or it can be performed pixel-by-pixel or region-by-region. It should be noted that the selected image region to be analyzed, the analysis method used, and the computer algorithm employed can vary depending on the quality metric, and no restrictions are imposed here.
[0024] By evaluating the quality of each image in a multi-exposure image sequence, objective and multi-dimensional data is provided for determining the first weight, overcoming the problem of insufficient detail retention caused by image fusion using fixed weights in existing technologies, and helping to generate HDR images with rich details and true colors.
[0025] Optionally, the quality indicators may include, but are not limited to, at least one of the following: local contrast, brightness, color saturation, edge sharpness, and exposure appropriateness.
[0026] Local contrast reflects the dispersion of pixel grayscale values within a specific neighborhood of an image. It can be calculated as the ratio of the standard deviation to the mean of pixel values in that area and is an important indicator of detail sharpness. Specifically, a dynamic window can be used, adaptively selecting a 3×3, 5×5, or 7×7 window based on local texture density. For example, a 3×3 window can be used for densely textured forest areas in an image, while a 7×7 window can be used for sparsely textured sky areas. For image i in a multi-exposure image sequence, its local contrast is calculated using the following formula. :
[0027] in, The variance of pixels within the window. The average pixel value within the window. , It is a natural constant.
[0028] Brightness reflects the average lightness or darkness of a certain area of an image. It is obtained by calculating the weighted average of the pixel brightness values within that area and is used to evaluate the exposure level. Specifically, highlight areas with pixel values >220 are assigned a weight of 0.2, dark areas with pixel values <30 are assigned a weight of 0.8, and other areas are assigned a weight of 0.5. For image i in a multi-exposure image sequence, its brightness is calculated using the following formula. :
[0029] in, Here, N is the pixel weighting coefficient, and N is the total number of pixels within the window. This represents the pixel brightness value within the window.
[0030] Color saturation reflects the vividness or purity of colors in an image. It can be obtained by converting the image to the HSV color space and calculating the value of its saturation (S) channel. Specifically, the image can first be converted to the HSV space, and pixels with abnormal saturation, such as S>0.95 or S<0.05, can be removed. Then, neighborhood interpolation can be used to correct the saturation, and the image can be normalized to the [0,1] interval.
[0031] Edge sharpness reflects the sharpness of the contours or texture boundaries of objects in an image. It can be obtained by extracting edges using edge detection operators, such as the Canny operator, and then calculating the product of the edge pixel percentage and the mean gradient.
[0032] Exposure appropriateness reflects how suitable the exposure time of the current image is relative to a preset ideal reference exposure time Tref, and is usually calculated based on a Gaussian function of the deviation between the two. For image i in a multi-exposure image sequence, its exposure appropriateness is calculated using the following formula. :
[0033] in, This represents the standard deviation of exposure time.
[0034] Step 103: Based on the quality assessment results, determine the first weight of each image in the multi-exposure image sequence.
[0035] In this embodiment, for each image in the multi-exposure image sequence, its first weight is a coefficient assigned to that image to control its contribution to the final composite result. In practice, the higher the image quality indicated by the quality assessment result, the higher the first weight; conversely, the lower the image quality indicated by the quality assessment result, the lower the first weight. Based on the quality assessment results of each image in the multi-exposure image sequence, the first weight of each image in the multi-exposure image sequence can be determined in various ways.
[0036] As an example, a weight calculation formula can be pre-defined based on a large amount of statistical data. For each image in a multi-exposure image sequence, the quantified values of each quality index in its quality assessment results can be substituted into this weight calculation formula to obtain the first weight of that image.
[0037] As another example, a weight calculation model can be pre-trained using machine learning methods, such as logistic regression. The quality assessment results of each image in a multi-exposure image sequence can be input into this weight calculation model to obtain the first weight of that image.
[0038] Because the quality assessment results are derived from the adaptive determination of the first weight for each image, the weight allocation is no longer fixed or based on a single metric, but rather dynamically and accurately reflects the quality advantages of each image. Based on this, image fusion ensures that high-quality images contribute more significantly when synthesizing HDR images, thereby significantly improving the overall detail richness, color fidelity, and dynamic range of the generated HDR image. This avoids problems such as detail loss and lighting distortion caused by fixed or improper weight allocation, thus improving the quality of HDR images.
[0039] Step 104: Based on the first weight, the images in the multi-exposure image sequence are fused to generate an HDR image.
[0040] In this embodiment, an HDR image refers to an image whose pixel brightness value can represent or exceed the brightness range of the actual shooting scene, such as an image that is much higher than the range that a standard display device can directly display. Its data format is usually floating point number in order to retain a wide range of brightness information.
[0041] Image fusion is an image processing operation that combines images from a multi-exposure image sequence into a single image. Here, image fusion can be performed using a weighted fusion method to obtain an HDR image; alternatively, weighted fusion can be performed first, followed by further optimization of the resulting image to obtain an HDR image; alternatively, preprocessing can be performed on the images in the multi-exposure image sequence before weighted fusion, and then weighted fusion can be performed on the processed images to obtain an HDR image; no specific limitations are specified here.
[0042] The method provided in the above embodiments of this application first performs quality assessment on each image in a multi-exposure image sequence to obtain a quality assessment result; then, based on the quality assessment result, determines a first weight for each image in the multi-exposure image sequence; finally, based on the first weight, fuses the images in the multi-exposure image sequence to generate an HDR image. In this process, by performing quality assessment on each image in the multi-exposure image sequence and adaptively determining the first weight for each image based on the quality assessment result, the weight allocation is no longer fixed or based on a single indicator, but can dynamically and accurately reflect the quality advantages of each image. Image fusion based on this ensures that high-quality images contribute more significantly when synthesizing HDR images, thereby significantly improving the overall detail richness, color fidelity, and dynamic range performance of the generated HDR image, avoiding problems such as detail loss and light and shadow distortion caused by fixed or improper weight allocation, and improving the quality of the HDR image.
[0043] In some optional embodiments, step 101 may include the following steps: Step S11: Obtain the dynamic range of the shooting scene of the multi-exposure image sequence.
[0044] The shooting scene refers to the objective physical world scene and its lighting environment that the camera lens is pointing at and recording. Dynamic range refers to the ratio of the brightness of the brightest object surface or area to the brightness of the darkest object surface or area in the shooting scene, usually expressed in decibels (dB). It is a physical quantity that describes the brightness range of the scene itself and is independent of the shooting device.
[0045] In practice, after a user triggers HDR shooting mode, a quick scene analysis process can be performed first. A preview frame can be captured using a default exposure parameter, such as 1 / 100s. A full-image brightness analysis can then be performed on this preview frame, generating its brightness histogram. By analyzing this histogram, the minimum and maximum effective pixel brightness values are found, corresponding to the darkest and brightest parts of the scene, respectively. Based on the photoelectric response characteristics of the camera sensor, these two digital brightness values are converted into corresponding estimated physical brightness values for the scene. Then, their ratio is calculated and converted to decibels. This estimated value represents the dynamic range of the shooting scene.
[0046] As an example, for a landscape scene consisting of a bright sky and dark woods, analysis of the preview frame brightness histogram determined that the pixel brightness distribution spanned a wide range from near 0 to near the saturation value of 255. The calculated dynamic range estimate was 75 dB.
[0047] Step S12: Obtain a multi-exposure image sequence based on dynamic range acquisition.
[0048] The first step is to determine the number of images to be acquired based on the dynamic range.
[0049] Specifically, a dynamic range threshold can be preset to guide the selection of shooting strategies; for example, the dynamic range threshold can be set to 60dB. The dynamic range estimated in the previous step can be compared with the dynamic range threshold, and the number of images to be acquired can be determined based on the comparison result.
[0050] As an example, if the dynamic range is less than or equal to the dynamic range threshold, it can be determined that the scene brightness range is small, and a sparser exposure sampling strategy can be adopted to balance quality and processing efficiency. In this case, it can be determined that there are 3 images to be acquired, namely a short exposure image, a medium exposure image, and a long exposure image.
[0051] Conversely, if the dynamic range exceeds the dynamic range threshold, it can be determined that the scene brightness spans a large range. To ensure that all details from extremely bright to extremely dark areas can be fully captured, a denser exposure sampling strategy can be adopted. In this case, five images can be determined to be captured: an ultra-short exposure image, a short exposure image, a medium exposure image, a long exposure image, and an ultra-long exposure image.
[0052] The second step is to acquire images with different exposure times based on the determined number, thus obtaining a multi-exposure image sequence.
[0053] Here, after determining the number of images to be acquired, the exposure time Ti for each image i can be calculated. The core of this process is to determine a reference exposure time Tref, which is typically based on the camera's metering system's assessment of the overall scene brightness, aiming to ensure correct exposure of the midtone areas. Then, according to a preset exposure bracketing scheme, using Tref as a reference, and with a certain exposure compensation step size, the exposure times for other images are calculated separately in the overexposed and underexposed directions.
[0054] As an example, with a reference exposure time Tref = 1 / 100s, a total of 5 images need to be captured: ultra-short exposure image I0, short exposure image I1, medium exposure image I2, long exposure image I3, and ultra-long exposure image I4. The exposure time can be set as follows: ultra-short exposure image T0 = 1 / 2000s, short exposure image I1 T1 = 1 / 1000s, medium exposure image I2 T2 = Tref = 1 / 100s, long exposure image I3 T3 = 1 / 10s, and ultra-long exposure image I4 T4 = 1 / 5s. By controlling the camera to take pictures sequentially or simultaneously with these five exposure times, a multi-exposure image sequence {I0, I1, I2, I3, I4} can be obtained.
[0055] By acquiring the dynamic range of the shooting scene from the aforementioned multi-exposure image sequence, the extreme brightness and darkness of the scene can be quantitatively assessed before shooting. This changes the blind approach of using a fixed number of images and a fixed exposure compensation step size in traditional HDR shooting, providing objective data for the formulation of shooting strategies. By determining the number of exposure images based on the dynamic range, the number of images captured is no longer fixed but adapts to the scene complexity, ensuring that optimized images for both highlights and shadows are captured on the brightness axis, providing complete raw data for subsequent fusion. For wide dynamic range scenes, by incorporating ultra-short exposure images and ultra-long exposure images, the signal capture capability in extreme highlight and shadow areas can be specifically enhanced.
[0056] Therefore, this approach ensures that the overall brightness coverage of the multi-exposure image sequence matches the dynamic range of the real scene from the source. It effectively solves two problems that may arise from the fixed shooting strategy in existing technologies: overshooting and resource waste in low dynamic range scenes, and undershooting and missing raw data in high dynamic range scenes. The latter, in particular, is problematic because the lack of extreme brightness details in the raw data cannot be fully compensated for by subsequent algorithms. Therefore, this embodiment, through an adaptive pre-shooting strategy, provides a solid and more closely matched data foundation for generating high-quality, information-free HDR images, thereby improving the robustness and final image quality ceiling of the HDR imaging system from the source.
[0057] In some optional embodiments, after performing step 101, the following steps may also be performed: Step S21: Preprocess the multi-exposure image sequence. The preprocessing includes at least one of the following: image alignment processing and noise suppression processing.
[0058] In this embodiment, image alignment processing, also known as image registration, is a process of performing spatial geometric transformations on multiple images captured in the same scene from different perspectives or at different times, so that the corresponding scene points are positioned consistently in the image coordinate system. Its purpose is to eliminate pixel-level positional deviations caused by camera shake, slight object movement, or lens distortion.
[0059] Image alignment processing may include, but is not limited to, aligning images in a multi-exposure image sequence based on scale-invariant feature transform (SIFT) feature point matching algorithms and / or optical flow. SIFT is a classic local feature detection and description algorithm used to extract feature points from an image that are invariant to scale, rotation, and brightness changes, and to generate their high-dimensional descriptors; it is commonly used for image matching and alignment. Optical flow is a technique for estimating the optical flow field of pixels in an image sequence. Based on the assumptions of constant temporal brightness and spatial smoothness, it calculates the minute displacement of each pixel between adjacent images and is often used to correct for minute motions between consecutive frames.
[0060] As an example, SIFT can be used first to locate key matching points such as edges and textures of each image in a multi-exposure image sequence, for example, 1200 valid matching points can be identified; then, the slight rotation and scaling offsets generated during the shooting process can be corrected by optical flow, such as rotation angle ≤1° and scaling ratio ≤5%, so that the final pixel offset error is controlled within 0.3 pixels to ensure image alignment accuracy.
[0061] In this embodiment, noise suppression processing, also known as image denoising, is a processing technique aimed at recovering the original clean signal from an image contaminated by noise. Its core is to remove random noise while preserving as much of the image's structural details such as edges and textures as possible.
[0062] Noise suppression processing includes, but is not limited to, at least one of the following: median filtering for images in a multi-exposure image sequence with exposure times greater than a threshold; and wavelet thresholding for images in a multi-exposure image sequence with exposure times less than the aforementioned threshold. Median filtering is a nonlinear spatial filtering technique. It sorts the gray values of all pixels in a pixel's neighborhood and takes the median as the output value for that pixel. It is highly effective at removing impulse noise while also preserving edges well. Wavelet thresholding is a frequency-domain transform-based denoising method. It decomposes the image into the wavelet domain, suppresses noise by applying thresholding to high-frequency wavelet coefficients, and then reconstructs the image through inverse transform, achieving a good balance between denoising and detail preservation.
[0063] As an example, a reference exposure time Tref = 1 / 100s, i.e., the exposure time of a medium-exposure image, can be used as a threshold. Adaptive median filtering is applied to long-exposure and ultra-long-exposure images, with the window size dynamically adjusted according to noise density. For example, the selectable range is from 3×3 to 7×7 to suppress Gaussian noise in dark areas. Wavelet thresholding is used for ultra-short-exposure and short-exposure images, decomposing the wavelet coefficients into three layers and thresholding the high-frequency noise coefficients to preserve detail information. In practice, after preprocessing, the signal-to-noise ratio of all five images is improved by ≥18%, meeting the requirements for subsequent processing.
[0064] By performing high-precision image alignment, accurate correspondences are created for pixel-level dynamic weight fusion, a prerequisite for achieving high-quality fusion. Adaptive noise suppression based on classification reduces the interference of noise on quality assessment and fusion results, improving the signal-to-noise ratio of the data. These two processes work synergistically to ensure that subsequent image fusion processes are based on more accurate data, thus laying a reliable data foundation for the final generation of high-resolution, low-noise, high-quality HDR images.
[0065] In some optional embodiments, the quality assessment results in step 102 may include, but are not limited to, at least one of the following: local contrast, brightness, color saturation, edge sharpness, and exposure appropriateness. Step 103 may further include the following steps: Step S31: Based on the shooting scene of the multi-exposure image sequence, determine the second weight of each result in the quality assessment result.
[0066] Here, a pre-trained scene classification model, such as a random forest classifier, can be invoked. This model takes global features of the mid-exposure image I2 as input, such as color histogram and texture features, and outputs a classification label for the current scene, such as "landscape," "portrait," or "night scene." Based on this label, a predefined weight configuration mapping table can be indexed. This weight configuration mapping table stores the second weights for each result in the quality assessment results for different scene types.
[0067] As an example, the quality assessment results may include local contrast, brightness, color saturation, edge sharpness, and exposure appropriateness. By retrieving the weight configuration mapping table, a second weight combination [α, β, γ, δ, ε] can be obtained, where α, β, γ, δ, and ε are the second weights for local contrast, brightness, color saturation, edge sharpness, and exposure appropriateness, respectively, and their sum is 1. For example, in a landscape scene, the scene classification model can determine the parameters α=0.35, β=0.2, γ=0.3, δ=0.1, and ε=0.05.
[0068] By determining the second weight of each result in the quality assessment result based on the shooting scene of the multi-exposure image sequence, the evaluation criteria can be dynamically adjusted according to the visual optimization focus of different scenes. For example, landscapes emphasize details and colors, while portraits emphasize skin color and contours, enabling the weight allocation strategy to ensure the consistency between the fusion target and the scene semantics.
[0069] Step S32: Based on the second weight, perform weighted summation on the quality assessment results corresponding to each image in the multi-exposure image sequence to obtain the third weight corresponding to each image.
[0070] Specifically, for each image Ii in the multi-exposure image sequence, the quality assessment of this image has been completed in the previous steps, generating the quantization results of various quality indicators. For example, the quality assessment results may include local contrast , brightness , color saturation , edge sharpness , and exposure rationality . These values can be weighted and summed to obtain the third weight of the image Ii:
[0071] By performing weighted summation on each result in the quality assessment result of each image based on the second weight to obtain the third weight of this image, the performance of the image in multiple independent dimensions such as local contrast and brightness can be integrated into a single and more representative quality score according to the importance ratio of the scene, solving the problem of one-sidedness in single-index evaluation and enabling the weight to more comprehensively reflect the comprehensive quality of the image.
[0072] Step S33: Compensate the third weight based on the exposure time corresponding to each image in the multi-exposure image sequence to obtain the first weight of each image in the multi-exposure image sequence.
[0073] Specifically, the exposure time Ti of the image Ii and the preset reference exposure time Tref can be obtained, and a piecewise linear compensation function is applied. If Ti > Tref, it means overexposure, and the third weight can be compensated according to the following formula: . If Ti < Tref, it means underexposure, and the third weight can be compensated according to the following formula: . Where δ1 and δ2 are preset positive compensation coefficients less than 1, used to adjust the intensity of the compensation. For example, = 0.15, = 0.08.
[0074] Since exposure time is a key physical parameter affecting image signal-to-noise ratio and dynamic range, by giving appropriate weight compensation to images that deviate from the reference exposure based on exposure time, we can further encourage the preservation of irreplaceable brightness range information contained in extreme exposure images, such as highlights from ultra-short exposures and shadows from ultra-long exposures, on top of content-based quality evaluation.
[0075] In summary, the method can assign an appropriate first weight to each image in a multi-exposure image sequence, thereby fundamentally overcoming the limitations of fixed weight or simple brightness mapping methods, and providing a core decision-making basis for generating high-quality HDR images with rich details, balanced exposure, and scene characteristics.
[0076] In some optional embodiments, step 104 above may further include the following steps: Step S41: Construct the image pyramid for each image in the multi-exposure image sequence.
[0077] An image pyramid refers to a collection of images generated from the same image, with progressively decreasing resolution; the higher the level, the smaller the size and the lower the resolution. In practice, this can be achieved by performing a series of downsampling or bandpass filtering operations on each image in a multi-exposure image sequence, generating a sequence of images with progressively decreasing resolution, each level representing a different spatial frequency component. This sequence is arranged from the bottom to the top, resembling a pyramid. Each level is called a scale and is used to analyze or process the image at different spatial frequencies.
[0078] By constructing image pyramids for each image in the aforementioned multi-exposure image sequence, each image is decomposed into scale spaces of different scales, so that each pyramid layer represents information of the original image at different spatial frequency bandwidths. Specifically, the top layer carries a large range of brightness structure and contours, while the bottom layer carries fine edges and textures. This achieves scale separation of image information, creating conditions for processing different types of information at different granularities.
[0079] Step S42: Based on the first weight, the image pyramids of each image in the multi-exposure image sequence are fused to obtain the fused image pyramid.
[0080] Here, the image pyramids of each image in the multi-exposure image sequence can be fused layer by layer to obtain the fused image pyramid. As an example, the image pyramid has four layers. The first layer images from the image pyramids of each image in the multi-exposure image sequence can be weighted and fused to obtain the fused first layer image. Similarly, the second layer images from the image pyramids of each image in the multi-exposure image sequence can be weighted and fused to obtain the fused second layer image. This process continues until the fused fourth layer image is obtained. The fused four layers constitute the fused image pyramid.
[0081] By fusing the image pyramids, parallel, scale-adaptive, dynamically weighted fusion is achieved across multiple resolution domains. The bottom-level fusion focuses on selecting and preserving the sharpest details, while the top-level fusion focuses on constructing the most reasonable overall brightness and contrast relationship. This separation process avoids detail blurring or halo artifacts caused by competition or interference between high-frequency details and low-frequency structures during single fusion at full resolution.
[0082] Step S43: Generate an HDR image based on the fused image pyramid.
[0083] This step is the reverse process of image pyramid construction, called pyramid reconstruction. It refers to starting from the fused top layer, combining the detailed information of the next layer, and through a series of upsampling and overlay operations, recovering a single image with the original resolution and fused multi-source information layer by layer. The final image obtained is the HDR image.
[0084] The pyramid reconstruction algorithm integrates the fusion results obtained independently at each scale into a complete image, ensuring that all information from macroscopic brightness distribution to microscopic texture details is harmoniously and uniformly reflected in the final image.
[0085] In summary, the above process significantly improves the visual quality of the fusion result, ensuring a natural transition and global consistency between information at different scales, thereby generating an HDR image that is superior in both overall tone and local detail. This overcomes the contradiction between global consistency and local accuracy that traditional single-scale fusion methods struggle to achieve when dealing with scenes with large dynamic ranges.
[0086] In some optional embodiments, the image pyramids of each image in the multi-exposure image sequence include a Laplacian pyramid and a Gaussian pyramid. The Gaussian pyramid is a multi-scale image sequence generated by iteratively applying Gaussian low-pass filtering and downsampling to the original image. Its top layer is a highly blurred and downsampled image, mainly containing the low-frequency brightness structure and large-scale contour information of the original image. The Laplacian pyramid is a multi-scale data structure derived from the Gaussian pyramid, used to represent high-frequency details of an image. Each layer is calculated by the difference between the corresponding Gaussian pyramid level and its upsampled version above it. Therefore, each layer of the Laplacian pyramid is essentially the bandpass filtering result of the original image at a specific scale, containing details such as edges and textures at that scale. Step S42 may further include the following steps: Step S51: Based on the first weight, the Laplacian pyramids of each image in the multi-exposure image sequence are fused to obtain the fused Laplacian pyramid.
[0087] Step S52: Based on the first weight, the Gaussian pyramids of each image in the multi-exposure image sequence are fused to obtain the fused Gaussian pyramid.
[0088] The fusion methods of the Laplacian pyramids and Gaussian pyramids of each image in a multi-exposure image sequence can be found in the image pyramid fusion method in the above embodiments, and will not be repeated here.
[0089] Understandably, the Laplacian channel focuses on optimizing detail quality such as edge sharpness and texture richness, while the Gaussian channel focuses on optimizing brightness structure quality such as exposure rationality and average regional brightness. By independently performing dynamic weight fusion in the two separate information channels, the first weight can exert its maximum effect in its most relevant information domain, avoiding mutual interference or compromises that may occur when evaluating detail and structure information together.
[0090] Step S53: Merge the merged Laplacian pyramid and the merged Gaussian pyramid to obtain the merged image pyramid.
[0091] Specifically, for each image i in a multi-exposure image sequence, the fused Laplacian pyramid and the fused Gaussian pyramid can be fused using the following formula:
[0092] in, Let i be the l-th layer of the Laplacian pyramid. Let i be the l-th layer of the Gaussian pyramid. This is the first layer of the merged Pyramid of Laplace. Let P be the l-th layer of the merged Gaussian pyramid, and Q be the weights of the merged Laplace pyramid. This represents the l-th layer of the merged image pyramid.
[0093] It should be noted that for lower levels, such as the first and second layers of a fused Laplacian pyramid and a fused Gaussian pyramid, the weight of the fused Laplacian pyramid can be greater than the weight of the fused Gaussian pyramid. For example, the weight of the fused Laplacian pyramid might be 0.7, while the weight of the fused Gaussian pyramid might be 0.3. Since the image quality at lower levels primarily depends on detail, assigning a higher weight to the fused Laplacian pyramid ensures richness and clarity in the final output. Conversely, for higher levels, such as a fused Laplacian pyramid and a fused Gaussian pyramid, the weight of the fused Laplacian pyramid can be less than the weight of the fused Gaussian pyramid. For example, the weight of the fused Laplacian pyramid might be 0.3, while the weight of the fused Gaussian pyramid might be 0.7. Since the image quality at higher levels primarily depends on overall tonal gradation and brightness relationships, assigning a higher weight to the fused Gaussian pyramid ensures natural global contrast and brightness in the final output, aligning with the human visual system's sensitivity to different image attributes at different scales.
[0094] Optionally, pixel-level confidence weighting can be further incorporated into the fusion process. Specifically, the variance of each pixel location in the multi-exposure image sequence can be calculated, and pixels with high consistency, such as those with variance <10, can be assigned a weight of 1.2 times; pixels with low consistency, such as those with variance >50, can be assigned a weight of 0.8 times.
[0095] Optionally, a Poisson fusion gradient guidance strategy can be used in overlapping edge regions of different objects in the image, such as overlapping edge regions of the sky and mountains, to make the edge transition brightness difference ≤3, so as to eliminate stitching marks.
[0096] Through the above process, the contradiction of simultaneously preserving high-frequency details and low-frequency structures in single pyramid fusion or simple weighted fusion is resolved. It can achieve excellent local detail reproduction and global tonal harmony in the final generated HDR image, thereby significantly reducing the halo artifacts, detail flattening or local contrast imbalance caused by the coupling processing of detail and structural information, which are common in traditional methods, and obtaining fusion results with better visual effects.
[0097] In some alternative embodiments, see Figure 2 As shown, after performing step 104, the following steps can also be performed: Step 105: Perform tone optimization processing on the HDR image.
[0098] In the field of image processing, tonal optimization refers to a series of operations that improve the brightness distribution, contrast relationship, detail representation, and overall visual appeal of an image. Its core goal is to make the image more vivid and natural, and to meet specific aesthetic or display requirements. This processing is particularly crucial for HDR images, involving the compression and remapping of brightness information that exceeds the standard display range.
[0099] In this embodiment, the tone optimization processing includes, but is not limited to, at least one of the following processing methods: Processing Method 1: Adjust the contrast and brightness of the highlight, midtone, and shadow areas in the HDR image based on different mapping functions.
[0100] A mapping function is a mathematical transformation rule used to define the correspondence between input pixel values and output pixel values. Different function forms, such as linear, logarithmic, Gamma, and S-curve curves, will have different effects on the brightness and contrast of an image.
[0101] Highlight regions refer to the set of pixels in an HDR image whose brightness values are in the highest range, such as pixels with a value greater than 200. These typically correspond to the brightest parts of a scene, such as the sun, sky, and areas directly illuminated by a light source. The goal of processing them is to prevent overexposure and preserve texture details. For highlight regions, logarithmic compression algorithms or the Reinhard highlight suppression function can be used as mapping functions, aiming to smoothly compress the extremely high brightness values to a displayable range.
[0102] Midtone regions refer to the set of pixels in an HDR image whose brightness values fall within the middle range, such as pixels with values greater than or equal to 30 and less than or equal to 200. These typically correspond to the areas containing the main subject or most of the details in a scene. The goal of processing them is to enhance the sense of depth and visual impact. For midtone regions, mapping functions such as Gamma correction or contrast stretching algorithms can be used, with the aim of achieving optimal visual contrast in the main subject area.
[0103] Dark areas refer to the set of pixels in an HDR image whose brightness values are in the lowest range, such as pixels with a value less than 30. These typically correspond to shadows or dark objects in a scene. The goal of processing them is to improve visibility and reveal hidden details. For dark areas, linear stretching algorithms or shadow enhancement curves can be used as mapping functions to bring hidden dark details into the visible range.
[0104] By adjusting the contrast and brightness of highlight, midtone, and shadow areas in HDR images based on different mapping functions, different processing can be applied to address issues such as overexposure of highlights, lack of visibility of shadow details, and need to highlight midtones. This achieves a coordinated and balanced display of information from the brightest to the darkest within a single image, avoiding the loss of local details or contrast imbalance caused by a single global mapping function, and improving the quality of HDR images.
[0105] Method 2: Smoothing and edge-preserving processing of HDR images based on guided filtering algorithm.
[0106] Among them, the guided filtering algorithm is an edge-preserving smoothing filter based on a local linear model. It uses a guide image (usually the image to be processed itself) to guide the filtering process, which can effectively smooth uniform regions while accurately preserving edges.
[0107] By using a guided filtering algorithm to smooth and preserve edges in HDR images, adaptive smoothing is achieved within the pixel neighborhood. The structural information provided by the guided image ensures that the filter weights are distributed along the edge direction, effectively suppressing noise in flat areas while maintaining the clarity of object contours and boundaries, thus improving the visual purity of the image without introducing edge blurring.
[0108] Method 3: Optimize the texture of HDR images based on a bilateral filtering algorithm.
[0109] Among them, the bilateral filtering algorithm is a nonlinear filter whose weights are determined by both spatial distance and pixel value differences. It can better preserve edges and textures when smoothing images because the range weights prevent pixels that cross significant edges from averaging with each other.
[0110] By using a bilateral filtering algorithm to optimize the texture of HDR images, pixel value similarity can be used as an additional constraint. This allows the filter to identify and preserve subtle changes within the texture during smoothing, while also smoothing across significant brightness / color abrupt changes. This enhances and highlights the texture details and quality of the image while removing small-amplitude noise or unevenness.
[0111] Method 4: Noise and artifact suppression processing of HDR images based on nonlocal mean filtering algorithm.
[0112] Nonlocal mean filtering (NMR) is an advanced denoising algorithm that utilizes redundant information in the image. For the current pixel, it searches the entire image for all pixel blocks with similar neighborhood structures and uses a weighted average of these similar blocks to estimate the new value of the current pixel. It is highly effective at suppressing Gaussian noise and certain artifacts.
[0113] By using a nonlocal mean filtering algorithm to suppress noise and artifacts in HDR images, the algorithm leverages the stronger prior of the nonlocal self-similarity of images to find regions in the image that are far from the current position but structurally similar to assist in estimating the current pixel. This is extremely effective in suppressing spatially unrelated random noise and specific structural artifacts, and can better preserve complex and repetitive details while providing strong denoising.
[0114] The first processing method described above performs global tone optimization on the HDR image, while the second, third, and fourth processing methods perform local tone optimization on the HDR image. By flexibly configuring and combining the above processing methods, the visual quality of the final output HDR image can be significantly improved, enabling it to not only have a wide dynamic range but also achieve excellent levels in subjective visual indicators such as contrast, sharpness, purity, and detail.
[0115] In some alternative embodiments, see also [link to previous document]. Figure 2 After performing step 105, the following steps can also be performed: Step 106: Based on user feedback, adjust the parameters used in at least one of the quality assessment, weight determination, and tone optimization processes.
[0116] User feedback refers to users' subjective evaluations or operational instructions regarding HDR images. This feedback can take the form of text descriptions, ratings, marking of specific areas, or adjustments to the HDR image, such as brightness and saturation. User feedback reflects users' personalized preferences and optimization expectations for HDR image effects.
[0117] The parameters used in quality assessment may include, but are not limited to, the selection rules of the dynamic window when calculating local contrast, the weight of each brightness interval, and the standard deviation in the calculation of exposure rationality; the parameters used in the first weight determination process may include, but are not limited to, the weight coefficients of each quality index; the parameters used in tone optimization processing may include, but are not limited to, the thresholds of highlight / midtone / dark regions, the parameters of each region mapping function, and the filtering radius of various filtering algorithms, etc., which are not limited here.
[0118] In practice, optimization goals can be determined first based on user feedback. Electronic devices can maintain a parameter mapping table for user feedback, which defines the relationship between different quantification optimization goals and the parameters that need to be adjusted, as well as the direction / magnitude of their adjustment. The parameters that need adjustment and their direction / magnitude can be determined by querying the parameter mapping table.
[0119] Step 107: Update the HDR image based on the adjusted parameters.
[0120] Here, after updating the parameters, steps 101 to 105 above can be re-executed to obtain the updated HDR image.
[0121] By establishing a user feedback mechanism, we can learn and respond to users' unique aesthetic preferences, and make targeted adjustments to the HDR generation process accordingly, thereby enhancing the applicability and practicality of the HDR image generation process in the face of diverse and personalized visual needs.
[0122] It should be noted that the image generation method provided in this application can be executed by an image generation device. This application uses an image generation device executing the image generation method as an example to illustrate the image generation device provided in this application.
[0123] like Figure 3 As shown, the image generation apparatus 300 of this embodiment includes: an acquisition unit 301, used to acquire a multi-exposure image sequence; wherein, the exposure time of each image in the multi-exposure image sequence is different; an evaluation unit 302, used to perform quality evaluation on each image in the multi-exposure image sequence to obtain a quality evaluation result; a determination unit 303, used to determine a first weight of each image in the multi-exposure image sequence based on the quality evaluation result; and a fusion unit 304, used to fuse each image in the multi-exposure image sequence based on the first weight to generate an HDR image.
[0124] In some optional implementations of this embodiment, the acquisition unit 301 is further configured to: acquire the dynamic range of the shooting scene of the multi-exposure image sequence; determine the number of images to be acquired based on the dynamic range; and acquire images with different exposure times based on the number to obtain the multi-exposure image sequence.
[0125] In some optional implementations of this embodiment, the apparatus further includes a preprocessing unit, configured to: preprocess the multi-exposure image sequence, the preprocessing including at least one of the following: image alignment processing and noise suppression processing; wherein the noise suppression processing includes at least one of the following: performing median filtering processing on images in the multi-exposure image sequence with exposure times greater than a threshold; and performing wavelet threshold denoising processing on images in the multi-exposure image sequence with exposure times less than the threshold.
[0126] In some optional implementations of this embodiment, the quality assessment result includes at least one of the following: local contrast, brightness, color saturation, edge sharpness, and exposure reasonableness; the determining unit 303 is further configured to: determine a second weight for each result in the quality assessment result based on the shooting scene of the multi-exposure image sequence; perform a weighted summation of the quality assessment results corresponding to each image in the multi-exposure image sequence based on the second weight to obtain a third weight corresponding to each image; and compensate the third weight based on the exposure time corresponding to each image in the multi-exposure image sequence to obtain a first weight for each image in the multi-exposure image sequence.
[0127] In some optional implementations of this embodiment, the fusion unit 304 is further configured to: construct an image pyramid for each image in the multi-exposure image sequence; fuse the image pyramids of each image in the multi-exposure image sequence based on the first weight to obtain a fused image pyramid; and generate the HDR image based on the fused image pyramid.
[0128] In some optional implementations of this embodiment, the image pyramid includes a Laplacian pyramid and a Gaussian pyramid; the fusion unit 304 is further configured to: fuse the Laplacian pyramids of each image in the multi-exposure image sequence based on the first weight to obtain a fused Laplacian pyramid; fuse the Gaussian pyramids of each image in the multi-exposure image sequence based on the first weight to obtain a fused Gaussian pyramid; and fuse the fused Laplacian pyramid and the fused Gaussian pyramid to obtain a fused image pyramid.
[0129] In some optional implementations of this embodiment, the apparatus further includes a first update unit, configured to: perform tone optimization processing on the HDR image; wherein the tone optimization processing includes at least one of the following: adjusting the contrast and brightness of the highlight region, midtone region, and shadow region in the HDR image based on different mapping functions; performing smoothing and edge preservation processing on the HDR image based on a guided filtering algorithm; performing texture optimization processing on the HDR image based on a bilateral filtering algorithm; and performing noise and artifact suppression processing on the HDR image based on a nonlocal mean filtering algorithm.
[0130] In some optional implementations of this embodiment, the apparatus further includes a second updating unit, configured to: adjust the parameters used in at least one of the quality assessment, the first weight, and the tonal optimization processing based on user feedback information; and update the HDR image based on the adjusted parameters.
[0131] The apparatus provided in the above embodiments of this application first performs quality assessment on each image in a multi-exposure image sequence to obtain a quality assessment result; then, based on the quality assessment result, determines a first weight for each image in the multi-exposure image sequence; finally, based on the first weight, fuses the images in the multi-exposure image sequence to generate an HDR image. In the above process, by performing quality assessment on each image in the multi-exposure image sequence and adaptively determining the first weight for each image based on the quality assessment result, the weight allocation is no longer fixed or based on a single indicator, but can dynamically and accurately reflect the quality advantages of each image. Image fusion based on this ensures that high-quality images contribute more significantly when synthesizing HDR images, thereby significantly improving the overall detail richness, color fidelity, and dynamic range performance of the generated HDR image, avoiding problems such as detail loss and light and shadow distortion caused by fixed or improper weight allocation, and improving the quality of the HDR image.
[0132] The image generation device in this application embodiment can be an electronic device or a component within an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices besides a terminal. For example, the electronic device can be a mobile phone, tablet computer, laptop computer, PDA, in-vehicle electronic device, mobile internet device (MID), augmented reality (AR) / virtual reality (VR) device, robot, wearable device, ultra-mobile personal computer (UMPC), netbook, or personal digital assistant (PDA), etc. It can also be a server, network attached storage (NAS), personal computer (PC), television (TV), ATM, or self-service machine, etc. This application embodiment does not specifically limit the device.
[0133] The image generation device in this application embodiment can be a device with an operating system. This operating system can be Android, iOS, or other possible operating systems; this application embodiment does not specifically limit the specific operating system.
[0134] The image generation apparatus provided in this application embodiment can achieve... Figure 1 The various processes implemented in the method implementation examples will not be described again here to avoid repetition.
[0135] Optionally, such as Figure 4 As shown, this application embodiment also provides an electronic device 400, including a processor 401 and a memory 402. The memory 402 stores a program or instructions that can run on the processor 401. When the program or instructions are executed by the processor 401, they implement the various steps of the above-described image generation method embodiment and can achieve the same technical effect. To avoid repetition, they will not be described again here.
[0136] It should be noted that the electronic devices in the embodiments of this application include the mobile electronic devices and non-mobile electronic devices described above.
[0137] Figure 5 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of this application. The electronic device 500 includes, but is not limited to, components such as: radio frequency unit 501, network module 502, audio output unit 503, input unit 504, sensor 505, display unit 506, user input unit 507, interface unit 508, memory 509, and processor 510.
[0138] Those skilled in the art will understand that the electronic device 500 may also include a power supply (such as a battery) for supplying power to various components. The power supply may be logically connected to the processor 510 through a power management system, thereby enabling functions such as managing charging, discharging, and power consumption through the power management system. Figure 5 The electronic device structure shown does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements, which will not be elaborated here. The processor 510 is configured to acquire a multi-exposure image sequence, wherein each image in the multi-exposure image sequence has a different exposure time; to perform quality assessment on each image in the multi-exposure image sequence to obtain a quality assessment result; to determine a first weight for each image in the multi-exposure image sequence based on the quality assessment result; and to fuse the images in the multi-exposure image sequence based on the first weight to generate a high dynamic range (HDR) image.
[0139] By evaluating the quality of each image in a multi-exposure image sequence and adaptively determining the first weight of each image based on the evaluation results, the weight allocation is no longer fixed or based on a single metric, but rather dynamically and accurately reflects the quality advantages of each image. Image fusion based on this ensures that high-quality images contribute more significantly when synthesizing HDR images, thereby significantly improving the overall detail richness, color fidelity, and dynamic range of the generated HDR image. This avoids problems such as detail loss and lighting distortion caused by fixed or improper weight allocation, thus improving the quality of HDR images.
[0140] In some optional implementations of this embodiment, the processor 510 is further configured to acquire the dynamic range of the shooting scene of the multi-exposure image sequence; determine the number of images to be acquired based on the dynamic range; and acquire images with different exposure times based on the number to obtain the multi-exposure image sequence.
[0141] In some optional implementations of this embodiment, the processor 510 is further configured to preprocess the multi-exposure image sequence, the preprocessing including at least one of the following: image alignment processing and noise suppression processing; wherein the noise suppression processing includes at least one of the following: median filtering processing on images in the multi-exposure image sequence with an exposure time greater than a threshold; and wavelet threshold denoising processing on images in the multi-exposure image sequence with an exposure time less than the threshold.
[0142] In some optional implementations of this embodiment, the quality assessment result includes at least one of the following: local contrast, brightness, color saturation, edge sharpness, and exposure rationality; the processor 510 is further configured to determine a second weight for each result in the quality assessment result based on the shooting scene of the multi-exposure image sequence; based on the second weight, perform a weighted summation on the quality assessment result corresponding to each image in the multi-exposure image sequence to obtain a third weight corresponding to each image; and compensate the third weight based on the exposure time corresponding to each image in the multi-exposure image sequence to obtain the first weight of each image in the multi-exposure image sequence.
[0143] In some optional implementations of this embodiment, the processor 510 is further configured to construct an image pyramid for each image in the multi-exposure image sequence; fuse the image pyramids of each image in the multi-exposure image sequence based on the first weight to obtain a fused image pyramid; and generate the HDR image based on the fused image pyramid.
[0144] In some optional implementations of this embodiment, the image pyramid includes a Laplacian pyramid and a Gaussian pyramid; the processor 510 is further configured to fuse the Laplacian pyramids of each image in the multi-exposure image sequence based on the first weight to obtain a fused Laplacian pyramid; fuse the Gaussian pyramids of each image in the multi-exposure image sequence based on the first weight to obtain a fused Gaussian pyramid; and fuse the fused Laplacian pyramid and the fused Gaussian pyramid to obtain a fused image pyramid.
[0145] In some optional implementations of this embodiment, the device further includes a processor 510, which is further configured to perform tone optimization processing on the HDR image; wherein the tone optimization processing includes at least one of the following: adjusting the contrast and brightness of the highlight, midtone and shadow regions in the HDR image based on different mapping functions; performing smoothing and edge preservation processing on the HDR image based on a guided filtering algorithm; performing texture optimization processing on the HDR image based on a bilateral filtering algorithm; and performing noise and artifact suppression processing on the HDR image based on a nonlocal mean filtering algorithm.
[0146] In some optional implementations of this embodiment, the processor 510 is further configured to adjust the parameters used in at least one of the quality assessment, the first weight, and the tone optimization processing based on user feedback information; and update the HDR image based on the adjusted parameters.
[0147] It should be understood that, in this embodiment, the input unit 504 may include a graphics processing unit (GPU) 5041 and a microphone 5042. The GPU 5041 processes image data of still images or videos obtained by an image capture device (such as a camera) in video capture mode or image capture mode. The display unit 506 may include a display panel 5061, which may be configured in the form of a liquid crystal display, an organic light-emitting diode, or the like. The user input unit 507 includes at least one of a touch panel 5071 and other input devices 5072. The touch panel 5071 is also called a touch screen. The touch panel 5071 may include a touch detection device and a touch controller. Other input devices 5072 may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, power buttons, etc.), trackballs, mice, and joysticks, which will not be described in detail here.
[0148] The memory 509 can be used to store software programs and various data. The memory 509 may primarily include a first storage area for storing programs or instructions and a second storage area for storing data. The first storage area may store the operating system, application programs or instructions required for at least one function (such as sound playback, image playback, etc.). Furthermore, the memory 509 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus RAM (DRRAM). The memory 509 in this embodiment includes, but is not limited to, these and any other suitable types of memory.
[0149] Processor 510 may include one or more processing units; optionally, processor 510 integrates an application processor and a modem processor, wherein the application processor mainly handles operations involving the operating system, user interface, and applications, and the modem processor mainly handles wireless communication signals, such as a baseband processor. It is understood that the aforementioned modem processor may also not be integrated into processor 510.
[0150] This application also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the above-described image generation method embodiments and achieve the same technical effect. To avoid repetition, they will not be described again here.
[0151] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.
[0152] This application embodiment also provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement the various processes of the above-described image generation method embodiments and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0153] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.
[0154] This application provides a computer program product, which is stored in a storage medium and executed by at least one processor to implement the various processes of the image generation method embodiments described above, and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0155] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
[0156] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0157] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.
Claims
1. An image generation method, characterized in that, The method includes: A multi-exposure image sequence is obtained; wherein, each image in the multi-exposure image sequence corresponds to a different exposure time; The quality of each image in the multi-exposure image sequence is evaluated to obtain the quality evaluation result; Based on the quality assessment results, a first weight is determined for each image in the multi-exposure image sequence; Based on the first weight, the images in the multi-exposure image sequence are fused to generate a high dynamic range (HDR) image.
2. The method according to claim 1, characterized in that, The acquisition of the multi-exposure image sequence includes: Obtain the dynamic range of the shooting scene for the multi-exposure image sequence; The multi-exposure image sequence is obtained based on the dynamic range.
3. The method according to claim 1, characterized in that, After acquiring the multi-exposure image sequence, the method further includes: The multi-exposure image sequence is preprocessed, and the preprocessing includes at least one of the following: image alignment processing and noise suppression processing; The noise suppression processing includes at least one of the following: performing median filtering on images in the multi-exposure image sequence whose exposure time is greater than a threshold; and performing wavelet threshold denoising on images in the multi-exposure image sequence whose exposure time is less than the threshold.
4. The method according to claim 1, characterized in that, The quality assessment results include at least one of the following: local contrast, brightness, color saturation, edge sharpness, and exposure appropriateness; determining the first weight of each image in the multi-exposure image sequence based on the quality assessment results includes: Based on the shooting scene of the multi-exposure image sequence, determine the second weight of each result in the quality assessment result; Based on the second weight, the quality assessment results corresponding to each image in the multi-exposure image sequence are weighted and summed to obtain the third weight corresponding to each image. The third weight is compensated based on the exposure time corresponding to each image in the multi-exposure image sequence to obtain the first weight of each image in the multi-exposure image sequence.
5. The method according to claim 1, characterized in that, The step of fusing the images in the multi-exposure image sequence based on the first weight to generate a high dynamic range (HDR) image includes: Construct an image pyramid for each image in the multi-exposure image sequence; Based on the first weight, the image pyramids of each image in the multi-exposure image sequence are fused to obtain a fused image pyramid. The HDR image is generated based on the fused image pyramid.
6. The method according to claim 5, characterized in that, The image pyramid includes a Laplacian pyramid and a Gaussian pyramid; the process of fusing the image pyramids of each image in the multi-exposure image sequence based on the first weight to obtain a fused image pyramid includes: The Laplacian pyramids of each image in the multi-exposure image sequence are fused based on the first weight to obtain the fused Laplacian pyramid. Based on the first weight, the Gaussian pyramids of each image in the multi-exposure image sequence are fused to obtain the fused Gaussian pyramid. The merged Laplacian pyramid and the merged Gaussian pyramid are then merged to obtain the merged image pyramid.
7. The method according to claim 1, characterized in that, After generating the high dynamic range (HDR) image, the method further includes: Perform tonal optimization processing on the HDR image; The tonal optimization process includes at least one of the following: The contrast and brightness of the highlight, midtone and shadow areas in the HDR image are adjusted based on different mapping functions. The HDR image is smoothed and edge-preserving based on a guided filtering algorithm; The texture optimization process for the HDR image is performed based on a bilateral filtering algorithm; The HDR image is processed to suppress noise and artifacts based on a nonlocal mean filtering algorithm.
8. An image generation apparatus, characterized in that, The device includes: An acquisition unit is used to acquire a multi-exposure image sequence; wherein, each image in the multi-exposure image sequence corresponds to a different exposure time; An evaluation unit is used to perform quality evaluation on each image in the multi-exposure image sequence and obtain a quality evaluation result. A determining unit is configured to determine the first weight of each image in the multi-exposure image sequence based on the quality assessment results; The fusion unit is used to fuse the images in the multi-exposure image sequence based on the first weight to generate an HDR image.
9. An electronic device, characterized in that, It includes a processor and a memory, the memory storing a program or instructions that can run on the processor, the program or instructions being executed by the processor to implement the steps of the image generation method as described in any one of claims 1-7.
10. A readable storage medium, characterized in that, The readable storage medium stores a program or instructions that, when executed by a processor, implement the steps of the image generation method as described in any one of claims 1-7.
Citation Information
Cited By
Image processing method and device, equipment and storage medium
CN122089789A