Image dark space noise reduction method and device

By pre-processing, color processing and gamma correction on the image, the color distortion problem of dark area image is solved, and the effective reduction of dark area noise and image clarity are achieved.

CN120013805AActive Publication Date: 2025-05-16SHINING 3D TECH CO LTD
View PDF 11 Cites 0 Cited by

Patent Information

Application Number
CN202510479692.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-16
Publication Date
2025-05-16
Estimated Expiration
2045-04-16

AI Technical Summary

Technical Problem

In the prior art, when processing dark areas of images, the tone of noise will not change, and the color distortion problem in dark areas cannot be effectively solved.

Method used

By acquiring the original image data, performing pre-processing and color processing, determining the gamma correction method, calculating the pixel values ​​of each channel, and performing image enhancement processing to obtain noise-reducing image data.

Benefits of technology

It effectively reduces the saturation of the dark area of ​​the image, significantly reduces color noise, solves the problem of color distortion in the dark area, and improves the clarity and visual effect of the image.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120013805A_ABST
    Figure CN120013805A_ABST
Patent Text Reader

Abstract

The invention discloses a noise reduction method and device for an image dark area, which is applied to the technical field of computers, and comprises the following steps: obtaining original image data; preprocessing the original image data to obtain processed image data; performing color processing on the processed image data to obtain corrected image data; wherein the corrected image data at least comprises gray values of an R channel, a G channel and a B channel; determining a gamma correction mode for correcting the image data according to the gray value of the R channel, the gray value of the G channel and the gray value of the B channel; calculating pixel values of the R channel, the G channel and the B channel according to a gamma correction mode; and performing image enhancement processing on the corrected image data based on the pixel values of the R channel, the G channel and the B channel to obtain noise reduction image data. Therefore, according to the gamma correction mode, the bright and saturated color of the bright area can be ensured, the saturation of the dark area of the image is reduced, the effect of reducing color noise is remarkable, and the problem of color distortion of the dark area is effectively solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method and device for reducing noise in dark areas of an image. Background Art

[0002] Since noise can make images blurry and rough, it can easily affect the clarity and visual effects of images, especially in low-light environments, where noise is more obvious, which can cause color distortion and make the colors of color images look less real and natural. Therefore, we can remove unnecessary interference by performing noise reduction on images, improve image clarity and detail, make image colors more accurate and vivid, improve overall visual effects, and make images more in line with the aesthetic needs of the human eye.

[0003] In the existing image noise reduction processing technology, six filtering methods are mainly used to remove image noise. Specifically, the first filtering method is mean filtering, which replaces the value of the central pixel by calculating the average value in the pixel neighborhood, thereby smoothing the image and reducing noise. The second filtering method is Gaussian filtering, which performs weighted averaging processing on the image using the convolution kernel generated by the Gaussian function. The weight decreases as the distance from the central pixel increases, achieving the effect of reducing noise. The third filtering method is median filtering, which sorts the pixel values ​​in the pixel neighborhood and replaces the value of the central pixel with the median to better preserve the image edge. The fourth filtering method is bilateral filtering, which combines the weights of the spatial domain and the value domain, considering both the spatial distance of the pixels and the similarity of the pixel values, and can retain the edge details of the image while removing noise. The fifth filtering method is non-local mean filtering, which removes noise by calculating the weighted average of similar blocks in the image. The weight is determined by the similarity between the blocks, which can better preserve the texture and details of the image. The fifth filtering method is block matching adaptive noise reduction, which removes noise through block matching and adaptive threshold processing.

[0004] However, when the above six filtering methods process the dark areas of the image, the hue of the noise will not change. They only transform the noise from granular to flake or block, which cannot truly and effectively solve the color distortion problem in the dark areas. Summary of the invention

[0005] Based on the above-mentioned deficiencies of the prior art, the present application provides a method and device for reducing noise in dark areas of an image to solve the problem of color distortion in dark areas.

[0006] In order to achieve the above objectives, this application provides the following technical solutions:

[0007] The first aspect of the present application provides a method for reducing noise in dark areas of an image, comprising:

[0008] Get the original image data;

[0009] Preprocessing the original image data to obtain processed image data;

[0010] Performing color processing on the processed image data to obtain corrected image data; wherein the corrected image data at least includes a grayscale value of an R channel, a grayscale value of a G channel, and a grayscale value of a B channel;

[0011] Determining a gamma correction mode of the corrected image data according to the grayscale value of the R channel, the grayscale value of the G channel, and the grayscale value of the B channel;

[0012] Calculating pixel values ​​of the R channel, the G channel, and the B channel according to the gamma correction method;

[0013] The corrected image data is subjected to image enhancement processing based on the pixel values ​​of the R channel, the G channel and the B channel to obtain noise-reduced image data.

[0014] Optionally, in the above-mentioned method for reducing noise in dark areas of an image, the step of obtaining original image data includes:

[0015] Acquire optical signals through sensors;

[0016] Converting the optical signal into an analog electrical signal by photoelectric conversion;

[0017] Perform analog-to-digital conversion on the analog electrical signal to obtain original image data.

[0018] Optionally, in the above-mentioned method for reducing noise in dark areas of an image, preprocessing the original image data to obtain processed image data includes:

[0019] Performing black level compensation processing on the original image data to obtain compensated image data;

[0020] Performing bad pixel correction processing on the compensated image data to obtain bad pixel corrected image data;

[0021] The bad pixel correction image data is subjected to shadow correction processing to obtain processed image data.

[0022] Optionally, in the above-mentioned method for reducing noise in dark areas of an image, the color processing of the processed image data to obtain corrected image data includes:

[0023] Performing color interpolation processing on the processed image data to obtain an RGB image;

[0024] Performing white balance processing on the RGB image to obtain a white balanced RGB image;

[0025] Perform color correction processing on the white-balanced RGB image to obtain corrected image data.

