Image fusion method and device, computer device and computer readable storage medium

By acquiring global information of the color channels of multiple frames, abnormal frames and target frames are identified, and image alignment and fusion are performed. This solves the image fusion problem of traditional methods in complex scenes and achieves image effects with a wider dynamic range and greater depth of field.

CN117830120BActive Publication Date: 2026-11-24GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311851786.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-28
Publication Date
2026-11-24
Estimated Expiration
2043-12-28

AI Technical Summary

Technical Problem

Traditional image fusion methods are not suitable for image fusion of multiple frames generated in complex scenes, such as polar night starry sky and fireworks scenes, where the colors of the images change drastically and are difficult to fuse accurately.

Method used

By acquiring global information of each color channel of multiple frames, abnormal frames and target frames are identified. Image fusion is then performed on the target frames using image alignment, weight allocation, and fusion strategies to ensure the accuracy of image fusion.

Benefits of technology

It achieves accurate fusion of multi-frame images in complex scenes, expands dynamic range, improves details and textures, increases depth of field, and reduces exposure risk, making it suitable for high dynamic range imaging and focus stacking applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117830120B_ABST
    Figure CN117830120B_ABST
Patent Text Reader

Abstract

This application relates to an image fusion method, apparatus, computer device, and computer-readable storage medium. The method includes: acquiring global information of each color channel of each frame in a multi-frame image to be fused; determining an abnormal frame image and a target frame image in the multi-frame image based on the global information of each color channel of each frame image; wherein the abnormal frame image includes first color information, and the target frame image includes second color information; and performing image fusion on the target frame image to obtain a fused image. This method is applicable to image fusion of multi-frame images generated in complex scenes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] Image multi-frame fusion combines multiple images with different exposures or focal lengths to produce an image with a wider dynamic range or greater depth of field.

[0003] However, traditional image fusion methods are not suitable for image fusion of multiple frames generated in complex scenes. For example, traditional image fusion methods are not suitable for image fusion of multiple frames with drastic changes in color and lighting. Summary of the Invention

[0004] This application provides an image fusion method, apparatus, computer device, and computer-readable storage medium, which can be applied to image fusion of multiple frames of images generated in complex scenes.

[0005] In a first aspect, embodiments of this application provide an image fusion method, including:

[0006] Obtain global information of each color channel in each frame of the multi-frame images to be fused;

[0007] Based on the global information of each color channel of each frame image, abnormal frame images and target frame images in the multi-frame images are determined; wherein, the abnormal frame image includes first color information, and the target frame image includes second color information;

[0008] The target frame image is fused to obtain the fused image.

[0009] Secondly, embodiments of this application provide an image fusion apparatus, comprising:

[0010] The acquisition module is used to acquire global information of each color channel of each frame in the multi-frame images to be fused;

[0011] The determination module is used to determine abnormal frame images and target frame images in the multi-frame images based on the global information of each color channel of each frame image; wherein, the abnormal frame image includes first color information and the target frame image includes second color information;

[0012] The fusion module is used to perform image fusion on the target frame image to obtain a fused image.

[0013] Thirdly, embodiments of this application provide a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the steps of the image fusion method as described in the first aspect.

[0014] Fourthly, embodiments of this application provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described in the first aspect.

[0015] Fifthly, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the steps of the method described in the first aspect.

[0016] The aforementioned image fusion method, apparatus, computer device, and computer-readable storage medium, by acquiring the global information of each color channel of each frame in the multi-frame images to be fused, can determine the abnormal frame images including the first color information and the target frame images including the second color information in the multi-frame images to be fused based on the global information of each color channel of each frame in the multi-frame images. Then, image fusion can be performed on the target frame images including the second color information. Since the multi-frame image fusion is performed on the target frame images including the second color information in the multi-frame images, and the fused images are the target frame images including the same color information, it ensures that traditional image fusion methods can also be applied to the image fusion of multi-frame images generated in complex scenes. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 This is a schematic diagram of an image generated in a complex scene in one embodiment;

[0019] Figure 2 This is a schematic diagram of an image generated in another complex scenario in one embodiment;

[0020] Figure 3 Here is a flowchart of an image fusion method in one embodiment;

[0021] Figure 4 A flowchart of an image fusion method in another embodiment;

[0022] Figure 5A flowchart of an image fusion method in another embodiment;

[0023] Figure 6 A flowchart of an image fusion method in another embodiment;

[0024] Figure 7 A flowchart of an image fusion method in another embodiment;

[0025] Figure 8 A flowchart of an image fusion method in another embodiment;

[0026] Figure 9 This is a schematic diagram of the pixels included in each frame of a multi-frame image to be fused in one embodiment;

[0027] Figure 10 This is a structural block diagram of an image fusion device in one embodiment;

[0028] Figure 11 This is a structural block diagram of the image fusion apparatus in another embodiment;

[0029] Figure 12 This is a structural block diagram of the image fusion apparatus in another embodiment;

[0030] Figure 13 This is a structural block diagram of the image fusion apparatus in another embodiment;

[0031] Figure 14 This is a schematic diagram of the internal structure of a computer device in one embodiment. Detailed Implementation

[0032] 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.

[0033] Multi-frame image fusion is an image processing technique that combines multiple images obtained with different exposures or focal lengths to produce a single image with a wider dynamic range or greater depth of field. Multi-frame image fusion is commonly used in applications such as High Dynamic Range (HDR) imaging and focus stacking. The benefits of fusing multiple frames obtained from different exposures include:

[0034] 1. Expanding Dynamic Range: Images with different exposures or focal lengths can capture information of varying brightness or sharpness. By merging these images, the dynamic range of the image can be expanded, preserving more detail. This is particularly useful for shooting high-contrast scenes, such as landscape photos where bright skies and shadowed areas coexist.

[0035] 2. Improve details and textures: Fusing multiple images can reduce noise and artifacts, improve image clarity and detail retention. Since each image may have a different noise distribution, fusion can average these noises, resulting in a cleaner image.

[0036] 3. Increase depth of field: By merging multiple images with different focal points, a single image with greater depth of field can be created. This is very useful for indoor or outdoor photography where both the foreground and background need to be sharp at the same time.

[0037] IV. Reduce exposure risks: In some cases, especially in high dynamic range scenes, a single image may not be able to properly expose all areas. By acquiring multiple images with different exposures and merging them together, the problems of overexposure or underexposure can be avoided, and a more balanced exposure result can be obtained.

[0038] However, traditional image fusion methods are not suitable for image fusion of multi-frame images generated in complex scenes. A typical complex scene is a polar night sky (completely black) with the moon. In this scene, the image is extremely dark, with very little effective information. The stars are too small to be distinguished from noise, making fusion misalignment more likely. Another example is fireworks scenes. Because the colors and shapes of the fireworks change extremely rapidly after they explode, traditional image fusion methods are no longer suitable for image fusion of multi-frame images generated in fireworks scenes. For example, images generated in complex scenes such as KTVs, theaters, cinemas, and fireworks can be fused as follows: Figure 1 and Figure 2 As shown, by Figure 1 and Figure 2 As can be seen, the light source changes between different frames in this complex scene, leading to color differences between them. Therefore, this application provides an image fusion method applicable to image fusion of multiple frames generated in complex scenes.

[0039] In one embodiment, such as Figure 3 As shown, an image fusion method is provided. This embodiment illustrates the method by applying it to a computer device. It is understood that this method can also be applied to a server, and further to a system including both a computer device and a server, and is implemented through the interaction between the computer device and the server. In this embodiment, the method includes the following steps:

[0040] S201, Obtain global information of each color channel of each frame in the multi-frame images to be fused.

[0041] The multiple frames to be fused can be in RAW or RGB format; this embodiment does not limit the image format of the multiple frames to be fused. In this embodiment, the color channels of each frame include R channel, G channel, and B channel. That is, in this embodiment, the global information of the R channel, G channel, and B channel of each frame in the multiple frames to be fused is obtained.

[0042] Optionally, in this embodiment, global information of each color channel of each frame of the multi-frame image to be fused can be obtained by statistically analyzing the pixel sum of each color channel of each pixel in each frame of the multi-frame image to be fused.

[0043] S202, based on the global information of each color channel of each frame image, determine the abnormal frame image and the target frame image in the multi-frame image; wherein, the abnormal frame image includes first color information, and the target frame image includes second color information.

[0044] It is understood that the global information of each color channel of each frame in the multi-frame images to be fused can reflect the color information of each frame. Optionally, in this embodiment, the global information of each color channel of each frame can be compared according to the global information of each color channel of each frame in the multi-frame images to be fused, and the abnormal frame image including the first color information and the target frame image including the second color information can be determined. That is, by comparing the global information of each color channel of each frame, the abnormal frame image and the target frame image with inconsistent color information can be determined from the multi-frame images to be fused.

[0045] S203, perform image fusion on the target frame image to obtain the fused image.

[0046] In this embodiment, after the computer device determines the above-mentioned abnormal frame image and target frame image, the computer device can use existing image fusion algorithms to perform image fusion on the determined target frame image to obtain the fused image.

[0047] It should be noted that image fusion algorithms typically involve the following steps:

[0048] Image alignment: Spatially aligning input images, typically using techniques such as feature point matching or motion estimation to ensure correspondence between images.

[0049] Weighting: Assign weights to each input image to determine each image's contribution to the final result. Weights can be calculated based on image quality, motion stability, or other reliability metrics.

[0050] Fusion strategy: Based on weights and pixel values, the pixel values ​​of multiple input images are merged. Common fusion strategies include weighted averaging, median fusion, gradient-based fusion, etc.

[0051] Post-processing: Further processing of the fused image, such as noise reduction, detail enhancement, and color adjustment, to improve the quality of the final output.

[0052] In the above image fusion method, by obtaining the global information of each color channel of each frame in the multi-frame images to be fused, it is possible to determine the abnormal frame images including the first color information and the target frame images including the second color information in the multi-frame images to be fused based on the global information of each color channel of each frame in the multi-frame images. Then, image fusion can be performed on the target frame images including the second color information. Since the multi-frame image fusion is performed on the target frame images including the second color information in the multi-frame images, the fused images are the target frame images including the same color information. Therefore, it is ensured that the traditional image fusion method can also be applied to the image fusion of multi-frame images generated in complex scenes.

[0053] In the scenario described above, where abnormal and target frame images are determined based on the global information of each color channel in each frame of a multi-frame image to be fused, the difference information between each frame can be determined based on the global information of each color channel, thereby identifying the abnormal and target frame images in the multi-frame image. In one embodiment, such as... Figure 4 As shown, the above S202 includes:

[0054] S301, based on the global information of each color channel of each frame image, determine the difference information between the base frame image and the first candidate frame image in the multi-frame image; wherein, the base frame image includes second color information; the first candidate frame image includes at least one frame image other than the base frame image in the multi-frame image.

