Image processing method, storage medium and electronic device

By acquiring image pixel values ​​at different exposure levels and determining fusion weight values, combined with bit width compensation and exposure alignment processing, the motion artifact problem in the image fusion process is solved, achieving high dynamic range and high fidelity image output.

CN120823097APending Publication Date: 2025-10-21SANECHIPS TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410403643.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-04-03
Publication Date
2025-10-21

AI Technical Summary

Technical Problem

In existing technologies, high bit width images output during image fusion are prone to motion artifacts, especially motion artifacts caused by misalignment between multi-exposure images, which have not yet been effectively resolved.

Method used

By acquiring the pixel values ​​of two images with different exposures, a fusion weight value is determined, including a first fusion weight value, a second fusion weight value, and a third fusion weight value. These are used for image fusion in high-brightness areas, low-brightness areas, and motion areas, respectively. Combined with bit width compensation and exposure alignment processing, flexible image fusion is achieved.

Benefits of technology

It effectively solves the problem of motion artifacts in the image fusion process, and the output high bit width image has high dynamic range and minimizes motion artifacts, thus achieving high dynamic range and high fidelity image presentation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120823097A_ABST
    Figure CN120823097A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an image processing method, a storage medium and an electronic device, and the method comprises the steps: obtaining the pixel values of two images with different exposures in a target scene, determining a fusion weight value according to the pixel values of the two images, the fusion weight values comprise a first fusion weight value, a second fusion weight value and a third fusion weight value, the first fusion weight value is a fusion weight value of a high-brightness area of the first image, the second fusion weight value is a fusion weight value of a low-brightness area of the second image, and the third fusion weight value is a fusion weight value of motion areas in the two images; and fusing the two images according to the fusion weight value to obtain a fused image, thereby solving the problem that a high-bit-width image output in an image fusion process has motion flaws in related technologies, and achieving the technical effects that the output high-bit-width image has a high dynamic range and the motion flaws are minimized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the field of images, and in particular, to an image processing method, a storage medium, and an electronic device. Background Art

[0002] High Dynamic Range (HDR) imaging is a set of technologies used to achieve a higher dynamic range than conventional digital imaging techniques. Because consumer-grade sensors typically have limited image dynamic range acquisition capabilities, often smaller than the dynamic range of real natural scenes and the dynamic range observable by the human eye, effectively combining sensors, image signal processors (ISPs), and displays to produce images with high dynamic range and high color fidelity is a practical and important issue.

[0003] In the digital image pre-processing stage, in order to effectively improve the dynamic range of the image, a variety of sensor acquisition technologies can be used, such as Digital Overlap (DOL), Staggered or Quad Color Filter Array (QCFA) and other multi-exposure image acquisition technologies, to output multiple digital signals with different exposures to the ISP. The multi-exposure synthesis is then performed by the ISP's multi-exposure processing unit to output a high-bit-width, high-dynamic range image for downstream ISP units and display processing. For the multi-exposure processing unit in the SIP, due to the different sampling durations and sampling start and end times between the multi-exposure images, as well as the movement of the photographer, equipment and scene, there are global and local motion misalignment problems between the multi-exposure images. As a result, motion artifacts are very likely to appear in the high-bit-width image output by the fusion.

[0004] With respect to the problem in the related art that high-bit-width images output during the image fusion process have motion artifacts, no suitable solution has yet been proposed. Summary of the Invention

[0005] Embodiments of the present invention provide an image processing method, a storage medium, and an electronic device to at least solve the problem in the related art that a high-bit-width image output during an image fusion process has motion artifacts.

[0006] According to one embodiment of the present invention, there is provided an image processing method, comprising:

[0007] Obtaining pixel values ​​of two images with different exposures under a target scene, wherein the two images include a first image with a larger exposure and a second image with a smaller exposure;

[0008] Determining a fusion weight value according to pixel values ​​of the two images, wherein the fusion weight value includes at least one of the following: a first fusion weight value, a second fusion weight value, and a third fusion weight value, wherein the first fusion weight value is a fusion weight value of a high-brightness area of ​​the first image, the second fusion weight value is a fusion weight value of a low-brightness area of ​​the second image, and the third fusion weight value is a fusion weight value of a motion area in the two images;

[0009] The two images are fused according to the fusion weight value to obtain a fused image.

[0010] According to another embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above method embodiments are executed.

[0011] According to another embodiment of the present application, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0012] According to another embodiment of the present application, a computer program product is provided, including a computer program, which implements the steps of any of the above method embodiments when executed by a processor.

[0013] Through the present invention, pixel values ​​of two images with different exposures in a target scene are obtained, wherein the two images include a first image with a larger exposure and a second image with a smaller exposure; a fusion weight value is determined according to the pixel values ​​of the two images, wherein the fusion weight value includes at least one of the following: a first fusion weight value, a second fusion weight value, and a third fusion weight value, the first fusion weight value is a fusion weight value of a high-brightness area of ​​the first image, the second fusion weight value is a fusion weight value of a low-brightness area of ​​the second image, and the third fusion weight value is a fusion weight value of a motion area in the two images; the two images are fused according to the fusion weight values ​​to obtain a fused image, which can solve the problem in the related art that the high-bit width image output during the image fusion process has motion defects, and achieves the technical effect that the output high-bit width image has a high dynamic range and minimizes motion defects. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] Figure 1 This is a hardware structure block diagram of a computer terminal for an image processing method according to an embodiment of the present invention;

[0015] Figure 2is a flowchart of an image processing method according to an embodiment of the present invention;

[0016] Figure 3 The process of determining the fusion weight value according to the pixel values ​​of two images according to an embodiment of the present invention is as follows: Figure 1 ;

[0017] Figure 4 The process of determining the fusion weight value according to the pixel values ​​of two images according to an embodiment of the present invention is as follows: Figure 2 ;

[0018] Figure 5 The process of determining the fusion weight value according to the pixel values ​​of two images according to an embodiment of the present invention is as follows: Figure 3 ;

[0019] Figure 6 is a flowchart of restoring image color according to an embodiment of the present invention;

[0020] Figure 7 is a flow chart of fusing two images according to an embodiment of the present invention;

[0021] Figure 8 This is a schematic diagram of fusing three images according to an embodiment of the present invention. Figure 1 ;

[0022] Figure 9 This is a schematic diagram of fusing three images according to an embodiment of the present invention. Figure 2 ;

[0023] Figure 10 is a schematic diagram of fusing four images according to an embodiment of the present invention;

[0024] Figure 11 is a specific flow chart of an image processing method according to an embodiment of the present invention. DETAILED DESCRIPTION

[0025] Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings and in combination with embodiments.