[0026] Optionally, in the above-mentioned method for reducing noise in dark areas of an image, determining a gamma correction method of the corrected image data according to the grayscale value of the R channel, the grayscale value of the G channel, and the grayscale value of the B channel includes:

[0027] Determine whether any one of the grayscale values ​​of the R channel, the G channel, and the B channel is greater than a first preset threshold, or whether the grayscale values ​​of the R channel, the G channel, and the B channel are all greater than a second preset threshold;

[0028] If any one of the grayscale values ​​of the R channel, the G channel and the B channel has a grayscale value greater than a first preset threshold, or the grayscale values ​​of the R channel, the G channel and the B channel are all greater than a second preset threshold, then determining that the gamma correction mode of the corrected image data is a bright area correction mode;

[0029] If none of the grayscale values ​​of the R channel, the G channel and the B channel is greater than the first preset threshold, or the grayscale values ​​of the R channel, the G channel and the B channel are not greater than the second preset threshold, it is determined that the gamma correction method of the corrected image data is a dark area correction method.

[0030] Optionally, in the above-mentioned method for reducing noise in dark areas of an image, when the gamma correction mode of the corrected image data is a bright area correction mode, calculating the pixel values ​​of the R channel, the G channel and the B channel according to the gamma correction mode includes:

[0031] Get the preset gamma value;

[0032] Calculating a pixel value of the R channel based on the preset gamma value and the grayscale value of the R channel;

[0033] Calculating a pixel value of the G channel based on the preset gamma value and the grayscale value of the G channel;

[0034] The pixel value of the B channel is calculated according to the preset gamma value and the grayscale value of the B channel.

[0035] Optionally, in the above-mentioned method for reducing noise in dark areas of an image, when the gamma correction mode of the corrected image data is a dark area correction mode, calculating the pixel values ​​of the R channel, the G channel and the B channel according to the gamma correction mode includes:

[0036] Based on the grayscale value of the R channel, the grayscale value of the G channel, and the grayscale value of the B channel, respectively calculate a brightness component, a blue difference component, and a red difference component;

[0037] Calculating the Y channel value of the corrected image data according to the brightness component;

[0038] Calculate the pixel value of the R channel based on the Y channel value and the red difference component;

[0039] Calculate the pixel value of the G channel based on the Y channel value, the red difference component and the blue difference component;

[0040] The pixel value of the B channel is calculated according to the Y channel value and the blue difference component.

[0041] Optionally, in the above-mentioned method for reducing noise in dark areas of an image, performing image enhancement processing on the corrected image data based on the pixel values ​​of the R channel, the G channel and the B channel to obtain the reduced-noise image data comprises:

[0042] According to the pixel values ​​of the R channel, the G channel and the B channel, the pixel values ​​of the corresponding channels of the corrected image data are adjusted to obtain the target image data;

[0043] Performing sharpening processing on the target image data to obtain sharpened image data;

[0044] The sharpened image data is subjected to noise reduction processing by using a filtering algorithm to obtain noise-reduced image data.

[0045] A second aspect of the present application provides a device for reducing noise in dark areas of an image, comprising:

[0046] An image data acquisition unit, used for acquiring original image data;

[0047] A preprocessing unit, used for preprocessing the original image data to obtain processed image data;

[0048] A color processing unit, used to perform color processing on the processed image data to obtain corrected image data; wherein the corrected image data at least includes a grayscale value of an R channel, a grayscale value of a G channel, and a grayscale value of a B channel;

[0049] a gamma correction determination unit, configured to determine a gamma correction mode of the corrected image data according to the grayscale value of the R channel, the grayscale value of the G channel, and the grayscale value of the B channel;

[0050] A pixel value calculation unit, used to calculate the pixel values ​​of the R channel, the G channel and the B channel according to the gamma correction method;

[0051] The enhancement processing unit is used to perform image enhancement processing on the corrected image data based on the pixel values ​​of the R channel, the G channel and the B channel to obtain noise-reduced image data.

[0052] Optionally, in the above-mentioned image dark area noise reduction device, the image data acquisition unit includes:

[0053] A signal acquisition unit, used for acquiring an optical signal through a sensor;

[0054] A conversion unit, used for converting the optical signal into an analog electrical signal through photoelectric conversion;

[0055] The analog-to-digital conversion unit is used to perform analog-to-digital conversion on the analog electrical signal to obtain original image data.

[0056] Optionally, in the above-mentioned image dark area noise reduction device, the preprocessing unit includes:

[0057] A compensation processing unit, used for performing black level compensation processing on the original image data to obtain compensated image data;

[0058] A bad pixel processing unit, used for performing bad pixel correction processing on the compensated image data to obtain bad pixel corrected image data;

[0059] The shadow processing unit is used to perform shadow correction processing on the bad pixel correction image data to obtain processed image data.

[0060] Optionally, in the above-mentioned image dark area noise reduction device, the color processing unit includes:

[0061] An interpolation processing unit, used for performing color interpolation processing on the processed image data to obtain an RGB image;

[0062] A white balance processing unit, used to perform white balance processing on the RGB image to obtain a white balanced RGB image;

[0063] The color processing unit is used to perform color correction processing on the white-balanced RGB image to obtain corrected image data.

[0064] Optionally, in the above-mentioned image dark area noise reduction device, the gamma correction determination unit includes:

[0065] A judging unit, used to judge whether any one of the grayscale values ​​of the R channel, the G channel and the B channel is greater than a first preset threshold, or whether the grayscale values ​​of the R channel, the G channel and the B channel are all greater than a second preset threshold;

[0066] a first determining unit, configured to determine that the gamma correction mode of the corrected image data is a bright area correction mode if any one of the grayscale values ​​of the R channel, the G channel and the B channel is greater than a first preset threshold, or the grayscale values ​​of the R channel, the G channel and the B channel are all greater than a second preset threshold;