[0055] Optionally, in this embodiment, if the multiple frames to be fused are images with equal exposure, any frame can be determined as the base frame image; if the multiple frames to be fused are images with unequal exposure, the frame with a brightness value corresponding to normal exposure can be determined as the base frame image. Here, equal exposure refers to the case where the brightness of the multiple frames is the same, and unequal exposure refers to the case where the brightness of the multiple frames is different, including both dark and bright frames.

[0056] The first candidate frame image includes at least one frame image other than the base frame image in the multiple frames to be fused. That is, the other frame images in the multiple frames to be fused, other than the base frame image, can all be the first candidate frame images in this embodiment, or some of the frame images in the other frame images in the multiple frames to be fused, other than the base frame image, can be the first candidate frame images in this embodiment.

[0057] Optionally, in this embodiment, the computer device can determine the global information of each color channel of the base frame image and the global information of each color channel of the first candidate frame image in the multi-frame images to be fused based on the global information of each color channel of each frame image, and then compare the global information of each color channel of the base frame image and the global information of each color channel of the first candidate frame image to determine the difference information between the base frame image and the first candidate frame image.

[0058] S302, based on the difference information between the base frame image and the first candidate frame image and the exposure information corresponding to the multiple frame images, determine the abnormal frame image and the target frame image.

[0059] Optionally, in this embodiment, the multi-frame images to be fused may be multi-frame images acquired under equal exposure conditions or multi-frame images acquired under unequal exposure conditions. For different exposure information, the methods used to determine the abnormal frame images and target frame images in the multi-frame images may also be different. Therefore, in this embodiment, the computer device can determine the corresponding abnormal frame images and target frame images based on the exposure information corresponding to the multi-frame images to be fused, and then determine the abnormal frame images and target frame images from the multi-frame images to be fused based on the difference information between the base frame image and the first candidate frame image. For example, for equal exposure frames, the method for determining the abnormal frame images and target frame images may be to determine the abnormal frame images in the multi-frame images based on the difference information between the base frame image and the first candidate frame image respectively; for unequal exposure frames, the method for determining the abnormal frame images may be to combine the difference information between the base frame image and multiple different first candidate frame images to determine the abnormal frame images in the multi-frame images.

[0060] In this embodiment, based on the global information of each color channel of each frame in the multi-frame images to be fused, the difference information between the base frame image and the first candidate frame image other than the base frame image in the multi-frame images to be fused can be accurately determined. Thus, based on the difference information between the base frame image and the first candidate frame image in the multi-frame images and the exposure information corresponding to the multi-frame images, the abnormal frame image and the target frame image in the multi-frame images can be accurately determined, ensuring the accuracy of the abnormal frame image and the target frame image determined by the computer device.

[0061] This embodiment will describe in detail the process of determining the difference information between the base frame image and the first candidate frame image in the multi-frame images to be fused, based on the global information of each color channel in each frame image. In one embodiment, such as Figure 5 As shown, the above S301 includes:

[0062] S401, based on the global information of each color channel of each frame image, obtain the gain value of the color channel of the base frame image and the gain value of the color channel of the first candidate frame image.

[0063] In this embodiment, taking the base frame image as an example, the global information of each color channel of the base frame image can be represented as baseR. sum , baseG sum and baseB sum , where baseR sum =∑ pixel_base R(x,y)*baseGain, baseG sum =∑ pixel_base G(x,y)*baseGain, baseB sum =∑ pixel_base B(x,y)*baseGain, where baseGain represents the exposure gain of the base frame image, R(x,y) represents the pixel value of each pixel in the R color channel of the base frame image, G(x,y) represents the pixel value of each pixel in the G color channel of the base frame image, and B(x,y) represents the pixel value of each pixel in the B color channel of the base frame image. The calculation method for the global information of each color channel of the first candidate frame image is the same as the calculation method for the global information of each color channel of the base frame image, and will not be repeated here in this embodiment.

[0064] Optionally, in this embodiment, the gain value of the R color channel of each frame can be obtained based on the ratio of the global information of the R color channel to the global information of the G color channel in each frame of the multi-frame images to be fused, and the gain value of the B color channel of each frame can be obtained based on the ratio of the global information of the B color channel to the global information of the G color channel in each frame of the multi-frame images to be fused. For example, continuing with the base frame image, the gain value of the color channels of the base frame image can be obtained based on the global information of each color channel of the base frame image using the following formula: rGainBase = baseR sum / baseG sum bGainBase = baseB sum / baseG sum In the formula, rGainBase represents the gain value of the R color channel of the base frame image, and bGainBase represents the gain value of the B color channel of the base frame image. Similarly, the calculation process for the gain value of the color channels of the first candidate frame image can be found in the calculation process for the gain value of the color channels of the base frame image, and will not be repeated here in this embodiment.

[0065] S402, determine the difference information between the base frame image and the first candidate frame image based on the gain values ​​of the color channels of the base frame image and the gain values ​​of the color channels of the first candidate frame image.

[0066] First, it should be noted that the gain values ​​of the color channels in each frame of the multi-frame images to be fused may include the gain values ​​of the R color channel and the B color channel. Optionally, in this embodiment, the computer device can determine the difference information of the R color channels between the base frame image and the first candidate frame image based on the gain values ​​of the R color channels of the base frame image and the first candidate frame image, and determine the difference information of the B color channels between the base frame image and the first candidate frame image based on the gain values ​​of the B color channels of the base frame image and the first candidate frame image.