[0026] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0027] The method embodiments provided in the embodiments of the present application can be executed in a computer terminal or similar computing device. Taking running on a computer terminal as an example, Figure 1 FIG. 1 is a hardware structure diagram of a computer terminal for an image processing method according to an embodiment of the present invention. Figure 1 As shown, the computer terminal includes one or more ( Figure 1Only one is shown) a processor 102 (the processor 102 includes but is not limited to a microprocessor MCU or a programmable logic device FPGA and other processing devices) and a memory 104 for storing data, wherein the above-mentioned computer terminal also includes a transmission device 106 and an input and output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above-mentioned computer terminal. For example, the computer terminal may also include Figure 1 More or fewer components than shown, or with Figure 1 Different configurations shown.

[0028] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the image processing method in the embodiment of the present invention. The processor 102 executes the computer program stored in the memory 104 to perform various functional applications and data processing, that is, to implement the above-mentioned method. The memory 104 may include a high-speed random access memory and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely located relative to the processor 102, and these remote memories may be connected to the computer terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0029] The transmission device 106 is used to receive or transmit data via a network. A specific example of the aforementioned network may include a wireless network provided by a computer terminal's communications provider. In one embodiment, the transmission device 106 includes a network interface controller (NIC), which can be connected to other network devices via a base station to enable communication with the Internet. In another embodiment, the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0030] In this embodiment, an image processing method running on the above-mentioned computer terminal is provided. Figure 2 is a flow chart of an image processing method according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:

[0031] Step S202: acquiring pixel values ​​of two images with different exposures under a target scene, wherein the two images include a first image with a larger exposure and a second image with a smaller exposure;

[0032] Step S204: determining a fusion weight value based on the pixel values ​​of the two images, wherein the fusion weight value includes at least one of the following: a first fusion weight value, a second fusion weight value, and a third fusion weight value, wherein the first fusion weight value is a fusion weight value for a high-brightness area of ​​the first image, the second fusion weight value is a fusion weight value for a low-brightness area of ​​the second image, and the third fusion weight value is a fusion weight value for a moving area in the two images;

[0033] Step S206: fusing the two images according to the fusion weight value to obtain a fused image.

[0034] Through the above steps S202 to S206, during the image fusion process, the first fusion weight value can be used to enhance the low-brightness area of ​​the image, the second fusion weight value can be used to suppress the high-brightness area of ​​the image, and the third fusion weight value can be used to eliminate the defects in the motion area of ​​the image. By fusing the two images with the three fusion weight values, the optimal area of ​​the two exposed images can be flexibly selected, which solves the problem in the related art that the high-bit width image output during the image fusion process has motion defects, and achieves the technical effect of the output high-bit width image having a high dynamic range and minimized motion defects.

[0035] In one embodiment, the two images are pre-processed images, and the pre-processing includes at least one of the following: black level correction (BLC), digital gain (DG), and noise reduction (NR). The two images may also be images pre-processed for multi-exposure alignment by an image registration unit, or images converted into RGB domain or YUV domain after being processed by a digital signal pipeline.

[0036] In one embodiment, the two images are images that have been processed by one of the following: pre-filtering, bit width alignment, and exposure compensation.

[0037] In this application example, img S,i,j 、img M,i,j Respectively represent the pixel values ​​of the first image and the second image at position (i, j) in the two images.

[0038] In one embodiment, performing pre-filtering on the two images includes:

[0039] img S,filter,i,j =prefilter(img S,i,j );

[0040] imgM,filter,i,j =prefilter(img M,i,j );

[0041] Among them, img S,filter,i,j ,img M,filter,i,j They respectively represent the pixel values ​​of the first image and the second image after pre-filtering, and prefilter(.) represents a preset pre-filtering function, which can be a noise removal function, such as a bilateral filter or a median filter.

[0042] In one embodiment, performing bit width compensation and exposure alignment on the two images includes:

[0043] Define the exposure ratio of the first image and the second image ev,S,M ;

[0044] img S,EValign,i,j =img S,i,j >>(bitwidth output -bitwidth input );

[0045] img M,EValign,i,j =(img M,i,j >>(bitwidth output -bitwidth input ))·ratio ev,S,M ;

[0046] Among them, img S,EValign,i,j 、img M,EValign,i,j Respectively represent the pixel values ​​of the first image and the second image after bit width compensation and exposure alignment, bitwidth output Indicates the output bit width, bitwidth input Indicates the input bit width, and >> indicates a shift operation.

[0047] When the two images are pre-filtered images, performing bit width compensation and exposure alignment on the two images includes:

[0048] img S,filter , EValign,i,j =img S,filter,i,j >>(bitwidth output -bitwidth input );

[0049] img M,filter,EValign,i,j =(img M,filter,i,j >>(bitwidth output -bitwidthinput ))·ratio ev,S,M ;

[0050] Among them, img S,filter,EValign,i,j ,img M,filter,EValign,i,j Respectively represent the pixel values ​​of the two images after pre-filtering and after bit width compensation and exposure alignment, ratio ev,S,M is a floating point number less than 1. It should be noted that, although the embodiments of the present application are described with floating point numbers, those skilled in the art may also understand it as a behavior of converting it into a fixed point number operation.

[0051] For the multi-exposure processing unit in the ISP, due to the different sampling durations and sampling start and end times of the multi-exposure images, as well as the movement of the photographer, equipment and scene, there is global or local misalignment between the multi-exposure images, resulting in motion artifacts in the high-bit width images output during the image fusion process.

[0052] The embodiment of the present invention performs bit width compensation and exposure alignment processing before fusing the multi-exposure images, which can solve the problem of motion artifacts in the high-bit width images output during the image fusion process.

[0053] In one embodiment, Figure 3 The process of determining the fusion weight value according to the pixel values ​​of two images according to an embodiment of the present invention is as follows: Figure 1 ,like Figure 3 As shown, the above step S204 includes:

[0054] Step S302, determining a brightness value of the first image according to pixel values ​​of the first image;

[0055] In this embodiment, the above-mentioned step S302 may specifically include: determining pixel values ​​of the red, green and blue color channels of the first image according to the pixel values ​​of the first image; and determining the brightness value of the first image according to the pixel values ​​of the three color channels.

[0056] Determining the pixel values ​​of the red, green, and blue color channels of the first image according to the pixel values ​​of the first image includes: performing a pixel denoising operation on the first image or using a neighborhood interpolation method to obtain the pixel values ​​r of the red, green, and blue color channels of the first image. S,i,j, ,g S,i,j ,b S,i,j .

[0057] Determining brightness values ​​of pixels of the first image according to pixel values ​​of the three color channels includes:

[0058] luma S,i,j =func luma (rS,i,j, ,g S,i,j ,b S,i,j );

[0059] Among them, luma S,i,j Indicates the brightness value of the pixel at position (i, j) in the first image, func luma (·) represents the set brightness calculation function;

[0060] func luma (·) can be the following function:

[0061]

[0062] Among them, w luma Indicates the configurable fusion coefficient.

[0063] Step S304: Determine the first fusion weight value according to the brightness value of the first image.

[0064] In this embodiment, the above-mentioned step S304 may specifically include: querying a first table according to the brightness value of the first image to obtain the first fusion weight value, wherein the first table pre-stores a first correspondence between the brightness value and the first fusion weight value, and the first correspondence includes: when the brightness value is less than a first threshold, the fusion weight value is 0; when the brightness value is greater than a second threshold, the fusion weight value is 1; when the brightness value is between the first threshold and the second threshold, the brightness value is between 0 and 1.

[0065] Obtaining the first fusion weight value by querying a first table according to the brightness value of the pixel of the first image includes:

[0066] w lowlit,S,M,i,j =LUT lowlit,S,M (lowlit S,M,i,j ); lowlit S,M,i,j =func lowlit (luma S,i,j );

[0067] Among them, w lowlit,S,M,i,j Indicates the first fusion weight value, LUT lowlit,S,M (·) represents the function of looking up the first table, lowlit S,M,i,j Indicates the low brightness measurement value, func lowlit (·) represents a function for obtaining a corresponding low brightness measurement value for the brightness value;

[0068] LUT lowlit,S,M (·) can be the following function:

[0069] Wherein, th1 represents the first threshold, and th2 represents the second threshold;

[0070] func lowlit (·) can be the following function:

[0071] func lowlit (luma S,i,j )=w lowlit ·luma S,i,j ; Among them, w lowlit Indicates the configurable fusion coefficient;

[0072] In this embodiment, the method further includes: processing the first fusion weight value using a low-pass filter.

[0073] In one embodiment, Figure 4 The process of determining the fusion weight value according to the pixel values ​​of two images according to an embodiment of the present invention is as follows: Figure 2 ,like Figure 4 As shown, the above step S204 also includes:

[0074] Step S402, determining a brightness value of the second image according to pixel values ​​of the second image;

[0075] In this embodiment, the above-mentioned step S402 may specifically include: determining the pixel values ​​of the three color channels of red, green and blue in the second image according to the pixel values ​​of the second image; and determining the brightness value of the second image according to the pixel values ​​of the three color channels.

[0076] Determining the pixel values ​​of the red, green, and blue color channels of the second image according to the pixel values ​​of the second image includes: performing a pixel denoising operation on the second image or using a neighborhood interpolation method to obtain the pixel values ​​r of the red, green, and blue color channels of the second image. M,i,j ,,g M,i,j ,b M,i,j .

[0077] Determining brightness values ​​of pixels of the second image according to pixel values ​​of the three color channels includes:

[0078] luma M,i,j =func luma (r M,i,j ,,g M,i,j ,b M,i,j );

[0079] Among them, luma M,i,j Represents the brightness value of the pixel at position (i, j) in the second image, func luma (·) represents the set brightness calculation function.

[0080] Step S404: Determine the second fusion weight value according to the brightness value of the second image.

[0081] In this embodiment, the above-mentioned step S404 includes: querying the second table according to the brightness value of the second image to obtain the second fusion weight value, wherein the second table pre-stores a second correspondence between the brightness value and the second fusion weight value, and the second correspondence includes: when the brightness value is greater than the third threshold, the fusion weight value is 1; when the brightness value is less than the fourth threshold, the fusion weight value is 0; when the brightness value is between the third threshold and the fourth threshold, the brightness value is between 0 and 1.

[0082] The step of querying a second table according to the brightness value of the second image to obtain the second fusion weight value includes:

[0083] w highlit,S,M,i,j =LUT highlit,S,M (highlit S,M,i,j );highlit S,M,i,j =func highlit (luma M,i,j );

[0084] Among them, w highlit,S,M,i,j Indicates the second fusion weight value, LUT highlit,S,M (·) represents the function of looking up the second table, highlight S,M,i,j Indicates the measurement value of high brightness; func highlit (·) represents a function for obtaining a corresponding high brightness measurement value for the brightness value;

[0085] In this embodiment, the method further includes: processing the second fusion weight value using a low-pass filter.

[0086] In one embodiment, Figure 5 The process of determining the fusion weight value according to the pixel values ​​of two images according to an embodiment of the present invention is as follows: Figure 3 ,like Figure 5 As shown, the above step S204 also includes:

[0087] Step S502, obtaining a motion detection metric based on the absolute value of the difference between the pixel values ​​of the two images;

[0088] In this embodiment, the above step S502 includes:

[0089] motion S,M,i,j =func motion (img S,i,j ,imgM,i,j );

[0090] Among them, motion S,M,i,j is the motion detection metric for the pixel at position (i, j) in the two images, func motion (·) is the set motion detection function. It should be noted that in the above formula (img S,i,j ,img M,i,j ) can also be replaced by (img S,filter,i,j ,img M,filter,i,j )、(img S,filter,EValign,i,j ,img M,filter,EValign,i,j )、(luma S,i,j ,luma M,i,j ).

[0091] func motion (·) can be the following function:

[0092] func motion (·)=∑ (i,j)∈region |img S,i,j -img M,i,j | / num pixel , where region is the neighborhood window at position (i, j), num pixel is the number of pixels in the neighborhood window; func motion (·) The gradient value difference between the two images or a multi-scale scheme may also be used as a function of the motion detection metric calculation standard.

[0093] Step S504 : querying a third table according to the motion detection metric to obtain the third fusion weight value, wherein the third table pre-stores a third correspondence between the motion detection metric and the third fusion weight value.

[0094] In this embodiment, the above step S504 includes:

[0095] w motion,S,M,i,j =LUT motion,S,M (motion S,M,i,j );

[0096] Among them, w motion,S,M,i,j Indicates the third fusion weight value, LUT motion,S,M (·) represents the motion detection metric motion in the third table S,M,i,j The value of the table lookup, when motion S,M,i,j The larger the value, the greater the probability that the pixel is in the motion area. motion,S,M,i,j The larger the value.

[0097] In this embodiment, the method further includes: processing the third fusion weight value using a low-pass filter or a dilation-erosion operation.

[0098] Due to the different exposure times of different exposure images, a bit width alignment operation is performed on the multiple exposure images to correctly align the value range of the different exposure image signals. However, the longer exposure image signal is prone to pixel value saturation due to the longer exposure time. After bit width alignment and exposure compensation, color cast or color loss problems are prone to occur, resulting in color defects in the output high-bit width image. For this problem, the relevant technology has not yet found a suitable solution.