[0067] The second determination unit is used to determine that the gamma correction method of the corrected image data is a dark area correction method if none of the grayscale values ​​of the R channel, the G channel and the B channel is greater than the first preset threshold, or the grayscale values ​​of the R channel, the G channel and the B channel are not greater than the second preset threshold.

[0068] Optionally, in the above-mentioned image dark area noise reduction device, when the gamma correction mode of the corrected image data is a bright area correction mode, the pixel value calculation unit includes:

[0069] An acquiring unit, used for acquiring a preset gamma value;

[0070] A first calculation unit, configured to calculate a pixel value of the R channel based on the preset gamma value and the grayscale value of the R channel;

[0071] A second calculation unit, configured to calculate a pixel value of the G channel based on the preset gamma value and the grayscale value of the G channel;

[0072] The third calculation unit is used to calculate the pixel value of the B channel according to the preset gamma value and the grayscale value of the B channel.

[0073] Optionally, in the above-mentioned image dark area noise reduction device, when the gamma correction mode of the corrected image data is a dark area correction mode, the pixel value calculation unit includes:

[0074] A numerical calculation unit, used to calculate a brightness component, a blue difference component, and a red difference component based on the grayscale value of the R channel, the grayscale value of the G channel, and the grayscale value of the B channel;

[0075] a fourth calculation unit, configured to calculate a Y channel value of the corrected image data according to the brightness component;

[0076] a fifth calculating unit, configured to calculate a pixel value of the R channel based on the Y channel value and the red difference component;

[0077] a sixth calculation unit, configured to calculate a pixel value of the G channel based on the Y channel value, the red difference component and the blue difference component;

[0078] The seventh calculation unit is used to calculate the pixel value of the B channel according to the Y channel value and the blue difference component.

[0079] Optionally, in the above-mentioned image dark area noise reduction device, the enhancement processing unit includes:

[0080] An adjustment unit, configured to adjust the pixel values ​​of the corresponding channels of the corrected image data according to the pixel values ​​of the R channel, the G channel and the B channel, so as to obtain target image data;

[0081] A sharpening processing unit, used for performing sharpening processing on the target image data to obtain sharpened image data;

[0082] The noise reduction processing unit is used to perform noise reduction processing on the sharpened image data by using a filtering algorithm to obtain noise-reduced image data.

[0083] The present application provides a method for reducing noise in dark areas of an image, which obtains original image data, preprocesses the original image data, obtains processed image data, and then performs color processing on the processed image data to obtain corrected image data, wherein the corrected image data at least includes the grayscale value of the R channel, the grayscale value of the G channel, and the grayscale value of the B channel, and then determines the gamma correction method of the corrected image data according to the grayscale value of the R channel, the grayscale value of the G channel, and the grayscale value of the B channel, and then calculates the pixel values ​​of the R channel, the G channel, and the B channel according to the gamma correction method, and finally performs image enhancement processing on the corrected image data based on the pixel values ​​of the R channel, the G channel, and the B channel to obtain the reduced noise image data. Therefore, according to the gamma correction method, it can ensure that the bright area color is bright and saturated, while reducing the saturation of the dark area of ​​the image, and has a significant effect on reducing color noise, effectively solving the color distortion problem in the dark area. BRIEF DESCRIPTION OF THE DRAWINGS

[0084] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0085] Figure 1 A schematic diagram of a process for reducing noise in dark areas of an image provided by an embodiment of the present application;

[0086] Figure 2 A schematic diagram of a flow chart of a method for acquiring original image data provided in an embodiment of the present application;

[0087] Figure 3 A flowchart of a method for acquiring image data provided in an embodiment of the present application;

[0088] Figure 4 A schematic diagram of a flow chart of a method for acquiring corrected image data provided in an embodiment of the present application;

[0089] Figure 5 A flowchart of a method for determining a gamma correction mode provided in an embodiment of the present application;

[0090] Figure 6 A flowchart of a method for calculating a pixel value provided in an embodiment of the present application;

[0091] Figure 7 A schematic diagram of a flow chart of another method for calculating pixel values ​​provided in an embodiment of the present application;

[0092] Figure 8 A schematic diagram of a process for obtaining denoised image data provided in an embodiment of the present application;

[0093] Fig. 9 A schematic diagram of the structure of original image data provided in an embodiment of the present application;

[0094] Fig.10 A schematic diagram of the structure of denoised image data provided in an embodiment of the present application;

[0095] Fig.11 A schematic structural diagram of a device for reducing noise in dark areas of an image provided by another embodiment of the present application. DETAILED DESCRIPTION

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

[0097] In this application, relational terms such as first and second, etc. are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.

[0098] The present application embodiment provides a method for reducing noise in dark areas of an image. Figure 1 As shown, the specific steps include:

[0099] S101, obtaining original image data.

[0100] Specifically, since the lens may be in a relatively dark environment when shooting images, the captured color images may have color distortion. Therefore, in order to solve this problem, it is necessary to first obtain the original image data shot by the lens so as to subsequently restore the color of the original image data.

[0101] Optionally, in another embodiment of the present application, a specific implementation of step S101 is as follows: Figure 2 As shown, the following steps are included:

[0102] S201. Acquire an optical signal through a sensor.

[0103] It is understandable that the lens will project the captured light signal into the photosensitive area of ​​the image sensor, and then the noise reduction device will acquire the light signal captured by the lens through the image sensor.

[0104] Optionally, the image sensor may be a CMOS (complementary metal oxide semiconductor) or a CCD (charge coupled device). Of course, the embodiments of the present application are not limited to these two types of image sensors, and the specific ones may be selected according to the requirements.

[0105] S202: Convert the optical signal into an analog electrical signal through photoelectric conversion.

[0106] Specifically, since the optical signal is composed of photons, in order to further process the image data, the optical signal needs to be converted into an analog electrical signal through photoelectric conversion, because the analog electrical signal is a more intuitive and easy to process form and can be operated through circuit equipment.

[0107] S203: Perform analog-to-digital conversion on the analog electrical signal to obtain original image data.

