A method and device for reducing noise in dark regions of an image

By pre-processing and gamma correction processing on the image, especially the different gamma correction methods of bright and dark areas, the problem of color distortion in the dark areas of the image is solved, the bright colors in the bright areas and the noise reduction in the dark areas are achieved, and the visual quality of the image is improved.

CN120013805BActive Publication Date: 2025-07-25SHINING 3D TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

When processing dark areas of the image, existing image noise reduction processing technology cannot effectively solve the color distortion problem caused by noise, resulting in the color image being unreal in low-light environments.

Method used

Preprocessing is performed by acquiring the original image data, including black level compensation, bad point correction and shadow correction, followed by color processing such as color interpolation and white balance, and finally, the gamma correction method is determined based on the grayscale values of the R, G, and B channels, the pixel value is calculated and image enhancement processing is performed, especially the gamma correction methods of the bright and dark areas are different to adjust the brightness and chromaticity.

Benefits of technology

It effectively reduces the saturation of the dark area of the image, improves the reduction effect of color noise, ensures bright and saturated colors in the bright area, solves the problem of color distortion in the dark area, and improves the visual effect of the image.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120013805B_ABST
    Figure CN120013805B_ABST
Patent Text Reader

Abstract

The present application discloses a noise reduction method and device for image dark regions, which are applied to the field of computer technology and include: 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 includes the gray values of the R channel, the G channel, and the B channel; determining the gamma correction method of the corrected image data according to the gray values of the R channel, the G channel, and the B channel; calculating the pixel values of the R channel, the G channel, and the B channel according to the gamma correction method; 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. Thus, according to the gamma correction method, it can not only ensure that the bright regions have vivid and saturated colors, but also reduce the saturation of the image dark regions, and has a significant effect on reducing color noise, effectively solving the problem of color distortion in the dark regions.
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] Preprocess the original image data to obtain processed image data;

[0010] Perform color processing on the processed image data to obtain corrected image data; wherein, the corrected image data at least includes the gray values of the R channel, the G channel, and the B channel;

[0011] Determine the gamma correction method of the corrected image data according to the gray values of the R channel, the G channel, and the B channel;

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

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

[0014] Optionally, in the above noise reduction method for the dark area of the image, the obtaining of the original image data includes:

[0015] Obtain an optical signal through a sensor;

[0016] Convert the optical signal into an analog electrical signal through photoelectric conversion;

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

[0018] Optionally, in the above noise reduction method for the dark area of the image, the preprocessing of the original image data to obtain processed image data includes:

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

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

[0021] Perform shadow correction processing on the bad pixel corrected image data to obtain processed image data.

[0022] Optionally, in the above noise reduction method for the dark area of the image, the color processing of the processed image data to obtain corrected image data includes:

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

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

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

[0026] Optionally, in the above noise reduction method for the dark area of the image, the method for determining the gamma correction method of the corrected 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 includes:

[0027] Determine whether there is any gray value greater than the first preset threshold among the gray values of the R channel, the G channel, and the B channel, or whether the gray values of the R channel, the G channel, and the B channel are all greater than the second preset threshold;

[0028] If there is any gray value greater than the first preset threshold among the gray values of the R channel, the G channel, and the B channel, or if the gray values of the R channel, the G channel, and the B channel are all greater than the second preset threshold, determine that the gamma correction method of the corrected image data is the bright area correction method;

[0029] If there is no gray value greater than the first preset threshold among the gray values of the R channel, the G channel, and the B channel, or if the gray values of the R channel, the G channel, and the B channel are all not greater than the second preset threshold, determine that the gamma correction method of the corrected image data is the dark area correction method.

[0030] Optionally, in the above noise reduction method for the dark area of the image, when the gamma correction method of the corrected image data is the bright area correction method, the method for calculating the pixel values of the R channel, the G channel, and the B channel according to the gamma correction method includes:

[0031] Obtain a preset gamma value;

[0032] Based on the preset gamma value and the gray value of the R channel, calculate the pixel value of the R channel;

[0033] Based on the preset gamma value and the gray value of the G channel, calculate the pixel value of the G channel;