[0067] For example, a computer device can be based on the formula The difference information of the R color channel between the base frame image and the first candidate frame image is determined. In this formula, diffR represents the difference information of the R color channel between the base frame image and the first candidate frame image, and abs(rGainBase-rGainFrame) represents the absolute value of the difference between the gain value of the R color channel of the base frame image and the gain value of the R color channel of the first candidate frame image. Similarly, computer equipment can use the formula... Determine the difference information of the B color channel between the base frame image and the first candidate frame image. In the formula, diffB represents the difference information of the B color channel between the base frame image and the first candidate frame image, and abs(bGainBase-bGainFrame) represents the absolute value of the difference between the gain value of the B color channel of the base frame image and the gain value of the B color channel of the first candidate frame image.

[0068] In this embodiment, the computer device can reverse-engineer the gain values ​​of the color channels of the base frame image and the first candidate frame image based on the global information of each color channel of the multi-frame images to be fused. This allows the computer device to accurately determine the gain values ​​of the color channels of the base frame image and the first candidate frame image. As a result, the computer device can accurately determine the difference information between the base frame image and the first candidate frame image based on the gain values ​​of the color channels of the base frame image and the first candidate frame image in the multi-frame images to be fused, ensuring the accuracy of the determined difference information between the base frame image and the first candidate image.

[0069] This embodiment will describe in detail the process by which a computer device determines abnormal frame images and target frame images in a multi-frame image set to be fused. In one embodiment, such as Figure 6 As shown, the above S302 includes:

[0070] S501, based on the difference information between the base frame image and the first candidate frame image and the exposure information corresponding to the multiple frame images, an abnormal frame image and a second candidate frame image are determined; the second candidate frame image includes at least one frame image from the first candidate frame image; the second candidate frame image includes the second color information.

[0071] The second candidate frame image includes at least one frame image from the first candidate frame image, and the second candidate frame image includes second color information, that is, the second candidate frame image is a frame image in the first candidate frame image whose color information is consistent with the base frame image and inconsistent with the abnormal frame image.

[0072] Optionally, in this embodiment, based on the difference information between the base frame image and the first candidate frame image and the exposure information corresponding to the multiple frame images, an abnormal frame image whose color information is inconsistent with that of the base frame image and a second candidate frame image whose color information is consistent with that of the base frame image can be determined from the multiple frame images to be fused.

[0073] S502, the second candidate frame image and the base frame image are determined as the target frame image.

[0074] In this embodiment, the second candidate frame image is a frame image that includes the second color information in the first candidate frame image. That is, the color information of the second candidate frame image is consistent with the color information of the base frame image. Therefore, in this embodiment, the second candidate frame image and the base frame image can be determined as the target frame image. That is, the determined target frame image is a frame image with consistent color information among the multiple frames to be fused.

[0075] In this embodiment, based on the difference information between the base frame image and the first candidate frame image in the multi-frame images to be fused, as well as the exposure information corresponding to the multi-frame images, the abnormal frame image including the first color information and the second candidate frame image including the second color information in the multi-frame images to be fused can be accurately determined, ensuring the accuracy of the determined abnormal frame image and the second candidate frame image. Thus, the base frame image and the second candidate frame image in the multi-frame images to be fused can be determined as the target frame image, ensuring the accuracy of the target frame image in the multi-frame images to be fused determined by the computer device.

[0076] It is understandable that the exposure information corresponding to the multiple frames to be fused can be equal exposure or unequal exposure. That is to say, the multiple frames to be fused can be equal exposure or unequal exposure. The following will explain in detail the process of determining the abnormal frame image and the target frame image in the multiple frames to be fused, respectively, when the multiple frames to be fused are equal exposure and unequal exposure.

[0077] The first method: When the multiple frames to be fused are multiple frames with equal exposure, in one embodiment, such as... Figure 7 As shown, the above S501 includes:

[0078] S601, when the exposure information is equal exposure, the color of the base frame image and the first candidate frame image is determined to be consistent based on the difference information between the base frame image and the first candidate frame image.

[0079] In this embodiment, when the exposure information corresponding to the multiple frames to be fused is equal exposure, i.e., the multiple frames to be fused are multiple frames with equal exposure, the computer device can determine whether the colors of the base frame image and the first candidate frame image are consistent based on the difference information between the base frame image and the first candidate frame image. It is understood that the difference information between the base frame image and the first candidate frame image includes the difference information of the R color channel and the difference information of the B color channel between the base frame image and the first candidate frame image. In other words, in this embodiment, the computer device can determine whether the colors of the base frame image and the first candidate image are consistent based on the difference information of the R color channel and the difference information of the B color channel between the base frame image and the first candidate image.

[0080] Optionally, in this embodiment, if the computer device determines that the difference information of the R color channel between the base frame image and the first candidate frame image is greater than a preset first difference threshold, it can determine that the colors of the base frame image and the first candidate frame image are inconsistent. Alternatively, if the computer device determines that the difference information of the B color channel between the base frame image and the first candidate frame image is greater than a preset second difference threshold, it can determine that the colors of the base frame image and the first candidate frame image are inconsistent. Optionally, the first difference threshold and the second difference threshold can be the same difference threshold, or they can be different difference thresholds.

[0081] For example, in this embodiment, the computer device can determine that the colors of the base frame image and the first candidate frame image are inconsistent according to the following formula: condColor = (diffR>colorThres||diffB>colorThres). In the formula, condColor indicates that the colors of the base frame image and the first candidate frame image are inconsistent, and (diffR>colorThres||diffB>colorThres) indicates that the difference information of the R color channel between the base frame image and the first candidate frame image is greater than a preset difference threshold, or the difference information of the B color channel between the base frame image and the first candidate frame image is greater than a preset difference threshold. These two difference thresholds can be the same difference threshold or different difference thresholds.