[0108] It is understandable that in order to ensure the accuracy, stability and operability of the image data for subsequent computer processing, the original image data in Bayer format can be generated by performing analog-to-digital conversion (ADC) on the analog electrical signal.

[0109] S102: Preprocess the original image data to obtain processed image data.

[0110] Specifically, in order to improve image quality, increase subsequent processing efficiency, and adapt it to subsequent image analysis, processing, and application requirements, it is necessary to preprocess the original image data in advance, thereby improving image quality, reducing interference information, and thus improving processing efficiency.

[0111] Optionally, in another embodiment of the present application, a specific implementation of step S102 is as follows: Figure 3 As shown, the following steps are included:

[0112] S301 , performing black level compensation processing on original image data to obtain compensated image data.

[0113] It can be understood that in order to eliminate the current noise of the original image data under the condition of no light, black level compensation processing (Black Level Compensation) can be performed on the original image data.

[0114] Specifically, first calculate the black level value of the original image data, then subtract the black level value from the original image data, that is, the offset can be directly subtracted from the brightness value of each pixel in the image, and then ensure that the pixel value of the original image data is within the valid range. Since the brightness value of the image usually has a fixed range, after subtracting the black level offset, negative values ​​or exceeding the maximum value may appear. Therefore, it is usually necessary to crop the compensated image pixels to ensure that each pixel value is still within the allowed range. Finally, process the different color channels of the original image data, because for color images, usually each color channel (red, green, blue) needs to be compensated for the black level. The black level of each channel may be different, so each channel needs to be compensated separately.

[0115] S302: Perform bad pixel correction processing on the compensated image data to obtain bad pixel corrected image data.

[0116] It should be noted that due to image sensor defects or other reasons, bad pixels (i.e. pixels that cannot display color or brightness correctly) may appear in the original image data. The bad pixels usually appear as fixed color points in the image or areas that do not respond during the imaging process.

[0117] Therefore, after black level compensation, bad pixel correction is a necessary step to further improve image quality. The specific steps are as follows: first, detect bad pixels in the compensated image data. The bad pixel detection method can be based on static analysis, that is, detecting pixels that appear as fixed brightness or color in multiple images. Another method is to identify fixed pixels that still exist in different frames by comparing consecutive frame images. For example, if the brightness value of a pixel is always fixed to the maximum or minimum value (for example: 0 or 255), it may be a bad pixel. Then repair the bad pixels in the compensated image data. The specific repair method usually uses neighborhood interpolation or estimation based on the values ​​of other pixels. Finally, check the compensated image data after repairing the bad pixels, that is, check whether the bad pixels in the image are completely eliminated. If the repair effect is not ideal, you can try a more complex repair algorithm, or further judge and correct it through multiple images.

[0118] For example, suppose that in the image after black level compensation, a certain pixel value (such as the pixel at position (50, 100)) is always 255, which may be a bad pixel. Through the neighborhood averaging method, we can repair the bad pixel with the average value of the surrounding pixels. For example, if the average value of the pixels around the bad pixel is 120, then we set the pixel value of the bad pixel to 120 to complete the bad pixel correction.

[0119] S303: Perform shadow correction processing on the bad pixel correction image data to obtain processed image data.

[0120] It is understandable that since correcting the optical characteristics of the lens may cause the original image data to have uneven brightness at the image edge, after the bad pixel correction process, it is necessary to further perform shadow correction process on the bad pixel correction image data.

[0121] The specific steps of shadow correction are as follows: Since shadow areas usually have lower brightness values, a threshold can be set to detect these areas. For example, pixels below a certain brightness value can be detected to determine whether they are shadow areas, or based on the contrast detection method, low-contrast parts of the image can be detected, which are usually shadow areas. Secondly, once the shadow area is detected, it can be corrected by different algorithms. The shadow correction methods include: histogram equalization, shadow model-based repair, reflection model repair, edge-preserving shadow correction, and bilateral filtering correction. After shadow correction of the bad pixel correction image data, some areas of the image may be over-brightened or lack contrast. The bad pixel correction image data can be further optimized, such as brightness and contrast adjustment and high dynamic range (HDR) processing, and finally the processed image data can be obtained.

[0122] S103: Perform color processing on the processed image data to obtain corrected image data.

[0123] The corrected image data may include a grayscale value of an R channel, a grayscale value of a G channel, and a grayscale value of a B channel.

[0124] It should be noted that in order to improve or enhance the visual effect, quality and information transmission of the image, it is also necessary to perform color processing on the pre-processed original image data to correct the color cast.

[0125] Optionally, in another embodiment of the present application, a specific implementation of step S103 is as follows: Figure 4 As shown, the following steps are included:

[0126] S401, performing color interpolation processing on the processed image data to obtain an RGB image.

[0127] It should be noted that the original image data in Bayer format is a single-channel image, which uses a color filter array (CFA), usually composed of red, green and blue pixels. Bayer format images store the brightness and color information of the image through different color arrangement patterns, but each pixel has only one color channel information, so it needs to be converted to RGB format through an interpolation algorithm to restore the complete color of the image.

[0128] The specific steps are: obtain the processed image data, then use an interpolation algorithm (such as bilinear interpolation, nearest neighbor interpolation, or more complex interpolation methods) to interpolate the processed image data in Bayer format, estimate the missing red, green, and blue information, and finally fill the red, green, and blue channels of each pixel through interpolation calculations and combine them into an RGB image.

[0129] S402: Perform white balance processing on the RGB image to obtain a white balanced RGB image.

[0130] It is understandable that in order to adjust the gains of the R channel, G channel and B channel in the RGB image so that the white object can present the correct color under different lighting conditions, the RGB image will be white balanced after it is obtained.