[0034] According to the preset gamma value and the gray value of the B channel, calculate the pixel value of the B channel.

[0035] Optionally, in the above noise reduction method for the dark area of the image, when the gamma correction method of the corrected image data is the dark area correction method, the method for calculating the pixel values of the R channel, the G channel, and the B channel according to the gamma correction method includes:

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

[0037] Calculate the Y-channel value of the corrected image data according to the luminance 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] Calculate the pixel value of the B channel according to the Y-channel value and the blue difference component.

[0041] Optionally, in the above noise reduction method for the dark area of the image, the image enhancement processing of the corrected image data based on the pixel values of the R channel, the G channel, and the B channel to obtain the noise reduction image data includes:

[0042] 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;

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

[0044] Use a filtering algorithm to perform noise reduction processing on the sharpened image data to obtain the noise reduction image data.

[0045] The second aspect of the present application provides a noise reduction device for the dark area of an image, including:

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

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

[0048] A color processing unit for performing color processing on the processed image data to obtain the corrected image data; wherein, the corrected image data at least includes the gray value of the R channel, the gray value of the G channel, and the gray value of the B channel;

[0049] A gamma correction determination unit for determining the gamma correction method of the corrected 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;

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

[0051] An enhancement processing unit for 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 reduction image data.

[0052] Optionally, in the noise reduction device for the dark area of the image described above, the image data acquisition unit includes:

[0053] A signal acquisition unit, configured to acquire an optical signal through a sensor;

[0054] A conversion unit, configured to convert the optical signal into an analog electrical signal through photoelectric conversion;

[0055] An analog-to-digital conversion unit, configured to perform analog-to-digital conversion on the analog electrical signal to obtain original image data.

[0056] Optionally, in the noise reduction device for the dark area of the image described above, the preprocessing unit includes:

[0057] A compensation processing unit, configured to perform black level compensation processing on the original image data to obtain compensated image data;

[0058] A bad pixel processing unit, configured to perform bad pixel correction processing on the compensated image data to obtain bad pixel corrected image data;

[0059] A shadow processing unit, configured to perform shadow correction processing on the bad pixel corrected image data to obtain processed image data.

[0060] Optionally, in the noise reduction device for the dark area of the image described above, the color processing unit includes:

[0061] An interpolation processing unit, configured to perform color interpolation processing on the processed image data to obtain an RGB image;

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

[0063] A color processing unit, configured to perform color correction processing on the white balance RGB image to obtain corrected image data.

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

[0065] A judgment unit, configured to judge whether there is any gray value greater than a first preset threshold among the gray values of the R channel, the G channel, and the B channel, or whether the gray values of the R channel, the G channel, and the B channel are all greater than a second preset threshold;

[0066] A first determination unit, configured to determine that the gamma correction method of the corrected image data is a bright area correction method if there is any gray value greater than a first preset threshold among the gray values of the R channel, the G channel, and the B channel, or if the gray values of the R channel, the G channel, and the B channel are all greater than a second preset threshold;

[0067] A second determination unit, configured to determine that the gamma correction method of the corrected image data is a dark area correction method if there is no gray value greater than a first preset threshold among the gray values of the R channel, the G channel, and the B channel, or if the gray values of the R channel, the G channel, and the B channel are all not greater than a second preset threshold.

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

[0069] An acquisition unit, configured to acquire a preset gamma value;

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

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

[0072] A third calculation unit, configured to calculate the pixel value of the B channel according to the preset gamma value and the gray value of the B channel.

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

[0074] A numerical calculation unit, configured to calculate a luminance component, a blue difference component, and a 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;

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

[0076] A fifth calculation unit, configured to calculate the 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 the pixel value of the G channel based on the Y channel value, the red difference component, and the blue difference component;

[0078] A seventh calculation unit, configured to calculate the pixel value of the B channel according to the Y channel value and the blue difference component.

[0079] Optionally, in the noise reduction device for the dark area of the image described above, the enhancement processing unit includes:

[0080] An adjustment unit for adjusting 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 target image data;

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