[0099] In one embodiment, Figure 6 FIG. 1 is a flowchart of restoring image color according to an embodiment of the present invention. Figure 6 As shown, before the above step S206, the method further includes:

[0100] Step S601, determining a hue ratio according to the brightness values ​​of the two images;

[0101] In this embodiment, the above step S601 includes:

[0102] hue ration,S,M,i,j =func hue (luma M,i,j ,luma S,i,j ); where hue ration,S,M,i,j Indicates the hue ratio, func hue (·) represents the set hue ratio function;

[0103] func hue (·) can be the following function:

[0104] func hue (luma M,i,j ,luma S,i,j )=(gamma(luma M,i,j ·ratio ev,S,M )) / gamma(luma S,i,j ), where gamma(·) represents the gamma nonlinear mapping function.

[0105] Step S602, determining a hue restoration value according to the hue ratio and the pixel value of the first image;

[0106] In this embodiment, the above step S602 includes:

[0107] color Rvy,S,M,i,j =img S,i,j hue ration,S,M,i,j; Among them, color Rvy,S,M,i,j Indicates the indicated hue restoration value.

[0108] Using hue to restore the value color Rvy,S,M,i,j Before the saturation of the second image and the first image is determined, the color is fused in a certain proportion according to the saturation of the second image and the first image. Rvy,S,M,i,j .

[0109] Step S606: Obtain an updated second image according to the hue restoration value and a fourth fusion weight value of the second image, wherein the fourth fusion weight value is a saturation degree value of pixels in the second image.

[0110] In this embodiment, the above step S606 includes:

[0111] img M,i,j =img M,i,j ·(1-w hue,long,S,M,i,j )+color Rvy,S,M,i,j w hue,long,S,M,i,j , where w hue,long,S,M,i,j Represents the fourth fusion weight value.

[0112] In one embodiment, the method further comprises:

[0113] Step S604: updating the fourth fusion weight value according to the fifth fusion weight value to obtain the updated fourth fusion weight value, wherein the fifth fusion weight value is a saturation degree value of pixels in the first image.

[0114] In this embodiment, the above step S604 includes:

[0115] w hue,long,S,M,i,j =(1-w hue,short,S,M,i,j )·w hue,long,S,M,i,j , where w hue,short,S,M,i,j Represents the fifth fusion weight value.

[0116] In one embodiment, the method further comprises:

[0117] Step S603: determining the fourth fusion weight value according to the pixel values ​​of the second image; and determining the fifth fusion weight value according to the pixel values ​​of the first image;

[0118] In this embodiment, the above step S603 includes:

[0119] w hue,long,S,M,i,j =LUT hue,long,S,M (img M,i,j );w hue,short,S,M,i,j =LUT hue,short,S,M (imgS,i,j );

[0120] Among them, LUT hue,long,S,M Indicates the value obtained by looking up the table for the pixels of the second image, LUT hue,short,S,M Indicates a value obtained by querying the pixels of the second image.

[0121] It should be noted that img in the above formula M,i,j Can be replaced by luma M,i,j 、g M,i,j 、r M,i,j 、b M,i,j , you can also use img M,i,j The value after Auto White Balance (AWB) compensation. For example, when img M,i,j Replace with g M,i,j When the pixel green channel value g is M,i,j The fourth fusion weight value is obtained by looking up the table, where g M,i,j It can be obtained by interpolation of the neighborhood green channel, w hue,long,S,M,i,j The larger the value is, the higher the probability that the pixels in the second image are high brightness. S,i,j Can be replaced by luma S,i,j 、g S,i,j 、r M,i,j 、b S,i,j , you can also use img S,i,j The value after automatic white balance (AWB) compensation, w hue,short,S,M,i,j The larger the value is, the higher the probability that the pixel of the first image is high brightness.

[0122] In the above embodiment, by restoring the image color, the color distortion problem in the saturated area of ​​the long exposure signal can be effectively solved, and the effect of restoring the image color with high fidelity can be achieved.

[0123] The selection and use of anchor exposures in multi-exposure images directly determines the noise level of the fused high-bit-width image. This not only easily introduces the aforementioned motion artifacts and color distortion, but also causes signal-to-noise ratio (SNR) drops. Therefore, the multi-exposure fusion unit in the ISP must design a multi-exposure fusion solution that balances minimizing motion artifacts, suppressing color distortion, and ensuring output SNR.

[0124] In one embodiment, the above step S206 includes:

[0125] When the first image is used as the anchor point, the fused image is calculated according to the following formula:

[0126] img S,M,i,j =img M,i,j ·(1-w high,S,M,i,j )+img S,i,j w high,S,M,i,j , where img S,M,i,j is the pixel value of the fused image.

[0127] When the second image is used as the anchor point, Figure 7 FIG. 1 is a flow chart of fusing two images according to an embodiment of the present invention. Figure 7 As shown, the fused image is obtained according to the following steps:

[0128] Step S701, fusing the two images according to the third fusion weight value to obtain a fourth image of the motion area, and updating the second fusion weight value according to the third fusion weight value to obtain an updated second fusion weight value;

[0129] Specifically, img motion,i,j =img M,i,j ·(1-w motin,S,M,i,j )+img S,i,j w motion,S,M,i,j ; Among them, img motion,S,M,i,j is the pixel value of the fourth image;

[0130] w lowlit,S,M,i,j =w lowlit,S,M,i,j +w motion,i,j ·(1-w lowlit,S,M,i,j ).

[0131] Step S702: fusing the fourth image and the second image according to the updated second fusion weight value to obtain a fifth image;

[0132] Specifically, img lowlit,i,j =img motion,i,j w lowlit,S,M,i,j +img M,i,j ·(1-w lowlit,S,M,i,j ); where img lowlit,i,j is the pixel value of the fifth image;

[0133] Step S703: Fusing the fifth image and the second image according to the first fusion weight value to obtain the fused image.

[0134] Specifically, img S,M,i,j =img lowlit,i,j ·(1-w highlit,S,M,i,j )+img S,i,j w highlit,S,M,i,j , where img S,M,i,jis the pixel value of the fused image.

[0135] In this embodiment, the anchor point exposure can be flexibly selected to effectively solve the problems of motion artifacts, color distortion, and signal-to-noise ratio faults, and can achieve the goal of minimizing motion artifacts, suppressing color distortion, and ensuring the output signal-to-noise ratio.