[0082] It is understood that in this embodiment, the computer device can use the above-described judgment method to judge the base frame image and the first candidate frame image respectively, and judge whether the colors of the base frame image and the first candidate frame image are consistent.

[0083] S602, the first candidate frame image whose color is inconsistent with the base frame image is determined as an abnormal frame image, and the first candidate frame image whose color is consistent with the base frame image is determined as a second candidate frame image.

[0084] Optionally, in this embodiment, after the computer device uses the above method to determine whether the colors of the base frame image and the first candidate frame image are consistent in the multi-frame images to be fused, if the color of the first candidate frame image is inconsistent with the color of the base frame image, it indicates that the color of the image at the first candidate frame image has changed in the multi-frame images, and the color of this frame image is inconsistent with the color of the previous frame image. In this case, the computer device can determine the first candidate frame image whose color is inconsistent with the base frame image as an abnormal frame image. Conversely, the computer device can determine the first candidate frame image whose color is consistent with the base frame image as a second candidate frame image.

[0085] In this embodiment, when the exposure information of the multiple frames to be fused is equal exposure, that is, the multiple frames to be fused are equal exposure images, the computer device determines whether the colors of the base frame image and the first candidate frame image are consistent based on the difference information between the base frame image and the first candidate frame image in the multiple frames to be fused. The computational workload is small, and it can quickly determine whether the colors of the base frame image and the first candidate frame image are consistent. Thus, based on the judgment result of whether the colors of the base frame image and the first candidate frame image are consistent, the first candidate frame image with inconsistent colors with the base frame image is quickly identified as an abnormal frame image, and the first candidate frame image with consistent colors with the base frame image is identified as a second candidate frame image, ensuring the efficiency of determining the abnormal frame image and the second candidate frame image in the multiple frames to be fused.

[0086] The second type: When the multi-frame images to be fused are multi-frame images with unequal exposure, in one embodiment, the above S501 includes: when the exposure information is unequal exposure, a determination operation is performed; the determination operation includes: based on the difference information between the base frame image and the first candidate frame image, obtaining a judgment result on whether the colors of the first frame image in the base frame image and the first candidate frame image are consistent, and determining the abnormal frame image and the second candidate frame image based on the judgment result; wherein, the brightness of the first frame image is less than the brightness of the base frame image.

[0087] In this embodiment, when the exposure information of the multiple frames to be fused is unequal, i.e., the multiple frames to be fused are multiple frames with unequal exposure, the computer device can determine the abnormal frame image and the second candidate frame image from the multiple frames to be fused by performing a determination operation. Optionally, before performing the above determination operation, the computer device can first sort the first candidate frame images in descending order of brightness, with the brighter first candidate frame image appearing earlier. Of course, the brightness of the first frame image in the first candidate frame images is less than that of the base frame image.

[0088] As an optional implementation, the above-mentioned determination operation includes: obtaining a judgment result on whether the colors of the first frame image in the base frame image and the first candidate frame image are consistent based on the difference information between the base frame image and the first candidate frame image; and then determining the abnormal frame image and the second candidate frame image in the multi-frame image based on the judgment result on whether the colors of the first frame image in the base frame image and the first candidate frame image are consistent. It should be noted that in this embodiment, the judgment result on whether the colors of the first frame image in the base frame image and the first candidate frame image are consistent based on the difference information between the base frame image and the first candidate frame image can refer to the judgment principle on whether the colors of the base frame image and the first candidate image are consistent when the multi-frame images to be fused are of equal exposure. The judgment principles are the same, and will not be repeated here.

[0089] Optionally, in this embodiment, if it is determined that the colors of the base frame image and the first frame image in the first candidate frame image are inconsistent, then all the first candidate frame images in the multi-frame images to be fused can be determined as abnormal frame images; if it is determined that the colors of the base frame image and the first frame image in the first candidate frame image are consistent, then a new first frame image can be determined from the first candidate frame images, wherein the brightness of the new first frame image is less than the brightness of the first frame image in the first candidate frame image. Further, the computer device returns to execute the judgment result of whether the colors of the base frame image and the new first frame image are consistent based on the difference information between the base frame image and the new first frame image in the first candidate frame image. Based on the judgment result, the determination operation of abnormal frame images and second candidate frame images is performed until a preset iteration stop condition is reached, and the abnormal frame images and second candidate images in the multi-frame images to be fused are determined. Optionally, the preset iteration stop condition may be that all the first candidate frame images in the multi-frame images to be fused have been traversed, or it may be that a certain number of iterations has been reached.

[0090] The following example illustrates the process of identifying abnormal frames when the multi-frame images to be merged are multi-frame images with unequal exposures: As shown in Table 1, assume that the multi-frame images to be merged include three frames: EV0, EV12, and EV24. EV0 is the base frame image, and EV12 and EV24 are the first candidate frame images. The brightness of EV12 is greater than that of EV24. When the color of EV0 is a and the color of EV12 is b, and the two colors are inconsistent, regardless of whether the color of EV24 is consistent with the color of EV0, the computer device will no longer determine whether the colors of EV0 and EV24 are consistent, and will directly identify EV12 and EV24 as abnormal frames and discard them. When the color of EV0 is a and the color of EV12 is a, and the two colors are consistent, the computer device will continue to determine whether the colors of EV0 and EV24 are consistent. If the colors of EV0 and EV24 are inconsistent, then EV24 will be identified as an abnormal frame and discarded.

[0091] Table 1

[0092] frame EV0 EV12 EV24 deal with 1 a b c Lost EV12 EV24 2 a a b Lost EV24 3 a b b Lost EV12 EV24 4 a b a Lost EV12 EV24