[0131] The specific white balance processing steps are: calculate the average value of each color channel in the RGB image, and then calculate the adjustment factor corresponding to each color channel based on the average value of each color channel, so that the average value of each channel is close to a target value. Finally, use the adjustment factor corresponding to each color channel to adjust each pixel value corresponding to each color channel in the RGB channel.

[0132] S403: Perform color correction processing on the white-balanced RGB image to obtain corrected image data.

[0133] It is understandable that after white balance processing, the color of the white balance RGB image can be further adjusted to make it more consistent with the color of the real scene. Therefore, the white balance RGB image is color corrected through matrix transformation to optimize color restoration and obtain corrected image data.

[0134] S104 , determining a gamma correction method for correcting the image data according to the grayscale value of the R channel, the grayscale value of the G channel, and the grayscale value of the B channel.

[0135] It should be noted that in the embodiment of the present application, the gamma correction method (Gamma Correction) adopts a method of combining the bright area RGB Gamma and the dark area Y Gamma, which can ensure that the bright area color is bright and saturated, while reducing the saturation of the dark area of ​​the image. The gamma correction method adjusts the grayscale of the image through nonlinear operations, enhances the dark details of the image, and makes it closer to the visual perception of the human eye. Therefore, by correcting the grayscale value of the R channel, the grayscale value of the G channel, and the grayscale value of the B channel in the image data, it is determined whether to select the bright area RGB Gamma or the dark area Y Gamma in the gamma correction method as the gamma correction method for correcting the image data.

[0136] Specifically, the grayscale values ​​of the R channel, the G channel, and the B channel can be directly extracted by correcting the color value of each pixel of the image data.

[0137] Optionally, in another embodiment of the present application, a specific implementation of step S104 is as follows: Figure 5 As shown, the following steps are included:

[0138] S501, determine whether any of the grayscale values ​​of the R channel, the G channel, and the B channel has a grayscale value greater than a first preset threshold, or whether the grayscale values ​​of the R channel, the G channel, and the B channel are all greater than a second preset threshold.

[0139] Specifically, in order to determine whether it is the bright area RGB Gamma or the dark area Y Gamma, the embodiment of the present application determines by setting a threshold, that is, judging whether any of the grayscale value of the R channel (Iin_R), the grayscale value of the G channel (Iin_G) and the grayscale value of the B channel (Iin_B) is greater than the first preset threshold (thred1), or whether the grayscale value of the R channel (Iin_R), the grayscale value of the G channel (Iin_G) and the grayscale value of the B channel (Iin_B) are all greater than the second preset threshold (thred2). Therefore, if any of the grayscale values ​​of the R channel, the G channel and the B channel is greater than the first preset threshold, or the grayscale values ​​of the R channel, the G channel and the B channel are all greater than the second preset threshold, it indicates that the gamma correction method of the corrected image data is the bright area correction method, that is, the bright area RGB Gamma, and step S502 is executed. If none of the grayscale values ​​of the R channel, G channel and B channel is greater than the first preset threshold, or the grayscale values ​​of the R channel, G channel and B channel are not greater than the second preset threshold, it means that the gamma correction method of the corrected image data is the dark area correction method, that is, the dark area YGamma, and step S503 is executed.

[0140] S502: Determine that the gamma correction mode for correcting the image data is a bright area correction mode.

[0141] It can be understood that the bright area correction method RGB Gamma is a nonlinear adjustment of the three RGB color channels respectively, which affects the contrast and brightness of the image by changing the brightness of each channel. Moreover, the adjustment of RGB Gamma will affect both brightness and chromaticity information because it acts directly on the color channel. Therefore, when adjusting RGB Gamma, the saturation of the image usually does not change significantly because the relative proportion between the RGB channels remains relatively stable.

[0142] S503: Determine that the gamma correction mode for correcting the image data is a dark area correction mode.

[0143] It is understandable that the dark area correction method Y Gamma mainly acts on the brightness channel (Y channel) in the YUV color space, without directly changing the chromaticity information (U and V channels). The YUV color space separates the brightness and chromaticity of the image, where the Y channel represents the brightness information and the U and V channels represent the chromaticity information. When the Y channel is Gamma adjusted, although the brightness changes, the chromaticity information remains unchanged. Since the color perceived by the human eye is determined by brightness and chromaticity, changes in brightness will cause the ratio between the RGB channels to change. Therefore, in the embodiment of the present application, Y Gamma will increase the brightness. When the brightness is increased, the relative ratio of the RGB channels is broken, resulting in a decrease in saturation.

[0144] S105 . Calculate the pixel values ​​of the R channel, the G channel, and the B channel according to the gamma correction method.

[0145] It should be noted that in order to adjust the brightness and contrast of the corrected image data so that the corrected image data is more in line with the visual characteristics of the human eye, the pixel value of the R channel (Iout_R), the pixel value of the G channel (Iout_G), and the pixel value of the B channel (Iout_B) are calculated according to the determined gamma correction method.

[0146] Optionally, in another embodiment of the present application, when the gamma correction method of the corrected image data is a bright area correction method, a specific implementation of step S105 is as follows: Figure 6 As shown, the following steps are included:

[0147] S601: Obtain a preset gamma value.

[0148] Specifically, the preset gamma value (Gamma value) is generally 2.4 by default, of course, it can also be other thresholds, and the specific setting is based on needs.

[0149] The preset gamma value γ is a gamma value for controlling brightness.

[0150] S602: Calculate the pixel value of the R channel based on the preset gamma value and the grayscale value of the R channel.

[0151] Specifically, the calculation formula for the pixel value of the R channel (Iout_R) is: Iout_R=(1.055*(Iin_R / 255) 1 / γ -0.055) × 255.

[0152] Among them, the preset gamma value is γ, and the grayscale value of the R channel is Iin_R.

[0153] S603: Calculate the pixel value of the G channel based on the preset gamma value and the grayscale value of the G channel.

[0154] Specifically, the calculation formula for the pixel value of the G channel (Iout_G) is: Iout_G = (1.055*(Iin_G / 255) 1 / γ -0.055) × 255.