[0082] A noise reduction processing unit for performing noise reduction processing on the sharpened image data by using a filtering algorithm to obtain noise-reduced image data.

[0083] A noise reduction method for the dark area of an image provided by the present application includes: obtaining original image data, secondly preprocessing the original image data to obtain processed image data, then performing color processing on the processed image data to obtain corrected image data, where the corrected image data at least includes the gray values of the R channel, the G channel, and the B channel, then determining the gamma correction method of the corrected image data according to the gray values of the R channel, the G channel, and the B channel, subsequently calculating the pixel values of the R channel, the G channel, and the B channel according to the gamma correction method, and finally 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-reduced image data. Thus, according to the gamma correction method, it can not only ensure that the bright area has bright and saturated colors, but also reduce the saturation of the dark area of the image, and has a significant effect on reducing color noise, effectively solving the problem of color distortion in the dark area. Description of the Drawings

[0084] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the following drawings are only the embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained according to the provided drawings.

[0085] Figure 1 It is a schematic flowchart of a noise reduction method for the dark area of an image provided by an embodiment of the present application;

[0086] Figure 2 It is a schematic flowchart of a method for obtaining original image data provided by an embodiment of the present application;

[0087] Figure 3 It is a schematic flowchart of a method for obtaining processed image data provided by an embodiment of the present application;

[0088] Figure 4 Schematic flow chart of a method for obtaining corrected image data provided by an embodiment of the present application;

[0089] Figure 5 Schematic flow chart of a method for determining a gamma correction method provided by an embodiment of the present application;

[0090] Figure 6 Schematic flow chart of a method for calculating pixel values provided by an embodiment of the present application;

[0091] Figure 7 Schematic flow chart of another method for calculating pixel values provided by an embodiment of the present application;

[0092] Figure 8 Schematic flow chart of a method for obtaining noise-reduced image data provided by an embodiment of the present application;

[0093] Figure 9 Schematic diagram of the structure of original image data provided by an embodiment of the present application;

[0094] Figure 10 Schematic diagram of the structure of noise-reduced image data provided by an embodiment of the present application;

[0095] Figure 11 Schematic diagram of the structure of a noise reduction device for the dark area of an image provided by another embodiment of the present application. Detailed implementation manners

[0096] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.

[0097] In the present application, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover a non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the phrase "including a..." does not exclude the existence of additional identical elements in the process, method, article or device including the element.

[0098] An embodiment of the present application provides a method for reducing noise in dark areas of an image, as follows Figure 1 shown, which specifically includes the following steps:

[0099] S101. Obtain the original image data.

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

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

[0102] S201. Obtain the optical signal through the sensor.

[0103] It can be understood that the lens projects the captured optical signal onto the photosensitive area of the image sensor, and then the noise reduction device obtains the optical signal captured by the lens from the image sensor.

[0104] Optionally, the image sensor can 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 specifically can be selected according to 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, it is necessary to convert the optical signal into an analog electrical signal through photoelectric conversion, because the analog electrical signal is a relatively intuitive and easy-to-process form and can be operated by circuit devices.

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

[0108] It can be understood that for subsequent computer processing to ensure the accuracy, stability, and operability of the image data, therefore, the analog electrical signal can be subjected to analog-to-digital conversion (ADC) to generate the original image data in Bayer format.

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

[0110] Specifically, in order to improve the image quality, enhance the subsequent processing efficiency, and make it adapt to the subsequent image analysis, processing, and application requirements, it is necessary to preprocess the original image data in advance, so as to improve the image quality, reduce interference information, and further improve the processing efficiency.

[0111] Optionally, in another embodiment of the present application, a specific implementation manner of step S102 is as Figure 3 shown, and it includes the following steps:

[0112] S301. Perform black level compensation processing on the 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, and 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. Then ensure that the pixel values of the original image data are 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 values exceeding the maximum value may occur. Therefore, usually, it is necessary to clip 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 a color image, usually each color channel (red, green, blue) needs to be subjected to black level compensation processing. The black level of each channel may be different, so it is necessary to compensate each channel 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 correctly display colors or brightness) may appear in the original image data. Among them, bad pixels usually appear as fixed color points in the image or areas with no response 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 method for detecting bad pixels can be based on static analysis, that is, detecting pixels that appear as fixed brightness or color in multiple images. Another method is to compare consecutive frame images to identify fixed pixels that still exist in different frames. For example, if the brightness value of a certain pixel is always fixed at the maximum or minimum value (e.g., 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, more complex repair algorithms can be tried, or further judgment and correction can be made through multiple images.

[0118] For example, assume that in the image after black level compensation, the value of a certain pixel (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 this bad pixel with the average value of the surrounding pixels. For example, if the average value of the surrounding pixels of this bad pixel is 120, then we set the pixel value of this bad pixel to 120 to complete the correction of the bad pixel.

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

[0120] It can be understood that due to the optical characteristics of the correction lens, the original image data may have uneven brightness at the image edge. Therefore, after bad pixel correction processing, it is necessary to further perform shadow correction processing on the bad pixel corrected image data.

[0121] The specific shadow correction steps are as follows: Since the shadow area usually has lower brightness values, a threshold can be set to detect these areas. For example, by detecting pixels below a certain brightness value, it can be determined whether it is a shadow area, or based on the contrast detection method, that is, the low-contrast parts of the image can be detected, and these parts are usually shadow areas. Secondly, once the shadow area is detected, it can be corrected through different algorithms. The shadow correction methods include: histogram equalization, restoration based on the shadow model, reflection model restoration, shadow correction based on edge preservation, and bilateral filtering correction. Then, after performing shadow correction on the bad pixel corrected image data, there may be over-brightening or insufficient contrast in some areas of the image. The bad pixel corrected image data can be further optimized, such as brightness and contrast adjustment and high dynamic range (HDR) processing. Finally, the processed image data can be obtained.

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

[0123] Among them, the corrected image data may include the gray values of the R channel, the gray values of the G channel, and the gray values of the B channel.

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

[0125] Optionally, in another embodiment of the present application, a specific implementation manner of step S103, as Figure 4 shown, includes the following steps:

[0126] S401. Perform 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. The image in Bayer format stores the luminance and color information of the image through different color arrangement patterns, but each pixel only has the information of one color channel. Therefore, it is necessary to convert it to RGB format through an interpolation algorithm to restore the complete color of the image.

[0128] The specific steps are as follows: Obtain the processed image data, and 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 through interpolation calculation, fill the red, green, and blue channels of each pixel and combine them into an RGB image.

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

[0130] It can be understood that in order to adjust the gains of the R channel, G channel, and B channel in the RGB image so that white objects can present the correct color under different lighting conditions, after obtaining the RGB image, white balance processing is also performed on the RGB image.

[0131] The specific white balance processing steps are as follows: Calculate the average value of each color channel in the RGB image, and then calculate the adjustment factor corresponding to each color channel according to the mean value of each color channel, so that the mean 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 channels.

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

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

[0134] S104. Determine the gamma correction method of the corrected image data according to the gray values of the R channel, the G channel, and 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 combining bright area RGB Gamma and dark area Y Gamma, which can not only ensure that the colors in the bright area are bright and saturated, but also reduce the saturation of the dark area of the image. The gamma correction method adjusts the gray level of the image through non-linear operations, enhances the dark details of the image, and makes it closer to the visual perception of the human eye. Therefore, the gray values of the R channel, the G channel, and the B channel in the corrected image data are used to determine whether to select bright area RGB Gamma or dark area Y Gamma in the gamma correction method as the gamma correction method of the corrected image data.

[0136] Specifically, the gray values of the R channel, the G channel, and the B channel can be directly extracted from the color values of each pixel of the corrected image data.

[0137] Optionally, in another embodiment of the present application, a specific implementation manner of step S104 is as Figure 5 shown, and includes the following steps:

[0138] S501. Determine whether there is any gray value greater than the first preset threshold among the gray values of the R channel, the G channel, and the B channel, or whether the gray values of the R channel, the G channel, and the B channel are all greater than the second preset threshold.

[0139] Specifically, in order to determine whether it is the bright-region RGB Gamma or the dark-region Y Gamma, the embodiments of the present application determine it by setting thresholds, that is, to determine whether there is any gray value greater than the first preset threshold (thred1) among the gray values of the R channel (Iin_R), the gray values of the G channel (Iin_G), and the gray values of the B channel (Iin_B), or whether the gray values of the R channel (Iin_R), the gray values of the G channel (Iin_G), and the gray values of the B channel (Iin_B) are all greater than the second preset threshold (thred2). Therefore, if there is any gray value greater than the first preset threshold among the gray values of the R channel, the G channel, and the B channel, or the gray 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 for correcting the image data is the bright-region correction method, that is, the bright-region RGB Gamma, and step S502 is executed. If there is no gray value greater than the first preset threshold among the gray values of the R channel, the G channel, and the B channel, or the gray values of the R channel, the G channel, and the B channel are not all greater than the second preset threshold, it indicates that the gamma correction method for correcting the image data is the dark-region correction method, that is, the dark-region Y Gamma, and step S503 is executed.

[0140] S502. Determine that the gamma correction method for correcting the image data is the bright-region correction method.

[0141] It can be understood that the bright-region correction method RGB Gamma performs non-linear adjustment on the three color channels of RGB respectively, affects the contrast and light and darkness of the image by changing the brightness of each channel, and the adjustment of RGB Gamma will affect both the brightness and chromaticity information at the same time. Because it acts directly on the color channels, when adjusting RGB Gamma, the saturation of the image usually does not change significantly because the relative ratio between the RGB channels remains relatively stable.

[0142] S503. Determine that the gamma correction method for correcting the image data is the dark-region correction method.

[0143] It can be understood that the dark-region correction method Y Gamma mainly acts on the luminance channel (Y channel) in the YUV color space and does not directly change the chromaticity information (U and V channels). The YUV color space separates the luminance and chromaticity of the image, where the Y channel represents the luminance information and the U and V channels represent the chromaticity information. When performing Gamma adjustment on the Y channel, although the luminance changes, the chromaticity information remains unchanged. Since the color perceived by the human eye is jointly determined by the luminance and chromaticity, the change in luminance will cause a change in the ratio between the RGB channels. Therefore, in the embodiments of the present application, Y Gamma will increase the luminance. When the luminance increases, 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, G channel, and 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 to make the corrected image data more in line with the visual characteristics of the human eye, the pixel values of the R channel (Iout_R), G channel (Iout_G), and B channel (Iout_B) will be 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 the bright area correction method, a specific implementation manner of step S105 is as follows Figure 6 shown, including the following steps:

[0147] S601. Obtain the preset gamma value.

[0148] Specifically, the preset gamma value (Gamma value) is generally defaulted to 2.4. Of course, it can also be other thresholds, which are specifically set according to requirements.

[0149] Among them, the preset gamma value γ is the Gamma value for controlling brightness.

[0150] S602. Calculate the pixel value of the R channel based on the preset gamma value and the gray 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 gray 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 gray 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 gray 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] Wherein, the preset gamma value is γ, and the gray value of the B channel is Iin_B.

[0159] Optionally, in another embodiment of the present application, when the gamma correction method for correcting image data is the dark area correction method, a specific implementation manner of step S105 is as Figure 7 shown, including the following steps:

[0160] S701. Calculate the luminance 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.

[0161] Specifically, the calculation formula for the luminance component Yin is:

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

[0163] The calculation formula for 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 for the red difference component 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 luminance component.

[0168] Specifically, the calculation formula for 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 for the pixel value Iout_R of the R channel is:

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

[0172] Wherein, Yout is the Y channel value, and Cr is the red difference component.

[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 for the pixel value Iout_G of the G channel is as follows:

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

[0176] Wherein, 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 for the pixel value Iout_B of the B channel is as follows:

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

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

[0181] S106. Perform image enhancement processing on the corrected image data based on the pixel values of the R channel, G channel, and B channel to obtain noise-reduced image data.

[0182] It can be understood that performing image enhancement processing on the corrected image data based on the pixel values of the R channel, G channel, and B channel generally includes adjusting the brightness, contrast, saturation, etc. of the red (R), green (G), and blue (B) channels to improve the quality of the image or highlight specific image features. Among them, noise reduction processing is also included in the image enhancement processing. Therefore, by performing different enhancement processes 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 manner of step S106 is as follows Figure 8 shown, including the following steps:

[0184] S801. Adjust the pixel values of the corresponding channels of the corrected image data according to the pixel values of the R channel, G channel, and B channel to obtain target image data.

[0185] Specifically, first extract the R, G, and B channels from the corrected image data, then perform corresponding adjustments (such as brightness, contrast, saturation, etc.) on 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. Perform sharpening processing on the target image data to obtain sharpened image data.

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

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

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

[0190] It should be noted that the structural schematic diagram of the original image data can be referred to Figure 9 the content shown, in which according to Figure 9 what can be seen, the shooting effect of the person's hair shows a greenish tint, so it is necessary to restore Figure 9 the color distortion problem, so Figure 9 after the processing of steps S102 to S106, the noise-reduced image data shown in Figure 10 can be referred to, so as to obtain an image with normal hair effect.

[0191] A method for reducing noise in the dark area of an image provided by the present application includes obtaining original image data, secondly preprocessing the original image data to obtain processed image data, then performing color processing on the processed image data to obtain corrected image data, where the corrected image data at least includes the gray values of the R channel, the G channel, and the B channel, and then determining the gamma correction method of the corrected image data according to the gray values of the R channel, the G channel, and the B channel, subsequently calculating the pixel values of the R channel, the G channel, and the B channel according to the gamma correction method, and finally 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-reduced image data. Thus, according to the gamma correction method, it can not only ensure that the bright area has bright and saturated colors, but also reduce 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 the dark area of an image, as Figure 11 shown, including the following units:

[0193] An image data acquisition unit 1101, configured to acquire original image data.

[0194] A preprocessing unit 1102 for preprocessing the original image data to obtain processed image data.

[0195] A color processing unit 1103 for performing color processing on the processed image data to obtain calibrated image data. The calibrated image data includes at least the gray values of the R channel, the G channel, and the B channel.

[0196] A gamma correction determination unit 1104 for determining the gamma correction method of the calibrated image data according to the gray values of the R channel, the G channel, and the B channel.

[0197] A pixel value calculation unit 1105 for calculating the pixel values of the R channel, the G channel, and the B channel according to the gamma correction method.

[0198] An enhancement processing unit 1106 for performing image enhancement processing on the calibrated 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 processes of the above units in the embodiments of the present application may be correspondingly referred to the steps S101 to S106 in the above method embodiments, and will not be elaborated here.

[0200] Optionally, in an image dark area noise reduction device provided in another embodiment of the present application, the image data acquisition unit 1101 includes:

[0201] A signal acquisition unit for acquiring an optical signal through a sensor.

[0202] A conversion unit for converting the optical signal into an analog electrical signal through photoelectric conversion.

[0203] An analog-to-digital conversion unit for performing analog-to-digital conversion on the analog electrical signal to obtain the original image data.

[0204] Optionally, in an image dark area noise reduction device provided in another embodiment of the present application, the preprocessing unit 1102 includes:

[0205] A compensation processing unit for performing black level compensation processing on the original image data to obtain compensated image data.

[0206] A bad pixel processing unit for performing bad pixel correction processing on the compensated image data to obtain bad pixel corrected image data.

[0207] A shadow processing unit for performing shadow correction processing on the bad pixel corrected image data to obtain processed image data.

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

[0209] An interpolation processing unit for performing color interpolation processing on the processed image data to obtain an RGB image.

[0210] A white balance processing unit for performing white balance processing on the RGB image to obtain a white balance RGB image.

[0211] A color processing unit for performing color correction processing on the white balance RGB image to obtain corrected image data.

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

[0213] A judgment unit for judging whether there is any gray value greater than a first preset threshold among the gray values of the R channel, G channel, and B channel, or whether the gray values of the R channel, G channel, and B channel are all greater than a second preset threshold.

[0214] A first determination unit for determining that the gamma correction method of the corrected image data is a bright area correction method if there is any gray value greater than a first preset threshold among the gray values of the R channel, G channel, and B channel, or if the gray values of the R channel, G channel, and B channel are all greater than a second preset threshold.

[0215] A second determination unit for determining that the gamma correction method of the corrected image data is a dark area correction method if there is no gray value greater than a first preset threshold among the gray values of the R channel, G channel, and B channel, or if the gray values of the R channel, G channel, and B channel are all not greater than a second preset threshold.

[0216] Optionally, in a noise reduction device for an image dark area 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] An acquisition unit for acquiring a preset gamma value.

[0218] A first calculation unit for calculating the pixel value of the R channel based on the preset gamma value and the gray value of the R channel.

[0219] A second calculation unit for calculating the pixel value of the G channel based on the preset gamma value and the gray value of the G channel.

[0220] A third calculation unit for calculating 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 noise reduction device for an image dark area provided by another embodiment of the present application, when the gamma correction method for correcting image data is a dark area correction method, the pixel value calculation unit 1105 includes:

[0222] A numerical calculation unit for calculating a luminance component, a blue difference component, and a 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] A fourth calculation unit for calculating the Y channel value of the corrected image data according to the luminance component.