[0093] In this embodiment, when the multi-frame images to be fused are multi-frame images with unequal exposure, the computer device can quickly obtain the judgment result of whether the colors of the first frame image in the base frame image and the first candidate frame image are consistent based on the difference information between the base frame image and the first candidate frame image in the multi-frame images to be fused. Thus, based on the judgment result of whether the colors of the first frame image in the base frame image and the first candidate frame image are consistent, the abnormal frame image and the second candidate frame image can be quickly determined, ensuring the efficiency of the computer device in determining the abnormal frame image and the second candidate frame image in the multi-frame images to be fused.

[0094] In the scenario where the multiple frames to be fused are images with unequal exposures, as an optional implementation, the computer device needs to perform image alignment processing on the images with unequal exposures before performing image fusion. In one embodiment, such as... Figure 8 As shown, the above method also includes:

[0095] S701 performs brightness alignment processing on multiple frames of images to obtain the processed multiple frames of images.

[0096] In this embodiment, when the multiple frames to be fused are images with unequal exposures, due to the inconsistency in brightness information between the frames, brightness alignment processing is required first to align the brightness of the multiple frames, resulting in the processed multiple frames. Optionally, in this embodiment, the computer device can perform brightness alignment processing on the multiple frames to be fused based on the brightness gain value of each frame in the multiple frames. It should be noted that for multiple frames with unequal exposures in different image formats, the computer device can use a brightness alignment processing method corresponding to that image format to perform brightness alignment processing on the multiple frames with unequal exposures.

[0097] Furthermore, after performing brightness alignment processing on multiple frames of images with unequal exposures, the above-mentioned S201 includes:

[0098] S702, obtain global information of each color channel of each frame in the processed multi-frame image.

[0099] In this embodiment, the computer device performs brightness alignment processing on multiple frames of images with unequal exposures to obtain processed multi-frame images. Then, it can use the method described above to obtain global information for each color channel of each frame in the processed multi-frame images.

[0100] In this embodiment, when the multi-frame images to be fused are multi-frame images with unequal exposure, the computer device can perform brightness alignment processing on these multi-frame images to make the processed multi-frame images brightness aligned. Then, the global information of each color channel of each frame in the processed multi-frame images is obtained, ensuring the accuracy of the global information of each color channel of each frame in the multi-frame images to be fused obtained by the computer device.

[0101] In this embodiment, the detailed process of obtaining global information of each color channel of each frame in the multi-frame images to be fused will be described. In one embodiment, S201 above includes: obtaining global information of each color channel of each frame image by using a skip block statistics method for each color channel.

[0102] In this embodiment, the computer device can predefine the size of the statistical image. Based on the size of the statistical image and the size of each frame in the multi-frame image to be fused, a statistical step size is determined. Then, based on this statistical step size, each pixel in each frame of the multi-frame image to be fused is traversed, i.e., a skip-block statistical method is used to traverse each pixel in each frame of the multi-frame image to be fused, obtaining global information of each color channel in each frame of the multi-frame image to be fused. For example, assuming the predefined size of the statistical image is process_width * process_height, and the size of each frame in the multi-frame image to be fused is defined as input_width * input_height, the statistical step size can be determined using the following formula:

[0103] step=min(input_width / process_width, input_height / process_height).

[0104] Understandably, when the multi-frame images to be merged are in RAW format, the computer device can use the aforementioned skip block statistics method for each color channel to obtain the global information of each color channel in each frame of the multi-frame images to be merged; when the multi-frame images to be merged are in RGB format, the computer device can use the aforementioned skip block statistics method for each of the R, G, and B channels to obtain the global information of each color channel in each frame of the multi-frame images to be merged.

[0105] For example, when the multiple frames to be fused are in RAW format, the number of pixels in each frame of the multiple frames to be fused is as follows: Figure 9 As shown, the computer device can use a jump block statistics method to count the global information of each color channel at positions 1, 3, 9, and 11 to replace the global information of each color channel at positions 1-16, or only count the global information of each color channel at position 1 to replace the global information of each color channel at positions 1-16.

[0106] In this embodiment, for each frame of the multi-frame images to be fused, the global information of each color channel of each frame is obtained by using a skip block statistics method. This reduces the amount of computation required to obtain the global information of each color channel of each frame, thereby improving the efficiency of obtaining the global information of each color channel of each frame.

[0107] To facilitate understanding by those skilled in the art, the image fusion method provided in this disclosure is described in detail below. This method may include:

[0108] S1. For each color channel, the global information of each color channel of each frame in the multi-frame image to be fused is obtained by using the skip block statistics method. If the multi-frame image to be fused is a multi-frame image with unequal exposure, then after performing brightness alignment processing on the multi-frame image to be fused, the global information of each color channel of each frame in the processed multi-frame image is obtained.

[0109] S2, based on the global information of each color channel of each frame image, obtain the gain value of the color channel of the base frame image and the gain value of the color channel of the first candidate frame image; the base frame image includes second color information; the first candidate frame image includes at least one frame image other than the base frame image among multiple frames.

[0110] S3. Based on the gain values ​​of the color channels of the base frame image and the gain values ​​of the color channels of the first candidate frame image, determine the difference information between the base frame image and the first candidate frame image.

[0111] S4, when the exposure information corresponding to multiple frames is equal exposure, then based on the difference information between the base frame image and the first candidate frame image, it is determined whether the colors of the base frame image and the first candidate frame image are consistent. The first candidate frame image whose color is inconsistent with the base frame image is determined as an abnormal frame image, and the first candidate frame image whose color is consistent with the base frame image is determined as a second candidate frame image. The second candidate frame image includes at least one frame image from the first candidate frame image. The second candidate frame image includes second color information. The abnormal frame image includes first color information.