[0155] Among them, the preset gamma value is γ, and the grayscale value of the G channel is Iin_G.

[0156] S604: Calculate the pixel value of the B channel according to the preset gamma value and the gray value of the B channel.

[0157] Specifically, the calculation formula for the pixel value of the B channel (Iout_B) is: Iout_B=(1.055*(Iin_B / 255) 1 / γ-0.055) × 255.

[0158] Among them, the preset gamma value is γ, and the grayscale value of the B channel is Iin_B.

[0159] Optionally, in another embodiment of the present application, when the gamma correction method of the corrected image data is a dark area correction method, a specific implementation of step S105 is as follows: Figure 7 As shown, the following steps are included:

[0160] S701 , based on the grayscale value of the R channel, the grayscale value of the G channel, and the grayscale value of the B channel, respectively calculate a brightness component, a blue difference component, and a red difference component.

[0161] Specifically, the calculation formula of the brightness component Yin is:

[0162] Yin=0.299*Iin_R+0.587*Iin_G+0.114*Iin_B

[0163] The calculation formula of the blue difference component Cb is:

[0164] Cb=-0.1687*Iin_R-0.3313*Iin_G+0.5*Iin_B+0.502

[0165] The calculation formula of the red difference Cr is:

[0166] Cr=0.5*Iin_R-0.4187*Iin_G-0.0813*Iin_B+0.502

[0167] S702: Calculate the Y channel value of the corrected image data according to the brightness component.

[0168] Specifically, the calculation formula of the Y channel value Yout is: Yout = (1.055* (Yin / 255) 1 / γ -0.055) × 255.

[0169] S703: Calculate the pixel value of the R channel based on the Y channel value and the red difference component.

[0170] Specifically, the calculation formula of the pixel value Iout_R of the R channel is:

[0171] Iout_R=Yout+1.4075*Cr-0.7065

[0172] Among them, Yout is the Y channel value and Cr is the red difference.

[0173] S704: Calculate the pixel value of the G channel based on the Y channel value, the red difference component and the blue difference component.

[0174] Specifically, the calculation formula of the pixel value Iout_G of the G channel is:

[0175] Iout_G=Yout-0.3455*Cb-0.7169*Cr+0.5333

[0176] Among them, Yout is the Y channel value, Cr is the red difference component, and Cb is the blue difference component.

[0177] S705: Calculate the pixel value of the B channel according to the Y channel value and the blue difference component.

[0178] Specifically, the calculation formula of the pixel value Iout_B of the B channel is:

[0179] Iout_B=Yout+1.779*Cb-0.893

[0180] Among them, Yout is the Y channel value and Cb is the blue difference component.

[0181] S106 , performing image enhancement processing on the corrected image data based on the pixel values ​​of the R channel, the G channel, and the B channel to obtain denoised image data.

[0182] It can be understood that image enhancement processing is performed on the corrected image data based on the pixel values ​​of the R channel, the G channel and the B channel, which usually includes adjusting the brightness, contrast, saturation, etc. of the red (R), green (G) and blue (B) channels to improve the image quality or highlight specific image features. The image enhancement processing also includes noise reduction processing. Therefore, by performing different enhancement processing on the RGB channels, the visual effect and quality of the image can be significantly improved.

[0183] Optionally, in another embodiment of the present application, a specific implementation of step S106 is as follows: Figure 8 As shown, the following steps are included:

[0184] S801. According to the pixel values ​​of the R channel, the G channel and the B channel, the pixel values ​​of the corresponding channels of the corrected image data are adjusted to obtain the target image data.

[0185] Specifically, first extract the R, G, and B channels from the corrected image data, then make corresponding adjustments (such as brightness, contrast, saturation, etc.) to each channel according to the pixel values ​​of the R channel, G channel, and B channel, and finally merge each adjusted channel back into a complete image data to obtain the target image data.

[0186] S802: Sharpening the target image data to obtain sharpened image data.

[0187] It is understandable that in order to enhance the edge details of the target image data and thus improve the clarity of the image, further sharpening processing will be performed after adjusting and correcting the image data. The specific sharpening processing may include any one of USM (unsharp mask) and Laplace sharpening, so that the sharpened image data can be obtained.

[0188] S803: Using a filtering algorithm, perform noise reduction processing on the sharpened image data to obtain noise-reduced image data.

[0189] Specifically, after the sharpening process, the sharpened image data can be further subjected to noise reduction processing to improve the image quality. Therefore, in an embodiment of the present application, the sharpened image data is subjected to noise reduction processing through a filtering algorithm to obtain noise-reduced image data. The specific filtering algorithm can be any one or more of bilateral filtering, median filtering, mean filtering or Gaussian filtering.

[0190] It should be noted that the structural diagram of the original image data can be found in Fig. 9 The content shown, including Fig. 9 As you can see, the character's hair appears greenish in the shot, so it needs to be restored. Fig. 9 The color distortion problem will Fig. 9 After processing from step S102 to step S106, you can refer to Fig.10 The denoised image data is shown, resulting in an image with normal hair effect.

[0191] The present application provides a method for reducing noise in dark areas of an image, which obtains original image data, preprocesses the original image data, obtains processed image data, and then performs color processing on the processed image data to obtain corrected image data, wherein the corrected image data at least includes the grayscale value of the R channel, the grayscale value of the G channel, and the grayscale value of the B channel, and then determines the gamma correction method of the corrected image data according to the grayscale value of the R channel, the grayscale value of the G channel, and the grayscale value of the B channel, and then calculates the pixel values ​​of the R channel, the G channel, and the B channel according to the gamma correction method, and finally performs image enhancement processing on the corrected image data based on the pixel values ​​of the R channel, the G channel, and the B channel to obtain the reduced noise image data. Therefore, according to the gamma correction method, it can ensure that the bright area color is bright and saturated, while reducing the saturation of the dark area of ​​the image, and has a significant effect on reducing color noise, effectively solving the color distortion problem in the dark area.