[0136] In one embodiment, the method further includes: extracting an image with the highest exposure from an image set as the first image, wherein the number of images in the image set is greater than or equal to 2; repeating the following steps until the number of images in the current image set is 0: extracting an image with the highest exposure from the current image set as the second image; obtaining pixel values ​​of the first image and the second image; determining a fusion weight value based on the pixel values; fusing the first image and the second image based on the fusion weight value to obtain a fused image; and using the fused image as the first image. The first image and the second image may replace each other.

[0137] The embodiment of the present invention can fuse any number of images by pairwise fusion. For example, it can support the fusion of 2 images, 3 images, 4 images, etc. Figure 8 This is a schematic diagram of fusing three images according to an embodiment of the present invention. Figure 1 , Figure 9 This is a schematic diagram of fusing three images according to an embodiment of the present invention. Figure 2 ,img S 、img M 、img L Respectively represent the short exposure image, the second short exposure image, and the medium exposure image in the three images, such as Figure 8 、 Figure 9 As shown, the order of fused images can be flexibly selected, such as Figure 8 Starting from the fusion of short exposure and sub-short exposure, Figure 9 Start blending from the second shortest exposure and the medium exposure. Figure 10 is a schematic diagram of fusing four images according to an embodiment of the present invention, img S 、img M 、img L points, img VL The four images represent the short exposure image, the second short exposure image, the medium exposure image, and the long exposure image, respectively. Fusion begins with the short exposure image and the second short exposure image. In this embodiment of the present invention, fusing N exposure images requires N-1 passes. For example, fusing 2, 3, and 4 exposure images requires 1, 2, and 3 passes, respectively.

[0138] In the embodiments of the present invention, the exposure image signal can be an image signal in the RAW domain, the RGB domain, or the YUV domain. For RGB domain exposure signals, compared to RAW domain multi-exposure signal processing, RGB domain signals can directly obtain RGB three-channel values ​​without demosaicing interpolation. For YUV domain exposure signals, the Y channel can be fused with multiple exposures in pairs according to this embodiment, and then the UV channel can be treated with the Y channel fusion weights. Alternatively, the YUV domain multi-exposure signal can be converted to the RGB domain, fused, and then converted to the YUV domain for output.

[0139] The embodiments of the present invention can be applied to various HDR exposure technologies such as digital overlap DOL, staggered, multi-frame HDR (MFHDR), and four-color filter array QCFA.

[0140] The embodiments of the present invention can be applied to a variety of image formats, including but not limited to RAW domain CFA format, YUV domain format, QCFA format, for example, RGGB, BGGR, GRBG, GBGR and other CFA formats, or YUV444, YUV422, YUV420 and other formats; for the QCFA format, the same exposure pixel values ​​in 2x2, 3x3 or 4x4 neighborhoods can be merged and output to the ISP multi-exposure image and then processed using the solution of the above embodiment.

[0141] The ISP online mode adopts a pipeline mode based on line buffer. In the embodiment of the present invention, based on the multi-exposure line buffer mode, it supports online processing mode and can support real-time application systems, such as mobile phone preview and real-time video mode, or in-vehicle real-time video mode.

[0142] Figure 11 is a specific flow chart of an image processing method according to an embodiment of the present invention. Figure 11 As shown, the method includes the following steps:

[0143] Step S1101, obtaining pixel values ​​of multiple images with different exposures in a target scene, and outputting pre-filtered and non-pre-filtered multi-channel signals;

[0144] Take the number of images as 4 as an example, define img s,i,j ,img M,i,j ,img L,i,j ,img VL,i,j They represent the pixel values ​​of the short exposure image, second short exposure image, medium exposure image, and long exposure image in the four images respectively.

[0145] The pre-filtering process for the four images includes:

[0146] imgS,filter,i,j =prefilter(img S,i,j );

[0147] img M,filter,i,j =prefilter(img M,i,j );

[0148] img L,filter,i,j =prefilter(img L,i,j );

[0149] img VL,filter,i,j =prefilter(img VL,i,j );

[0150] Among them, img S,filter,i,j 、img M,filter,i,j 、img L,filter,i,j 、img VL,filter,i,j They represent the pixel values ​​of the four images after pre-filtering, respectively. prefilter(.) represents the set pre-filtering scheme, which can be a noise removal scheme, such as a bilateral filter or a median filter.

[0151] After pre-filtering, two signals are output, including the original signal img s,i,j ,img M,i,j ,img L,i,j ,img VL,i,j and the filtered signal img S,filter,i,j 、img M,filter,i,j 、img L,filter,i,j 、img VL,filter,i,j .

[0152] Step S1102, calculating bit width compensation and exposure alignment;

[0153] Specifically, the bit width compensation and exposure alignment processing of the four images includes:

[0154] img S,EValign,i,j =img S,i,j >>(bitwidth output -bitwidth input );

[0155] img M,EValign,i,j =img M,i,j >>(bitwidth output -bitwidth input )·ratio ev,S,M ;

[0156] img L,EValign,i,j =(imgL,i,j >>(bitwidth output -bitwidth input )·ratio ev,M,L )·ratio ev,S,M ;

[0157] img VL,EValign,i,j =

[0158] (img VL,i,j >>(bitwidth output -bitwidth input ))·ratio ev,VL,L ·ratio ev,M,L ·ratio ev,S,M ;

[0159] Among them, img S,EValign,i,j 、img M,EValign,i,j 、img L,EValign,i,j 、img VL,EValign,i,j Respectively represent the pixel values ​​of the four images after bit width compensation and exposure alignment, bitwidth output Indicates the output bit width, bitwidth input Indicates input bit width, >> indicates shift operation, ratio ev,S,M 、ratio ev,M,L 、ratio ev,VL,L They respectively represent the ratio of exposure time of short exposure to exposure time of the second shortest exposure, the ratio of exposure time of the second shortest exposure to exposure time of medium exposure, and the ratio of exposure time of medium exposure to exposure time of long exposure.

[0160] The bit width compensation and exposure alignment processing of the pixel values ​​of the four pre-filtered images includes:

[0161] img S,filter,EValign,i,j =img S,filter,i,j >>(bitwidth output -bitwidth input );

[0162] img M,filter,EValign,i,j =img M,filter,i,j >>(bitwidth output -bitwidth input )·ratio ev,S,M ;

[0163] img L,filter,EValign,i,j =

[0164] (img L,filter,i,j >>(bitwidth output-bitwidth input )·ratio ev,M,L )·ratio ev,S,M ;

[0165] img VL,filter,EValign,i,j =

[0166] (img VLfilter,i,j >>(bitwidth output -bitwidth input ))·ratio ev,VL,L ·ratio ev,M,L ·ratio ev,S,M ;