[0112] S5, when the exposure information corresponding to multiple frames is unequal exposure, a determination operation is performed; the determination operation includes: based on the difference information between the base frame image and the first candidate frame image, obtaining the judgment result of whether the color of the first frame image in the base frame image and the first candidate frame image is consistent, and determining the abnormal frame image and the second candidate frame image based on the judgment result; wherein, the brightness of the first frame image is less than the brightness of the base frame image.

[0113] S6, if the judgment result is that the colors of the base frame image and the first frame image are inconsistent, then all first candidate frame images are determined as abnormal frame images; if the judgment result is that the colors of the base frame image and the first frame image are consistent, then a new first frame image is determined from the first candidate frame images, and the determination operation is returned to be executed until the preset iteration stop condition is reached, and the abnormal frame image and the second candidate frame image are determined; wherein, the brightness of the new first frame image is less than the brightness of the first frame image.

[0114] S7, the second candidate frame image and the base frame image are determined as the target frame image; the target frame image includes the second color information.

[0115] S8 performs image fusion on the target frame image to obtain the fused image.

[0116] It should be noted that the descriptions of the above steps can be found in the relevant descriptions in the above embodiments, and their effects are similar, so they will not be repeated here.

[0117] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0118] Based on the same inventive concept, this application also provides an image fusion apparatus for implementing the image fusion method described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, the specific limitations in one or more image fusion apparatus embodiments provided below can be found in the limitations of the image fusion method described above, and will not be repeated here.

[0119] In one embodiment, such as Figure 10 As shown, an image fusion device is provided, including: an acquisition module 10, a determination module 11, and a fusion module 12, wherein:

[0120] The acquisition module 10 is used to acquire global information of each color channel of each frame in the multi-frame images to be fused.

[0121] The determination module 11 is used to determine abnormal frame images and target frame images in multiple frames based on the global information of each color channel of each frame image; wherein, the abnormal frame image includes first color information and the target frame image includes second color information.

[0122] The fusion module 12 is used to perform image fusion on the target frame image to obtain the fused image.

[0123] The image fusion apparatus provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, so it will not be described again here.

[0124] Based on the above embodiments, such as Figure 11As shown, optionally, the above-mentioned determining module 11 includes: a first determining unit 111 and a second determining unit 112, wherein:

[0125] The first determining unit 111 is used to determine the difference information between the base frame image and the first candidate frame image in the multi-frame image based on the global information of each color channel of each frame image; wherein the base frame image includes second color information; and the first candidate frame image includes at least one frame image other than the base frame image in the multi-frame image.

[0126] The second determining unit 112 is used to determine the abnormal frame image and the target frame image based on the difference information between the base frame image and the first candidate frame image and the exposure information corresponding to the multiple frame images.

[0127] The image fusion apparatus provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, so it will not be described again here.

[0128] Based on the above embodiments, optionally, the first determining unit 111 is specifically used to determine the abnormal frame image and the second candidate frame image based on the difference information between the base frame image and the first candidate frame image and the exposure information corresponding to the multiple frame images; the second candidate frame image includes at least one frame image in the first candidate frame image; the second candidate image includes second color information; and the second candidate image and the base frame image are determined as the target frame image.

[0129] The image fusion apparatus provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, so it will not be described again here.

[0130] Based on the above embodiments, optionally, the second determining unit 112 is specifically used to determine whether the colors of the base frame image and the first candidate frame image are consistent based on the difference information between the base frame image and the first candidate frame image when the exposure information is equal exposure, and to determine the first candidate frame image whose color is inconsistent with the base frame image as an abnormal frame image, and to determine the first candidate frame image whose color is consistent with the base frame image as a second candidate frame image.

[0131] The image fusion apparatus provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, so it will not be described again here.

[0132] Based on the above embodiments, optionally, the second determining unit 112 is specifically used to perform a determining operation when the exposure information is unequal exposure; the determining operation includes: obtaining a judgment result on whether the colors of the first frame image in the base frame image and the first candidate frame image are consistent based on the difference information between the base frame image and the first candidate frame image, and determining the abnormal frame image and the second candidate frame image based on the judgment result; wherein, the brightness of the first frame image is less than the brightness of the base frame image.

[0133] The image fusion apparatus provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, so it will not be described again here.

[0134] Based on the above embodiments, optionally, the second determining unit 112 is specifically used to determine all first candidate frame images as abnormal frame images if the determination result is that the colors of the base frame image and the first frame image are inconsistent; if the determination result is that the colors of the base frame image and the first frame image are consistent, a new first frame image is determined from the first candidate frame images, and the determination operation is returned until a preset iteration stop condition is reached, and the abnormal frame image and the second candidate frame image are determined; wherein, the brightness of the new first frame image is less than the brightness of the first frame image.

[0135] The image fusion apparatus provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, so it will not be described again here.

[0136] Based on the above embodiments, such as Figure 12 As shown, optionally, if the multiple frames are unequal exposure frames, the above apparatus further includes: a processing module 13, wherein:

[0137] Processing module 13 is used to perform brightness alignment processing on multiple frames of images to obtain processed multiple frames of images;

[0138] The aforementioned acquisition module 10 is used to acquire global information of each color channel of each frame in the processed multi-frame image.

[0139] The image fusion apparatus provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, so it will not be described again here.

[0140] Based on the above embodiments, such as Figure 13 As shown, optionally, the above-mentioned acquisition module 10 includes: acquisition unit 101, wherein:

[0141] The acquisition unit 101 is used to acquire global information of each color channel of each frame image by using a skip block statistics method.

[0142] The image fusion apparatus provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, so it will not be described again here.

[0143] 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, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.

[0144] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 14 As shown, the computer device includes a processor, memory, input / output interfaces, a communication interface, a display unit, and an input device. The processor, memory, and input / output interfaces are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interfaces. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interfaces are used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements an image fusion method. The display unit is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.

[0145] Those skilled in the art will understand that Figure 14 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.

[0146] This application also provides a computer-readable storage medium. One or more non-volatile computer-readable storage media containing computer-executable instructions, which, when executed by one or more processors, cause the processors to perform the steps of an image fusion method.

[0147] This application also provides a computer program product containing instructions that, when run on a computer, cause the computer to perform an image fusion method.

[0148] 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, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, 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, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0149] 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.

[0150] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. 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 application should be determined by the appended claims.

Claims

1. An image fusion method, characterized in that, include: Obtain global information of each color channel in each frame of the multi-frame images to be fused; Based on the global information of each color channel of each frame image, the gain values ​​of the color channels of the base frame image and the first candidate frame image are obtained. Based on the gain values ​​of the color channels of the base frame image and the first candidate frame image, the difference information between the base frame image and the first candidate frame image is determined. Based on the difference information between the base frame image and the first candidate frame image and the exposure information corresponding to the multiple frames, the abnormal frame image and the target frame image in the multiple frames are determined. The abnormal frame image includes first color information, and the target frame image includes second color information. The base frame image includes the second color information. The first candidate frame image includes at least one frame image in the multiple frames, excluding the base frame image. The target frame image is fused to obtain the fused image.

2. The method according to claim 1, characterized in that, The step of determining the abnormal frame image and the target frame image based on the difference information between the base frame image and the first candidate frame image and the exposure information corresponding to the multiple frame images includes: Based on the difference information between the base frame image and the first candidate frame image, and the exposure information corresponding to the multiple frame images, the abnormal frame image and the second candidate frame image are determined; the second candidate frame image includes at least one frame image from the first candidate frame image; the second candidate frame image includes the second color information; The second candidate frame image and the base frame image are determined as the target frame image.

3. The method according to claim 2, characterized in that, The step of determining the abnormal frame image and the second candidate frame image based on the difference information between the base frame image and the first candidate frame image and the exposure information corresponding to the multiple frame images includes: When the exposure information is equal exposure, the color of the base frame image and the first candidate frame image is determined to be consistent based on the difference information between the base frame image and the first candidate frame image. The first candidate frame image whose color is inconsistent with the base frame image is determined as the abnormal frame image, and the first candidate frame image whose color is consistent with the base frame image is determined as the second candidate frame image.

4. The method according to claim 2, characterized in that, The step of determining the abnormal frame image and the second candidate frame image based on the difference information between the base frame image and the first candidate frame image and the exposure information corresponding to the multiple frame images includes: When the exposure information is unequal exposure, a determination operation is performed; the determination operation includes: obtaining a judgment result on whether the colors of the first frame image in the base frame image and the first candidate frame image are consistent based on the difference information between the base frame image and the first candidate frame image; and determining the abnormal frame image and the second candidate frame image based on the judgment result; wherein the brightness of the first frame image is less than the brightness of the base frame image.

5. The method according to claim 4, characterized in that, The step of determining the abnormal frame image and the second candidate frame image based on the judgment result includes: If the determination result is that the colors of the base frame image and the first frame image are inconsistent, then all the first candidate frame images are determined to be the abnormal frame images; If the determination result is that the base frame image and the first frame image have the same color, then a new first frame image is determined from the first candidate frame images, and the determination operation is returned until the preset iteration stop condition is reached, and the abnormal frame image and the second candidate frame image are determined; wherein, the brightness of the new first frame image is less than the brightness of the first frame image.

6. The method according to claim 4, characterized in that, If the multiple frames are images with unequal exposure, the method further includes: The multi-frame images are subjected to brightness alignment processing to obtain the processed multi-frame images; The step of obtaining global information of each color channel of each frame in the multi-frame images to be fused includes: Obtain global information for each color channel of each frame in the processed multi-frame image.

7. The method according to any one of claims 1 to 6, characterized in that, The step of obtaining global information of each color channel of each frame in the multi-frame images to be fused includes: For each color channel, a skip block statistics method is used to obtain the global information of each color channel of each frame image.

8. An image fusion apparatus, characterized in that, include: The acquisition module is used to acquire global information of each color channel of each frame in the multi-frame images to be fused; The determining module is configured to obtain the gain values ​​of the color channels of a base frame image and the gain values ​​of the color channels of a first candidate frame image based on the global information of each color channel of each frame image; determine the difference information between the base frame image and the first candidate frame image based on the gain values ​​of the color channels of the base frame image and the first candidate frame image; and determine the abnormal frame image and the target frame image in the multi-frame image based on the difference information between the base frame image and the first candidate image and the exposure information corresponding to the multi-frame image; wherein the abnormal frame image includes first color information, the target frame image includes second color information; the base frame image includes the second color information; and the first candidate frame image includes at least one frame image in the multi-frame image excluding the base frame image. The fusion module is used to perform image fusion on the target frame image to obtain a fused image.

9. A computer device, comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the computer program is executed by the processor, the processor performs the steps of the image fusion method as described in any one of claims 1 to 7.

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

11. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Image fusion method, computer program product and electronic equipment

    CN116721021A

  • Image processing method and device, equipment and storage medium

    CN117237228A