Image fusion method and device, computer device and storage medium
By fusing the weight map and gradient map of the image, the artifact problem caused by dynamic elements is solved, and a more realistic high dynamic range image is generated.
Patent Information
- Application Number
- CN202111142496.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-28
- Publication Date
- 2026-01-13
- Estimated Expiration
- 2041-09-28
AI Technical Summary
Existing image fusion techniques often result in artifacts in high dynamic range images when processing images containing dynamic elements, thus losing the realism of the original image.
By acquiring the weight map of the image to be fused and the gradient maps of multiple preset opposing directions, a fusion process is performed to obtain the fused gradient map. A system of difference equations is constructed by combining the fused gradient map and color level mapping is performed to generate a high dynamic range image.
While preserving rich details in both bright and dark areas of the image, it reduces ghosting in high dynamic range images and improves image realism.
Smart Images

Figure CN113962914B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computers, and in particular to an image fusion method, apparatus, computer device, and storage medium. Background Technology
[0002] High-Dynamic Range (HDR) images offer greater dynamic range and detail compared to ordinary images. HDR is typically obtained by fusing LDR (Low-Dynamic Range) images taken at different exposure times, using the LDR images with the best detail corresponding to each exposure time. Image fusion refers to the process of combining image data of the same target acquired from multiple sources using image processing and computer technology to extract the most useful information from each channel and finally synthesize it into a high-quality image. This improves the utilization of image information, enhances the accuracy and reliability of computer interpretation, and increases the spatial and spectral resolution of the original image, thus facilitating monitoring.
[0003] However, images obtained in real-world scenarios often contain dynamic elements such as moving objects, which can cause artifacts in the resulting high dynamic range (HDR) image. Existing image fusion techniques typically remove artifacts by directly removing all moving objects from the images to be fused in the final result. However, this to some extent causes the resulting HDR image to lose the realism of the original image. Summary of the Invention
[0004] Therefore, it is necessary to provide an image fusion method, apparatus, computer device, and storage medium that can maintain the authenticity of the original image in order to address the above-mentioned technical problems.
[0005] An image fusion method, the method comprising:
[0006] Obtain the images to be fused;
[0007] Obtain the weight map and gradient map in multiple preset opposing directions of the image to be fused;
[0008] The weight map and the gradient maps of the multiple preset opposing directions are fused to obtain a fused gradient map;
[0009] Based on the fusion gradient map, obtain the high dynamic range image corresponding to the image to be fused.
[0010] In one embodiment, acquiring the image to be fused includes:
[0011] Obtain the original image to be fused;
[0012] The original images to be fused are aligned to obtain the images to be fused.
[0013] In one embodiment, obtaining the weight map of the image to be fused includes:
[0014] Obtain the channel values corresponding to each pixel in the image to be fused;
[0015] Based on the channel values corresponding to each pixel in the image to be fused, the weights of each pixel in the image to be fused are determined, and the weight map of the image to be fused is obtained.
[0016] In one embodiment, before fusing the weight map and the gradient maps of the plurality of preset opposing directions to obtain the fused gradient map, the method further includes:
[0017] The weight map of the images to be fused is normalized.
[0018] In one embodiment, before fusing the weight map and the gradient maps of the plurality of preset opposing directions to obtain the fused gradient map, the method further includes:
[0019] The weight map of the image to be fused is filtered and smoothed.
[0020] In one embodiment, obtaining the high dynamic range image corresponding to the image to be fused based on the fusion gradient map includes:
[0021] Construct a system of difference equations based on the fused gradient map;
[0022] Solve the system of difference equations to obtain the target fused image;
[0023] The target fusion image is subjected to color level mapping processing to obtain the high dynamic range image corresponding to the image to be fused.
[0024] An image fusion apparatus, the apparatus comprising:
[0025] The image acquisition module is used to acquire the images to be fused.
[0026] The gradient map acquisition module is used to acquire the weight map of the image to be fused and the gradient map in multiple preset opposing directions;
[0027] The gradient graph fusion module is used to fuse the weight graph and the gradient graphs of the multiple preset opposing directions to obtain a fused gradient graph.
[0028] The image fusion module is used to obtain the high dynamic range image corresponding to the image to be fused based on the fusion gradient map.
[0029] In one embodiment, the image acquisition module is specifically used to: acquire the original image to be merged; perform alignment processing on the original image to be merged to acquire the image to be merged.
[0030] A computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program performing the following steps:
[0031] Obtain the images to be fused;
[0032] Obtain the weight map and gradient map in multiple preset opposing directions of the image to be fused;
[0033] The weight map and the gradient maps of the multiple preset opposing directions are fused to obtain a fused gradient map;
[0034] Based on the fusion gradient map, obtain the high dynamic range image corresponding to the image to be fused.
[0035] A computer-readable storage medium having a computer program stored thereon, the computer program performing the following steps when executed by a processor:
[0036] Obtain the images to be fused;
[0037] Obtain the weight map and gradient map in multiple preset opposing directions of the image to be fused;
[0038] The weight map and the gradient maps of the multiple preset opposing directions are fused to obtain a fused gradient map;
[0039] Based on the fusion gradient map, obtain the high dynamic range image corresponding to the image to be fused.
[0040] The aforementioned image fusion method, apparatus, computer device, and storage medium involve: acquiring an image to be fused; acquiring a weight map and gradient maps in multiple preset opposing directions of the image to be fused; performing fusion processing on the weight map and the gradient maps in multiple preset opposing directions to obtain a fused gradient map; and acquiring a high dynamic range image corresponding to the image to be fused based on the fused gradient map. In this application, during the image fusion process, the weight map of the image to be fused is first acquired, and the gradient maps in multiple preset opposing directions are simultaneously determined. The gradient maps are then fused based on the weight map, resulting in a fused image with gradients similar to the original image in highlights and shadows. This allows for richer details in both bright and dark areas of the image, reduces ghosting in the fused high dynamic range image, and achieves better processing results for motion artifacts while maintaining the realism of the original image. Attached Figure Description
[0041] Figure 1This is an application environment diagram of the image fusion method in one embodiment;
[0042] Figure 2 This is a flowchart illustrating an image fusion method in one embodiment;
[0043] Figure 3 In one embodiment Figure 2 A schematic diagram of the sub-process of step 201;
[0044] Figure 4 In one embodiment Figure 2 A schematic diagram of the sub-process of step 203;
[0045] Figure 5 In one embodiment Figure 2 A schematic diagram of the sub-process of step 207;
[0046] Figure 6 This is a structural block diagram of an image fusion device in one embodiment;
[0047] Figure 7 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0048] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0049] The image fusion method provided in this application can be applied to, for example... Figure 1 In the application environment shown, terminal 102 communicates with server 104 via a network. When staff on terminal 102 need to perform image fusion processing on multiple images, they can send these images to server 104 as images to be fused. Server 104 then performs image fusion processing on the images submitted by terminal 102. Server 104 acquires the images to be fused; acquires the weight map and gradient maps in multiple preset opposing directions of the images to be fused; performs fusion processing on the weight map and the gradient maps in multiple preset opposing directions to obtain a fused gradient map; and acquires the high dynamic range image corresponding to the images to be fused based on the fused gradient map. Terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices. Server 104 can be implemented using a standalone server or a server cluster consisting of multiple servers. Of course, in other embodiments, the image fusion method of this application can also be applied to a terminal.
[0050] In one embodiment, such as Figure 2As shown, an image fusion method is provided, which can be applied to... Figure 1 Taking server 104 as an example, the following steps are included:
[0051] Step 201: Obtain the image to be fused.
[0052] Step 203: Obtain the weight map of the image to be fused and the gradient map in multiple preset opposing directions.
[0053] In this application, the images to be fused are the processing objects of the image fusion method and the fusion materials in the image fusion process. These images to be fused are generally image data about the same target. Image fusion refers to the process of extracting the advantageous information from each channel to the maximum extent through image processing and computer technology from image data collected from multiple channels about the same target, and finally synthesizing them into a high-quality image to improve the utilization rate of image information, improve the accuracy and reliability of computer interpretation, and enhance the spatial and spectral resolution of the original image, which is beneficial for monitoring. The weights are used to characterize the importance. The weight map of the images to be fused refers to the weight distribution map of different pixels in the different images to be fused. It is used to characterize the importance between different pixels. The gradient is a vector that represents the directional derivative of a function at a point where the directional derivative reaches its maximum value along that direction. That is, the function changes the fastest and has the largest rate of change (the magnitude of the gradient) along that direction at that point. Images are stored in computers as digital images, that is, they exist in the form of numerical matrices, thus forming discrete numerical signals. Therefore, the gradient map of the image to be fused in multiple preset opposing directions can be calculated by assigning pixel values to each point in the image. In a specific embodiment, the multiple preset opposing directions specifically include four pairwise opposing directions: horizontal forward, horizontal backward, vertical forward, and vertical backward, when the image is placed upright on a horizontal plane. Alternatively, four directions—upper left, lower left, upper right, and lower right—can be used. Or, all of the above directions can be combined into eight directions.
[0054] Specifically, the image fusion method of this application is used for fusion processing between different images. Therefore, it is first necessary to obtain multiple images to be fused, and then perform image fusion processing on these images. During the fusion process, this application first needs to determine the weight map of the images to be fused, based on which the importance of pixels in each image to be fused can be determined. In one embodiment, N images to be fused are obtained, and then the weight map W of these N images to be fused is calculated. i (u,v). Weighted graph W i (u,v) represents the importance of the pixel at coordinates (u,v) in the i-th image. In one embodiment, the formula for calculating the weighted image is as follows:
[0055]
[0056] Where i = 1, 2, 3, ..., n; are the indices of n images, and r, g, b are the RGB values at coordinates (u, v). The function f can be a Gaussian function, as illustrated below: Where σ is an empirical value, not limited in this invention, and is typically taken as 51. Simultaneously, during image fusion processing, fusion can be performed based on a gradient map combined with a weight map. Therefore, when performing image fusion, the gradient maps of the images to be fused in multiple preset opposing directions can be obtained simultaneously when determining the weight map of the images to be fused. In one embodiment, the multiple preset opposing directions specifically include four pairwise opposing directions: horizontal forward, horizontal backward, vertical forward, and vertical backward, when the image is upright on a horizontal plane. The specific formulas for calculating the gradient maps in these four directions are as follows:
[0057]
[0058]
[0059]
[0060]
[0061] Where the superscript and subscript i represent the i-th image, I i (u,v) represents the pixel value of the i-th image at coordinates (u,v). width represents the total number of pixels in the width direction, and height represents the total number of pixels in the length direction.
[0062] Step 205: Perform a fusion process on the weight map and the gradient maps of multiple preset opposing directions to obtain a fused gradient map.
[0063] Among them, the fused gradient map refers to the fused gradient map corresponding to the gradient maps of the multiple preset opposing directions obtained after the weight map is fused with the gradient maps of multiple preset opposing directions.
[0064] Specifically, these images to be fused can be fused separately using weight maps and gradient maps of multiple preset opposing directions to obtain four fused gradient maps of the fused gradient and weights. In a specific embodiment, W can be used... i The gradient map is represented by (u,v). as well as These represent the gradient maps in the four directions. The specific formula for calculating the fused gradient map is as follows:
[0065]
[0066]
[0067]
[0068]
[0069] Step 207: Obtain the high dynamic range image corresponding to the image to be fused based on the fusion gradient map.
[0070] High Dynamic Range (HDR) images, compared to ordinary images, offer a wider dynamic range and greater image detail. HDR is typically created by fusing LDR images with different exposure times, using the LDR images with the best detail corresponding to each exposure time.
[0071] Specifically, the gradient map fusion combines a weighted map containing pixel importance information with a gradient map containing gradient information. Equations can be established using the fused gradient maps to solve for the final high dynamic range image. Simultaneously, it ensures that the fused image maintains a gradient close to that of the original image (the one with the best pixel) in both highlights and shadows. Because the fusion only considers a small-scale gradient, compared to the large-scale fusion of multi-resolution (classic) methods, it introduces much less ghosting in cases of misalignment, thus preserving the realism of the original image.
[0072] The aforementioned image fusion method involves acquiring an image to be fused, determining its weight map, acquiring gradient maps of the image to be fused in multiple preset opposing directions, fusing the weight map and the gradient maps in multiple preset opposing directions to obtain a fused gradient map, and acquiring a high dynamic range image corresponding to the image to be fused based on the fused gradient map. In this application, during the image fusion process, the weight map of the image to be fused is first acquired, and the gradient maps of the image to be fused in multiple preset opposing directions are simultaneously determined. The gradient maps are then fused based on the weight map, resulting in a fused image with gradients similar to the original image in highlights and shadows. This allows for richer details in both bright and dark areas of the image, reduces ghosting in the fused high dynamic range image, and achieves better processing results for motion artifacts while maintaining the realism of the original image.
[0073] In one embodiment, such as Figure 3 As shown, step 201 includes:
[0074] Step 302: Obtain the original image to be fused.
[0075] Step 304: Align the original images to be fused to obtain the images to be fused.
[0076] Specifically, image alignment (also known as image registration) refers to the technique of deforming one image (or sometimes two images) to perfectly align the features in the two images. In the scheme of this application, multiple images to be fused are mainly aligned. After alignment, subsequent fusion processing operations such as weight map calculation are performed to ensure that the features in these images correspond. Image alignment can be achieved through methods such as extrinsic parameter calibration, feature point matching, and optical flow alignment. In this embodiment, by performing fusion processing on the original images to be fused to obtain the images to be fused, the accuracy of the image fusion process can be effectively improved.
[0077] In one embodiment, such as Figure 4 As shown, step 203 includes:
[0078] Step 401: Obtain the channel values corresponding to each pixel in the image to be fused.
[0079] Step 403: Determine the weight of each pixel in the image to be fused based on the channel values corresponding to each pixel in the image to be fused, and obtain the weight map of the image to be fused.
[0080] Here, each channel value specifically refers to the value of each channel within the color model. The color system can be an existing RGB color system or YUV color system, or a custom non-standard color model. The following example uses the channel values of the RGB color system. The RGB color system is an industry standard that obtains various colors by varying the red (R), green (G), and blue (B) color channels and their superposition. RGB represents the colors of the red, green, and blue channels. This standard covers almost all colors perceptible to human vision and is one of the most widely used color systems. Specifically, in this embodiment, the importance of each pixel can be determined based on its RGB value. First, the RGB values of each pixel in the image to be fused are obtained. Then, the weight of each pixel is calculated based on its RGB value. The formula for calculating the weight map is as follows:
[0081]
[0082] Where i = 1, 2, 3, ..., n; are the indices of n images, and r, g, b are the RGB values at coordinates (u, v). The function f can be a Gaussian function, as illustrated below: Where σ is an empirical value, which is not limited in this invention, but is usually taken as 51. In this embodiment, the weights are calculated based on the color system channel values corresponding to different pixels, which can effectively obtain the weight map of the image to be fused.
[0083] In one embodiment, before step 205, the method further includes: normalizing the weight map of the images to be fused.
[0084] Normalization refers to transforming the absolute values of physical system values into relative values. In this application, normalization refers to considering weights on the same image within a unified dimension, thereby simplifying calculations. In one embodiment, the specific formula for normalizing the weight map is:
[0085]
[0086] Where s is the sum of the weights of all pixels in the weight map, and W′ i This is the weight representation in the normalized weight graph.
[0087] In this embodiment, by normalizing the weight map before performing subsequent fusion processing, the computational complexity of the image fusion process can be effectively reduced, thereby improving the computational efficiency of image fusion.
[0088] In one embodiment, before step 205, the method further includes: performing a filtering and smoothing process on the weight map of the image to be fused.
[0089] The term "filtering" originates from communication theory and refers to a technique for extracting useful signals from received signals containing interference. The "received signal" is analogous to the observed random process, while the "useful signal" is analogous to the estimated random process. For example, when tracking an aircraft with radar, the measured aircraft position data contains measurement errors and other random interference. How to use this data to estimate the aircraft's position, velocity, acceleration, etc., at each moment as accurately as possible, and predict the aircraft's future position, is a filtering and prediction problem. Such problems are prevalent in electronics, aerospace science, control engineering, and other scientific and technological fields. In this application, filtering primarily aims to make the weight map spatially smooth and non-abrupt, with better results even when some pixels are misaligned. In one embodiment, low-pass filtering is specifically used to smooth the weight map of the image to be fused. In another embodiment, mean filtering is used. Furthermore, other filtering methods such as high-pass filtering can also be used for smoothing, and this application does not impose further constraints on these methods. In this embodiment, by filtering and smoothing the weight map of the fused image, it is possible to effectively ensure that the weight map is spatially smooth and not abrupt, thereby improving the fusion effect in the image fusion process.
[0090] In one embodiment, such as Figure 5 As shown, step 207 includes:
[0091] Step 502: Construct a system of difference equations based on the fused gradient map.
[0092] Step 504: Obtain the target fused image by solving the system of difference equations.
[0093] Step 506: Perform color level mapping processing on the target fusion image to obtain the high dynamic range image corresponding to the image to be fused.
[0094] Color mapping, originally a term in photography, addresses the issue of gradation. Printed photographs cannot represent the full range of brightness in the real world. Simply linearly compressing the entire brightness range of the real world into the range of a photograph results in the loss of detail at both the light and dark ends – clearly undesirable. Color mapping exists to overcome this limitation. Since a photograph's brightness range is finite, we can control a suitable brightness range based on the overall brightness of the scene being photographed, adjusting the aperture and exposure time. This ensures that detail is not lost without distortion. The process of color mapping involves first calculating the average brightness of the scene, then selecting a suitable brightness range based on this average brightness, and finally mapping the entire scene onto this range to obtain the correct result.
[0095] Specifically, during image fusion processing, a system of difference equations can be constructed based on the fused gradient map. In one embodiment, when the gradient maps of multiple preset opposing directions are specifically gradient maps of four pairwise opposing directions (horizontal forward, horizontal backward, vertical forward, and vertical backward), four systems of difference equations can be constructed as shown below to calculate and obtain the target image:
[0096] AI = G x1
[0097] BI=G x2
[0098] CI = G y1
[0099] DI=G y2
[0100] Among them, G x1 G x2 G y1 G y2The column vector, denoted as 1*Sum, is formed by arranging the four fusion gradient maps in pixel order. A, B, C, and D are the coefficient matrices of the four difference equations, each with a size of Sum*Sum. Sum = W*H represents the number of pixels in the image. I is the target fusion image, formed by arranging the pixels in order. By solving the above system of equations, the target fusion image can be obtained. After obtaining the target fusion image, a color level mapping process can be performed to obtain the final high dynamic range image. Specifically, the color level mapping process involves rearranging the target fusion image I into an image with H rows and W columns, denoted as P. Since the minimum value of P may be less than 0, the maximum value may be greater than 255, and the total number of brightness levels may be greater than 256, a high dynamic range image can be obtained by mapping image P to 0–255 using the color level mapping method. In this embodiment, by constructing a system of difference equations and using color level mapping to obtain the high dynamic range image, the computational efficiency of the high dynamic range image can be effectively guaranteed while maintaining the fidelity of the original image.
[0101] It should be understood that, although Figure 2-5 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order in which these steps are executed, and they can be performed in other orders. Figure 2-5 At least some of the steps in the process may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but may be executed at different times. The execution order of these steps or stages is not necessarily sequential, but may be executed in turn or alternately with other steps or at least some of the steps or stages in other steps.
[0102] In one embodiment, such as Figure 6 As shown, an image fusion apparatus is provided, comprising:
[0103] Image acquisition module 601 is used to acquire the image to be fused.
[0104] The gradient map acquisition module 603 is used to acquire the weight map of the image to be fused and the gradient map in multiple preset opposing directions.
[0105] The gradient graph fusion module 605 is used to fuse the weight graph and gradient graphs of multiple preset opposing directions to obtain a fused gradient graph.
[0106] The image fusion module 607 is used to obtain the high dynamic range image corresponding to the image to be fused based on the fusion gradient map.
[0107] The aforementioned image fusion apparatus acquires an image to be fused; acquires a weight map and gradient maps of the image to be fused in multiple preset opposing directions; performs fusion processing on the weight map and the gradient maps in multiple preset opposing directions to obtain a fused gradient map; and acquires a high dynamic range image corresponding to the image to be fused based on the fused gradient map. In the image fusion process, this application first acquires the weight map of the image to be fused and simultaneously determines the gradient maps of the image to be fused in multiple preset opposing directions. The gradient maps are then fused based on the weight map, resulting in a fused image with gradients similar to the original image in highlights and shadows. This allows for richer details in both bright and dark areas of the image, reduces ghosting in the fused high dynamic range image, and achieves better processing results for motion artifacts while maintaining the realism of the original image.
[0108] In one embodiment, the image acquisition module 601 is specifically used to: acquire the original image to be fused; perform alignment processing on the original image to be fused to acquire the image to be fused.
[0109] In one embodiment, the gradient map acquisition module 603 is specifically used to: acquire the channel values corresponding to each pixel in the image to be fused; determine the weights of each pixel in the image to be fused based on the channel values corresponding to each pixel in the image to be fused; and acquire the weight map of the image to be fused.
[0110] In one embodiment, a normalization processing module is also included, which is used to: normalize the weight map of the image to be fused.
[0111] In one embodiment, a smoothing filter processing module is further included for: performing filtering and smoothing processing on the weight map of the image to be fused.
[0112] In one embodiment, the image fusion module 607 is specifically used to: construct a system of difference equations based on the fusion gradient map; obtain a target fused image by solving the system of difference equations; and perform color level mapping processing on the target fused image to obtain a high dynamic range image corresponding to the image to be fused.
[0113] For specific limitations regarding the image fusion device, please refer to the limitations of the image fusion method above, which will not be repeated here. Each module in the aforementioned image fusion device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0114] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 7As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores traffic forwarding data. The network interface communicates with external terminals via a network connection. When executed by the processor, the computer program implements an image fusion method.
[0115] Those skilled in the art will understand that Figure 7 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0116] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0117] Obtain the images to be fused;
[0118] Obtain the weight map and gradient map in multiple preset opposing directions of the image to be fused;
[0119] The weight map and gradient maps of multiple preset opposing directions are fused to obtain a fused gradient map;
[0120] Based on the fusion gradient map, obtain the high dynamic range image corresponding to the image to be fused.
[0121] In one embodiment, when the processor executes the computer program, it further performs the following steps: acquiring the original image to be fused; aligning the original image to be fused to acquire the image to be fused.
[0122] In one embodiment, when the processor executes the computer program, it further performs the following steps: obtaining the channel values corresponding to each pixel in the image to be fused; determining the weights of each pixel in the image to be fused based on the channel values corresponding to each pixel in the image to be fused; and obtaining a weight map of the image to be fused.
[0123] In one embodiment, when the processor executes the computer program, it further performs the following steps: normalizing the weight map of the images to be fused.
[0124] In one embodiment, the processor, while executing the computer program, also performs the following steps: filtering and smoothing the weight map of the images to be fused.
[0125] In one embodiment, when the processor executes the computer program, it further performs the following steps: constructing a system of difference equations based on the fusion gradient map; solving the system of difference equations to obtain the target fused image; and performing color level mapping processing on the target fused image to obtain the high dynamic range image corresponding to the image to be fused.
[0126] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:
[0127] Obtain the images to be fused;
[0128] Obtain the weight map and gradient map in multiple preset opposing directions of the image to be fused;
[0129] The weight map and gradient maps of multiple preset opposing directions are fused to obtain a fused gradient map;
[0130] Based on the fusion gradient map, obtain the high dynamic range image corresponding to the image to be fused.
[0131] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: acquiring the original image to be fused; aligning the original image to be fused to acquire the image to be fused.
[0132] In one embodiment, when the computer program is executed by a processor, it further performs the following steps: obtaining the channel values corresponding to each pixel in the image to be fused; determining the weights of each pixel in the image to be fused based on the channel values corresponding to each pixel in the image to be fused; and obtaining a weight map of the image to be fused.
[0133] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: normalizing the weight map of the images to be fused.
[0134] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: filtering and smoothing the weight map of the images to be fused.
[0135] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: constructing a system of difference equations based on the fusion gradient map; solving the system of difference equations to obtain the target fused image; and performing color level mapping processing on the target fused image to obtain the high dynamic range image corresponding to the image to be fused.
[0136] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, or optical storage, etc. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.
[0137] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0138] The above embodiments merely illustrate several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. An image fusion method, the method comprising: obtaining to-be-fused images; for each of the to-be-fused images, obtaining a weight map of the to-be-fused image and gradient maps of the to-be-fused image in a plurality of preset opposite directions, the weight map of the to-be-fused image being a weight distribution map corresponding to different pixel points in each different to-be-fused image, the weight map being used to represent importance between the different pixel points; for each of the to-be-fused images, fusing the weight map of the to-be-fused image with the gradient maps of the to-be-fused image in the plurality of preset opposite directions respectively to obtain a plurality of fusion gradient maps corresponding to the gradient maps in the plurality of preset opposite directions respectively; obtaining a high dynamic range image corresponding to the to-be-fused image according to the fusion gradient maps.
2. The method of claim 1, wherein, The obtaining to-be-fused images comprises: obtaining original to-be-fused images; aligning the original to-be-fused images to obtain to-be-fused images.
3. The method of claim 1, wherein, The obtaining the weight map of the to-be-fused image comprises: obtaining channel values corresponding to each pixel point in the to-be-fused image; determining weights of each pixel point in the to-be-fused image according to the channel values corresponding to each pixel point in the to-be-fused image to obtain a weight map of the to-be-fused image.
4. The method of claim 1, wherein, Before the fusing the weight map and the gradient maps in the plurality of preset opposite directions to obtain the fusion gradient maps, the method further comprises: normalizing the weight map of the to-be-fused image.
5. The method of claim 1, wherein, Before the fusing the weight map and the gradient maps in the plurality of preset opposite directions to obtain the fusion gradient maps, the method further comprises: filtering and smoothing the weight map of the to-be-fused image.
6. The method of claim 1, wherein, The obtaining the high dynamic range image corresponding to the to-be-fused image according to the fusion gradient maps comprises: constructing a difference equation set according to the fusion gradient maps; solving the difference equation set to obtain a target fusion image; performing color scale mapping on the target fusion image to obtain the high dynamic range image corresponding to the to-be-fused image.
7. An image fusion apparatus characterized by comprising: The apparatus comprises: an image obtaining module configured to obtain to-be-fused images; a gradient map obtaining module configured to, for each of the to-be-fused images, obtain a weight map of the to-be-fused image and gradient maps of the to-be-fused image in a plurality of preset opposite directions, the weight map of the to-be-fused image being a weight distribution map corresponding to different pixel points in each different to-be-fused image, the weight map being used to represent importance between the different pixel points; a gradient map fusing module configured to, for each of the to-be-fused images, fuse the weight map of the to-be-fused image with the gradient maps of the to-be-fused image in the plurality of preset opposite directions respectively to obtain a plurality of fusion gradient maps corresponding to the gradient maps in the plurality of preset opposite directions respectively; an image fusion module configured to obtain a high dynamic range image corresponding to the to-be-fused image according to the fusion gradient maps.
8. The apparatus of claim 7, wherein, The image obtaining module is specifically configured to obtain original to-be-fused images and align the original to-be-fused images to obtain to-be-fused images. 9.A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the computer device is configured to perform the method according to any one of claims 1-8 when the computer program is executed by the processor. The processor, when executing the computer program, implements the steps of the method in any one of claims 1 to 6.
10. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program, which is executed by a processor, implements the steps of the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Image Detail Enhancement Method
CN109146798A
Image fusion method and device for removing ghost artifacts
CN110428391A