Noise reduction method for low-illumination image
By preprocessing thermal noise and calculating noise parameters in low-light image processing, image details are restored using the encoder-decoder structure, the problem of limited noise suppression effect in the prior art is solved, and high-quality low-light image noise reduction is achieved and texture recovery improves image quality.
Patent Information
- Application Number
- CN202411053372.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-02
- Publication Date
- 2024-11-29
- Estimated Expiration
- 2044-08-02
AI Technical Summary
The prior art is difficult to effectively suppress noise and retain details in low-light image enhancement, resulting in a degradation of image quality, especially in low-light scenes where noise propagation and amplification will affect image quality.
By acquiring the noise reduction data set of the RAW domain, preprocessing the thermal noise of the dark light noise image, calculating the noise parameters, and inputting them into a symmetric encoder-decoder structure, using the shrinkage and expansion path recovery of the encoder and decoder and the decoder Image details, combined with noise parameters for noise reduction processing.
High-quality noise reduction and texture recovery of 4K dark light images are achieved, which improves the visual effect and quality of the image, reduces the impact of thermal noise on the image, and retains more detailed information.
Smart Images

Figure CN119048383A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to a method for reducing noise of a low-light image. Background Art
[0002] Low-light image enhancement has received more and more attention due to its practicality in cameras. It can effectively solve the problems of low brightness, low contrast, and serious loss of details in images obtained in low-light scenes. At the same time, due to the physical characteristics and process level of the sensor, after the camera completes the photoelectric conversion under low-light conditions, the original image data contains a lot of noise. If these noises cannot be effectively suppressed, it will seriously affect the quality of low-light images and subsequent processing and analysis.
[0003] At present, low-light image enhancement and image noise reduction are mostly performed in the later stages of the ISP pipeline in low-light scenes, and are processed on RGB or YUV. However, at the same time, noise will continue to be generated, propagated, amplified, and change statistical characteristics in each module of the ISP pipeline, which has an increasingly greater impact on image quality. The pressure of noise reduction only on RGB or YUV is relatively high. In order to solve this problem, a method of removing noise from the original RAW data is proposed to improve the signal-to-noise ratio of the data. Most existing technologies use traditional algorithms, such as non-local mean noise reduction and wavelet transform, to reduce noise on images in the RAW domain. This can suppress noise, but the benefits are limited. It cannot strike a good balance between noise reduction and detail retention. Forcible noise removal in low light is prone to over-smoothing, which affects the overall quality of the image.
[0004] Using neural network methods to reduce noise in the RAW domain can achieve higher quality noise reduction effects, but there are also problems such as limited noise reduction effects, loss of clarity, and poor versatility. Therefore, it is necessary to improve on the existing basis, learn more complex image features and noise patterns, and achieve higher quality noise reduction effects.
[0005] In view of the deficiencies of the prior art, the present invention proposes a denoising method for low-light images. Summary of the invention
[0006] The purpose of the present invention is to overcome the shortcomings of the prior art and provide a low-light image denoising method with more ideal texture information restoration and better noise reduction effect, thereby realizing automatic restoration, enhancement and noise reduction processing of 4K low-light images, and improving the visual effect and quality of low-light images.
[0007] The object of the present invention is achieved by the following technical solution: A method for reducing noise of a low-light image, comprising:
[0008] S1. Obtain a RAW domain noise reduction dataset; the RAW domain noise reduction dataset includes low-light noise images in RAW format and low-light noise-reduced images in RAW format;
[0009] S2. Obtain the grayscale image of the low-light noise image, and determine whether the current low-light noise image is in a low-light scene according to the grayscale image features;
[0010] If it is in a low-light scene, go to step S3;
[0011] If it is not in a low-light scene, end the noise reduction of the low-light image;
[0012] S3. Preprocess the thermal noise points of the low-light noise image to obtain a low-light noise image with thermal noise points removed;
[0013] S4. Calculate the noise parameters of the low-light noise image with thermal noise points removed;
[0014] S5. Input the low-light noise-reduced image in RAW format, the low-light noise image with thermal noise points removed, and the noise parameters into a symmetric encoder-decoder structure to obtain a noise-reduced image.
[0015] Further, the obtaining the grayscale image of the low-light noise image and determining whether the current low-light noise image is in a low-light scene according to the grayscale image includes:
[0016] S201. Downsample the low-light noise image to obtain a downsampled image, and perform grayscale calculation on the downsampled image to obtain a grayscale image;
[0017] S202. Obtain the grayscale value and grayscale histogram from the grayscale image, and calculate the cumulative distribution function;
[0018] S203. Obtain the value of m corresponding to the grayscale image when the value of the cumulative distribution function = 0.75;
[0019] When 0 < m ≤ the first preset value, the low-light noise image is in a low-light scene, and take the intensity parameter alpha for removing thermal noise points as 1;
[0020] When the first preset value < m < the second preset value, the low-light noise image is in a relatively low-light scene, and take 0 < alpha < 1;
[0021] When m ≥ the second preset value, the low-light noise image is in a normal bright light environment and not in a low-light scene, then alpha = 0, and end the noise reduction of the low-light image.
[0022] Further, the preprocessing the thermal noise points of the low-light noise image to obtain a low-light noise image with thermal noise points removed includes:
[0023] S301, calculating the median of the gradient values of the dark light noise image in the horizontal direction, the vertical direction, the 45° direction and the 135° direction;
[0024] S302, according to the minimum value of the median values of the gradient values in the horizontal direction, the vertical direction, the 45° direction and the 135° direction, taking the minimum value as the edge direction;
[0025] min_grad=min(median_Dh,median_Dv,median_D45,median_D135)
[0026] Where:
[0027] min_grad indicates the edge direction;
[0028] median_Dh represents the minimum value of the median in the horizontal direction;
[0029] median_Dv represents the minimum value of the median in the vertical direction;
[0030] median_D45 represents the minimum value of the median in the 45° direction;
[0031] median_D135 represents the minimum value of the median in the 135° direction;
[0032] S303, judging whether the central pixel Pc is a thermal noise point according to the edge direction;
[0033] If the central pixel is not a thermal noise point, then enter S4;
[0034] If the central pixel is a thermal noise point, proceed to S304;
[0035] S304, calculating the final correction result by removing the intensity parameter alpha blending of the thermal noise points;
[0036] S305 , obtaining a dark light noise image after removing thermal noise points according to the correction result.
[0037] Further, the step of calculating the gradients of the dark light noise image in the horizontal direction, the vertical direction, the 45° direction, and the 135° direction includes:
[0038] The central pixel Pc of the dark light noise image is obtained, and P1, P2, P3, P4, P5, P6, P7 and P8 are eight adjacent pixels around the central pixel Pc;
[0039] Calculate the three second-order gradients in the horizontal direction to get the absolute value of the horizontal gradient:
[0040] Dh1=|P1+P3-2*P2|, Dh2=|P4+P5-2*Pc|, Dh3=|P6+P8-2*P7|;
[0041] Take the median of the absolute value of the horizontal gradient. The calculation expression is as follows:
[0042] median_Dh=median(Dh1,Dh2,Dh3);
[0043] Calculate the three second-order gradients in the vertical direction to get the absolute value of the vertical gradient:
[0044] Dv1=|P1+P6-2*P4|, Dv2=|P2+P7-2*Pc|, Dv3=|P3+P8-2*P5|;
[0045] Take the median of the absolute value of the vertical gradient. The calculation expression is as follows:
[0046] median_Dv=median(Dv1,Dv2,Dv3);
[0047] Three second-order gradients in the 45° direction:
[0048] D45_1=2*|P4-P2|, D45_2=|P3+P6-2Pc|, D45_3=2*|P7-P5|;
[0049] Take the median of the absolute value of the vertical gradient. The calculation expression is as follows:
[0050] median_D45=median(D45_1,D45_2,D45_3);
[0051] Three second-order gradients in the 135° direction:
[0052] D135_1=2*|P2-P5|, D135_2=|P1+P8-2Pc|, D135_3=2*|P7-P4|;
[0053] Take the median of the absolute value of the vertical gradient. The calculation expression is as follows:
[0054] median_D135=median(D135_1,D135_2,D135_3).
[0055] Further, judging whether the middle pixel Pc is a thermal noise point according to the edge direction includes:
[0056] If the edge direction is horizontal or vertical, determine whether the absolute value of the second-order gradient in the horizontal or vertical direction where the center pixel Pc is located is greater than 4 times the absolute values of the other two second-order gradients in the same direction;
[0057] When the edge direction is horizontal, Dh2>4*(Dh1+Dh3), then Pc is a thermal noise point;
[0058] Otherwise, Pc is not a thermal noise point;
[0059] When the edge direction is vertical, Dv2>4*(Dv1+Dv3), then Pc is a thermal noise point;
[0060] Otherwise, Pc is not a thermal noise point.
[0061] If the edge direction is 45°, then the sum of the absolute values of the differences between the absolute values of the three second-order gradients in the 135° direction is calculated. The formula is as follows:
[0062] D135_sum=|D135_1-D135_2|+|D135_2-D135_3|+|D135_3-D135_1|;
[0063] If D135_sum<400, and D45_2>3*(D45_1+D45_3) and D135_2>3*(D135_1+D135_3), then Pc is a thermal noise point;
[0064] If D135_sum>=400, and D45_2>3*(D45_1+D45_3), then Pc is a thermal noise point;
[0065] If the edge direction is 135°, then calculate the sum of the absolute values of the differences between the absolute values of the three second-order gradients in the 45° direction. The formula is as follows:
[0066] D45_sum=|D45_1-D45_2|+|D45_2-D135_3|+|D45_3-D45_1|;
[0067] If D45_sum<400, and D45_2>3*(D45_1+D45_3) and D135_2>3*(D135_1+D135_3), then Pc is a thermal noise point;
[0068] If D45_sum>=400, and D135_2>3*(D135_1+D135_3), then Pc is a thermal noise point.
[0069] Furthermore, the step of judging whether the middle pixel Pc is a thermal noise point according to the edge direction further includes:
[0070] When Pc<60, and the values of the surrounding pixels P1, P2, P3, P4, P5, P6, P7, and P8 are all greater than Pc by more than 160, then Pc is a thermal noise point;
[0071] When Pc>920, and the values of the surrounding pixels P1, P2, P3, P4, P5, P6, P7 and P8 are all less than 120 than the Pc value, then Pc is a thermal noise point;
[0072] Furthermore, the method of detecting thermal noise points by using a gradient percentage, then preliminarily correcting the thermal noise points by using a median filter, and finally calculating the final correction result by using an alpha blending method includes:
[0073] If the edge direction is horizontal,
[0074] When |P4-Pc|<|Pc-P5|, the value of the central pixel Pc after thermal noise correction is obtained according to the gradient of the brightness of the same color channel:
[0075] ouput=alpha*(P4+(P2+P7-P1-P6) / 2)+(1-alpha)*Pc;
[0076] When |P4-Pc|≧|Pc-P5|, the value of the central pixel Pc after thermal noise correction is obtained according to the gradient of the brightness of the same color channel:
[0077] ouput=alpha*(P5+(P2+P7-P3-P8) / 2)+(1-alpha)*Pc;
[0078] If the edge direction is vertical,
[0079] When |P2-Pc|<|Pc-P7|, the value of the central pixel Pc after thermal noise correction is obtained according to the gradient of the brightness of the same color channel:
[0080] ouput=alpha*(P2+(P4+P5-P1-P3) / 2)+(1-alpha)*Pc;
[0081] When |P2-Pc|≥|Pc-P7|, the value of the central pixel Pc after thermal noise correction is obtained according to the gradient of the brightness of the same color channel:
[0082] ouput=alpha*(P7+(P4+P5-P6-P8) / 2)+(1-alpha)*Pc;
[0083] If the edge direction is 45°,
[0084] When |P3-Pc|<|P6-Pc|, the value of the central pixel c after thermal noise correction is obtained according to the gradient of the brightness of the same color channel:
[0085] output=alpha*(P3+(P4+P7-P2-p5) / 2)+(1-alpha)*Pc;
[0086] When |P3-Pc|≥|P6-Pc|, the value of the central pixel Pc after thermal noise correction is obtained according to the gradient of the brightness of the same color channel:
[0087] output=alpha*(P6+(P2+P5-P7-p4) / 2)+(1-alpha)*Pc;
[0088] If the edge direction is 135°,
[0089] When |P1-Pc|<|P8-Pc|, the value of the central pixel Pc after thermal noise correction is obtained according to the gradient of the brightness of the same color channel:
[0090] output=alpha*(P1+(P5+P7-P2-p4) / 2)+(1-alpha)*Pc;
[0091] When |P1-Pc|≥|P8-Pc|, the value of the central pixel Pc after thermal noise correction is obtained according to the gradient of the brightness of the same color channel:
[0092] output=alpha*(P8+(P2+P4-P5-p7) / 2)+(1-alpha)*Pc.
[0093] Furthermore, the noise parameters include shot noise parameters and readout noise parameters.
[0094] The calculation formula of the noise parameter of the shot noise parameter is as follows:
[0095] λ shot =g d g a
[0096] In the formula,
[0097] λ shot : Shot noise parameter;
[0098] g d : digital gain;
[0099] g a : analog gain;
[0100] The calculation formula of the noise parameter of the readout noise parameter is as follows:
[0101]
[0102] In the formula,
[0103] λ read : Readout noise parameters;
[0104] Fixed readout variance.
[0105] Furthermore, the step of inputting the dark light noise-reduced image in RAW format, the dark light noise image after removing thermal noise points, and the noise parameter into a symmetrical encoder-decoder structure to obtain the denoised image after noise reduction includes:
[0106] Input the dark light denoised image in RAW format into the decoder as the label image;
[0107] Input the dark light noise image after removing the thermal noise into the symmetrical encoder-decoder;
[0108] Input shot noise parameters and read noise parameters into the encoder;
[0109] The encoder is used to downsample the input dark light noise image after removing thermal noise points by using a contraction path through a shot noise parameter and a readout noise parameter, so as to obtain image feature maps of different sizes;
[0110] Upsampling the input dark light noise image after removing thermal noise using the decoder by using a dilation path to restore the size and texture details of the dark light noise image after removing thermal noise;
[0111] Jump-connecting and splicing the image feature map on the path of the contraction path and the upsampled image on the path of the expansion path;
[0112] Continuously upsampling the stitched image to the size of the original input dark light noise image after removing the thermal noise points, to obtain a stitched denoised image;
[0113] The denoised image is compared with the label image. When the difference between the denoised image and the label image is reduced to a certain preset value, the denoised image is input.
[0114] The present invention has the following advantages:
[0115] (1) The present invention processes the thermal noise of the low-light image before sending it to the neural network, effectively reducing the thermal noise of the image introduced by the camera using high sensitivity and long exposure mode in the low-light environment, and effectively improving the quality of the RAW image;
[0116] (2) The present invention comprehensively considers the characteristics of dark light images, which have many noise points, and thermal noise points are more acute than general noise points. The use of general denoising networks will remove too many image details due to thermal noise points. Therefore, the method of first confirming and then removing thermal noise points is selected, and then a symmetrical encoder-decoder structure is used to more accurately restore the texture and detail information of the original image.
[0117] (3) Adding noise parameters as additional input can effectively improve the noise reduction effect of low-light images and retain more details in the image, providing higher quality RAW images for subsequent low-light enhancement. BRIEF DESCRIPTION OF THE DRAWINGS
[0118] Figure 1 It is a diagram of the method steps of the present invention;
[0119] Figure 2 is the relationship diagram between m and alpha;
[0120] Figure 3 It is a position relationship diagram of P1, P2, P3, P4, P5, P6, P7, P8 and Pc;
[0121] Figure 4 Schematic diagram of a symmetrical encoder-decoder;
[0122] Figure 5 This is an experimental table of comparative results between the present invention and other methods. DETAILED DESCRIPTION
[0123] The present invention is further described below in conjunction with the accompanying drawings, but the protection scope of the present invention is not limited to the following description.
[0124] It should be noted that the directions or positional relationships indicated by "left", "right", etc. are based on the directions or positional relationships shown in the accompanying drawings, or are the directions or positional relationships in which the inventive product is usually placed when in use, or are the directions or positional relationships commonly understood by those skilled in the art. Such terms are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific direction, be constructed and operated in a specific direction, and therefore cannot be understood as a limitation on the present invention.
[0125] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features and technical solutions in the embodiments may be combined with each other.
[0126] See also Figure 1 The present invention provides a method for reducing noise of a low-light image, comprising:
[0127] S1. Acquire a RAW domain denoised dataset; the RAW domain denoised dataset includes a dark light noise image in a RAW format and a dark light denoised image in a RAW format;
[0128] S2. Obtain the grayscale image of the low-light noise image, and determine whether the current low-light noise image is in a low-light scene according to the grayscale image;
[0129] If it is in a low-light scene, go to step S3;
[0130] If it is not in a low-light scene, end the noise reduction of the low-light image;
[0131] S3. Preprocess the thermal noise points of the low-light noise image to obtain the low-light noise image after removing the thermal noise points;
[0132] S4. Calculate the noise parameters of the low-light noise image after removing the thermal noise points;
[0133] S5. Input the RAW format low-light noise-reduced image, the low-light noise image after removing the thermal noise points, and the noise parameters into a symmetric encoder-decoder structure to obtain the noise-reduced image.
[0134] Further, the obtaining the grayscale image of the low-light noise image and determining whether the current low-light noise image is in a low-light scene according to the grayscale image includes:
[0135] S201. Downsample the low-light noise image to obtain a downsampled image, and perform grayscale binarization on the downsampled image to obtain a grayscale image;
[0136] S202. Obtain the grayscale value and grayscale histogram from the grayscale image, and calculate the cumulative distribution function;
[0137] S203. Obtain the value of m corresponding to the grayscale image when the value of the cumulative distribution function = 0.75;
[0138] Refer to Figure 2 , Figure 2 is the relationship diagram between m and the intensity parameter alpha;
[0139] From Figure 2 it can be seen that
[0140] When 0 < m ≤ the first preset value th1, the low-light noise image is in a low-light scene, and the intensity parameter alpha for removing the thermal noise points is taken as 1;
[0141] When the first preset value th1 < m < the second preset value th2, the low-light noise image is in a relatively low-light scene, and 0 < alpha < 1 is taken;
[0142] When m ≥ the second preset value th2, the low-light noise image is in a normal bright environment and not in a low-light scene, then alpha = 0, and the noise reduction of the low-light image ends.
[0143] In some specific embodiments, the first preset value th1 is set to 50, and the second preset value th2 is set to 500.
[0144] Furthermore, the preprocessing of the thermal noise points of the dark light noise image to obtain the dark light noise image after removing the thermal noise points includes:
[0145] S301, calculating the median of the gradient values of the dark light noise image in the horizontal direction, the vertical direction, the 45° direction and the 135° direction;
[0146] S302, according to the minimum value of the median values of the gradient values in the horizontal direction, the vertical direction, the 45° direction and the 135° direction, taking the minimum value as the edge direction;
[0147] min_grad=min(median_Dh,median_Dv,median_D45,median_D135)
[0148] Where:
[0149] min_grad indicates the edge direction;
[0150] median_Dh represents the minimum value of the median in the horizontal direction;
[0151] median_Dv represents the minimum value of the median in the vertical direction;
[0152] median_D45 represents the minimum value of the median in the 45° direction;
[0153] median_D135 represents the minimum value of the median in the 135° direction;
[0154] S303, judging whether the middle point is a thermal noise point according to the edge direction;
[0155] S304, detecting thermal noise points according to the gradient, preliminarily correcting the thermal noise points by median filtering, and finally calculating the final correction result by removing the intensity parameter alpha blending of the thermal noise points;
[0156] S305 , obtaining a dark light noise image after removing thermal noise points according to the correction result.
[0157] Further, the step of calculating the gradients of the dark light noise image in the horizontal direction, the vertical direction, the 45° direction, and the 135° direction includes:
[0158] The central pixel Pc of the dark light noise image is obtained, and P1, P2, P3, P4, P5, P6, P7 and P8 are eight adjacent pixels around the central pixel Pc;
[0159] For the positional relationship between P1, P2, P3, P4, P5, P6, P7, P8 and Pc, refer to Figure 3 ;
[0160] Calculate the three second-order gradients in the horizontal direction to get the absolute value of the horizontal gradient:
[0161] Dh1=|P1+P3-2*P2|, Dh2=|P4+P5-2*Pc|, Dh3=|P6+P8-2*P7|;
[0162] Take the median of the absolute value of the horizontal gradient. The calculation expression is as follows:
[0163] median_Dh=median(Dh1,Dh2,Dh3);
[0164] Calculate the three second-order gradients in the vertical direction to get the absolute value of the vertical gradient:
[0165] Dv1=|P1+P6-2*P4|, Dv2=|P2+P7-2*Pc|, Dv3=|P3+P8-2*P5|;
[0166] Take the median of the absolute value of the vertical gradient. The calculation expression is as follows:
[0167] median_Dv=median(Dv1,Dv2,Dv3);
[0168] Three second-order gradients in the 45° direction:
[0169] D45_1=2*|P4-P2|, D45_2=|P3+P6-2Pc|, D45_3=2*|P7-P5|;
[0170] Take the median of the absolute value of the vertical gradient. The calculation expression is as follows:
[0171] median_D45=median(D45_1,D45_2,D45_3);
[0172] Three second-order gradients in the 135° direction:
[0173] D135_1=2*|P2-P5|, D135_2=|P1+P8-2Pc|, D135_3=2*|P7-P4|;
[0174] Take the median of the absolute value of the vertical gradient. The calculation expression is as follows:
[0175] median_D135=median(D135_1,D135_2,D135_3).
[0176] Further, judging whether the middle pixel Pc is a thermal noise point according to the edge direction includes:
[0177] If the edge direction is horizontal or vertical, determine whether the absolute value of the second-order gradient in the horizontal or vertical direction where the center pixel Pc is located is greater than 4 times the absolute values of the other two second-order gradients in the same direction;
[0178] When the edge direction is horizontal, Dh2>4*(Dh1+Dh3), then Pc is a thermal noise point;
[0179] Otherwise, Pc is not a thermal noise point;
[0180] When the edge direction is vertical, Dv2>4*(Dv1+Dv3), then Pc is a thermal noise point;
[0181] Otherwise, Pc is not a thermal noise point.
[0182] If the edge direction is 45°, then calculate the sum of the absolute values of the differences between the absolute values of the three second-order gradients in the 135° direction. The formula is as follows:
[0183] D135_sum=|D135_1-D135_2|+|D135_2-D135_3|+|D135_3-D135_1|;
[0184] If D135_sum<400, and D45_2>3*(D45_1+D45_3) and D135_2>3*(D135_1+D135_3), then Pc is a thermal noise point;
[0185] If D135_sum>=400, and D45_2>3*(D45_1+D45_3), then Pc is a thermal noise point;
[0186] If the edge direction is 135°, then calculate the sum of the absolute values of the differences between the absolute values of the three second-order gradients in the 45° direction. The formula is as follows:
[0187] D45_sum=|D45_1-D45_2|+|D45_2-D135_3|+|D45_3-D45_1|;
[0188] If D45_sum<400, and D45_2>3*(D45_1+D45_3) and D135_2>3*(D135_1+D135_3), then Pc is a thermal noise point;
[0189] If D45_sum>=400, and D135_2>3*(D135_1+D135_3), then Pc is a thermal noise point.
[0190] Furthermore, the step of judging whether the middle pixel Pc is a thermal noise point according to the edge direction further includes:
[0191] When Pc<60, and the values of the surrounding pixels P1, P2, P3, P4, P5, P6, P7, and P8 are all greater than Pc by more than 160, then Pc is a thermal noise point;
[0192] When Pc>920, and the values of the surrounding pixels P1, P2, P3, P4, P5, P6, P7 and P8 are all less than 120 than the Pc value, then Pc is a thermal noise point;
[0193] Furthermore, the method of detecting thermal noise points by using a gradient percentage, then preliminarily correcting the thermal noise points by using a median filter, and finally calculating the final correction result by using an alpha blending method includes:
[0194] If the edge direction is horizontal,
[0195] When |P4-Pc|<|Pc-P5|, the value of the central pixel Pc after thermal noise correction is obtained according to the gradient of the brightness of the same color channel:
[0196] ouput=alpha*(P4+(P2+P7-P1-P6) / 2)+(1-alpha)*Pc;
[0197] When |P4-Pc|≧|Pc-P5|, the value of the central pixel Pc after thermal noise correction is obtained according to the gradient of the brightness of the same color channel:
[0198] ouput=alpha*(P5+(P2+P7-P3-P8) / 2)+(1-alpha)*Pc;
[0199] If the edge direction is vertical,
[0200] When |P2-Pc|<|Pc-P7|, the value of the central pixel Pc after thermal noise correction is obtained according to the gradient of the brightness of the same color channel:
[0201] ouput=alpha*(P2+(P4+P5-P1-P3) / 2)+(1-alpha)*Pc;
[0202] When |P2-Pc|≥|Pc-P7|, the value of the central pixel Pc after thermal noise correction is obtained according to the gradient of the brightness of the same color channel:
[0203] ouput=alpha*(P7+(P4+P5-P6-P8) / 2)+(1-alpha)*Pc;
[0204] If the edge direction is 45°,
[0205] When |P3-Pc|<|P6-Pc|, the value of the central pixel Pc after thermal noise correction is obtained according to the gradient of the brightness of the same color channel:
[0206] output=alpha*(P3+(P4+P7-P2-p5) / 2)+(1-alpha)*Pc;
[0207] When |P3-Pc|≥|P6-Pc|, the value of the central pixel Pc after thermal noise correction is obtained according to the gradient of the brightness of the same color channel:
[0208] output=alpha*(P6+(P2+P5-P7-p4) / 2)+(1-alpha)*Pc;
[0209] If the edge direction is 135°,
[0210] When |P1-Pc|<|P8-Pc|, the value of the central pixel Pc after thermal noise correction is obtained according to the gradient of the brightness of the same color channel:
[0211] output=alpha*(P1+(P5+P7-P2-p4) / 2)+(1-alpha)*Pc.
[0212] In low-light environments, cameras usually use high-sensitivity, long-exposure modes to capture images, which can effectively brighten the overall brightness of the image and allow the image to present more details. However, for images captured in high-sensitivity, long-exposure modes, due to the increase in camera sensor gain and the rise in temperature, some bright spots with pixel values significantly higher than those of surrounding pixels will appear in the image, namely, hot pixels; the lower the ambient illumination of the image, the higher the sensitivity of the camera sensor, the longer the exposure time, and the more obvious the image hot noise; the image hot noise is obviously different from the overall noise of the image. If a neural network-based method is used to filter out hot noise and other image noise at the same time, the image will become much more blurred and details will be lost to a large extent; the present invention uses the judgment of the central pixel Pc and corrects the hot noise through the gradual change of the brightness of the same color channel, so as to pre-process the hot noise, thereby reducing the total impact of the hot noise on the subsequent noise reduction process, mainly affecting the accuracy of the noise parameters.
[0213] Furthermore, the noise parameters include shot noise parameters and readout noise parameters.
[0214] The calculation formula of the noise parameter of the shot noise parameter is as follows:
[0215] λ shot =gd g a
[0216] In the formula,
[0217] λ shot : Shot noise parameter;
[0218] g d : digital gain;
[0219] g a : analog gain;
[0220] The calculation formula of the noise parameter of the readout noise parameter is as follows:
[0221]
[0222] In the formula,
[0223] λ read : Readout noise parameters;
[0224] Fixed readout variance.
[0225] Further, see Figure 4 The step of inputting the dark light noise reduction image in RAW format, the dark light noise image after removing the thermal noise points, and the noise parameters into a symmetrical encoder-decoder structure to obtain the noise reduction image after noise reduction includes:
[0226] Input the RAW format dark light denoised image into the decoder as the label image;
[0227] Input the dark light noise image after removing the thermal noise into the symmetrical encoder-decoder;
[0228] Input shot noise parameters and read noise parameters into the encoder;
[0229] The encoder is used to downsample the input dark light noise image after removing thermal noise points by using a contraction path through a shot noise parameter and a readout noise parameter, so as to obtain image feature maps of different sizes;
[0230] Upsampling the input dark light noise image after removing thermal noise using the decoder by using a dilation path to restore the size and texture details of the dark light noise image after removing thermal noise;
[0231] Jump-connecting and splicing the image feature map on the path of the contraction path and the up-sampled image on the path of the expansion path;
[0232] Continuously upsampling the stitched image to the size of the original input dark light noise image after removing the thermal noise points, to obtain a stitched denoised image;
[0233] The denoised image is compared with the label image. When the difference between the denoised image and the label image is reduced to a certain preset value, the denoised image is input.
[0234] Before sending the low-light image to the neural network, the present invention processes the thermal noise of the low-light image in advance, effectively reducing the image thermal noise introduced by the camera using high sensitivity and long exposure mode in low-light environment, and effectively improving the RAW image quality; and thermal noise is sharper than general noise, and the use of general denoising network will remove too many image details due to thermal noise; therefore, the method of first confirming and then removing the thermal noise is selected, and then a symmetrical encoder-decoder structure is used to more accurately restore the texture and detail information of the original image; the present invention also adds noise parameters as additional input, which can effectively improve the noise reduction effect of low-light images and retain more details in the image, providing higher quality RAW images for subsequent low-light enhancement.
[0235] The method used in the present invention is compared and verified by using the image effects before and after the test set is improved. The test results are as follows: Figure 5 As shown in FIG, the peak signal-to-noise ratio (PSNR) and structural similarity (SSIM) commonly used in the field of image enhancement are used as evaluation indicators. The larger the PSNR, the higher the image quality, and the higher the SSIM, the more similar the two images are.
[0236] The above embodiments only express preferred implementation modes, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present invention. It should be pointed out that, for ordinary technicians in this field, several modifications and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention.
Claims
1. A method for reducing noise in low-light images, characterized in that: Including: S1. Obtain a RAW domain noise reduction dataset; The RAW domain noise reduction dataset includes multiple pairs of low-light noisy images in RAW format and low-light noise-reduced images in RAW format; S2. Obtain the grayscale image of the low-light noisy image, and determine whether the current low-light noisy image is in a low-light scene according to the grayscale image; If it is in a low-light scene, go to step S3; If it is not in a low-light scene, end the noise reduction of the low-light image; S3. Preprocess the thermal noise points of the low-light noisy image to obtain a low-light noisy image after removing thermal noise points; S4. Calculate the noise parameters of the low-light noisy image after removing thermal noise points; S5. Input the low-light noise-reduced image in RAW format, the low-light noisy image after removing thermal noise points, and the noise parameters into a symmetric encoder-decoder structure to obtain a noise-reduced image.
2. The method for reducing noise of a low-light image according to claim 1, characterized in that: The obtaining the grayscale image of the low-light noisy image and determining whether the current low-light noisy image is in a low-light scene according to the grayscale image includes: S201. Downsample the low-light noisy image to obtain a downsampled image, and calculate the grayscale of the downsampled image to obtain a grayscale image; S202. Perform grayscale information statistics on the grayscale image to obtain a cumulative distribution function; S203. Obtain the value m of the corresponding grayscale image when the value of the cumulative distribution function = 0.75; When 0 < m ≤ the first preset value, the low-light noisy image is in a low-light scene, and take the intensity parameter alpha for removing thermal noise points as 1; When the first preset value < m < the second preset value, the low-light noisy image is in a relatively low-light scene, and take 0 < alpha < 1; When m ≥ the second preset value, the low-light noisy image is in a normal bright light environment and not in a low-light scene, then alpha = 0, and end the noise reduction of the low-light image.
3. The method for reducing noise of a low-light image according to claim 1, characterized in that: The preprocessing the thermal noise points of the low-light noisy image to obtain a low-light noisy image after removing thermal noise points includes: S301. Calculate the median of the gradient values in the horizontal direction, vertical direction, 45° direction, and 135° direction of the low-light noisy image; S302. According to the minimum value of the median of the gradient values in the horizontal direction, vertical direction, 45° direction, and 135° direction, take the minimum value as the edge direction; the calculation formula is as follows: min_grad = min(median_Dh, median_Dv, median_D45, median_D135) In the formula: min_grad: Edge direction; median_Dh: Minimum value of the median in the horizontal direction; median_Dv: Minimum value of the median in the vertical direction; median_D45: Minimum value of the median in the 45° direction; median_D135: Minimum value of the median in the 135° direction; S303. Determine whether the central pixel Pc is a thermal noise point according to the edge direction; If the central pixel point is not a thermal noise point, go to S4; If the central pixel point is a thermal noise point, go to S304; S304. Calculate the final correction result by the mixing method of the intensity parameter alpha for removing thermal noise points; S305. Obtain a low-light noisy image after removing thermal noise points according to the correction result.
4. The method for reducing noise of a low-light image according to claim 3, characterized in that: The step of calculating the gradients of the dark light noise image in the horizontal direction, the vertical direction, the 45° direction and the 135° direction comprises: The central pixel Pc of the dark light noise image is obtained, and P1, P2, P3, P4, P5, P6, P7 and P8 are eight adjacent pixels around the central pixel Pc; Calculate the three second-order gradients in the horizontal direction to get the absolute value of the horizontal gradient: Dh1=|P1+P3-2*P2|, Dh2=|P4+P5-2*Pc|, Dh3=|P6+P8-2*P7|; Take the median of the absolute value of the horizontal gradient. The calculation expression is as follows: median_Dh=median(Dh1,Dh2,Dh3); Calculate the three second-order gradients in the vertical direction to get the absolute value of the vertical gradient: Dv1=|P1+P6-2*P4|, Dv2=|P2+P7-2*Pc|, Dv3=|P3+P8-2*P5|; Take the median of the absolute value of the vertical gradient. The calculation expression is as follows: median_Dv=median(Dv1,Dv2,Dv3); Three second-order gradients in the 45° direction: D45_1=2*|P4-P2|, D45_2=|P3+P6-2Pc|, D45_3=2*|P7-P5|; Take the median of the absolute value of the vertical gradient. The calculation expression is as follows: median_D45=median(D45_1,D45_2,D45_3); Three second-order gradients in the 135° direction: D135_1=2*|P2-P5|, D135_2=|P1+P8-2Pc|, D135_3=2*|P7-P4|; Take the median of the absolute value of the vertical gradient. The calculation expression is as follows: median_D135=median(D135_1,D135_2,D135_3).
5. The method for reducing noise of a low-light image according to claim 4, characterized in that: The step of judging whether the middle pixel Pc is a thermal noise point according to the edge direction includes: If the edge direction is horizontal or vertical, determine whether the absolute value of the second-order gradient in the horizontal or vertical direction where the center pixel Pc is located is greater than 4 times the absolute values of the other two second-order gradients in the same direction; When the edge direction is horizontal, Dh2>4*(Dh1+Dh3), then Pc is a thermal noise point; Otherwise, Pc is not a thermal noise point; When the edge direction is vertical, Dv2>4*(Dv1+Dv3), then Pc is a thermal noise point; Otherwise, Pc is not a thermal noise point. If the edge direction is 45°, the sum of the absolute values of the differences between the absolute values of the three second-order gradients in the 135° direction is calculated. The formula is as follows: D135_sum=|D135_1-D135_2|+|D135_2-D135_3|+|D135_3-D135_1|; If D135_sum<400, and D45_2>3*(D45_1+D45_3) and D135_2>3*(D135_1+D135_3), then Pc is a thermal noise point; If D135_sum>=400, and D45_2>3*(D45_1+D45_3), then Pc is a thermal noise point; If the edge direction is 135°, the sum of the absolute values of the differences between the absolute values of the three second-order gradients in the 45° direction is calculated. The formula is as follows: D45_sum=|D45_1-D45_2|+|D45_2-D135_3|+|D45_3-D45_1|; If D45_sum<400, and D45_2>3*(D45_1+D45_3) and D135_2>3*(D135_1+D135_3), then Pc is a thermal noise point; If D45_sum>=400, and D135_2>3*(D135_1+D135_3), then Pc is a thermal noise point.
6. The method for reducing noise of a low-light image according to claim 6, characterized in that: The step of judging whether the middle pixel Pc is a thermal noise point according to the edge direction also includes: When Pc<60, and the values of the surrounding pixels P1, P2, P3, P4, P5, P6, P7, and P8 are all greater than Pc by more than 160, then Pc is a thermal noise point; When Pc>920, and the values of the surrounding pixels P1, P2, P3, P4, P5, P6, P7 and P8 are more than 120 less than the Pc value, Pc is a thermal noise point.
7. The method for reducing noise of a low-light image according to claim 4, characterized in that: The method of detecting thermal noise points by using the gradient percentage, then preliminarily correcting the thermal noise points by using the median filter, and finally calculating the final correction result by using the alpha blending method, includes: If the edge direction is horizontal, When |P4-Pc|<|Pc-P5|, the value of the central pixel Pc after thermal noise correction is obtained according to the gradient of the brightness of the same color channel: ouput=alpha*(P4+(P2+P7-P1-P6) / 2)+(1-alpha)*Pc; When |P4-Pc|≧|Pc-P5|, the value of the central pixel Pc after thermal noise correction is obtained according to the gradient of the brightness of the same color channel: ouput=alpha*(P5+(P2+P7-P3-P8) / 2)+(1-alpha)*Pc; If the edge direction is vertical, When |P2-Pc|<|Pc-P7|, the value of the central pixel Pc after thermal noise correction is obtained according to the gradient of the brightness of the same color channel: ouput=alpha*(P2+(P4+P5-P1-P3) / 2)+(1-alpha)*Pc; When |P2-Pc|≥|Pc-P7|, the value of the central pixel Pc after thermal noise correction is obtained according to the gradient of the brightness of the same color channel: ouput=alpha*(P7+(P4+P5-P6-P8) / 2)+(1-alpha)*Pc; If the edge direction is 45°, When |P3-Pc|<|P6-Pc|, the value of the central pixel c after thermal noise correction is obtained according to the gradient of the brightness of the same color channel: output=alpha*(P3+(P4+P7-P2-p5) / 2)+(1-alpha)*Pc; When |P3-Pc|≥|P6-Pc|, the value of the central pixel Pc after thermal noise correction is obtained according to the gradient of the brightness of the same color channel: output=alpha*(P6+(P2+P5-P7-p4) / 2)+(1-alpha)*Pc; If the edge direction is 135°, When |P1-Pc|<|P8-Pc|, the value of the central pixel Pc after thermal noise correction is obtained according to the gradient of the brightness of the same color channel: output=alpha*(P1+(P5+P7-P2-p4) / 2)+(1-alpha)*Pc; When |P1-Pc|≥|P8-Pc|, the value of the central pixel Pc after thermal noise correction is obtained according to the gradient of the brightness of the same color channel: output=alpha*(P8+(P2+P4-P5-p7) / 2)+(1-alpha)*Pc.
8. The method for reducing noise of a low-light image according to claim 2, characterized in that: The noise parameters include shot noise parameters and readout noise parameters; The calculation formula of the noise parameter of the shot noise parameter is as follows: l shot =g d g a In the formula, λ shot : Shot noise parameter; g d : digital gain; g a : analog gain; The calculation formula of the noise parameter of the readout noise parameter is as follows: In the formula, λ read : Readout noise parameters; Fixed readout variance.
9. The method for reducing noise of a low-light image according to claim 8, characterized in that: The step of inputting the dark light noise reduction image in RAW format, the dark light noise image after removing the thermal noise points, and the noise parameter into a symmetrical encoder-decoder structure to obtain the noise reduction image after noise reduction includes: Input the dark light denoised image in RAW format into the decoder as the label image; Input the dark light noise image after removing the thermal noise into the symmetrical encoder-decoder; Input shot noise parameters and read noise parameters into the encoder; The encoder is used to downsample the input dark light noise image after removing thermal noise points by using a contraction path through a shot noise parameter and a readout noise parameter, so as to obtain image feature maps of different sizes; Upsampling the input dark light noise image after removing thermal noise using the decoder by using a dilation path to restore the size and texture details of the dark light noise image after removing thermal noise; Jump-connecting and splicing the image feature map on the path of the contraction path and the upsampled image on the path of the expansion path; Continuously upsampling the stitched image to the size of the original input dark light noise image after removing the thermal noise points, to obtain a stitched denoised image; The denoised image is compared with the label image. When the difference between the denoised image and the label image is reduced to a certain preset value, the denoised image is input.
Citation Information
Patent Citations
Image denoising method, image denoising device, storage medium and electronic equipment
CN111768351A
Full-color night vision enhancement method and system based on deep learning
CN115456903A
Image blind denoising method and device, electronic equipment and storage medium
CN115619652A
RAW domain image denoising method and shooting device
CN116723413A
Image adaptive denoising method based on supervised deep learning
CN117351216A