[0167] Among them, img S,filter,EValign,i,j 、img M,filter,EValign,i,j 、img L,filter,EValign,i,j 、img VL,EValign,i,j They represent the pixel values ​​of the four pre-filtered images after bit width compensation and exposure alignment.

[0168] Step S1103, calculating the local brightness value;

[0169] This embodiment adopts a pairwise exposure fusion method. Steps S1103 to S1106 are described by taking the fusion of a short exposure image and a sub-short light image as an example. Repeating steps S1103 to S1106 as described in step S1107 can achieve exposure fusion with other images.

[0170] Specifically, determining the brightness value of the short-exposure image according to the pixel values ​​of the three color channels of the short-exposure image includes:

[0171] luma S,i,j =func luma (r S,i,j, ,g S,i,j ,b S,i,j );

[0172] Among them, luma S,i,j Indicates the brightness value of the pixel at position (i, j) in the short exposure image, func luma (·) represents the set brightness calculation function, r S,i,j, ,g S,i,j ,b S,i,j They are the pixel values ​​of the red, green, and blue color channels of the pixel respectively.

[0173] Among them, func luma (·) can be the following function:

[0174] func luma (r S,i,j,g S,i,j ,b S,i,j )=w luma ·(r S,i,j +g S,i,j +b S,i,j )+(1-w luma )·max(r S,i,j ,g S,i,j ,b S,i,j );

[0175] Among them, w luma Indicates the configurable fusion coefficient.

[0176] Similarly, the brightness value luma of the second shortest exposure image can be calculated M,i,j .

[0177] Step S1104, calculating a motion metric value, a low brightness metric value, and a high brightness metric value;

[0178] 1. Calculation of motion metrics includes:

[0179] motion S,M,i,j =func motion (img S,i,j ,img M,i,j );

[0180] Among them, motion S,M,i,j is the motion detection metric for the pixel at position (i, j) in the two images, func motion (·) can be the set motion detection function, and in the above formula (img S,i,j ,img M,i,j ) can also be replaced by (img S,filter,i,j ,img M,filter,i,j )、(img S,filter,EValign,i,j ,img M,filter,EValign,i,j )、(luma S,i,j ,luma M,i,j ).

[0181] Among them, func motion (img S,i,j ,img M,i,j ) can be the following function:

[0182] func motion (img S,i,j ,img M,i,j )=∑ (i,j)∈region |img S,i,j -img M,i,j | / num pixel ; Where region is the neighborhood window of the pixel at position (i, j), numpixel is the number of pixels in the neighborhood window.

[0183] 2. Calculating low brightness measurement values ​​includes:

[0184] lowlit S,M,i,j =func lowlit (luma S,i,j );

[0185] Among them, lowlit S,M,i,j Indicates the low brightness measurement value, func lowlit Indicates the set low brightness measurement value calculation function.

[0186] 3. Calculating high brightness metric values ​​includes:

[0187] highlit S,M,i,j =func highlit (luma M,i,j );

[0188] Among them, highlit S,M,i,j Indicates the high brightness measurement value, func highlit (·) represents the high brightness measurement value calculation function.

[0189] Step S1105, calculating low brightness, high brightness and motion fusion weight values;

[0190] 1. Calculation of low brightness fusion weight values ​​includes:

[0191] w lowlit,S,M,i,j =LUT lowlit,S,M (lowlit S,M,i,j );

[0192] Among them, w lowlit,S,M,i,j Indicates the low brightness fusion weight value, LUT lowlit,S,M (·) represents the low brightness value lowlit in the first table S,M,i,j Function to perform table lookup. lowlit,S,M,i,j The larger the value, the lower the probability that the pixel (i, j) has low brightness.

[0193] Specifically, LUT lowlit,S,M (·) can be the following function:

[0194]

[0195] The obtained low brightness fusion weight value is post-processed, including:

[0196] w lowlit,S,M,i,j =func lowlit,S,M (w lowlit,S,M,i,j );

[0197] Among them, func lowlit,S,M (·) can be a low-pass filter function.

[0198] It should be noted that, in this embodiment, the method of first looking up a table and then performing post-processing may be replaced by first performing post-processing and then performing table looking up.

[0199] 2. Calculation of high brightness fusion weight values ​​includes:

[0200]

[0201] Among them, w highlit,S,M,i,j Indicates the high brightness fusion weight value, LUT highlit,S,M (·) represents the high brightness value highlit in the second table S,M,i,j For table lookup functions, you can use 3-segment mapping curves to design the LUT table. highlit,S,M,i,j The larger the value, the higher the probability that the pixel (i, j) is high brightness.

[0202] Post-process the obtained high brightness fusion weight value, including:

[0203] w highlit,S,M,i,j =func highlit,S,M (w highlit,S,M,i,j );

[0204] Among them, func highlit,S,M (·) can be a low-pass filter function.

[0205] It should be noted that, in this embodiment, the method of first looking up a table and then performing post-processing may be replaced by first performing post-processing and then performing table looking up.

[0206] 3. Calculation of motion fusion weights includes:

[0207] w motion,S,M,i,j =LUT motion,S,M (motion S,M,i,j );

[0208] Among them, w motion,S,M,i,j Indicates the motion fusion weight value, LUT motion,S,M (·) represents the motion detection metric motion in the third table S,M,i,j The LTU value of the table is looked up, when motion S,M,i,j The larger the value, the greater the probability that the pixel is in the motion area. motion,S,M,i,j The larger the value.

[0209] The obtained motion fusion weight values ​​are post-processed, including:

[0210] w motion,S,M,i,j=func motion,S,M (w motion,S,M,i,j );

[0211] Among them, func motion,S,M (·) can be a low-pass filter function or a dilation-erosion operation function.

[0212] It should be noted that, in this embodiment, the method of first looking up a table and then performing post-processing may be replaced by first performing post-processing and then performing table looking up.

[0213] Step S1106: dynamic fusion based on color restoration and motion detection;

[0214] Dynamic fusion based on color restoration and motion detection includes:

[0215] 1. Calculate the hue ratio, including:

[0216] hue ration,S,M,i,j =func hue (luma M,i,j ,luma S,i,j );

[0217] Among them, hue ration,S,M,i,j Indicates the hue ratio, func hue (·) represents the set hue ratio function.

[0218] func hue (·) can be the following function:

[0219] func hue (luma M,i,j ,luma S,i,j )=(gamma(luma M,i,j ·ratio ev,S,M )) / gamma(luma S,i,j );

[0220] Wherein, gamma(·) represents the gamma nonlinear mapping function.

[0221] 2. Calculate the hue restoration value, including:

[0222] color Rvy,S,M,i,j =img S,i,j hue ration,S,M,i,j ; Among them, color Rvy,S,M,i,j Indicates the hue restoration value.