[0192] Another embodiment of the present application provides a device for reducing noise in dark areas of an image. Fig.11 As shown, it includes the following units:

[0193] The image data acquisition unit 1101 is used to acquire original image data.

[0194] The preprocessing unit 1102 is used to preprocess the original image data to obtain processed image data.

[0195] The color processing unit 1103 is used to perform color processing on the processed image data to obtain corrected image data, wherein the corrected image data at least includes the grayscale value of the R channel, the grayscale value of the G channel and the grayscale value of the B channel.

[0196] The gamma correction determination unit 1104 is used to determine the gamma correction method of the corrected image data according to the grayscale value of the R channel, the grayscale value of the G channel and the grayscale value of the B channel.

[0197] The pixel value calculation unit 1105 is used to calculate the pixel values ​​of the R channel, the G channel and the B channel according to the gamma correction method.

[0198] The enhancement processing unit 1106 is used to perform image enhancement processing on the corrected image data based on the pixel values ​​of the R channel, the G channel and the B channel to obtain noise-reduced image data.

[0199] It should be noted that the specific working process of the above-mentioned units in the embodiment of the present application can refer to steps S101 to S106 in the above-mentioned method embodiment, and will not be repeated here.

[0200] Optionally, in a device for reducing noise in dark areas of an image provided by another embodiment of the present application, the image data acquisition unit 1101 includes:

[0201] The signal acquisition unit is used to acquire the optical signal through the sensor.

[0202] The conversion unit is used to convert the optical signal into an analog electrical signal through photoelectric conversion.

[0203] The analog-to-digital conversion unit is used to perform analog-to-digital conversion on the analog electrical signal to obtain original image data.

[0204] Optionally, in a device for reducing noise in dark areas of an image provided by another embodiment of the present application, the preprocessing unit 1102 includes:

[0205] The compensation processing unit is used to perform black level compensation processing on the original image data to obtain compensated image data.

[0206] The bad pixel processing unit is used to perform bad pixel correction processing on the compensated image data to obtain bad pixel corrected image data.

[0207] The shadow processing unit is used to perform shadow correction processing on the bad pixel correction image data to obtain processed image data.

[0208] Optionally, in a device for reducing noise in dark areas of an image provided by another embodiment of the present application, the color processing unit 1103 includes:

[0209] The interpolation processing unit is used to perform color interpolation processing on the processed image data to obtain an RGB image.

[0210] The white balance processing unit is used to perform white balance processing on the RGB image to obtain a white balanced RGB image.

[0211] The color processing unit is used to perform color correction processing on the white balance RGB image to obtain corrected image data.

[0212] Optionally, in a device for reducing noise in a dark area of ​​an image provided by another embodiment of the present application, the gamma correction determination unit 1104 includes:

[0213] The judgment unit is used to judge whether any of the grayscale values ​​of the R channel, the G channel and the B channel has a grayscale value greater than a first preset threshold, or whether the grayscale values ​​of the R channel, the G channel and the B channel are all greater than a second preset threshold.

[0214] The first determination unit is used to determine that the gamma correction method of the corrected image data is a bright area correction method if any one of the grayscale values ​​of the R channel, the G channel and the B channel is greater than a first preset threshold, or the grayscale values ​​of the R channel, the G channel and the B channel are all greater than a second preset threshold.

[0215] The second determination unit is used to determine that the gamma correction method of the corrected image data is a dark area correction method if none of the grayscale values ​​of the R channel, the G channel and the B channel is greater than the first preset threshold, or the grayscale values ​​of the R channel, the G channel and the B channel are not greater than the second preset threshold.

[0216] Optionally, in a dark area noise reduction device for an image provided by another embodiment of the present application, when the gamma correction method of the corrected image data is a bright area correction method, the pixel value calculation unit 1105 includes:

[0217] The obtaining unit is used to obtain a preset gamma value.

[0218] The first calculation unit is used to calculate the pixel value of the R channel based on a preset gamma value and the grayscale value of the R channel.

[0219] The second calculation unit is used to calculate the pixel value of the G channel based on the preset gamma value and the grayscale value of the G channel.

[0220] The third calculation unit is used to calculate the pixel value of the B channel according to the preset gamma value and the gray value of the B channel.

[0221] Optionally, in a device for reducing noise in dark areas of an image provided by another embodiment of the present application, when the gamma correction method of correcting the image data is a dark area correction method, the pixel value calculation unit 1105 includes:

[0222] The numerical calculation unit is used to calculate the brightness component, the blue difference component and the red difference component respectively based on the gray value of the R channel, the gray value of the G channel and the gray value of the B channel.

[0223] The fourth calculation unit is used to calculate the Y channel value of the corrected image data according to the brightness component.

[0224] The fifth calculation unit is used to calculate the pixel value of the R channel based on the Y channel value and the red difference component.

[0225] The sixth calculation unit is used to calculate the pixel value of the G channel based on the Y channel value, the red difference component and the blue difference component.

[0226] The seventh calculation unit is used to calculate the pixel value of the B channel according to the Y channel value and the blue difference component.

[0227] Optionally, in a noise reduction device for dark areas of an image provided by another embodiment of the present application, the enhancement processing unit 1106 includes:

[0228] The adjustment unit is used to adjust the pixel values ​​of the corresponding channels of the corrected image data according to the pixel values ​​of the R channel, the G channel and the B channel to obtain the target image data.

[0229] The sharpening processing unit is used to perform sharpening processing on the target image data to obtain sharpened image data.

[0230] The noise reduction processing unit is used to perform noise reduction processing on the sharpened image data using a filtering algorithm to obtain noise-reduced image data.

[0231] It should be noted that the specific working process of each unit provided in the above embodiments of the present application can refer to the corresponding steps in the above method embodiments, and will not be repeated here.