[0224] A fifth calculation unit for calculating the pixel value of the R channel based on the Y channel value and the red difference component.

[0225] A sixth calculation unit for calculating the pixel value of the G channel based on the Y channel value, the red difference component, and the blue difference component.

[0226] A seventh calculation unit for calculating 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 an image dark area provided by another embodiment of the present application, the enhancement processing unit 1106 includes:

[0228] An adjustment unit for adjusting 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 target image data.

[0229] A sharpening processing unit for performing sharpening processing on the target image data to obtain sharpened image data.

[0230] A noise reduction processing unit for performing noise reduction processing on the sharpened image data by using a filtering algorithm to obtain noise-reduced image data.

[0231] It should be noted that the specific working processes of the respective units provided in the above embodiments of the present application may be correspondingly referred to the corresponding steps in the above method embodiments, and will not be elaborated here.

[0232] It should also be noted that a noise reduction device for an image dark area provided by an embodiment of the present application has the technical effects of any one of the above embodiments, and will not be elaborated here in the embodiments of the present application.

[0233] Those skilled in the art may further realize that the units and algorithm steps of each example described in connection with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.

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

Claims

1. A noise reduction method for dark areas of an image, characterized in that, Including: Obtain original image data; Preprocess the original image data to obtain processed image data; Perform color processing on the processed image data to obtain calibrated image data; wherein, the calibrated image data at least includes the gray value of the R channel, the gray value of the G channel, and the gray value of the B channel; the gray values of the R channel, the G channel, and the B channel are directly extracted through the color values of each pixel of the calibrated image data; Determine the gamma correction method of the calibrated 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; Calculate the pixel values of the R channel, the G channel, and the B channel according to the gamma correction method; Perform image enhancement processing on the calibrated image data based on the pixel values of the R channel, the G channel, and the B channel to obtain noise-reduced image data; Among them, the determining the gamma correction method of the calibrated 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 includes: Judge whether there is any gray value greater than the first preset threshold among the gray values of the R channel, the G channel, and the B channel, or whether the gray values of the R channel, the G channel, and the B channel are all greater than the second preset threshold; If there is any gray value greater than the first preset threshold among the gray values of the R channel, the G channel, and the B channel, or the gray values of the R channel, the G channel, and the B channel are all greater than the second preset threshold, then determine that the gamma correction method of the calibrated image data is the bright area correction method; the bright area correction method is Bright Area RGB Gamma; If there is no gray value greater than the first preset threshold among the gray values of the R channel, the G channel, and the B channel, or the gray values of the R channel, the G channel, and the B channel are all not greater than the second preset threshold, then determine that the gamma correction method of the calibrated image data is the dark area correction method; the dark area correction method is Dark Area Y Gamma.

