Image fusion method, electronic device and storage device
By calculating the color adjustment ratio and suppressing color noise in image fusion, it solves the problem of poor image fusion effect in the existing technology, achieves more efficient color matching and noise removal, and is suitable for monitoring applications in low-light and haze scenes.
Patent Information
- Application Number
- CN202210204675.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-03
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2042-03-03
AI Technical Summary
Existing image fusion methods have shortcomings in fusion effects. Especially in low-light and haze scenes, it is difficult to effectively process colors and details, resulting in color noise and color cast problems.
By acquiring visible light images and infrared images, fusion processing is performed based on the brightness and color information of pixels, the color adjustment ratio is calculated, the initial color is adjusted to improve color saturation, and color noise is suppressed and color cast is eliminated through human eye sensitivity calculation, using Methods such as weighted fusion and energy selection are used for processing.
It significantly improves the image fusion effect, enhances color matching, eliminates color noise and color cast in low-light images, requires less calculation, is suitable for device transplantation, and simplifies the processing process.
Smart Images

Figure CN114841904B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of image processing technology, and specifically relates to an image fusion method, electronic equipment and storage device. Background Art
[0002] As people's requirements for monitoring continue to increase, image fusion technology has become one of the popular technologies for video surveillance. Through multi-sensor equipment, images of different light bands are collected, and multi-image fusion processing is performed to obtain a fused image with rich details and colors. Specifically, the steps of the multi-image fusion method generally include: through multi-sensor equipment, visible light images and non-visible light images are simultaneously acquired, and the information of the two different images is registered and fused to generate a fused image with the characteristics and detail information of the two images. However, the existing image fusion methods have the problem of poor fusion effect. Summary of the invention
[0003] The present application provides an image fusion method, an electronic device and a storage device to improve the fusion effect.
[0004] To solve the above technical problems, a technical solution adopted in the present application is: to provide an image fusion method, including: obtaining a visible light image and an infrared image and a non-visible light image acquired for a current scene; for at least part of the first pixel points in the visible light image, obtaining a second pixel point corresponding to the first pixel point from the infrared image and the non-visible light image; wherein the first pixel point and the corresponding second pixel point represent the same target; obtaining a fused brightness based on the first brightness of the first pixel point and the second brightness of the corresponding second pixel point; determining a color adjustment ratio of the first pixel point based on the fused brightness, the first brightness and the second brightness; adjusting the initial color of the first pixel point based on the color adjustment ratio to obtain a fused color; and obtaining the adjusted first pixel point based on the fused brightness and the fused color.
[0005] To solve the above technical problems, another technical solution adopted in the present application is: to provide an electronic device, comprising a memory and a processor coupled to each other, wherein the memory stores program instructions, and the processor is used to execute the program instructions to implement the image fusion method described in any of the above embodiments.
[0006] In order to solve the above technical problems, another technical solution adopted by the present application is: providing a storage device storing program instructions that can be executed by a processor, wherein the program instructions are used to implement the image fusion method described in any of the above embodiments.
[0007] Different from the prior art, the beneficial effect of the present application is that in the image fusion method provided by the present application, the brightness and color of the visible light image and the non-visible light image are fused from the perspective of the pixel points of the visible light image to improve the image effect after fusion. In addition, in the present application, the color adjustment ratio is determined by fusion brightness, the first brightness of the first pixel point in the visible light image, and the second brightness of the corresponding second pixel point in the non-visible light image, and the initial color of the first pixel point is adjusted based on the color adjustment ratio to achieve adaptive adjustment of the fusion color of the first pixel point, so as to improve the color saturation and make it more matched with the fusion brightness.
[0008] In addition, in this application, the color noise suppression ratio is calculated through the sensitivity of the human eye to color, so as to remove the color noise and color cast in the low-light image; and the fusion method does not have window filtering in the processing process, the amount of calculation is small, it is easy to transplant the device, and can significantly eliminate color noise and color cast. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work, among which:
[0010] Figure 1 This is a flow chart of an implementation method of the image fusion method of the present application;
[0011] Figure 2 A curve diagram of an implementation method of customizing a first brightness and an upper limit value;
[0012] Figure 3 A schematic diagram of an implementation of the sensitivity of the human eye to RGB;
[0013] Figure 4 for Figure 1 A schematic diagram of a flow chart of an implementation method corresponding to step S105;
[0014] Figure 5 for Figure 4 A flowchart of an implementation method corresponding to step S201 in FIG.
[0015] Figure 6 A schematic diagram showing a comparison of an embodiment of a visible light image before and after being processed by the image fusion method of the present application;
[0016] Figure 7 This is a schematic diagram of the framework of an embodiment of the image fusion device of the present application;
[0017] Figure 8This is a schematic diagram of the structure of an embodiment of an electronic device of the present application;
[0018] Fig. 9 This is a schematic structural diagram of an implementation of a storage device of the present application. DETAILED DESCRIPTION
[0019] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0020] See also Figure 1 , Figure 1 This is a flow chart of an embodiment of an image fusion method of the present application. The image fusion method includes:
[0021] S101: Obtain a visible light image and a non-visible light image acquired from the current scene.
[0022] Specifically, the visible light image and the non-visible light image may be acquired by multiple sensors simultaneously capturing the current scene, or the visible light image and the non-visible light image may be acquired by the same sensor capturing the current scene in time-sharing. Optionally, the non-visible light image may be a near-infrared image, an infrared image, or a fog-penetrating image.
[0023] For example, in the field of security, low-light scenes at night and haze scenes require the collection of more image information to improve monitoring effects. The near-infrared band sensor in the multi-sensor device can not only obtain near-infrared images with less noise and clear details in low-light environments at night, but also obtain fog-penetrating images with more details in haze weather. By fusing the visible light image obtained by the visible light band sensor, a fused image including color and details is obtained. It is especially suitable for road monitoring, where the color temperature of street lights and car lights is inconsistent, resulting in multiple color temperatures in the same scene.
[0024] S102: For at least part of the first pixel points in the visible light image, obtain second pixel points corresponding to the first pixel points from the non-visible light image; wherein the first pixel points and the corresponding second pixel points represent the same target.
[0025] Specifically, when the visible light image and the non-visible light image are acquired by the same sensor, the coordinates of the same target (e.g., car lights, car logos, etc.) in the visible light image and the non-visible light image are the same. In this case, the second pixel corresponding to the first pixel can be obtained from the non-visible light image by querying the coordinates. When the visible light image and the non-visible light image are acquired by different sensors, the coordinates of the pixels corresponding to the same target in the visible light image and the non-visible light image may be inconsistent. In this case, the non-visible light image or the visible light image can be processed so that the coordinates of the pixels corresponding to the same target in the visible light image and the non-visible light image are the same, so as to facilitate subsequent processing.
[0026] In addition, in the present application, the subsequent processing may be performed on all first pixels in the visible light image, or the subsequent processing may be performed only on all first pixels in a predetermined area (eg, non-background area) in the visible light image.
[0027] S103: Obtaining fusion brightness based on the first brightness of the first pixel and the second brightness of the corresponding second pixel.
[0028] Specifically, the data of the first pixel and the second pixel are stored in the form of YUV, wherein Y represents brightness value, UV represents color information, U represents chromaticity value, and V represents concentration value. The implementation process of the above step S103 may be: extracting the Y information of the first pixel to obtain the first brightness visy, and extracting the Y information of the second pixel to obtain the second brightness niry; processing the first brightness visy of the first pixel and the second brightness niry of the second pixel corresponding to the first pixel by weighting, energy information selection, or frequency domain selection to obtain the fused brightness fy.
[0029] Taking the weighted fusion method as an example, the formula is as follows: fy=a*visy+b*niry; where fy is the fusion brightness; a and b are weighting coefficients in the range of [0,1], and the sum of a and b is 1; for example, a and b can be set to 0.5; visy is the first brightness; niry is the second brightness.
[0030] S104: Determine a color adjustment ratio of the first pixel based on the fused brightness, the first brightness, and the second brightness.
[0031] Specifically, when implementing the above step S104, different methods can be selected according to the scene characteristics to obtain the color adjustment ratio. At this time, before the above step S104, it also includes: determining the scene characteristics of the current scene based on the visible light image; wherein the scene characteristics include a large-area monochrome scene, a dim light scene, or a lightless scene. For example, the white balance value can be obtained based on the UV information in the visible light image. When the white balance value exceeds the first threshold, the scene characteristics of the current scene are considered to be a large-area monochrome scene. For another example, the average brightness value can be obtained based on the Y information in the visible light image. When the average brightness value is lower than the second threshold and exceeds the third threshold, the scene characteristics of the current scene are considered to be a dim light scene; when the average brightness value is lower than the third threshold, the scene characteristics of the current scene are considered to be a lightless scene; wherein the third threshold is less than the second threshold. It should be noted that when the scene characteristics of the current scene are obtained as described above, it is based on the entire visible light image, rather than a single first pixel.
[0032] Further, the specific implementation process of the above step S104 can be: determining the color adjustment ratio of the first pixel based on the scene feature, the fused brightness, the first brightness and the second brightness. The physical meaning of the above color adjustment ratio is to adjust the color information of the input visible light image to obtain the color information of the fused image.
[0033] In an application scenario, in response to the current scene being a large-area monochrome scene or a dim light scene, the process of obtaining the color adjustment ratio uv_p is as follows:
[0034] A1. Determine the non-local coefficient α based on the fused brightness fy, the first brightness visy and the second brightness niry.
[0035] Specifically, the non-local coefficient α is used to correct the color cast problem of large-area monochrome scenes. The degree of color restoration can be determined mainly by the difference between the first brightness visy and the second brightness niry, and the ratio of the fused brightness fy to the first brightness visy. The specific process of determining the non-local coefficient α includes: obtaining the first difference between the first brightness visy and the second brightness niry, and obtaining the third ratio of the fused brightness fy to the absolute value of the first difference; obtaining the first sum of the fused brightness fy and the first brightness visy, and obtaining the fourth ratio of the first sum to 255; and taking the sum of the third ratio and the fourth ratio as the non-local coefficient α. It can be expressed as follows:
[0036] α=fy / abs(visy-niry)+(fy+visy) / 255.
[0037] B1. Obtain the first product of the fused brightness fy and the non-local coefficient α, and use the first ratio of the first product to the first brightness visy as the color adjustment ratio uv_p. The formula is as follows:
[0038] uv_p=fy*α / visy.
[0039] In addition, after the color adjustment ratio uv_p is obtained in the above manner, in order to prevent color overflow, for example, to prevent the blue from overflowing into purple after the color is adjusted by the color adjustment ratio uv_p, the size of the color adjustment ratio uv_p is limited. The specific process may be:
[0040] A2. Determine an upper limit value up_max based on the first brightness visy.
[0041] For example, in response to the color adjustment ratio uv_p being less than or equal to 1, the upper limit value up_max is set to 1; in response to the color adjustment ratio uv_p being greater than 1, the second logarithm of the first brightness visy with base 2 is obtained, and half of the second logarithm is used as the upper limit value up_max. It can be expressed as follows:
[0042]
[0043] Of course, in other embodiments, such as Figure 2 As shown, Figure 2 The first brightness and the upper limit value are defined in the following curve diagram. Figure 2 Get the corresponding upper limit value up_max.
[0044] B2. In response to the color adjustment ratio uv_p being greater than the upper limit value up_max, the upper limit value up_max is used as the color adjustment ratio uv_p; in response to the color adjustment ratio uv_p being less than or equal to the upper limit value up_max, the color adjustment ratio uv_p remains the original value.
[0045] In another application scenario, in response to the current scene being a dark scene, the process of obtaining the color adjustment ratio uv_p is as follows:
[0046] A3. Determine a non-local coefficient α based on the fused brightness fy, the first brightness visy and the second brightness niry, and use a second ratio of the fused brightness fy to the first brightness visy as an initial proportional coefficient uv_s.
[0047] Specifically, the process of obtaining the non-local coefficient α can be referred to the above step A1, which will not be repeated here. The calculation process of the initial proportional coefficient uv_s is expressed as follows:
[0048] uv_s=fy / visy.
[0049] B3. Determine the compression scale factor based on the initial scale factor and the non-local coefficient.
[0050] Specifically, the specific implementation process of the above step B3 can be: in response to the initial proportional coefficient uv_s being less than or equal to the first value, the initial proportional coefficient uv_s is used as the compression proportional coefficient uv_c. In response to the initial proportional coefficient uv_s being greater than the first value and less than or equal to the second value, the second product of the non-local coefficient α and the initial proportional coefficient uv_s is used as the compression proportional coefficient uv_c; wherein the second value is greater than the first value. In response to the initial proportional coefficient uv_s being greater than the second value, a third product of the first constant and the initial proportional coefficient uv_s is obtained, a first logarithm of the third product with base 2 is obtained, and a second difference between the first logarithm and the second constant is used as the compression proportional coefficient uv_c. Among them, the role of the above first constant and the second constant is to make the calculated compression proportional coefficient uv_c an integer, and the present application has no limitation on the values of the first constant and the second constant. When the first value is 1, the second value is 2, the first constant is 256, and the second constant is 8, the above process of determining the compression proportional coefficient uv_c is expressed by the following formula:
[0051]
[0052] C3. Perform a weighted summation of the initial scale coefficient uv_s and the compression scale coefficient uv_c to obtain the color adjustment scale uv_p.
[0053] Specifically, the calculation process of weighted summation is expressed as follows:
[0054] uv_p=β*uv_s+(1-β)*uv_c; wherein β is a weight coefficient with a value of [0,1].
[0055] In addition, after the color adjustment ratio uv_p is obtained in the above manner, in order to prevent color overflow, the size of the color adjustment ratio uv_p may be limited. The specific limiting process can be referred to the above steps A2-B2, which will not be described in detail here.
[0056] The above process of obtaining the corresponding color adjustment ratio uv_p according to the scene features can adaptively improve the color vividness, make the fused color closer to the visible road color, more natural, and solve the problem of abnormal color recovery caused by fusion brightness jump or large difference in visible brightness domain and infrared brightness. Of course, in other embodiments, scene features may not be distinguished, and different scene features can use one of the above two methods to calculate the color adjustment ratio uv_p.
[0057] S105: adjusting the initial color of the first pixel based on the color adjustment ratio to obtain a blended color.
[0058] Specifically, generally speaking, starting from the perception or stimulation of the human eye, the darker RGB colors of different proportions are analyzed. After the proportions are magnified, the human eye can distinguish the boundaries of colors. Figure 3 As shown, Figure 3 This is a schematic diagram of an implementation method of the human eye's sensitivity to RGB. The first column of colors is when the RGB three channel values increase together, the second column of colors is when the R channel value increases, the third column of colors is when the G channel value increases, and the fourth column of colors is when the B channel value increases. Among them, the human eye has different abilities to distinguish different columns of colors. The human eye is most sensitive to green, followed by red, and the weakest to blue. Based on this conclusion, according to the human eye's sensitivity to color, a color noise suppression ratio is generated to remove color noise and color cast from UV colors in visible light images, that is, to eliminate colors to which the human eye is not sensitive, to prevent them from being amplified into color noise or color cast after fusion, and to improve the quality of the fused image. For the specific process, please refer to Figure 4 , Figure 4 for Figure 1 The flowchart of an implementation method corresponding to step S105 in FIG. 1 is a flowchart of an implementation method corresponding to step S105 in FIG. 1 , wherein step S105 specifically includes:
[0059] S201: Obtaining a color noise suppression ratio based on an initial color of a first pixel.
[0060] Specifically, see Figure 5 , Figure 5 for Figure 4 The flowchart of an implementation method corresponding to step S201 in FIG. 1 is a flowchart of an implementation method corresponding to step S201 in FIG. 1 , wherein step S201 specifically includes:
[0061] S301: Obtain channel values of each color channel of a first pixel, and obtain a basic value according to the channel values of each color channel.
[0062] Specifically, the YUV data format of the first pixel point can be converted into the RGB data format. The specific conversion process is a general process and will not be described in detail here. The above basic value base can be calculated using any of the following formulas:
[0063] base = max(R,G,B);
[0064] Or, base = (R + G + B) / 3;
[0065] Or, base = 0.299*R + 0.587*G + 0.114*B;
[0066] Among them, R is the channel value of the red channel of the first pixel, G is the channel value of the green channel of the first pixel, B is the channel value of the blue channel of the first pixel, and max means taking the maximum value.
[0067] S302: Use the absolute value of the third difference between the channel value of each color channel and the base value as the condition judgment value for the corresponding color channel.
[0068] Specifically, it can be expressed by the following formula:
[0069] Rc = abs(R - base);
[0070] Gc = abs(G - base);
[0071] Bc = abs(B - base);
[0072] Among them, Rc is the condition judgment value of the red channel of the first pixel point, Gc is the condition judgment value of the green channel of the first pixel point, Bc is the condition judgment value of the blue channel of the first pixel point, and abs represents taking the absolute value.
[0073] S303: Determine the color noise suppression ratio based on the condition judgment values of each color channel and the corresponding channel thresholds; among them, the first pixel point includes a red channel, a blue channel, and a green channel, and the channel threshold Rthr of the red channel is greater than the channel threshold Gthr of the green channel and less than the channel threshold Bthr of the blue channel.
[0074] Specifically, Rthr / Gthr / Bthr represents the sensitivity of the human eye to the colors of the RGB three channels. The smaller the value, the more sensitive. Then, combined with Figure 3 The magnitude relationship of the channel thresholds of the above three colors can be obtained as Gthr < Rthr < Bthr. The value ranges of Rthr, Gthr, and Bthr are from 0 to 255. For example, Gthr is 5, Rthr is 10, and Bthr is 15.
[0075] Furthermore, the specific implementation process of the above step S303 can be:
[0076] A4. In response to the condition judgment values of at least two color channels being respectively less than the corresponding channel thresholds, obtain the fifth product of the color noise removal parameter an and the color sensitivity parameter xn, obtain the fifth ratio of the fifth product to 256, and use the sum of the fifth ratio and the color noise removal intensity parameter RGBthrn as the color noise suppression ratio c nw; among them, the color noise removal parameter an is obtained based on the color noise removal intensity parameter RGBthrn and the color noise removal range parameter Tthr, and the color sensitivity parameter xn is obtained based on the condition judgment values of at least two color channels less than the corresponding channel thresholds and the channel thresholds.
[0077] Specifically, when the condition judgment values of all color channels are respectively less than the corresponding channel thresholds, obtain the fourth difference between 255 and the color noise reduction intensity parameter, and obtain the sixth ratio of the fourth difference to N times the color noise reduction range parameter. Take the normalized sixth ratio as the color noise reduction parameter; the color sensitivity parameter is equal to the sum of the products of the condition judgment values of each color channel and the corresponding channel thresholds. It is expressed by the formula as follows: when Rc < Rthr and Gc < Gthr and Bc < Bthr,
[0078]
[0079]
[0080] x1 = Rthr * Rc + Gthr * Gc + Bthr * Bc.
[0081] Among them, N takes the value of 3; a1 is the color noise reduction parameter, used to control the noise reduction intensity and noise reduction range, and is calculated from RGBthr1 and Tthr; RGBthr1 is the color noise reduction intensity parameter, indicating the color noise reduction intensity, and its value range is from 0 to 255; Tthr is the color noise reduction range parameter, the larger the value, the larger the noise reduction range, and its value range is from 0 to 255. For example, Tthr is 25; x1 represents the sensitivity of colors in different regions of the image, and is calculated from Rthr / Gthr / Bthr and Rc / Gc / Bc.
[0082] When the condition judgment values of only two color channels are less than the corresponding color channel thresholds, obtain the fifth difference between 255 and the color noise reduction intensity parameter, and obtain the seventh ratio of the fifth difference to M times the color noise reduction range parameter. Take the normalized seventh ratio as the color noise reduction parameter; the color sensitivity parameter is equal to the sum of the products of the condition judgment values of the two color channels whose condition judgment values are less than the corresponding color channel thresholds and the corresponding channel thresholds; among them, M is less than N, and the color noise reduction intensity parameters in different cases are the same or different. It is expressed by the formula as follows:
[0083] When Rc < Rthr and Gc < Gthr and Bc ≥ Bthr,
[0084] When Rc ≥ Rthr and Gc < Gthr and Bc < Bthr,
[0085] When Rc < Rthr and Gc ≥ Gthr and Bc < Bthr,
[0086]
[0087]
[0088]
[0089] x2 = Rthr * Rc + Gthr * Gc;
[0090] x3 = Gthr * Gc + Bthr * Bc;
[0091] x4 = Rthr * Rc + Bthr * Bc.
[0092] Wherein, M takes a value of 2; a2, a3, and a4 are decoloring noise parameters used to control the denoising intensity and denoising range, and are respectively calculated from the corresponding RGBthrn and Tthr; RGBthr2, RGBthr3, and RGBthr4 are decoloring noise intensity parameters representing the decoloring noise intensity, and the value range is from 0 to 255; Tthr is the decoloring noise range parameter, and the larger its value, the larger the denoising range, and its value range is from 0 to 255. For example, Tthr is 25; x2, x3, and x4 represent the color sensitivity of different regions in the image. Of course, in other embodiments, the values of M and N can also be other values, as long as N is greater than M.
[0093] It should be noted that the values of the above RGBthr1, RGBthr2, RGBthr3, and RGBthr4 can be the same or different. For example, RGBthr1, RGBthr2, RGBthr3, and RGBthr4 can all take a value of 70, etc.
[0094] B4. In response to the condition judgment value of at most one color channel being less than the corresponding channel threshold, 256 is taken as the color noise suppression ratio cnw.
[0095] Specifically, when Rc < Rthr and Gc ≥ Gthr and Bc ≥ Bthr, or when Rc ≥ Rthr and Gc < Gthr and Bc ≥ Bthr, or when Rc ≥ Rthr and Gc ≥ Gthr and Bc < Bthr, or when Rc ≥ Rthr and Gc ≥ Gthr and Bc ≥ Bthr, cnw = 256, that is, no color noise suppression is required.
[0096] The above calculation method of the color noise suppression ratio cnw can adjust the denoising intensity, denoising range, and the influence degree of the RGB three channels. Applying this color noise suppression method can eliminate the influence of color noise and color cast in the low-light image to the greatest extent without losing the color of real objects, and improve the color quality of the fused image.
[0097] S202: Obtain the fourth product of the color adjustment ratio uv_p and the color noise suppression ratio cnw, and normalize the fourth product to obtain the proportional coefficient p.
[0098] Specifically, it is expressed as the formula: p=uv_p*cnw / 256.
[0099] S203: Obtaining an adjusted fused color based on the proportional coefficient p and the initial color of the first pixel.
[0100] Specifically, the proportional coefficient p can be applied to the initial color UV information of the first pixel to obtain the adjusted fused color UV information. The specific process can be: obtaining the sixth difference between the chromaticity value of the first pixel and the third constant, and obtaining the sixth product of the sixth difference and the proportional coefficient, and taking the sum of the sixth product and the third constant as the adjusted chromaticity value; and obtaining the seventh difference between the concentration value of the first pixel and the third constant, and obtaining the seventh product of the seventh difference and the proportional coefficient, and taking the sum of the seventh product and the third constant as the adjusted concentration value. It can be expressed as follows:
[0101] Us=(U-128)*p+128;
[0102] Vs = (V-128)*p+128;
[0103] Among them, the third constant is 128, which is the common conversion constant in the industry when storing; U is the chromaticity value of the first pixel before adjusting the fusion; Us is the chromaticity value of the first pixel after adjusting the fusion; V is the concentration value of the first pixel before adjusting the fusion; Vs is the concentration value of the first pixel after adjusting the fusion.
[0104] After obtaining the chromaticity value Us and the concentration value Vs of the first pixel after adjustment and fusion, they can also be limited to reduce the occurrence of overflow. The specific process can be: in response to the chromaticity value Us or the concentration value Vs after adjustment and fusion being less than 0, the chromaticity value Us or the concentration value Vs less than 0 is set to 0; in response to the chromaticity value Us or the concentration value Vs after adjustment and fusion being greater than 255, the chromaticity value Vs or the concentration value Vs greater than 255 is set to 255. In response to the chromaticity value Vs or the concentration value Vs after adjustment and fusion being greater than or equal to 0 and less than or equal to 255, the chromaticity value Vs or the concentration value Vs after adjustment and fusion is kept unchanged.
[0105] In the above embodiment, when the fused color is obtained based on the color adjustment ratio, the color noise suppression ratio is introduced; of course, in other embodiments, the color noise suppression ratio may not be introduced, and the color adjustment ratio may be directly used as the above-mentioned proportional coefficient p.
[0106] S106: Obtain an adjusted first pixel point based on the fused brightness and the fused color.
[0107] Specifically, the fused brightness fy, the fused chromaticity value Us, and the fused concentration value Vs may be combined to obtain the adjusted first pixel point.
[0108] In an application scenario, such as Figure 6 As shown, Figure 6 The figure is a comparison diagram of an embodiment of a visible light image before and after processing by the image fusion method of the present application. From the comparison diagram, it can be seen that the method provided by the present application can effectively improve the color saturation of the visible light image, and has a significant effect on eliminating color noise and color cast.
[0109] In summary, in the image fusion method provided by the present application, color enhancement is performed through a ratio adjustment method to achieve adaptive adjustment of color saturation of fused colors to better match fused brightness; color noise weight is calculated through the sensitivity of the human eye to color to achieve the removal of color noise and color cast in low-light images; and this method does not have window filtering during the processing process, the amount of calculation is small, it is easy to transplant equipment, and the effect of eliminating color noise and color cast is obvious. And when calculating the color adjustment ratio, the method of adjusting the ratio of fusion brightness and visible brightness is combined with logarithmic compression and upper limit curve mapping to achieve adaptive adjustment of color saturation of fused colors. When calculating the color noise suppression ratio, the color resolution ability of the human eye under low light is analyzed, and the relationship between color noise intensity, color noise range and color sensitivity is judged to achieve the elimination of color noise and color cast in low-light images.
[0110] See also Figure 7 , Figure 7 Schematic diagram of a framework of an embodiment of the image fusion device of the present application. The image fusion device comprises: a first obtaining module 10 , a determining module 12 , an adjusting module 14 and a second obtaining module 16 .
[0111] Among them, the first acquisition module 10 is used to obtain a visible light image and a non-visible light image acquired for the current scene; for at least part of the first pixel points in the visible light image, a second pixel point corresponding to the first pixel point is obtained from the non-visible light image; wherein the first pixel point and the corresponding second pixel point represent the same target; and a fused brightness is obtained based on the first brightness of the first pixel point and the second brightness of the corresponding second pixel point. The determination module 12 is connected to the first acquisition module 10, and is used to determine the color adjustment ratio of the first pixel point based on the fused brightness, the first brightness, and the second brightness. The adjustment module 14 is connected to the determination module 12, and is used to adjust the initial color of the first pixel point based on the color adjustment ratio to obtain the fused color. The second acquisition module 16 is connected to the adjustment module 14, and is used to obtain the adjusted first pixel point based on the fused brightness and the fused color.
[0112] See also Figure 8 , Figure 8Schematic diagram of the structure of an embodiment of an electronic device of the present application. The electronic device includes: a memory 32 and a processor 30 coupled to each other, the memory 32 stores program instructions, and the processor 30 is used to execute the program instructions to implement any of the above-mentioned image fusion methods. Specifically, the electronic device includes but is not limited to: a desktop computer, a laptop computer, a tablet computer, a server, etc., which are not limited here. In addition, the processor 30 can also be called a CPU (Center Processing Unit). The processor 30 may be an integrated circuit chip with signal processing capabilities. The processor 30 can also be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field-programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. In addition, the processor 30 can be implemented by an integrated circuit chip.
[0113] See also Fig. 9 , Fig. 9 This is a schematic diagram of the structure of an embodiment of a storage device of the present application. The storage device 50 stores program instructions 500 that can be executed by a processor. The program instructions 500 are used to implement any of the above-mentioned image fusion methods.
[0114] In the several embodiments provided in the present application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device implementation described above is only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0115] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0116] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0117] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) or a processor (processor) to execute all or part of the steps of each implementation method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.
[0118] The above description is only an embodiment of the present application and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. An image fusion method, characterized in that: include: Obtaining a visible light image and a non-visible light image acquired from the current scene; For at least part of the first pixel points in the visible light image, obtain second pixel points corresponding to the first pixel points from the non-visible light image; wherein the first pixel points and the corresponding second pixel points represent the same target; Obtaining a fused brightness based on a first brightness of the first pixel and a corresponding second brightness of the second pixel; determining a color adjustment ratio of the first pixel based on the fused brightness, the first brightness, and the second brightness; adjusting the initial color of the first pixel based on the color adjustment ratio to obtain a blended color; Obtaining an adjusted first pixel point based on the fused brightness and the fused color; The step of adjusting the initial color of the first pixel based on the color adjustment ratio to obtain a blended color includes: Obtaining a color noise suppression ratio based on the initial color of the first pixel; obtaining a fourth product of the color adjustment ratio and the color noise suppression ratio, and performing normalization processing on the fourth product to obtain a proportionality coefficient; An adjusted blended color is obtained based on the scale factor and the initial color of the first pixel.
2. The image fusion method according to claim 1, characterized in that: Before the step of determining the color adjustment ratio of the first pixel based on the fused brightness, the first brightness and the second brightness, the method includes: determining scene features of the current scene based on the visible light image; wherein the scene features include a large-area monochrome scene, a dim light scene or a dark scene; The step of determining the color adjustment ratio of the first pixel based on the fused brightness, the first brightness and the second brightness includes: determining the color adjustment ratio of the first pixel based on the scene feature, the fused brightness, the first brightness and the second brightness.
3. The image fusion method according to claim 2, characterized in that: The step of determining the color adjustment ratio of the first pixel based on the scene feature, the fused brightness, the first brightness, and the second brightness includes: In response to the current scene being a large-area monochrome scene or a dim light scene, determining a non-local coefficient based on the fused brightness, the first brightness, and the second brightness; obtaining a first product of the fused brightness and the non-local coefficient, and taking a first ratio of the first product to the first brightness as the color adjustment ratio; In response to the current scene being a dark scene, a non-local coefficient is determined based on the fused brightness, the first brightness, and the second brightness, and a second ratio of the fused brightness to the first brightness is used as an initial proportional coefficient; a compression proportional coefficient is determined based on the initial proportional coefficient and the non-local coefficient; and a weighted sum of the initial proportional coefficient and the compression proportional coefficient is performed to obtain the color adjustment ratio.
4. The image fusion method according to claim 3, characterized in that: The step of determining a non-local coefficient based on the fused brightness, the first brightness and the second brightness comprises: Obtaining a first difference between the first brightness and the second brightness, and obtaining a third ratio of the fused brightness to an absolute value of the first difference; Obtaining a first sum of the fused brightness and the first brightness, and obtaining a fourth ratio of the first sum to 255; The sum of the third ratio and the fourth ratio is used as the non-local coefficient.
5. The image fusion method according to claim 3, characterized in that: The step of determining the compression scale factor based on the initial scale factor and the non-local coefficient comprises: In response to the initial scale factor being less than or equal to a first value, using the initial scale factor as the compression scale factor; In response to the initial scale factor being greater than a first value and less than or equal to a second value, taking a second product of the non-local coefficient and the initial scale factor as the compression scale factor; wherein the second value is greater than the first value; In response to the initial proportionality coefficient being greater than the second value, a third product of a first constant and the initial proportionality coefficient is obtained, a first logarithm of the third product with base 2 is obtained, and a second difference between the first logarithm and the second constant is used as the compression proportionality coefficient.
6. The image fusion method according to any one of claims 1 to 5, characterized in that: Before the step of adjusting the color of the first pixel based on the color adjustment ratio to obtain a blended color, the method includes: determining an upper limit value based on the first brightness; In response to the color adjustment ratio being greater than the upper limit value, using the upper limit value as the color adjustment ratio; In response to the color adjustment ratio being less than or equal to the upper limit value, the color adjustment ratio maintains an original value.
7. The image fusion method according to claim 6, characterized in that: The step of determining an upper limit value based on the first brightness includes: In response to the color adjustment ratio being less than or equal to 1, setting the upper limit value to 1; In response to the color adjustment ratio being greater than 1, a second logarithm of the first brightness with base 2 is obtained, and half of the second logarithm is used as the upper limit value.
8. The image fusion method according to claim 1, characterized in that: The step of obtaining a color noise suppression ratio based on the initial color of the first pixel comprises: Obtaining channel values of each color channel of the first pixel, and obtaining a basic value according to the channel values of each color channel; taking the absolute value of the third difference between the channel value of each color channel and the base value as the conditional judgment value of the corresponding color channel; The color noise suppression ratio is determined based on the conditional judgment value of each color channel and the corresponding channel threshold; wherein the first pixel point includes a red channel, a blue channel and a green channel, and the channel threshold of the red channel is greater than the channel threshold of the green channel and less than the channel threshold of the blue channel.
9. The image fusion method according to claim 8, characterized in that: The step of determining the color noise suppression ratio based on the conditional judgment value of each color channel and the corresponding channel threshold comprises: In response to the conditional judgment values of at least two color channels being respectively less than the corresponding channel thresholds, a fifth product of the denoising parameter and the color sensitivity parameter is obtained, a fifth ratio of the fifth product to 256 is obtained, and a sum of the fifth ratio and the denoising intensity parameter is used as the denoising suppression ratio; wherein the denoising parameter is obtained based on the denoising intensity parameter and the denoising range parameter, and the color sensitivity parameter is obtained based on the conditional judgment values of the at least two color channels that are less than the corresponding channel threshold and the channel threshold; In response to the conditional judgment value of at most one color channel being less than the corresponding channel threshold, 256 is used as the color noise suppression ratio.
10. The image fusion method according to claim 9, characterized in that: When the conditional judgment values of all color channels are respectively less than the corresponding channel thresholds, a fourth difference between 255 and the denoising intensity parameter is obtained, and a sixth ratio between the fourth difference and N times the denoising range parameter is obtained, and the normalized sixth ratio is used as the denoising parameter; the color sensitivity parameter is equal to the sum of the products of the conditional judgment values of each color channel and the corresponding channel thresholds; When only the conditional judgment values of two color channels are less than the corresponding color channel thresholds, a fifth difference between 255 and the denoising intensity parameter is obtained, and a seventh ratio of the fifth difference and M times the denoising range parameter is obtained, and the normalized seventh ratio is used as the denoising parameter; the color sensitivity parameter is equal to the sum of the products of the conditional judgment values of the two color channels whose conditional judgment values are less than the corresponding color channel thresholds and the corresponding channel thresholds; wherein M is less than N, and the denoising intensity parameters in different situations are the same or different.
11. The image fusion method according to claim 1, characterized in that: The step of obtaining the adjusted fused color based on the scale coefficient and the initial color of the first pixel comprises: Obtaining a sixth difference between the chromaticity value of the first pixel and a third constant, and obtaining a sixth product of the sixth difference and the proportional coefficient, and taking the sum of the sixth product and the third constant as the adjusted chromaticity value; and obtaining a seventh difference between the concentration value of the first pixel and the third constant, and obtaining a seventh product of the seventh difference and the proportional coefficient, and taking the sum of the seventh product and the third constant as the adjusted concentration value; In response to the chromaticity value or the concentration value being less than 0, the chromaticity value or the concentration value being less than 0 is set to 0; in response to the chromaticity value or the concentration value being greater than 255, the chromaticity value or the concentration value being greater than 255 is set to 255.
12. An electronic device, characterized in that: The method comprises a memory and a processor coupled to each other, wherein the memory stores program instructions, and the processor is used to execute the program instructions to implement the image fusion method according to any one of claims 1 to 11.
13. A storage device, characterized in that: Program instructions that can be executed by a processor are stored, and the program instructions are used to implement the image fusion method according to any one of claims 1 to 11.