[0223] Using hue to restore the value color Rvy,S,M,i,j Before the saturation of the second image and the short exposure image is determined, the color is fused in a certain proportion according to the saturation of the second image and the short exposure image.Rvy,S,M,i,j .

[0224] 3. Calculate the long exposure saturation weight value, including:

[0225] w hue,long,S,M,i,j =LUT hue,long,S,M (img M,i,j );

[0226] Among them, w hue,long,S,M,i,j Indicates the long exposure saturation fusion weight value, LUT hue,long,S,M Indicates the value obtained by querying the pixel of the second shortest exposure image.

[0227] It should be noted that img M,i,j Can be replaced by luma M,i,j 、g M,i,j 、r M,i,j 、b M,i,j , you can also use img M,i,j The value after Auto White Balance (AWB) compensation.

[0228] 4. Calculate the short exposure saturation weight value, including:

[0229] w hue,short,S,M,i,j =LUT hue,short,S,M (img S,i,j );

[0230] Among them, w hue,short,S,M,i,j Indicates the short exposure saturation weight value, w hue,short,S,M,i,j Indicates the value obtained by querying the pixel with the short exposure saturation weight value. hue,short,S,M,i,j The larger the value, the higher the probability that the pixel of the short exposure image is high brightness.

[0231] It should be noted that img S,i,j Can be replaced by luma S,i,j 、g S,i,j 、r M,i,j 、b S,i,j , you can also use img S,i,j The value after Auto White Balance (AWB) compensation.

[0232] 5. Update the hue recovery fusion weight;

[0233] If the shorter exposure is saturated, the hue restoration value is used less, that is, the hue restoration fusion weight is updated.

[0234] w hue,long,S,M,i,j =(1-w hue,short,S,M,i,j )·w hue,long,S,M,i,j ;

[0235] 6. Update the longer exposure pixel value after hue restoration;

[0236] img M,i,j =img M,i,j ·(1-w hue,long,S,M,i,j )+color Rvy,S,M,i,j w hue,long,S,M,i,j ;

[0237] 7. Perform fusion;

[0238] When the first image is used as the anchor image, the fused image is calculated according to the following formula:

[0239] img S,M,i,j =img M,i,j ·(1-w high,S,M,i,j )+img S,i,j w high,S,M,i,j ; Among them, img S,M,i,j is the pixel value of the fused image.

[0240] When the second image is used as the anchor image, the fused image is obtained according to the following steps:

[0241] 1. Fusing the two images according to the third fusion weight value to obtain a fourth image of the motion area, and updating the second fusion weight value according to the third fusion weight value to obtain an updated second fusion weight value;

[0242] img motion,S,M,i,j =img M,i,j ·(1-w motin,S,M,i,j )+img S,i,j w motion,S,M,i,j ; Among them, img motion,S,M,i,j is the pixel value of the fourth image;

[0243] w lowlit,S,M,i,j =w lowlit,S,M,i,j +str motion w motion,S,M,i,j ·(1-w lowlit,S,M,i,j ), where str motion Represents a configurable exercise intensity reference factor.

[0244] 2. Fusing the fourth image and the short-exposure image according to the updated second fusion weight value to obtain a fifth image;

[0245] img lowlit,i,j =img motion,S,M,i,j w lowlit,S,M,i,j +img M,i,j ·(1-w lowlit,S,M,i,j); where img lowlit,i,j is the pixel value of the fifth image;

[0246] 3. Fuse the fifth image and the second image according to the first fusion weight value to obtain the fused image.

[0247] img S,M,i,j =img lowlit,i,j ·(1-w highlit,S,M,i,j )+img S,i,j w highlit,S,M,i,j ; Among them, img S,M,i,j is the pixel value of the fused image.

[0248] Step S1107, pairwise exposure fusion cycle.

[0249] Steps S1102 to S1106 illustrate the method for fusing short exposure and sub-short exposure. For 4 exposures, fusion is required 3 times, that is, in step S1106, the short exposure and sub-short exposure fusion result img is obtained. S,M,i,j Then, repeat steps S1102 to S1106, and transform the short exposure corresponding operation in steps S1102 to S1106 into the one for img S,M,i,j Processing, the shortest exposure corresponding operation is transformed into img L,i,j Processing, and then get img S,M,i,j and img L,i,j The fusion result img S,M,L,i,j , then repeat steps S1102 to S1106, and transform the short exposure corresponding operation in steps S1102 to S1106 into the one for img S,M,L,i,j Processing, the shortest exposure operation is transformed into img VL,i,j Processing, you can finally get img S,M,L,i,j and img VL,i,j The fusion result img S,M,L,VL,i,j .

[0250] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present invention.

[0251] An embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored. The computer program is configured to execute the steps of any one of the above method embodiments when running.

[0252] In an exemplary embodiment, the computer-readable storage medium includes, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.

[0253] An embodiment of the present invention further provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0254] In an exemplary embodiment, the electronic device further includes a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0255] An embodiment of the present application further provides a computer program product, including a computer program, which implements the steps of any of the above method embodiments when executed by a processor.

[0256] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail here.

[0257] Obviously, those skilled in the art will appreciate that the various modules or steps of the present invention described above can be implemented using a general-purpose computing device, can be centralized on a single computing device, or can be distributed across a network of multiple computing devices. They can be implemented using program code executable by the computing device, and thus, can be stored in a storage device and executed by the computing device. In some cases, the steps shown or described herein can be performed in a different order than that shown, or can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the present invention is not limited to any particular combination of hardware and software.

[0258] The foregoing description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Those skilled in the art will readily appreciate that various modifications and variations of the present invention are possible. Any modifications, equivalent substitutions, or improvements made within the principles of the present invention are intended to be within the scope of protection of the present invention.

Claims

1. An image processing method, characterized in that: include: Obtaining pixel values ​​of two images with different exposures under a target scene, wherein the two images include a first image with a smaller exposure and a second image with a larger exposure; Determining a fusion weight value according to pixel values ​​of the two images, wherein the fusion weight value includes at least one of the following: a first fusion weight value, a second fusion weight value, and a third fusion weight value, wherein the first fusion weight value is a fusion weight value of a low-brightness area of ​​the first image, the second fusion weight value is a fusion weight value of a low-brightness and high-brightness area of ​​the second image, and the third fusion weight value is a fusion weight value of a motion area in the two images; The two images are fused according to the fusion weight value to obtain a fused image.

2. The method according to claim 1, characterized in that Determining the fusion weight value according to the pixel values ​​of the two images includes: determining a brightness value of the first image according to pixel values ​​of the first image; The first fusion weight value is determined according to the brightness value of the first image.