[0232] It should also be noted that the noise reduction device for dark areas of an image provided in an embodiment of the present application has the technical effects of any of the above embodiments, and the embodiments of the present application are not described in detail here.

[0233] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0234] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for reducing noise in dark areas of an image, characterized in that: include: Get the original image data; Preprocessing the original image data to obtain processed image data; Performing color processing on the processed image data to obtain corrected image data; wherein the corrected image data at least includes a grayscale value of an R channel, a grayscale value of a G channel, and a grayscale value of a B channel; Determining a gamma correction mode of the corrected image data according to the grayscale value of the R channel, the grayscale value of the G channel, and the grayscale value of the B channel; Calculating pixel values ​​of the R channel, the G channel, and the B channel according to the gamma correction method; The corrected image data is subjected to image enhancement processing based on the pixel values ​​of the R channel, the G channel and the B channel to obtain noise-reduced image data.

2. The method according to claim 1, characterized in that The obtaining of original image data comprises: Acquire optical signals through sensors; Converting the optical signal into an analog electrical signal by photoelectric conversion; Perform analog-to-digital conversion on the analog electrical signal to obtain original image data.

3. The method according to claim 1, characterized in that The preprocessing of the original image data to obtain processed image data includes: Performing black level compensation processing on the original image data to obtain compensated image data; Performing bad pixel correction processing on the compensated image data to obtain bad pixel corrected image data; The bad pixel correction image data is subjected to shadow correction processing to obtain processed image data.

4. The method according to claim 1, characterized in that: The color processing of the processed image data to obtain corrected image data includes: Performing color interpolation processing on the processed image data to obtain an RGB image; Performing white balance processing on the RGB image to obtain a white balanced RGB image; Perform color correction processing on the white-balanced RGB image to obtain corrected image data.

5. The method according to claim 1, characterized in that Determining the gamma correction method of the corrected image data according to the grayscale value of the R channel, the grayscale value of the G channel, and the grayscale value of the B channel includes: Determine whether any one of the grayscale values ​​of the R channel, the G channel, and the B channel is greater than a first preset threshold, or whether the grayscale values ​​of the R channel, the G channel, and the B channel are all greater than a second preset threshold; If any one of the grayscale values ​​of the R channel, the G channel and the B channel has a grayscale value greater than a first preset threshold, or the grayscale values ​​of the R channel, the G channel and the B channel are all greater than a second preset threshold, then determining that the gamma correction mode of the corrected image data is a bright area correction mode; If none of the grayscale values ​​of the R channel, the G channel and the B channel is greater than the first preset threshold, or the grayscale values ​​of the R channel, the G channel and the B channel are not greater than the second preset threshold, it is determined that the gamma correction method of the corrected image data is a dark area correction method.

6. The method according to claim 5, characterized in that When the gamma correction mode of the corrected image data is a bright area correction mode, calculating the pixel values ​​of the R channel, the G channel, and the B channel according to the gamma correction mode includes: Get the preset gamma value; Calculating a pixel value of the R channel based on the preset gamma value and the grayscale value of the R channel; Calculating a pixel value of the G channel based on the preset gamma value and the grayscale value of the G channel; The pixel value of the B channel is calculated according to the preset gamma value and the grayscale value of the B channel.

7. The method according to claim 5, characterized in that When the gamma correction mode of the corrected image data is a dark area correction mode, calculating the pixel values ​​of the R channel, the G channel, and the B channel according to the gamma correction mode includes: Based on the grayscale value of the R channel, the grayscale value of the G channel, and the grayscale value of the B channel, respectively calculate a brightness component, a blue difference component, and a red difference component; Calculating the Y channel value of the corrected image data according to the brightness component; Calculate the pixel value of the R channel based on the Y channel value and the red difference component; Calculate the pixel value of the G channel based on the Y channel value, the red difference component and the blue difference component; The pixel value of the B channel is calculated according to the Y channel value and the blue difference component.

8. The method according to claim 1, characterized in that The performing image enhancement processing on the corrected image data based on the pixel values ​​of the R channel, the G channel and the B channel to obtain the noise-reduced image data includes: According to the pixel values ​​of the R channel, the G channel and the B channel, the pixel values ​​of the corresponding channels of the corrected image data are adjusted to obtain the target image data; Performing sharpening processing on the target image data to obtain sharpened image data; The sharpened image data is subjected to noise reduction processing by using a filtering algorithm to obtain noise-reduced image data.

9. A device for reducing noise in dark areas of an image, characterized in that: include: An image data acquisition unit, used for acquiring original image data; A preprocessing unit, used for preprocessing the original image data to obtain processed image data; A color processing unit, used to perform color processing on the processed image data to obtain corrected image data; wherein the corrected image data at least includes a grayscale value of an R channel, a grayscale value of a G channel, and a grayscale value of a B channel; a gamma correction determination unit, configured to determine a gamma correction mode of the corrected image data according to the grayscale value of the R channel, the grayscale value of the G channel, and the grayscale value of the B channel; A pixel value calculation unit, used to calculate the pixel values ​​of the R channel, the G channel and the B channel according to the gamma correction method; The enhancement processing unit is used to perform image enhancement processing on the corrected image data based on the pixel values ​​of the R channel, the G channel and the B channel to obtain noise-reduced image data.

10. The device according to claim 9, characterized in that The image data acquisition unit comprises: A signal acquisition unit, used for acquiring an optical signal through a sensor; A conversion unit, used for converting the optical signal into an analog electrical signal through photoelectric conversion; The analog-to-digital conversion unit is used to perform analog-to-digital conversion on the analog electrical signal to obtain original image data.

Citation Information

Patent Citations

  • Self-adaptive control system of LED backlight source

    CN101833927A

  • Image processing device and method, and program

    CN103297678A

  • Method and a device for enhancing image contrast

    CN109658341A

  • Image processing method and device

    CN110139020A

  • Image enhancement method and system based on two-dimensional gamma correction and tone mapping

    CN114529475A