2. The method according to claim 1, wherein The obtaining the original image data includes: Obtain an optical signal through a sensor; Convert the optical signal into an analog electrical signal through photoelectric conversion; Perform analog-to-digital conversion on the analog electrical signal to obtain original image data.

3. The method according to claim 1, wherein The preprocessing the original image data to obtain processed image data includes: Perform black level compensation processing on the original image data to obtain compensated image data; Perform bad pixel correction processing on the compensated image data to obtain bad pixel corrected image data; Perform shadow correction processing on the bad pixel corrected image data to obtain processed image data.

4. The method according to claim 1, wherein The performing color processing on the processed image data to obtain calibrated image data includes: Perform color interpolation processing on the processed image data to obtain an RGB image; Perform white balance processing on the RGB image to obtain a white balance RGB image; Perform color correction processing on the white balance RGB image to obtain calibrated image data.

5. The method according to claim 1, wherein When the gamma correction method for the corrected image data is the bright area correction method, calculating the pixel values of the R channel, the G channel, and the B channel according to the gamma correction method includes: Obtain a preset gamma value; Calculate the pixel value of the R channel based on the preset gamma value and the gray value of the R channel; Calculate the pixel value of the G channel based on the preset gamma value and the gray value of the G channel; Calculate the pixel value of the B channel according to the preset gamma value and the gray value of the B channel.

