Image processing method and device, electronic equipment and storage medium
By constructing a base map and a residual map using edge-preserving filtering technology, the problem of edge artifacts in high-contrast scenes during multi-exposure fusion is solved, achieving a more natural and stable image fusion effect.
Patent Information
- Application Number
- CN202611328395.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-28
- Publication Date
- 2026-11-27
AI Technical Summary
Existing multi-exposure fusion methods are prone to edge artifacts in high-contrast scenes, such as black edges, dark edges, or halos, especially in small foreground objects and the boundary between bright and dark areas, which affects the stability and naturalness of the image.
Edge-preserving filtering technology is used to construct an edge-preserving base map and a residual map. Multi-exposure image fusion is performed through an edge-preserving pyramid and combined with an initial fusion weight map for fusion processing to reduce artifacts in high-contrast edge areas.
It effectively reduces blurring and high-frequency transitions at high-contrast edges, improves the naturalness and edge stability of multi-exposure fused images, and reduces the probability of black borders and halo artifacts.
Smart Images

Figure CN123181279A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, specifically to an image processing method, apparatus, electronic device, and storage medium. Background Technology
[0002] Multi-exposure fusion is a common implementation method in high dynamic range imaging technology. It typically involves acquiring multiple images of the same scene with different exposures and fusing them based on the differences in imaging quality in different regions of each image to obtain a fused image with rich details in both bright and dark areas. This type of method can achieve image dynamic range extension without relying on camera response function calibration, and is therefore widely used in mobile terminals, cameras, video capture devices, and image processing software.
[0003] Among existing multi-exposure fusion methods, the Mertens exposure fusion method is a typical approach. This method typically calculates the fusion weights for each exposure image based on features such as contrast, saturation, and exposure of the input image, and then combines this with a multi-scale pyramid structure to fuse the images from different exposures. Because this method is relatively simple and computationally inexpensive, it is suitable for deployment on edge devices.
[0004] However, in real-world high-contrast scenes, existing multi-exposure fusion methods may still suffer from edge artifacts. For example, when an image contains small foreground objects, strong light-dark boundary areas, or dark structures in a bright background, the fused image may exhibit darkened edges, black borders, halos, or localized brightness discontinuities near the object edges. These problems are particularly noticeable in small or high-contrast structures such as tree branches, railings, finger edges, and building outlines.
[0005] Therefore, how to reduce black edges, dark edges or halo artifacts in high-contrast edge areas during multi-exposure fusion, and improve the stability and naturalness of fused images at complex edge structures, remains a technical problem that needs to be solved in this field. Summary of the Invention
[0006] This application provides an image processing method, apparatus, electronic device, and storage medium that can improve and reduce black edges, dark edges, or halo artifacts in high-contrast edge areas, and enhance the stability and naturalness of fused images at complex edge structures.
[0007] In a first aspect, embodiments of this application provide an image processing method, the method comprising: Acquire multi-exposure images, wherein the multi-exposure images include at least two images to be processed with different exposure levels; Calculate the initial fusion weight map corresponding to each of the images to be processed; Based on edge-preserving filtering, construct the edge-preserving base map and edge-preserving residual map corresponding to each of the images to be processed; The edge-preserving base map and the edge-preserving residual map are fused according to the initial fusion weight map to obtain the target multi-exposure fused image.
[0008] Secondly, embodiments of this application also provide an image processing apparatus, the apparatus comprising: An acquisition module is used to acquire multi-exposure images, wherein the multi-exposure images include at least two images to be processed with different exposure levels; The calculation module is used to calculate the initial fusion weight map corresponding to each of the images to be processed; The construction module is used to construct the edge-preserving base map and edge-preserving residual map corresponding to each of the images to be processed based on edge-preserving filtering; The fusion module is used to fuse the edge-preserving base map and the edge-preserving residual map according to the initial fusion weight map to obtain a target multi-exposure fused image.
[0009] Optionally, in some embodiments of this application, the step of constructing the edge-preserving base map and edge-preserving residual map corresponding to each of the images to be processed based on edge-preserving filtering includes: For each of the images to be processed, an edge-preserving pyramid is constructed through edge-preserving filtering. Each layer of the edge-preserving pyramid contains an edge-preserving base map and an edge-preserving residual map. The edge-preserving base map is obtained through edge-preserving filtering, and the edge-preserving residual map is constructed based on the difference between the edge-preserving base maps of adjacent layers.
[0010] Optionally, in some embodiments of this application, fusing the edge-preserving base map and the edge-preserving residual map according to the initial fusion weight map to obtain the target multi-exposure fused image includes: Construct the initial weight pyramids for each of the initial fusion weight graphs; Based on the initial weight pyramids, the edge-preserving pyramids are merged to obtain the merged pyramid; The fusion pyramid is reconstructed to obtain the target multi-exposure fused image.
[0011] Optionally, in some embodiments of this application, the step of merging the edge-preserving pyramids based on the initial weight pyramids to obtain a merged pyramid includes: Using the normally exposed image in each of the images to be processed as the guide image, the edge-preserving smooth diffusion is performed on each of the initial weight pyramids to obtain the optimized weight pyramids corresponding to each of the images to be processed. The optimized weighted pyramid is used to fuse the edge-preserving residual maps in the edge-preserving pyramid to obtain a fused residual pyramid. Each layer of the fused residual pyramid corresponds to the fused residual map and the unfused edge-preserving base map. The edge-preserving base map in the fusion residual pyramid is fused using the initial weight pyramid to obtain the fusion pyramid. Each layer of the fusion pyramid corresponds to the fused fusion residual map and the fused fusion base map.
[0012] Optionally, in some embodiments of this application, reconstructing the fusion pyramid to obtain the target multi-exposure fused image includes: The target multi-exposure fused image is obtained by fusing the fusion base map of the top layer of the fusion pyramid with the fusion residual maps of each layer; The fusion process includes at least one of the following: scale-wise weighted fusion, local weighted minimization, local energy minimization, noise adaptive fusion, or frequency adaptive fusion.
[0013] Optionally, in some embodiments of this application, the edge-preserving filter includes at least one of guided filtering, bilateral filtering, weighted least squares filtering, rasterized edge-preserving filtering, local adaptive mean filtering, and nonlocal mean filtering; or, The edge-preserving filter is implemented by constructing a Laplacian pyramid using an edge-aware mask; or, the edge-preserving filter is implemented by constructing a pyramid based on structural tensor control.
[0014] Optionally, in some embodiments of this application, the step of using the normally exposed image in each of the images to be processed as a guide image, and performing edge-preserving smooth diffusion on each of the initial weight pyramids to obtain the optimized weight pyramid corresponding to each of the images to be processed includes: Based on one or more of the following features of the normally exposed image, edge-preserving smooth diffusion is performed on each of the initial weight pyramids to obtain the optimized weight pyramid corresponding to each of the images to be processed; Edges, gradient magnitudes, structural tensors, edge masks, orientation consistency maps, neighborhood brightness variation maps, or adaptive region clustering.
[0015] Thirdly, embodiments of this application also provide an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, it implements the steps in the image processing method described above.
[0016] Fourthly, embodiments of this application also provide a storage medium, which includes a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps in the image processing method described above.
[0017] Fifthly, embodiments of this application also provide a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the methods provided in the various optional implementations described in embodiments of this application.
[0018] In summary, the embodiments of this application obtain a multi-exposure image, which includes at least two images to be processed with different exposure levels. An initial fusion weight map is calculated for each image to be processed. An edge-preserving base map and an edge-preserving residual map are constructed for each image to be processed based on edge-preserving filtering. The edge-preserving base map and the edge-preserving residual map are fused according to the initial fusion weight map to obtain the target multi-exposure fused image.
[0019] Edge-preserving filtering, by preserving strong edge structures while smoothing the image, reduces the problem of excessive blurring of low-frequency layers at high-contrast edges and lowers high-frequency jumps in the residual image. Consequently, in subsequent multi-exposure fusion and reconstruction processes, it reduces edge darkening, black borders, and halo artifacts, improving the naturalness and edge stability of the target multi-exposure fused image. Attached Figure Description
[0020] To more clearly illustrate the technical solutions in this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0021] Figure 1 This is a schematic diagram of a scenario in which a terminal device provided in this application performs the image processing method; Figure 2 This is a schematic flowchart of the image processing method provided in the embodiments of this application; Figure 3 This is a schematic diagram of the structure of the image processing 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.
[0022] Explanation of icon numbers: 101-Terminal device; 301-Acquisition module; 302-Computing module; 303-Construction module; 304-Fusion module; 401-Processor; 402-Memory; 403-Power supply; 404-Input unit. Detailed Implementation
[0023] The technical solutions of this application will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0024] In the description of the embodiments of this application, it should be understood that the terms "center," "longitudinal," "lateral," "length," "width," "thickness," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," and "outer," etc., indicating orientation or positional relationships based on the orientation or positional relationships shown in the accompanying drawings, are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the present invention. Furthermore, the terms "first," "second," "third," and "fourth" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, features defined with "first," "second," "third," and "fourth" may explicitly or implicitly include one or more features. In the description of the present invention, "a plurality of" means two or more, unless otherwise explicitly specified.
[0025] In this application, the term "exemplary" is used to mean "serving as an example, illustration, or description." Any embodiment described as "exemplary" in this application is not necessarily to be construed as being more preferred or advantageous than other embodiments. The following description is provided to enable any person skilled in the art to make and use the invention. Details are set forth in the following description for purposes of explanation. It should be understood that those skilled in the art will recognize that the invention can be made without using these specific details. In other instances, well-known structures and processes will not be described in detail to avoid obscuring the description of the invention with unnecessary detail. Therefore, the invention is not intended to be limited to the embodiments shown, but is consistent with the broadest scope of the principles and features disclosed in this application.
[0026] This application provides an image processing method, apparatus, electronic device, and storage medium. Specifically, this application provides an image processing apparatus suitable for electronic devices, including terminal devices such as mobile phones, tablets, laptops, cameras, or image signal processors. The method is applicable to multi-exposure image fusion processing in the aforementioned terminal devices. Specifically, this application constructs a base image and residual image for each exposure image through edge-preserving filtering, and performs edge-preserving smooth diffusion control on the weights corresponding to low-exposure images during the fusion process, thereby reducing black edge artifacts in high-contrast edge regions.
[0027] For example, please see Figure 1 , Figure 1 This is a schematic diagram illustrating a scenario where a terminal device, according to an embodiment of this application, executes the image processing method. Specifically, the execution process of the image processing method by the terminal device is as follows: Terminal device 101 acquires a multi-exposure image, which includes at least two images to be processed with different exposure levels. It calculates an initial fusion weight map corresponding to each image to be processed, constructs an edge-preserving base map and an edge-preserving residual map corresponding to each image to be processed based on edge-preserving filtering, and fuses the edge-preserving base map and the edge-preserving residual map according to the initial fusion weight map to obtain the target multi-exposure fused image.
[0028] In summary, edge-preserving filtering can smooth an image while retaining strong edge structures, thus reducing the problem of excessive blurring of low-frequency layers at high-contrast edges and lowering high-frequency jumps in the residual image. Therefore, in subsequent multi-exposure fusion and reconstruction processes, it can reduce edge darkening, black borders, and halo artifacts, improving the naturalness and edge stability of the target multi-exposure fused image.
[0029] The following sections provide detailed descriptions of each example. It should be noted that the order in which the embodiments are described is not intended to limit the priority of the embodiments.
[0030] Please see Figure 2 , Figure 2 This is a flowchart illustrating an image processing method provided in an embodiment of this application. Although a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than that shown in the flowchart. Specifically, the specific flow of this image processing method is as follows: S201. Obtain a multi-exposure image, wherein the multi-exposure image includes at least two images to be processed with different exposure levels.
[0031] Multiple exposure images are used to refer to multiple images with different exposure levels captured or generated for the same scene. For example, multiple exposure images can include low-exposure images, normal-exposure images, and high-exposure images, or they can include two or more images with different exposure levels.
[0032] The image to be processed refers to a single exposed image participating in the image fusion processing of this application. For example, the image to be processed can be an EV- image, an EV0 image, or an EV+ image. An EV- image can be understood as a low-exposure image, an EV0 image as a normal-exposure image, and an EV+ image as a high-exposure image.
[0033] Different exposure levels indicate the use of different exposure values, exposure compensation amounts, exposure times, gains, or brightness mapping methods during image acquisition or generation, resulting in differences in highlight details, shadow details, and overall brightness among the images being processed. For example, low-exposure images retain highlight details well, but shadow areas may be too dark; high-exposure images retain shadow details well, but highlight areas may be overexposed; and normally exposed images have relatively balanced overall brightness.
[0034] Understandably, to facilitate subsequent pixel-by-pixel or scale-by-scale fusion, each image to be processed can be preprocessed. This preprocessing may include at least one of the following: size unification, image registration, channel format unification, pixel value normalization, and color space conversion.
[0035] Understandably, this step provides the input image foundation for subsequent weight calculations, edge-preserving pyramid construction, and multi-exposure fusion.
[0036] S202. Calculate the initial fusion weight map corresponding to each of the images to be processed.
[0037] The initial fusion weight map is a weight distribution map calculated for each image to be processed before fusion. The weight value of each pixel in the initial fusion weight map is used to indicate the suitability of the corresponding image to participate in fusion at that pixel position. For example, if the bright details of a low-exposure image are relatively intact in a certain region, the initial fusion weight of the low-exposure image in that region can be higher; if the brightness of a normally exposed image is moderate and the details are clear in a certain region, the initial fusion weight of the normally exposed image in that region can be higher.
[0038] The calculation of the initial fusion weight map refers to the process of generating a corresponding weight map based on the image quality features of each image to be processed. Image quality features can include at least one of contrast, saturation, and exposure. For example, the contrast weight can be calculated based on the Laplacian response of the image, the saturation weight can be calculated based on the standard deviation of the RGB channels, and the exposure weight can be calculated based on the degree to which the pixel brightness is close to the mid-brightness.
[0039] In one possible implementation, an initial fusion weight map for each image to be processed can be calculated based on the Mertens exposure fusion method. Specifically, the contrast weight, saturation weight, and exposure weight of each image to be processed can be calculated separately, and these weight factors can be multiplied together to obtain the corresponding initial weights. Furthermore, the initial weights of each image to be processed at the same pixel position can be normalized so that the sum of the weights corresponding to each image to be processed at the same pixel position is 1.
[0040] Understandably, this step can determine the initial fusion contribution of each image to be processed at different locations, providing a weighting basis for subsequent residual map fusion and base map fusion.
[0041] S203. Construct the edge-preserving base map and edge-preserving residual map corresponding to each of the images to be processed based on edge-preserving filtering.
[0042] Edge-preserving filtering refers to filtering processes that preserve the edge structure of an image while smoothing it. Unlike ordinary smoothing filters such as Gaussian filtering, edge-preserving filtering can suppress noise or small fluctuations in flat areas and reduce cross-edge blurring in strong edge areas. Edge-preserving filters can be guided filtering, bilateral filtering, or weighted least squares filtering, among others.
[0043] The edge-preserving base map is used to indicate the low-frequency map or base layer image extracted from the image to be processed by edge-preserving filtering. The edge-preserving base map mainly contains information on the overall brightness, large-scale structure, and smooth regions of the image, while maintaining boundary stability at strong edges. For example, after applying edge-preserving filtering to an image containing tree branches and sky boundaries, the boundaries between the tree branches and sky in the base map will not be significantly blurred as in Gaussian filtering.
[0044] The edge-preserving residual map is used to indicate the difference between edge-preserving base maps at adjacent scales, or the difference between the current-scale image and its corresponding base map. The edge-preserving residual map primarily contains high-frequency information such as edges, textures, and local details. For example, in the edge region of a tree branch, the residual map can represent detail variations not included in the base map.
[0045] Specifically, for each image to be processed, edge-preserving filtering can be performed layer by layer. For example, the original image to be processed can be used as the base image at layer 0; edge-preserving filtering can be performed on the base image at layer 0 to obtain the base image at layer 1; then edge-preserving filtering can be performed on the base image at layer 1 to obtain the base image at layer 2; and so on, obtaining base images at multiple scales layer by layer. The difference between two adjacent base images at layer 0 can be used as the edge-preserving residual image of the corresponding layer.
[0046] In one possible implementation, different filtering radii can be used to filter the original image to be processed, resulting in edge-preserving base maps of different layers. For example, the filtering radius can be 3×3, 5×5, or 7×7, etc.
[0047] Understandably, this step can reduce the problem of excessive residuals in strong edge regions of traditional Gaussian pyramids, making the edge residuals more stable during subsequent reconstruction, thereby reducing black edge artifacts.
[0048] S204. The edge-preserving base map and the edge-preserving residual map are fused according to the initial fusion weight map to obtain the target multi-exposure fused image.
[0049] Among them, the target multi-exposure fusion image refers to the output image obtained by fusing multiple images to be processed at different exposure levels. This target multi-exposure fusion image can have a high dynamic range effect and can simultaneously preserve details in bright areas, dark areas, and normally exposed areas.
[0050] Fusion refers to the process of combining corresponding image components of different images into a single image component based on weights or optimization criteria. For example, at the same scale, the edge-preserving residual maps / edge-preserving base maps of low-exposure, normal-exposure, and high-exposure images can be weighted and summed according to their corresponding weights.
[0051] Understandably, in this step, a weight map of the corresponding scale can be formed based on the initial fusion weight map, and the edge-preserving base map and edge-preserving residual map of each image to be processed can be fused using the weight map of the corresponding scale, respectively, to obtain the fused multi-scale image representation. Then, reconstruction can be performed based on the fused base map and the fused residual map to obtain the target multi-exposure fused image.
[0052] Understandably, this step can improve the problem of black edges, dark edges, or halos in target multi-exposure fused images by using the edge-preserving base map and edge-preserving residual map to reduce the propagation of abnormal residuals at strong edges while preserving the advantages of multi-exposure images.
[0053] In summary, in traditional multi-exposure fusion, if Gaussian filtering is directly used for multi-exposure image fusion, strong edges are blurred by the low-frequency layer, causing large jumps in the residual layer at the edges, resulting in black edge artifacts. However, in the embodiments of this application, edge-preserving filtering can retain strong edge structures while smoothing the image, thus reducing the problem of excessive blurring of the low-frequency layer at high-contrast edges and reducing high-frequency jumps in the residual image. Therefore, in subsequent multi-exposure fusion and reconstruction processes, edge darkening, black edges, and halo artifacts can be reduced, improving the naturalness and edge stability of the target multi-exposure fused image.
[0054] Optionally, the construction method of the edge-preserving base map and the edge-preserving residual map can be explained in conjunction with the multi-layered characteristics of the pyramid. That is, optionally, in some embodiments of this application, the step of "constructing the edge-preserving base map and the edge-preserving residual map corresponding to each of the images to be processed based on edge-preserving filtering" includes: For each of the images to be processed, an edge-preserving pyramid is constructed through edge-preserving filtering. Each layer of the edge-preserving pyramid contains an edge-preserving base map and an edge-preserving residual map. The edge-preserving base map is obtained through edge-preserving filtering, and the edge-preserving residual map is constructed based on the difference between the edge-preserving base maps of adjacent layers.
[0055] The edge-preserving pyramid refers to a multi-scale image decomposition structure built based on edge-preserving filtering. Each layer of the edge-preserving pyramid includes an edge-preserving base map and an edge-preserving residual map. For example, an edge-preserving pyramid can be built for a low-exposure image, and an edge-preserving pyramid can be built for a normal-exposure image.
[0056] The difference between the edge-preserving base maps of adjacent layers indicates the difference between a finer-scale base map and an adjacent coarser-scale base map. For example, if the 0th base map is the original image and the 1st base map is the image obtained by edge-preserving filtering the 0th base map, then the 1st residual map can be obtained by subtracting the 0th base map from the 1st base map; if the 2nd base map is the image obtained by further edge-preserving filtering the 1st base map, then the 2nd residual map can be obtained by subtracting the 1st base map from the 2nd base map.
[0057] Specifically, the following multi-scale structure can be constructed for any image to be processed: Use the image to be processed as the base map for edge preservation at layer 0; Edge-preserving filtering is applied to the 0th layer edge-preserving baseline map to obtain the 1st layer edge-preserving baseline map, and the 1st layer edge-preserving residual map is obtained based on the difference between the 0th layer edge-preserving baseline map and the 1st layer edge-preserving baseline map. Edge-preserving filtering is applied to the first-layer edge-preserving baseline map to obtain the second-layer edge-preserving baseline map, and the second-layer edge-preserving residual map is obtained based on the difference between the first-layer edge-preserving baseline map and the second-layer edge-preserving baseline map. By analogy, we obtain the multi-layer edge-preserving base map and the multi-layer edge-preserving residual map.
[0058] In this way, the image to be processed can be decomposed into a combination of the coarsest edge-preserving base map and the edge-preserving residual maps of each layer.
[0059] Understandably, since each base map is obtained layer by layer through edge-preserving filtering, the residual map obtained by subtracting adjacent base maps is not formed by edge diffusion differences caused by ordinary Gaussian blurring, but rather by inter-layer detail differences extracted while maintaining the relative preservation of edge structure. In other words, edge-preserving filtering can smooth flat areas while suppressing cross-boundary diffusion at strong edges, ensuring good consistency between adjacent base maps at the true edge locations. Therefore, in the edge-preserving residual map obtained by subtracting adjacent base maps, the residual amplitudes corresponding to strong edges are more stable, and abnormally large residuals caused by excessive edge blurring are less likely to appear.
[0060] For example, in the region where a bright background meets a dark, small foreground object, if a Gaussian filter is used to construct the base map, the edges of the foreground object may be diffused into the background area, resulting in a large brightness difference between adjacent layers at that edge. This manifests as a significant abrupt change in the residual map. In contrast, when edge-preserving filtering is used to construct the base map layer by layer, the edge positions and shapes in the base map are relatively preserved. The differences between adjacent base maps reflect more of the true texture, details, and scale variations, rather than the pseudo-residuals introduced by filter diffusion. Therefore, edge-preserving residual maps have the characteristics of stable edge positions, continuous residual distribution, and fewer abrupt changes.
[0061] Furthermore, since strong edge anomaly residuals in the edge-preserving residual map are suppressed, even if there is a certain deviation in the weight of a certain exposure image in a local area during the subsequent fusion process, this deviation is not easily amplified in the reconstruction stage through large edge residuals. This can reduce the probability of black edges, dark edges or halo artifacts appearing in the reconstructed image and improve the naturalness and stability of the multi-exposure fused image in high-contrast edge areas.
[0062] Optionally, after obtaining the edge-preserving pyramids of each image to be processed, it is necessary to make the fusion weights correspond to the edge-preserving pyramids of the images in scale so as to perform cross-exposure fusion at each layer. Therefore, an initial weight pyramid of each initial fusion weight map can be further constructed, and the edge-preserving pyramids can be fused using the initial weight pyramid. That is, optionally, in some embodiments of this application, the step "fusing the edge-preserving base map and the edge-preserving residual map according to the initial fusion weight map to obtain the target multi-exposure fused image" includes: Construct the initial weight pyramids for each of the initial fusion weight graphs; Based on the initial weight pyramids, the edge-preserving pyramids are merged to obtain the merged pyramid; The fusion pyramid is reconstructed to obtain the target multi-exposure fused image.
[0063] The initial weight pyramid refers to the multi-scale weight structure generated from the initial fusion weight map. Each layer of the initial weight pyramid has the same or corresponding scale as the corresponding layer in the edge-preserving pyramid, and is used to control the fusion ratio of different images to be processed at that scale. For example, the initial fusion weight map of a low-exposure image can be used to construct a low-exposure weight pyramid, and the initial fusion weight map of a normal-exposure image can be used to construct a normal-exposure weight pyramid.
[0064] The fusion pyramid is used to indicate the multi-scale fusion structure obtained after fusing the edge-preserving pyramids of each image to be processed. This fusion pyramid can include a fusion base map for each layer and a fusion residual map for each layer.
[0065] Reconstruction refers to the process of combining multi-scale image components in the fusion pyramid into a single target multi-exposure fused image. For example, the topmost or coarsest fusion base map can be used as the starting point for reconstruction, and the fusion residual maps of each layer can be stacked back layer by layer to restore the target output image.
[0066] In this embodiment, an initial weight pyramid is first constructed for each image to be processed, based on its initial fusion weight map. This initial weight pyramid can be obtained by performing layer-by-layer smoothing, downsampling, or scaling to maintain pyramid scale matching with the edges on the initial fusion weight map. Subsequently, at each scale layer, the base map and residual map corresponding to each image to be processed are fused using the weight map corresponding to each image to obtain the fusion pyramid. Finally, reconstruction is performed based on the fusion pyramid to obtain the target multi-exposure fused image.
[0067] It is understood that, through this embodiment, the weight information can correspond to the multi-scale structure of the image, so that the brightness structure and detail structure at each scale can be fused according to the appropriate exposure image.
[0068] In multi-exposure fusion, the weight maps corresponding to different exposure images usually need to be smoothed to avoid discontinuous fusion caused by abrupt weight changes. However, if the weight smoothing process does not consider the real image edges, the weights of each exposure image may spread across the edges, causing an exposure image that is not suitable for fusion in a certain edge region to make a large contribution in that region. Especially in high-contrast edges, small foreground objects, or areas with abrupt changes in brightness, this problem may cause black edges, dark edges, halos, or local brightness abnormalities to appear at the fused edges. To this end, in some embodiments of this application, a normal exposure image can be used as a guide image to perform edge-preserving smoothing diffusion on the initial weight pyramids corresponding to each image to be processed, so as to obtain the optimized weight pyramids corresponding to each image to be processed. That is, optionally, in some embodiments of this application, the step "fusing each edge-preserving pyramid based on each initial weight pyramid to obtain a fused pyramid" includes: Using the normally exposed image in each of the images to be processed as the guide image, the edge-preserving smooth diffusion is performed on each of the initial weight pyramids to obtain the optimized weight pyramids corresponding to each of the images to be processed. The optimized weighted pyramid is used to fuse the edge-preserving residual maps in the edge-preserving pyramid to obtain a fused residual pyramid. Each layer of the fused residual pyramid corresponds to the fused residual map and the unfused edge-preserving base map. The edge-preserving base map in the fusion residual pyramid is fused using the initial weight pyramid to obtain the fusion pyramid. Each layer of the fusion pyramid corresponds to the fused fusion residual map and the fused fusion base map.
[0069] In this context, a normally exposed image is used to indicate an image among the images to be processed that has a relatively moderate exposure and a relatively balanced overall brightness. For example, a normally exposed image can be an EV0 image. Normally exposed images typically have a relatively stable edge structure in the transition regions between light and dark areas, and therefore can be used as a structural reference in the weighted diffusion process.
[0070] The guide map is used to indicate the image that provides information on edge, texture, brightness variations, or structural boundaries during the smooth diffusion process at the edges. For example, when an EV0 image is used as the guide map, the smooth diffusion of the weight map is constrained by the edge structure in the EV0 image, allowing the weights to diffuse smoothly in flat areas, but making it difficult for them to diffuse across boundaries at strong edges.
[0071] Among them, edge-preserving smooth diffusion is used to indicate the process of limiting the diffusion of weights across boundaries based on the edge structure in the guide map when smoothing the weight map. For example, in the EV0 image where there are tree branch edges, railing edges, or finger outlines, edge-preserving smooth diffusion can reduce the degree of mutual penetration of weights on both sides of different edges; while in areas with continuous brightness such as the sky and walls, the weights can transition more naturally and smoothly.
[0072] The optimized weight pyramid indicates the weight pyramid obtained after smoothing the edges of the initial weight pyramid. The weight map in the optimized weight pyramid has better edge consistency compared to the initial weight pyramid. In other words, its weight distribution better matches the true structural boundaries in a normally exposed image.
[0073] Furthermore, the optimized weight maps can be normalized so that the sum of the optimized weights corresponding to the images to be processed at the same pixel position is 1.
[0074] The fusion residual pyramid is used to indicate the multi-scale residual structure obtained after fusing the edge-preserving residual maps of each image to be processed. Each layer of the fusion residual pyramid includes the fused residual map, while still retaining the unfused edge-preserving base map for subsequent base map fusion.
[0075] The fused residual map is used to indicate the residual map obtained by fusing edge-preserving residual maps of different exposure images according to corresponding weights at the same scale layer. The edge-preserving residual map mainly contains the edges, textures, and local details in the image. Therefore, using an optimized weight pyramid guided by a normally exposed image for residual map fusion can make the detail fusion process more consistent with the real edge structure and reduce the erroneous contribution of unsuitable exposure images to edge details.
[0076] The unfused edge-preserving base map is used to indicate that, after obtaining the fusion residual pyramid, the base maps corresponding to each image to be processed have not yet completed cross-exposure fusion. For example, in the l-th layer, the fusion residual pyramid may include the fusion residual map that has already been fused, while still retaining the unfused edge-preserving base map.
[0077] The fusion base map is used to indicate the base map obtained after fusing the edge-preserving base maps of each image to be processed at the same scale. The edge-preserving base map mainly contains information on overall brightness, large-scale structure, and smooth regions.
[0078] In this embodiment, the edge-preserving base map in the fusion residual pyramid is fused using the initial weight pyramid to obtain the fusion pyramid. That is, in the base map fusion stage, the initial weight pyramid corresponding to each image to be processed can be used instead of the optimized weight pyramid guided by the normally exposed image.
[0079] Understandably, this approach allows for better constraint on the fusion of edge detail components during the residual image fusion stage, reducing the risk of edge residuals being dominated by incorrectly exposed images. In the base image fusion stage, the initial weight pyramid is used to preserve the overall brightness fusion relationship determined based on initial quality evaluation results such as contrast, saturation, and exposure, avoiding excessive edge constraints on low-frequency brightness structures, thus balancing edge detail stability and overall exposure naturalness.
[0080] In one possible implementation, an initial weight pyramid can be constructed based on the initial fusion weight map to be processed. Then, a normally exposed image is used as a guide map to perform edge-preserving smooth diffusion on each layer of the initial weight pyramid to obtain the optimized weight pyramid.
[0081] In another possible implementation, a normally exposed image can be used as a guide image to perform edge-preserving smooth diffusion on the initial fusion weight map corresponding to the image to be processed, and then the optimized weight pyramid can be directly constructed based on the weight map after edge-preserving smooth diffusion.
[0082] In another possible implementation, during the construction of the initial weight pyramid, the weights at each scale can be guided and constrained based on the edge structure of a normally exposed image to directly obtain the optimized weight pyramid.
[0083] It should be noted that in high-contrast edge scenes, while low-exposure images can preserve bright details, their low-frequency brightness is relatively dark. If the weights corresponding to the low-exposure image spread unrestrainedly at the edges, it may cause normally exposed areas to be darkened by the low-exposure image, resulting in black edges. Therefore, considering that black edge artifacts are mainly related to the cross-edge spread of the weights of the low-exposure image in many scenarios, it is also possible to perform guided optimization only on the weights corresponding to the low-exposure image.
[0084] That is, optionally, in some embodiments of this application, the image to be processed includes a normally exposed image and a low-exposure image, the initial weight pyramid includes a normally exposed weight pyramid and a low-exposure weight pyramid, and the step "fusing each edge-preserving pyramid based on each of the initial weight pyramids to obtain a fused pyramid" includes: The normally exposed image is used as a guide image to perform edge-preserving smooth diffusion on the low exposure weight pyramid to obtain the low exposure optimized weight pyramid; The edge-preserving residual map in the edge-preserving pyramid is fused using the normal exposure weight pyramid and the low exposure weight pyramid to obtain a fused residual pyramid. Each layer of the fused residual pyramid corresponds to the fused residual map and the unfused edge-preserving base map. The edge-preserving base map in the fusion residual pyramid is fused using the normal exposure weight pyramid and the low exposure optimized weight pyramid to obtain the fusion pyramid. Each layer of the fusion pyramid corresponds to the fused fusion residual map and the fused fusion base map.
[0085] In this context, a normally exposed image refers to an image to be processed with a relatively moderate exposure, such as an EV0 image. Normally exposed images typically have a more stable edge structure and a more balanced brightness distribution, thus they can be used as a guide image for weighted smooth diffusion.
[0086] Low-exposure images are used to indicate images to be processed that are less exposed than normally exposed images, such as EV-images. Low-exposure images can retain details in highlight areas, but their overall brightness is darker. If their weight spreads to edge areas where they should not dominate, it may result in black borders.
[0087] The normal exposure weight pyramid refers to the multi-scale weight structure constructed from the initial fusion weight map corresponding to a normally exposed image. The low exposure weight pyramid refers to the multi-scale weight structure constructed from the initial fusion weight map corresponding to a low exposure image.
[0088] The smooth edge diffusion feature is used to indicate that while smoothing the weight map, the edge structure of the guide map is referenced, allowing the weights to diffuse naturally in flat areas, while being restricted at strong edges to avoid crossing obvious boundaries. For example, the EV0 image can be used as the guide map to perform guided filtering on the EV-weight map, so that the EV-weights do not diffuse excessively across strong edges in the EV0 image.
[0089] The low-exposure optimized weight pyramid refers to the weight pyramid obtained by smoothing the edges of the original low-exposure weight pyramid. Compared to the original low-exposure weight pyramid, the low-exposure optimized weight pyramid has stronger edge consistency and lower cross-boundary diffusion at strong edges in normally exposed images.
[0090] The fusion residual pyramid indicates the multi-scale residual structure obtained after fusing the edge-preserving residual maps of each image to be processed. Each layer of the fusion residual pyramid includes the fused residual map and the unfused base map.
[0091] The fusion base map is used to indicate the base map obtained by fusing the edge-preserving base maps of each image to be processed at the same scale using appropriate weights. The fusion base map mainly contains the fused low-frequency brightness and large-scale structural information.
[0092] That is, in this embodiment, a normally exposed image is first used as a guide image to perform edge-preserving smooth diffusion on the low-exposure weight pyramid. Taking the l-th layer as an example, the image structure of the normally exposed image in the l-th layer can be used to guide the smoothing process of the low-exposure weight map, resulting in the l-th layer low-exposure optimized weight map. This process allows the low-exposure weights to diffuse along continuous flat areas in the normally exposed image, but it is suppressed at locations where there are strong edges, brightness abrupt changes, or structural boundaries in the normally exposed image.
[0093] Then, in the edge-preserving residual map fusion stage, initial weights, such as the normal exposure weight pyramid and the low exposure weight pyramid, are used to fuse the edge-preserving residual maps of each image to be processed. Here, the low exposure weight pyramid can be understood as the initial weight pyramid that has not been optimized by the normal exposure image mentioned above, and it is used to preserve the initial contribution of each exposure image in the detail layer.
[0094] Next, in the edge-preserving base map fusion stage, the base map is fused using a normal exposure weight pyramid and a low exposure optimized weight pyramid. In other words, the fusion of the low-frequency base map adopts the low exposure weight guided by the normal exposure image, thereby preventing the low-frequency dark brightness of the low exposure image from spreading across strong edges into the area that the normal exposure image should dominate.
[0095] That is, in this embodiment, residual map fusion and base map fusion employ different weight control strategies: residual map fusion focuses on preserving exposure advantage information in the detail layer, while base map fusion focuses on suppressing the low-frequency darkening effect of underexposed images. This can simultaneously maintain detail sharpness and edge brightness stability.
[0096] That is, in one possible implementation, a low-exposure weight pyramid can be constructed first based on the initial fusion weight map corresponding to the low-exposure image, and then the edge-preserving smooth diffusion of each layer of the weight map in the low-exposure weight pyramid can be performed using the normal-exposure image as a guide map to obtain the low-exposure optimized weight pyramid.
[0097] In another possible implementation, the normal exposure image can be used as a guide image to perform edge-preserving smooth diffusion on the initial fusion weight map corresponding to the low exposure image, and then the low exposure optimized weight pyramid can be constructed based on the weight map after edge-preserving smooth diffusion.
[0098] In another possible implementation, during the construction of the low exposure weight pyramid, the low exposure weights at each scale can be guided and constrained based on the edge structure of the normally exposed image to directly obtain the low exposure optimized weight pyramid.
[0099] It should be noted that if the multi-exposure image also includes a high-exposure image, the weight pyramid corresponding to the high-exposure image can be further combined in the above fusion process. To ensure that the sum of the weights of each image satisfies the fusion stability, after obtaining the low-exposure optimized weight pyramid, the weight pyramid corresponding to the low-exposure optimized weight pyramid, the normal exposure weight pyramid, and the weight pyramids corresponding to other exposure images (such as high-exposure images) can be normalized.
[0100] It is understandable that after obtaining the fusion pyramid, the fusion pyramid is still a multi-scale representation and not the final output image. Therefore, it is necessary to reconstruct the fusion base image and the fusion residual images of each layer. Furthermore, different fusion processing methods can be used for different scenarios to improve fusion quality. That is, optionally, in some embodiments of this application, the step "reconstructing the fusion pyramid to obtain the target multi-exposure fused image" includes: The target multi-exposure fused image is obtained by fusing the fusion base map at the top of the fusion pyramid with the fusion residual maps of each layer; The fusion process includes at least one of the following: scale-wise weighted fusion, local weighted minimization, local energy minimization, noise adaptive fusion, or frequency adaptive fusion.
[0101] The topmost fusion base map is used to indicate the coarsest, smoothest, or highest level of the fusion pyramid. This fusion base map mainly represents the image's large-scale brightness, overall contour, and low-frequency structure.
[0102] The fusion residual maps of each layer are used to indicate the detail components at different scales in the fusion pyramid. The fusion residual maps of each layer can respectively represent structural changes from coarse to fine, edge information, texture information, and local details.
[0103] Scale-wise weighted fusion refers to fusing image components of images with different exposures at each scale level according to corresponding weights. For example, at the l-th level, the residual maps of EV-, EV0, and EV+ are weighted and summed according to corresponding weights.
[0104] Local weighted minimization refers to determining the fusion result by minimizing the weighting error or weighting objective function within a local region. For example, it can increase the contribution of structurally sharp images in edge regions and increase the contribution of exposure-stable images in flat regions.
[0105] Local energy minimization refers to image fusion by constructing a local energy function and solving for the fusion result with lower energy. For example, the energy function can consider brightness smoothness, edge preservation, and exposure adaptation.
[0106] Noise-adaptive fusion refers to adjusting the fusion contribution based on the noise level in different regions or images with different exposures. For example, in a low-light region, if a high-exposure image has low noise, its contribution in that region can be increased; if an image has high noise, its contribution can be decreased.
[0107] Frequency adaptive fusion refers to using different fusion strategies for different frequency components. For example, low-frequency base maps are fused using weights guided by a normally exposed image, while high-frequency residual maps are fused using initial weights or weights that are more biased towards detail sharpness.
[0108] That is, in this embodiment, the top-level fusion base map can be used as the starting point for reconstruction, and the fusion residual maps of each layer can be superimposed layer by layer to obtain the target multi-exposure fused image. For example, if the fusion pyramid includes layers 1 to L, the fusion base map of layer L and the fusion residual maps of layers L to 1 can be synthesized sequentially to obtain the target multi-exposure fused image. If the dimensions of each layer are different, the image of the coarser layer can be upsampled during synthesis before the corresponding layer residual map is superimposed; if the dimensions of each layer are the same, the top-level fusion base map and the fusion residual maps of each layer can be directly superimposed.
[0109] It is understood that through this embodiment, low-frequency structures and detail structures at multiple scales can be resynthesized into a complete fused image, and appropriate fusion methods can be selected according to different image scenes, thereby improving the naturalness, detail fidelity and noise resistance of the fused image.
[0110] Optionally, to improve the applicability of the solution, edge-preserving filtering can employ various filtering methods that preserve edge structure while smoothing the image, and is not limited to a single guided filter. That is, optionally, in some embodiments of this application, edge-preserving filtering includes at least one of guided filtering, bilateral filtering, weighted least squares filtering, rasterized edge-preserving filtering, local adaptive mean filtering, and non-local mean filtering; or, the edge-preserving filtering is implemented by a Laplacian pyramid construction method combined with an edge-aware mask; or, the edge-preserving filtering is implemented by a pyramid construction method based on structural tensor control.
[0111] Guided filtering refers to a filtering method that uses the local linear relationships of a guide map to smooth the input image. For example, the image to be processed can be used as a guide map and guided filtering can be applied to it to smooth the image in flat areas and preserve boundaries in edge areas.
[0112] Bilateral filtering refers to a filtering method that considers both spatial distance and pixel value differences. For example, it assigns higher weights to pixels that are close to each other and have similar brightness, and lower weights to pixels that cross strong edges, thereby maintaining smooth edges.
[0113] Weighted least squares filtering refers to a filtering method that obtains the base image by minimizing the weighted smoothing objective function. For example, a lower smoothing intensity can be set at edges with large image gradients, while a higher smoothing intensity can be set in flat regions.
[0114] Among them, rasterized edge-preserving filtering refers to filtering methods that achieve edge smoothing through domain transformation, fast approximation, or rasterization. For example, Domain Transform filtering can be used to achieve efficient edge smoothing.
[0115] Local adaptive mean filtering refers to a mean filtering method that adaptively adjusts the filtering range or filtering weights based on changes in the structure or brightness of a local region. For example, it expands the smoothing range in flat areas and reduces or changes the smoothing direction in edge areas.
[0116] Nonlocal mean filtering refers to a filtering method that smooths the image based on the similarity between similar patches. For example, it finds other image patches similar to the current image patch and performs a weighted average based on their similarity.
[0117] An edge-aware mask is a mask generated based on the image edge intensity, gradient, or structural boundaries. This mask can be used to limit smoothing or residual propagation across edges during the construction of the Laplacian pyramid.
[0118] Among them, the pyramid construction method based on structural tensor control refers to controlling the pyramid construction process according to the local principal directions, gradient strength, or structural consistency represented by the structural tensor. For example, smoothing can be performed along the texture direction, while avoiding smoothing across the edge normal direction.
[0119] In summary, through the above methods, the embodiments of this application can be adapted to different computing platforms, different image scenes, and different image quality requirements. Regardless of the specific edge-preserving filtering method used, as long as it can reduce the cross-boundary blurring of strong edges when constructing the base map, it can reduce abnormal jumps in the residual layer, thereby improving black edge artifacts in the final fused image.
[0120] Optionally, when guiding the low-exposure weights based on normal-exposure images, various structural features in the normal-exposure images can be used to determine whether the low-exposure weights are allowed to diffuse across regions, thereby further improving the weight control accuracy. That is, optionally, in some embodiments of this application, the step "using the normal-exposure images in each of the images to be processed as guide images, and performing edge-preserving smooth diffusion on each of the initial weight pyramids to obtain the optimized weight pyramids corresponding to each of the images to be processed" includes: Based on one or more of the following features of the normally exposed image, edge-preserving smooth diffusion is performed on each of the initial weight pyramids to obtain the optimized weight pyramid corresponding to each of the images to be processed; Edges, gradient magnitudes, structural tensors, edge masks, orientation consistency maps, neighborhood brightness variation maps, or adaptive region clustering.
[0121] An edge is a location in a normally exposed image where there is a significant change in brightness, color, or texture. For example, the boundary between tree branches and the sky, the edge of a building, or the outline of a finger can all be considered an edge.
[0122] Gradient magnitude refers to the numerical value indicating the strength of changes in image brightness or color within a local area. For example, a larger gradient magnitude indicates that there is a more likely presence of a distinct edge or structural boundary at that location.
[0123] The structure tensor refers to the matrix features that characterize the orientation and intensity of the structure of a local image. For example, the structure tensor can be used to determine whether a local region is a flat region, an edge region, or a corner region.
[0124] An edge mask is a binary or continuous value map generated based on edge detection results. Edge masks can identify which locations belong to strong edge regions, thereby limiting the diffusion of low-exposure weights across boundaries at these locations.
[0125] The orientation consistency map refers to a graph showing the degree of orientation consistency of local structures in a normally exposed image. For example, when the gradient directions of multiple pixels within a local window are similar, the orientation consistency is high; when the orientation changes are chaotic or cross obvious boundaries, the orientation consistency is low. This orientation consistency map can be used to control the diffusion of weights along the structural direction, while avoiding diffusion across structural boundaries.
[0126] Among them, the neighborhood brightness variation map refers to a map showing the magnitude of brightness variation or the continuity of brightness within a local neighborhood. For example, if the brightness variation in the neighborhood of a certain location is large, it indicates that there may be a boundary near that location, and the cross-boundary diffusion of low exposure weights should be restricted.
[0127] Adaptive region clustering is used to indicate the process of dividing a normally exposed image into multiple local regions based on color, brightness, texture, or spatial location. For example, superpixel segmentation can be used to obtain multiple structurally consistent regions, and the low exposure weights can be smoothed mainly within the same region without spreading across region boundaries.
[0128] That is, in this embodiment, guiding constraints can be constructed based on one or more features of the normally exposed image, and these guiding constraints can be used to perform edge-preserving smooth diffusion of the low-exposure weight pyramid. For example, the gradient magnitude can be calculated based on the normally exposed image and an edge mask can be generated. Then, the diffusion intensity of the low-exposure weight can be reduced at the strong edge position corresponding to the edge mask. Alternatively, the direction of allowed diffusion can be determined based on the structural tensor or the orientation consistency map, so that the low-exposure weight is smooth along the structural direction without crossing the structural boundary.
[0129] It is understood that this embodiment allows for more precise control over the spatial distribution of low exposure weights, preventing low-exposure images from excessively participating in low-frequency base image fusion near strong edges of normally exposed images, thereby further reducing black borders and darkening artifacts at high-contrast edges.
[0130] In summary, edge-preserving filtering can smooth an image while retaining strong edge structures, thus reducing the problem of excessive blurring of low-frequency layers at high-contrast edges and lowering high-frequency jumps in the residual image. Therefore, in subsequent multi-exposure fusion and reconstruction processes, it can reduce edge darkening, black borders, and halo artifacts, improving the naturalness and edge stability of the target multi-exposure fused image.
[0131] This method involves constructing an edge-preserving pyramid, with each layer including an edge-preserving base map and an edge-preserving residual map, to decompose the image into multi-scale basic structures and multi-scale detail structures. Further construction of an initial weight pyramid allows the fusion weights to be matched with the base and residual maps at each scale, thereby fusing the advantageous information from images with different exposures at each scale. This approach improves the precision and stability of multi-scale fusion.
[0132] Specifically, by using a normally exposed image as a guide image to smoothly diffuse the low-exposure weight pyramid at the edges, the diffusion of low-exposure weights across strong edges in the normally exposed image can be limited, preventing the low-exposure image from excessively participating in base image fusion in unsuitable edge regions. Simultaneously, residual image fusion can still use the initial low-exposure weights to preserve detail contributions, while base image fusion uses low-exposure optimized weights to suppress low-frequency darkening effects. This approach simultaneously achieves both detail preservation and edge brightness stability, significantly reducing black border artifacts caused by the "erosion" of low-exposure images.
[0133] Specifically, by reconstructing the top-level fusion base image and the fusion residual images of each layer, multi-scale low-frequency structures and high-frequency details can be resynthesized into a single multi-exposure fused image of the target. Furthermore, by employing methods such as scale-wise weighted fusion, local weighted minimization, local energy minimization, noise-adaptive fusion, or frequency-adaptive fusion, more suitable fusion strategies can be selected for different scenes, different frequency components, or different noise levels, thereby improving the detail representation, brightness continuity, and noise resistance of the fused image.
[0134] Specifically, by extending edge-preserving filtering to guided filtering, bilateral filtering, weighted least squares filtering, rasterized edge-preserving filtering, local adaptive mean filtering, non-local mean filtering, and Laplacian pyramid construction combined with edge-aware masks, or pyramid construction based on structure tensor control, the adaptability of the solution under different hardware platforms and different image scenes can be improved. Furthermore, by utilizing the edges, gradient magnitudes, structure tensors, edge masks, orientation consistency maps, neighborhood brightness variation maps, or adaptive region clustering of normally exposed images to guide the diffusion of low-exposure weights, strong edges and structural boundaries can be identified more accurately, thereby further suppressing the cross-boundary diffusion of low-exposure weights and improving the edge naturalness and image quality of multi-exposure fused images.
[0135] To facilitate better implementation of the image processing method of this application, this application also provides an image processing apparatus based on the above-described image processing method. The meanings of the terms used are the same as in the image processing method described above, and specific implementation details can be found in the descriptions of the method embodiments.
[0136] Please see Figure 3 , Figure 3 This is a schematic diagram of the structure of an image processing apparatus provided in an embodiment of this application. Specifically, the image processing apparatus may be as follows: The acquisition module 301 is used to acquire a multi-exposure image, wherein the multi-exposure image includes at least two images to be processed with different exposure levels; The calculation module 302 is used to calculate the initial fusion weight map corresponding to each of the images to be processed; Construction module 303 is used to construct an edge-preserving base map and an edge-preserving residual map corresponding to each of the images to be processed based on edge-preserving filtering; The fusion module 304 is used to fuse the edge-preserving base map and the edge-preserving residual map according to the initial fusion weight map to obtain a target multi-exposure fused image.
[0137] Optionally, in some embodiments of this application, the step of constructing the edge-preserving base map and edge-preserving residual map corresponding to each of the images to be processed based on edge-preserving filtering includes: For each of the images to be processed, an edge-preserving pyramid is constructed through edge-preserving filtering. Each layer of the edge-preserving pyramid contains an edge-preserving base map and an edge-preserving residual map. The edge-preserving base map is obtained through edge-preserving filtering, and the edge-preserving residual map is constructed based on the difference between the edge-preserving base maps of adjacent layers.
[0138] Optionally, in some embodiments of this application, fusing the edge-preserving base map and the edge-preserving residual map according to the initial fusion weight map to obtain the target multi-exposure fused image includes: Construct the initial weight pyramids for each of the initial fusion weight graphs; Based on the initial weight pyramids, the edge-preserving pyramids are merged to obtain the merged pyramid; The fusion pyramid is reconstructed to obtain the target multi-exposure fused image.
[0139] Optionally, in some embodiments of this application, the step of merging the edge-preserving pyramids based on the initial weight pyramids to obtain a merged pyramid includes: Using the normally exposed image in each of the images to be processed as the guide image, the edge-preserving smooth diffusion is performed on each of the initial weight pyramids to obtain the optimized weight pyramids corresponding to each of the images to be processed. The optimized weighted pyramid is used to fuse the edge-preserving residual maps in the edge-preserving pyramid to obtain a fused residual pyramid. Each layer of the fused residual pyramid corresponds to the fused residual map and the unfused edge-preserving base map. The edge-preserving base map in the fusion residual pyramid is fused using the initial weight pyramid to obtain the fusion pyramid. Each layer of the fusion pyramid corresponds to the fused fusion residual map and the fused fusion base map.
[0140] Optionally, in some embodiments of this application, reconstructing the fusion pyramid to obtain the target multi-exposure fused image includes: The target multi-exposure fused image is obtained by fusing the fusion base map at the top of the fusion pyramid with the fusion residual maps of each layer; The fusion process includes at least one of the following: scale-wise weighted fusion, local weighted minimization, local energy minimization, noise adaptive fusion, or frequency adaptive fusion.
[0141] Optionally, in some embodiments of this application, the edge-preserving filter includes at least one of guided filtering, bilateral filtering, weighted least squares filtering, rasterized edge-preserving filtering, local adaptive mean filtering, and nonlocal mean filtering; or, The edge-preserving filter is implemented by constructing a Laplacian pyramid using an edge-aware mask; or, the edge-preserving filter is implemented by constructing a pyramid based on structural tensor control.
[0142] Optionally, in some embodiments of this application, the step of using the normally exposed image in each of the images to be processed as a guide image, and performing edge-preserving smooth diffusion on each of the initial weight pyramids to obtain the optimized weight pyramid corresponding to each of the images to be processed includes: Based on one or more of the following features of the normally exposed image, edge-preserving smooth diffusion is performed on each of the initial weight pyramids to obtain the optimized weight pyramid corresponding to each of the images to be processed; Edges, gradient magnitudes, structural tensors, edge masks, orientation consistency maps, neighborhood brightness variation maps, or adaptive region clustering.
[0143] In this embodiment, the acquisition module 301 acquires a multi-exposure image, which includes at least two images to be processed with different exposure levels. The calculation module 302 calculates an initial fusion weight map corresponding to each of the images to be processed. The construction module 303 constructs an edge-preserving base map and an edge-preserving residual map corresponding to each of the images to be processed based on edge-preserving filtering. The fusion module 304 fuses the edge-preserving base map and the edge-preserving residual map according to the initial fusion weight map to obtain a target multi-exposure fused image.
[0144] In summary, edge-preserving filtering can smooth an image while retaining strong edge structures, thus reducing the problem of excessive blurring of low-frequency layers at high-contrast edges and lowering high-frequency jumps in the residual image. Therefore, in subsequent multi-exposure fusion and reconstruction processes, it can reduce edge darkening, black borders, and halo artifacts, improving the naturalness and edge stability of the target multi-exposure fused image.
[0145] In addition, this application also provides an electronic device, such as Figure 4 As shown, it illustrates a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Specifically: The electronic device may include components such as a processor 401 with one or more processing cores, a memory 402 with one or more computer-readable storage media, a power supply 403, and an input unit 404. Those skilled in the art will understand that... Figure 4 The electronic device structure shown does not constitute a limitation on the electronic device and may include more or fewer components than shown, or combine certain components, or have different component arrangements. Wherein: The processor 401 is the control center of the electronic device. It connects various parts of the electronic device via various interfaces and lines. By running or executing software programs and / or modules stored in the memory 402, and by calling data stored in the memory 402, it performs various functions and processes data, thereby providing overall monitoring of the electronic device. Optionally, the processor 401 may include one or more processing cores; preferably, the processor 401 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 401.
[0146] The memory 402 can be used to store software programs and modules. The processor 401 executes various functional applications and data processing by running the software programs and modules stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, applications required for at least one function, etc.; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 402 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 402 may also include a memory controller to provide the processor 401 with access to the memory 402.
[0147] The electronic device also includes a power supply 403 that supplies power to the various components. Preferably, the power supply 403 can be logically connected to the processor 401 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. The power supply 403 may also include one or more DC or AC power supplies, recharging systems, power equipment debugging circuits, power converters or inverters, power status indicators, and other arbitrary components.
[0148] The electronic device may also include an input unit 404, which can be used to receive input digital or character information, and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
[0149] Although not shown, the electronic device may also include a display unit, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 401 in the electronic device loads the executable files corresponding to the processes of one or more applications into the memory 402 according to the following instructions, and the processor 401 runs the applications stored in the memory 402, thereby implementing the steps in any of the image processing methods provided in the embodiments of this application.
[0150] This application embodiment obtains a multi-exposure image, which includes at least two images to be processed with different exposure levels. An initial fusion weight map is calculated for each image to be processed. An edge-preserving base map and an edge-preserving residual map are constructed for each image to be processed based on edge-preserving filtering. The edge-preserving base map and the edge-preserving residual map are fused according to the initial fusion weight map to obtain the target multi-exposure fused image.
[0151] Edge-preserving filtering, by preserving strong edge structures while smoothing the image, reduces the problem of excessive blurring of low-frequency layers at high-contrast edges and lowers high-frequency jumps in the residual image. Consequently, in subsequent multi-exposure fusion and reconstruction processes, it reduces edge darkening, black borders, and halo artifacts, improving the naturalness and edge stability of the target multi-exposure fused image.
[0152] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.
[0153] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by instructions, or by instructions controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.
[0154] Therefore, this application provides a storage medium, including a computer-readable storage medium on which a computer program is stored, the computer program being loadable by a processor to execute the steps of any of the image processing methods provided in this application.
[0155] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.
[0156] The computer-readable storage medium may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0157] Since the instructions stored in the computer-readable storage medium can execute the steps of any of the image processing methods provided in this application, the beneficial effects that any of the image processing methods provided in this application can achieve can be realized, as detailed in the preceding embodiments, and will not be repeated here.
[0158] The foregoing has provided a detailed description of an image processing method, apparatus, electronic device, and computer-readable storage medium provided in this application. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, those skilled in the art will recognize that there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.
[0159] It is understood that in the specific embodiments of this application, data related to multi-exposure images is involved. When the embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
Claims
1. An image processing method, characterized in that, The method includes: Acquire multi-exposure images, wherein the multi-exposure images include at least two images to be processed with different exposure levels; Calculate the initial fusion weight map corresponding to each of the images to be processed; Based on edge-preserving filtering, construct the edge-preserving base map and edge-preserving residual map corresponding to each of the images to be processed; The edge-preserving base map and the edge-preserving residual map are fused according to the initial fusion weight map to obtain the target multi-exposure fused image.
2. The image processing method according to claim 1, characterized in that, The construction of the edge-preserving base map and edge-preserving residual map corresponding to each of the images to be processed based on edge-preserving filtering includes: For each of the images to be processed, an edge-preserving pyramid is constructed through edge-preserving filtering. Each layer of the edge-preserving pyramid contains an edge-preserving base map and an edge-preserving residual map. The edge-preserving base map is obtained through edge-preserving filtering, and the edge-preserving residual map is constructed based on the difference between the edge-preserving base maps of adjacent layers.
3. The image processing method according to claim 2, characterized in that, The step of fusing the edge-preserving base map and the edge-preserving residual map according to the initial fusion weight map to obtain the target multi-exposure fused image includes: Construct the initial weight pyramids for each of the initial fusion weight graphs; Based on the initial weight pyramids, the edge-preserving pyramids are merged to obtain the merged pyramid; The fusion pyramid is reconstructed to obtain the target multi-exposure fused image.
4. The image processing method according to claim 3, characterized in that, The process of merging the edge-preserving pyramids based on the initial weight pyramids to obtain the merged pyramid includes: Using the normally exposed image in each of the images to be processed as the guide image, the edge-preserving smooth diffusion is performed on each of the initial weight pyramids to obtain the optimized weight pyramids corresponding to each of the images to be processed. The optimized weighted pyramid is used to fuse the edge-preserving residual maps in the edge-preserving pyramid to obtain a fused residual pyramid. Each layer of the fused residual pyramid corresponds to the fused residual map and the unfused edge-preserving base map. The edge-preserving base map in the fusion residual pyramid is fused using the initial weight pyramid to obtain the fusion pyramid. Each layer of the fusion pyramid corresponds to the fused fusion residual map and the fused fusion base map.
5. The image processing method according to claim 4, characterized in that, The process of reconstructing the fusion pyramid to obtain the target multi-exposure fused image includes: The target multi-exposure fused image is obtained by fusing the fusion base map of the top layer of the fusion pyramid with the fusion residual maps of each layer; The fusion process includes at least one of the following: scale-wise weighted fusion, local weighted minimization, local energy minimization, noise adaptive fusion, or frequency adaptive fusion.
6. The image processing method according to claim 4, characterized in that, The step of using the normally exposed image from each of the images to be processed as a guide image, and performing edge-preserving smooth diffusion on each of the initial weight pyramids to obtain the optimized weight pyramid corresponding to each of the images to be processed includes: Based on one or more of the following features of the normally exposed image, edge-preserving smooth diffusion is performed on each of the initial weight pyramids to obtain the optimized weight pyramid corresponding to each of the images to be processed; Edges, gradient magnitudes, structural tensors, edge masks, orientation consistency maps, neighborhood brightness variation maps, or adaptive region clustering.
7. The image processing method according to claim 1, characterized in that, The edge-preserving filter includes at least one of guided filtering, bilateral filtering, weighted least squares filtering, rasterized edge-preserving filtering, local adaptive mean filtering, and nonlocal mean filtering; or, The edge-preserving filter is implemented by constructing a Laplacian pyramid using an edge-aware mask; or, the edge-preserving filter is implemented by constructing a pyramid based on structural tensor control.
8. An image processing apparatus, characterized in that, The device includes: An acquisition module is used to acquire multi-exposure images, wherein the multi-exposure images include at least two images to be processed with different exposure levels; The calculation module is used to calculate the initial fusion weight map corresponding to each of the images to be processed; The construction module is used to construct the edge-preserving base map and edge-preserving residual map corresponding to each of the images to be processed based on edge-preserving filtering; The fusion module is used to fuse the edge-preserving base map and the edge-preserving residual map according to the initial fusion weight map to obtain a target multi-exposure fused image.
9. An electronic device, characterized in that, It includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the image processing method as described in any one of claims 1-7.
10. A storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the steps of the image processing method as described in any one of claims 1-7.