3. The method according to claim 2, characterized in that Determining the brightness value of the first image according to the pixel value of the first image includes: Determining pixel values ​​of three color channels, red, green, and blue, in the first image according to the pixel values ​​of the first image; The brightness value of the first image is determined according to the pixel values ​​of the three color channels.

4. The method according to claim 2, characterized in that Determining the first fusion weight value according to the brightness value of the first image includes: The first fusion weight value is obtained by querying a first table according to the brightness value of the first image, wherein a first correspondence between the brightness value and the first fusion weight value is pre-stored in the first table, and the first correspondence includes: when the brightness value is less than a first threshold, the second fusion weight value is 0; when the brightness value is greater than a second threshold, the second fusion weight value is 1; when the brightness value is between the first threshold and the second threshold, the fusion weight value is between 0 and 1.

5. The method according to claim 1, wherein Determining the fusion weight value according to the pixel values ​​of the two images further includes: determining a brightness value of the second image according to pixel values ​​of the second image; The second fusion weight value is determined according to the brightness value of the second image.

6. The method according to claim 5, characterized in that Determining the brightness value of the second image according to the pixel value of the second image includes: Determine pixel values ​​of three color channels (red, green, and blue) in the second image according to the pixel values ​​of the second image; The brightness value of the second image is determined according to the pixel values ​​of the three color channels.

7. The method according to claim 5, characterized in that Determining the second fusion weight value according to the brightness value of the second image includes: The second fusion weight value is obtained by querying the second table according to the brightness value of the second image, wherein the second table pre-stores a second correspondence between the brightness value and the second fusion weight value, and the second correspondence includes: when the brightness value is greater than a third threshold, the fusion weight value is 1; when the brightness value is less than a fourth threshold, the fusion weight value is 0; when the brightness value is between the third threshold and the fourth threshold, the brightness value is between 0 and 1.

8. The method according to claim 1, characterized in that The two images are images that have been processed by one of the following: pre-filtering, bit width alignment, and exposure compensation.

9. The method according to claim 8, characterized in that Determining the fusion weight value according to the pixel values ​​of the two images includes: Obtaining a motion detection metric based on an absolute value of a difference in pixel values ​​between the two images; The third fusion weight value is obtained by querying a third table according to the motion detection metric, wherein a third correspondence between the motion detection metric and the third fusion weight value is pre-stored in the third table.

10. The method according to claim 9, characterized in that The motion detection metric is obtained based on the absolute value of the difference between the pixel values ​​of the two images, including: The motion detection metric is calculated according to the following formula: S,M,i,j =∑ (i,j)∈region |img S,i,j -img M,i,j | / num pixel , among which, motion S,M,i,j is the motion detection metric for the pixel at position (i, j) in the two images, img S,i,j is the pixel value of the second image at position (i, j), img M,i,j is the pixel value of the first image at position (i, j), region is the neighborhood window at position (i, j), num pixel is the number of pixels in the neighborhood window.

11. The method according to any one of claims 1 to 10, characterized in that Fusing the two images according to the fusion weight value to obtain a fused image includes: When the first picture is used as the anchor point, the fused image is calculated according to the following formula: img S,M,i,j =img M,i,j ·(1-w high,S,M,i,j )+img S,i,j w high,S,M,i,j ,img S,M,i,j is the pixel value of the fused image, img M,i,j is the pixel value of the first image at position (i, j), img S,i,j is the pixel value of the second image at position (i, j), w high,i,j is the first fusion weight value.

12. The method according to any one of claims 1 to 10, characterized in that When the second image is used as an anchor point, the fused image is obtained according to the following steps: fusing the two images according to the third fusion weight value to obtain a fourth image of the motion area, and updating the second fusion weight value according to the third fusion weight value to obtain an updated second fusion weight value; fusing the fourth image and the first image according to the updated second fusion weight value to obtain a fifth image; The fifth image and the second image are fused according to the first fusion weight value to obtain the fused image.

13. The method according to claim 12, characterized in that Fusing the two images according to the third fusion weight value to obtain a fourth image of the motion area includes: img motion,i,j =img M,i,j ·(1-w motin,S,M,i,j )+img S,i,j w motion,S,M,i,j , where img motion,S,M,i,j is the pixel value of the fourth image, img M,i,j is the pixel value of the first image at position (i, j), img S,i,j is the pixel value of the second image at position (i, j), w motion,S,M,i,j is the third fusion weight value; The second fusion weight value is updated according to the third fusion weight value to obtain an updated second fusion weight value, which includes: lowlit,S,M,i,j =w lowlit,S,M,i,j +w motion,i,j ·(1-w lowlit,S,M,i,j ), wherein said w lowlit,S,M,i,j is the second fusion weight value; The fifth image obtained by fusing the fourth image and the second image according to the updated second fusion weight value includes: img lowlit,i,j =img motion,i,j w lowlit,S,M,i,j +img M,i,j ·(1-w lowlit,S,M,i,j );in, img lowlit,i,j is the pixel value of the fifth image at position (i, j); The fused image is obtained by fusing the fifth image and the first image according to the first fusion weight value: including: img S,M,i,j =img lowlit,i,j ·(1-w highlit,S,M,i,j )+img S,i,j w highlit,S,M,i,j , where img S,M,i,j is the pixel value of the fused image at position (i, j), w highlit,S,M,i,j is the first fusion weight value.

14. The method according to claim 1, wherein Before fusing the two images according to the fusion weight value to obtain a fused image, the method further includes: determining a hue ratio according to the brightness values ​​of the two images; determining a hue restoration value according to the hue ratio and the first image; An updated second image is obtained according to the hue restoration value and a fourth fusion weight value of the second image, wherein the fourth fusion weight value is a degree of pixel saturation in the second image.

15. The method according to claim 14, characterized in that Before obtaining the updated second image according to the hue restoration value and the fourth fusion weight value of the second image, the method further includes: The fourth fusion weight value is updated according to the fifth fusion weight value to obtain the updated fourth fusion weight value, and the fifth fusion weight value is a saturation degree value of pixels in the first image.

16. The method according to claim 1, wherein The method further comprises: Extracting an image with the highest exposure from an image set as the first image, wherein the number of images in the image set is greater than 2; Repeat the following steps until the number of images in the current image set is 0: Extracting an image with the highest exposure from the current image set as the second image; obtaining brightness values ​​of the first image and the second image; determining a fusion weight value based on the brightness values; fusing the first image and the second image based on the fusion weight value to obtain a fused image; and using the fused image as the first image.

17. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the steps of the method described in any one of claims 1 to 16 are implemented.

18. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 16 are implemented.

19. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 16 are implemented.