6. The method according to claim 1, characterized in that When the gamma correction method for the corrected image data is the dark area correction method, calculating the pixel values of the R channel, the G channel, and the B channel according to the gamma correction method includes: Calculate the luminance component, the blue difference component, and the red difference component based on the gray values of the R channel, the G channel, and the B channel respectively; Calculate the Y channel value of the corrected image data according to the luminance 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; Calculate the pixel value of the B channel according to the Y channel value and the blue difference component.

7. The method according to claim 1, characterized in that, The image enhancement processing of 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: 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; Perform sharpening processing on the target image data to obtain the sharpened image data; Use a filtering algorithm to perform noise reduction processing on the sharpened image data to obtain the noise-reduced image data.

8. A noise reduction device for an image dark area, characterized in that, Including: An image data acquisition unit for acquiring original image data; A preprocessing unit for preprocessing the original image data to obtain processed image data; A color processing unit for performing color processing on the processed image data to obtain corrected image data; wherein, the corrected image data at least includes the gray values of the R channel, the G channel, and the B channel; the gray values of the R channel, the G channel, and the B channel are directly extracted from the color values of each pixel of the corrected image data; A gamma correction determination unit for determining the gamma correction method of the corrected image data according to the gray values of the R channel, the G channel, and the B channel; A pixel value calculation unit for calculating the pixel values of the R channel, the G channel, and the B channel according to the gamma correction method; An enhancement processing unit for 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; Among them, the gamma correction determination unit includes: A judgment unit, configured to judge whether there is any gray value greater than a first preset threshold among the gray values of the R channel, the G channel, and the B channel, or whether the gray values of the R channel, the G channel, and the B channel are all greater than a second preset threshold; A first determination unit, configured to determine that the gamma correction method of the corrected image data is a bright area correction method if there is any gray value greater than a first preset threshold among the gray values of the R channel, the G channel, and the B channel, or if the gray values of the R channel, the G channel, and the B channel are all greater than a second preset threshold; the bright area correction method is bright area RGBGamma; A second determination unit, configured to determine that the gamma correction method of the corrected image data is a dark area correction method if there is no gray value greater than a first preset threshold among the gray values of the R channel, the G channel, and the B channel, or if the gray values of the R channel, the G channel, and the B channel are all not greater than a second preset threshold; the dark area correction method is dark area YGamma.

9. The device according to claim 8, characterized in that, The image data acquisition unit includes: A signal acquisition unit, configured to acquire an optical signal through a sensor; A conversion unit, configured to convert the optical signal into an analog electrical signal through photoelectric conversion; An analog-to-digital conversion unit, configured to perform analog-to-digital conversion on the analog electrical signal to obtain original image data.

Citation Information

Patent Citations

  • Method and a device for enhancing image contrast

    CN109658341A

  • Image processing method, system and device, electronic equipment and storage medium

    CN119545195A