Method and apparatus for reducing image noise, computer readable storage medium, terminal
By performing data resampling and pixel-level fusion on the image using two processing methods, the problem of complex noise removal and severe color loss in existing technologies is solved, achieving the effect of preserving the true color of the image while removing noise.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SPREADTRUM COMMUNICATION (SHANGHAI) CO LTD
- Filing Date
- 2022-12-23
- Publication Date
- 2026-05-29
AI Technical Summary
Existing image denoising techniques are complex and resource-intensive, or they fail to effectively preserve the colors of real objects in the image, resulting in severe color loss.
Two processing methods are used to process the image to be processed. The first data processing adds at least one round of data resampling to generate a first image with better noise filtering effect and a second image that retains more real colors. Then, through pixel-level fusion processing, the fusion weight is determined by combining pixel differences and texture degree to achieve a balance between noise removal and color preservation.
While removing chromatic noise, it effectively preserves the colors of real objects in the image, reduces color loss, reduces computational load, and improves denoising uniformity and efficiency.
Smart Images

Figure CN115797223B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and in particular to a method and apparatus for reducing image noise, a computer-readable storage medium, and a terminal. Background Technology
[0002] In the field of image technology, image noise is a kind of interference in an image. On the one hand, it affects the subjective visual perception of the human eye on the image, and on the other hand, it affects the subsequent research and application of the image, and may even lead to erroneous results.
[0003] However, existing image denoising techniques are either complex and difficult to implement, consuming a lot of resources, or they cannot preserve the colors of real objects in the image, resulting in severe color loss.
[0004] There is an urgent need for a method to reduce image noise that can remove chromatic noise while preserving the colors of real objects in the image and reducing color loss. Summary of the Invention
[0005] One of the technical problems to be solved by this application is to provide a method and apparatus, computer-readable storage medium and terminal for reducing image noise, which can retain the colors of real objects in the image while removing chromatic noise and reducing color loss.
[0006] In a first aspect, embodiments of this application provide a method for reducing image noise. The method includes: performing a first data processing and a second data processing on the image to be processed to obtain a first image and a second image, wherein the first data processing adds at least one round of data resampling processing compared to the second data processing; determining a fusion weight value for each pixel based on the first image and the second image; and using the fusion weight values to perform pixel-level fusion processing on the first image and the second image to obtain a fused image.
[0007] Optionally, the additional data resampling process in each round of the first data processing compared to the second data processing includes: downsampling the U and V values of the image to be processed; upsampling the U and V values of the downsampled image; wherein, in each round of data resampling, the sampling factor of the downsampling process is the same as the sampling factor of the upsampling process.
[0008] Optionally, the first data processing includes: downsampling the U and V values of the image to be processed; filtering the U and V values of the downsampled image; and upsampling the U and V values of the filtered image.
[0009] Optionally, the second data processing includes: filtering the U-values and V-values of the image to be processed; wherein the number of filtering operations performed on the U-values and V-values of the image to be processed is the same as the number of filtering operations performed on the U-values and V-values of the downsampled image.
[0010] Optionally, before performing the first data processing and the second data processing on the image to be processed respectively, the method further includes: calibrating the noise of the image to be processed based on the brightness value of the image to be processed; wherein, the greater the noise of the image to be processed, the coarser the granularity of filtering the U value and V value of the image to be processed.
[0011] Optionally, before performing the first data processing and the second data processing on the image to be processed respectively, the method further includes: calibrating the noise of the image to be processed based on the brightness value of the image to be processed; wherein, the greater the noise, the greater the sampling multiple in each round of data resampling processing in the first data processing compared to the second data processing.
[0012] Optionally, the second data processing includes: performing bad pixel removal preprocessing on the image to be processed.
[0013] Optionally, before performing the first data processing and the second data processing on the image to be processed respectively, the method further includes: calibrating the noise of the image to be processed based on the brightness value of the image to be processed; wherein, the greater the noise, the more bad pixels are removed in the bad pixel removal preprocessing.
[0014] Optionally, determining the fusion weight value of each pixel based on the first image and the second image includes: determining the pixel difference weight of each pixel based on the difference between the U value and the difference between the V value of each pixel in the first image and the second image; determining the pixel texture weight of each pixel based on the U value and the V value of each pixel in the image to be processed or the second image; and determining the fusion weight value for each pixel based on the product of the pixel difference weight and the pixel texture weight.
[0015] Optionally, the pixel difference weight of each pixel is determined based on the difference between the U-values and the difference between the V-values of each pixel in the first image and the second image, including: determining the difference between the U-values and the difference between the V-values of each pixel in the first image and the second image; determining the pixel difference value of the pixel based on the comparison relationship between the difference between the U-values and the difference between the V-values of each pixel; and determining the pixel difference weight of each pixel based on a preset fitting relationship between the pixel difference value and the weight value.
[0016] Optionally, the pixel difference value for each pixel can be determined using the following formula:
[0017] diff=max(abs(U1-U2),abs(V1-V2))
[0018] Where, diff is used to represent pixel difference values, max() is used to represent the maximum value function, abs() is used to represent the absolute value function, U1 and U2 are used to represent the U value of the same pixel in the first image and the second image respectively, and V1 and V2 are used to represent the V value of the same pixel in the first image and the second image respectively.
[0019] Optionally, the pixel difference weight for each pixel can be determined using the following formula:
[0020] alphaDiff=curve(diff,diff_lut_x,alpha_lut_y)
[0021] Wherein, alphaDiff is used to represent the pixel difference value weight, diff_lut_x is used to represent the selectable range of pixel difference values, alpha_lut_y is used to represent the weight value, and 0≤alpha_lut_y≤1, curve() is used to represent the preset fitting relationship function, and curve(diff,diff_lut_x,alpha_lut_y) is used to represent the preset fitting relationship between pixel difference values and weight values when the pixel difference values are within the selectable range of pixel difference values.
[0022] Optionally, the pixel texture degree weight of each pixel is determined based on the U-value and V-value of each pixel in the image to be processed or the second image, including: determining the absolute value of the difference between the U-value of each pixel in the image to be processed or the second image and the mean U-value, wherein the mean U-value is the average of the U-values of multiple pixels within a preset range centered on that pixel; determining the absolute value of the difference between the V-value of each pixel in the image to be processed or the second image and the mean V-value, wherein the mean V-value is the average of the V-values of multiple pixels within a preset range centered on that pixel; determining the pixel texture degree of the pixel based on the comparison relationship between the absolute values of the U-value differences and the absolute values of the V-value differences of each pixel; and determining the pixel texture degree weight of each pixel based on a preset fitting relationship between the pixel texture degree and the weight value.
[0023] Optionally, the pixel texture level of each pixel can be determined using the following formula:
[0024] sadU = abs(U0 - mean(U0))
[0025] sadV = abs(V0 - mean(V0))
[0026] Sad = max(sadU, sadV)
[0027] Wherein, sadU represents the difference between the U value of a single pixel in the image to be processed or the second image and the mean U value; abs() represents the absolute value function; U0 represents the U value of a single pixel in the image to be processed or the second image; mean(U0) represents the mean U value of a single pixel in the image to be processed or the second image; sadV represents the difference between the V value of a single pixel in the image to be processed or the second image and the mean V value; V0 represents the V value of a single pixel in the image to be processed or the second image; mean(V0) represents the mean V value of a single pixel in the image to be processed or the second image; Sad represents the pixel texture level; and max() represents the maximum value function.
[0028] Optionally, the pixel texture weight of each pixel can be determined using the following formula:
[0029] alphaSad=curve(sad,sad_lut_x,alpha_lut_y)
[0030] Wherein, alphaSad is used to represent the pixel texture level weight, sad_lut_x is used to represent the selectable range of the pixel texture level weight, alpha_lut_y is used to represent the weight value, and 0≤alpha_lut_y≤1, curve() is used to represent the preset fitting relationship function, and curve(sad,sad_lut_x,alpha_lut_y) is used to represent the preset fitting relationship between the pixel texture level and the weight value when the pixel texture level is within the selectable range of the pixel texture level.
[0031] Optionally, the first image and the second image are pixel-level fusion processed using the fusion weight value to obtain a fused image, including: determining the weight of one of the first image and the second image according to the fusion weight value, determining the weight of the other of the first image and the second image according to the difference obtained by subtracting the fusion weight value from 1; for each pixel, the fusion U value and fusion V value of the pixel are determined by weighted summation operation, so as to be the U value and V value of the pixel in the fused image.
[0032] Optionally, the weight of the first image is determined based on the fusion weight value; before performing the first data processing and the second data processing on the images to be processed respectively, the method further includes: calibrating the noise of the image to be processed based on the brightness value of the image to be processed; the greater the noise of the image to be processed, the greater the sampling multiple in each round of data resampling processing in the first data processing compared to the second data processing, and the smaller the weight of the first image based on the fusion weight value.
[0033] Secondly, embodiments of this application provide an apparatus for reducing image noise. The apparatus includes: an image processing module, configured to perform first data processing and second data processing on the image to be processed to obtain a first image and a second image, wherein the first data processing adds at least one round of data resampling processing compared to the second data processing; a fusion weight value determination module, configured to determine the fusion weight value of each pixel based on the first image and the second image; and a pixel-level fusion module, configured to perform pixel-level fusion processing on the first image and the second image using the fusion weight values to obtain a fused image.
[0034] Thirdly, embodiments of this application provide a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when run by a processor, performs the steps of the above-described method for reducing image noise.
[0035] Fourthly, embodiments of this application provide a terminal, including a memory and a processor, wherein the memory stores a computer program capable of running on the processor, and the processor executes the steps of the above-described method for reducing image noise when running the computer program.
[0036] Fifthly, embodiments of this application provide a computer program product, the computer program product including a computer program, which, when run on a computer, causes the computer to perform any of the methods provided in the first aspect.
[0037] In a sixth aspect, embodiments of this application provide a chip that stores a computer program, which, when executed by the chip, causes any of the methods provided in the first aspect to be executed.
[0038] Compared with the prior art, the technical solution of the embodiments of the present invention has the following beneficial effects:
[0039] In this embodiment of the invention, two processing methods are used to process the same image to be processed. The first data processing adds at least one round of data resampling processing compared to the second data processing. Through data resampling processing, a first image with better noise filtering effect and a second image with slightly lower noise filtering effect but more real colors are retained. Thus, after pixel-level fusion processing of the first image and the second image, the colors of real objects in the image can be retained while removing chromatic noise, reducing color loss.
[0040] Furthermore, the additional data resampling process in each round of the first data processing compared to the second data processing includes: downsampling the U and V values of the image to be processed; and upsampling the U and V values of the downsampled image. In each round of data resampling, the sampling factor of the downsampling process is consistent with the sampling factor of the upsampling process. This allows noise to be filtered out through data resampling, achieving a filtering effect. Compared to conventional filtering, the downsampling followed by upsampling approach in the above technical solution effectively reduces computational load and allows for convenient increases or decreases in the granularity of the filtering process.
[0041] Furthermore, the first data processing includes: downsampling the U and V values of the image to be processed; filtering the U and V values of the downsampled image; and upsampling the U and V values of the filtered image. This can be achieved by adding filtering on top of the downsampling followed by upsampling process, thereby enhancing the noise reduction effect and improving the uniformity of noise removal through two rounds of filtering.
[0042] Furthermore, based on the brightness value of the image to be processed, the noise of the image to be processed is calibrated. The greater the noise of the image to be processed, the coarser the granularity of filtering the U value and V value of the image to be processed, thereby further enhancing the effect of reducing image noise.
[0043] Furthermore, based on the brightness value of the image to be processed, the noise of the image to be processed is calibrated. The greater the noise, the greater the sampling multiple in each round of data resampling processing in the first data processing compared to the second data processing. This allows for more powerful downsampling and upsampling processing, further enhancing the ability to reduce image noise.
[0044] Furthermore, based on the brightness value of the image to be processed, the noise of the image to be processed is calibrated. The greater the noise, the more bad pixels are removed in the bad pixel removal preprocessing. Thus, by setting stronger removal conditions, more bad pixels can be removed, thereby further enhancing the effect of reducing image noise.
[0045] Furthermore, based on the U-value difference and V-value difference of each pixel in the first image and the second image, the pixel difference value weight of each pixel is determined; based on the U-value and V-value of each pixel in the image to be processed or the second image, the pixel texture degree weight of each pixel is determined; for each pixel, the fusion weight value is determined by multiplying the pixel difference value weight and the pixel texture degree weight, so that the fusion ratio of the first image and the second image can be determined based on both pixel difference and pixel texture factors. On the basis of determining pixel difference, the influence of pixel texture is considered. For example, large pixel difference is not entirely caused by noise, but may also include pixel difference caused by complex pixel texture. Therefore, after combining the two factors of pixel difference and pixel texture, a more accurate and reasonable fusion ratio can be determined.
[0046] Furthermore, based on the brightness value of the image to be processed, the noise of the image to be processed is calibrated. The greater the noise of the image to be processed, the smaller the weight of the first image is based on the fusion weight value. Thus, when the noise is high, the sampling multiple in each round of data resampling processing of the first data processing is set to be larger than that of the second data processing, so as to enhance the reduction of image noise as much as possible. And by making the weight of the first image smaller based on the fusion weight value, more colors of real objects in the image are preserved as much as possible, reducing color loss, and further achieving a better balance between reducing image noise and reducing color loss. Attached Figure Description
[0047] Figure 1 This is a flowchart of a method for reducing image noise according to an embodiment of the present invention;
[0048] Figure 2 This is a schematic diagram of a working scenario for another method of reducing image noise in an embodiment of the present invention;
[0049] Figure 3 yes Figure 1 A flowchart of a specific implementation of step S12;
[0050] Figure 4 This is a schematic diagram of the structure of an image noise reduction device according to an embodiment of the present invention. Detailed Implementation
[0051] Noise in images primarily originates from the image acquisition and transmission processes. During image acquisition, image degradation occurs due to the inherent quality of the imaging sensor and environmental conditions, leading to a decrease in image quality. During image transmission, interference in the transmission channel is the main factor causing image contamination.
[0052] Noise can be classified in different ways according to its different characteristics. Based on the color components of an image, noise can be divided into luminance noise and chrominance noise. Luminance noise is the noise in the luminance component of color, while chrominance noise is the noise in the chrominance component of color.
[0053] Existing image denoising techniques are either complex and difficult to implement, consuming a lot of resources, or they cannot preserve the colors of real objects in the image, resulting in severe color loss.
[0054] Specifically, in an existing image denoising method, the UV components are subjected to wavelet transform or DCT transform, and hard thresholding and soft thresholding are performed in the transform domain to remove chromatic noise. A relatively complex pyramid color wavelet decomposition and reconstruction technique can be used. However, since transform domain denoising methods often require a large amount of image block data, the computational complexity is high and the resource consumption is large. Furthermore, it is still insufficient compared with spatial domain methods in terms of color overflow suppression.
[0055] Another existing image denoising method involves performing one or more filtering processes on the image to be processed, such as median filtering or mean filtering. However, this can lead to color loss, especially when the granularity of the filtering process is coarse. This can severely affect the colors of real objects in the image and can also easily cause color overflow at the boundaries between different colors.
[0056] In this embodiment of the invention, two processing methods are used to process the same image to be processed. The first data processing adds at least one round of data resampling processing compared to the second data processing. Through data resampling processing, a first image with better noise filtering effect and a second image with slightly lower noise filtering effect but more real colors are retained. Thus, after pixel-level fusion processing of the first image and the second image, the colors of real objects in the image can be retained while removing chromatic noise, reducing color loss.
[0057] To make the above-mentioned objectives, features and beneficial effects of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0058] Reference Figure 1 , Figure 1 This is a flowchart of a method for reducing image noise according to an embodiment of the present invention. The method for reducing image noise may include steps S11 to S13:
[0059] Step S11: Perform first data processing and second data processing on the image to be processed to obtain a first image and a second image, wherein the first data processing adds at least one round of data resampling processing compared to the second data processing;
[0060] Step S12: Determine the fusion weight value of each pixel based on the first image and the second image;
[0061] Step S13: Using the fusion weight value, perform pixel-level fusion processing on the first image and the second image to obtain the fused image.
[0062] It is understood that, in specific implementation, the method can be implemented using a software program that runs in a processor integrated within the chip or chip module.
[0063] In the specific implementation of step S11, the image to be processed is subjected to first data processing and second data processing respectively. The first data processing adds at least one round of data resampling processing compared to the second data processing, thereby making the first image and the second image different.
[0064] Specifically, by adding one or more rounds of data resampling, the first image can achieve better noise filtering, while the second image, lacking one or more rounds of data resampling, has slightly lower noise filtering but retains more realistic colors.
[0065] Furthermore, the additional data resampling process in each round of the first data processing compared to the second data processing may include: downsampling the U and V values of the image to be processed; upsampling the U and V values of the downsampled image; wherein, in each round of data resampling, the sampling factor of the downsampling process is the same as the sampling factor of the upsampling process.
[0066] It should be noted that, in this embodiment of the invention, if the image to be processed is a YUV domain image, the U value and V value of the image to be processed can be obtained directly; if the image to be processed is another type of image, such as an RGB domain image, the RGB data can be converted to YUV data first, and then the U value and V value of the image to be processed can be determined.
[0067] YUV can be used to represent the types of true-color color spaces. "Y" represents luminance (or luma), which is the grayscale value, while "U" and "V" represent chroma (or chroma), which describe the color and saturation of the image and are used to specify the color of a pixel. RGB can determine various colors by varying the red (R), green (G), and blue (B) color channels and superimposing them.
[0068] Furthermore, downsampling methods include, but are not limited to, nearest neighbor downsampling and mean downsampling, while upsampling methods include, but are not limited to, bilinear interpolation upsampling.
[0069] In this embodiment of the invention, the additional data resampling process in each round of the first data processing compared to the second data processing includes: downsampling the U and V values of the image to be processed, and upsampling the U and V values of the downsampled image. This allows noise to be filtered out through data resampling, resulting in a filtering effect. Compared to conventional filtering, the downsampling followed by upsampling method described above can effectively reduce the amount of computation and conveniently increase or decrease the granularity of the filtering process.
[0070] In a first specific embodiment of the present invention, the first data processing step may include: downsampling the U and V values of the image to be processed; and upsampling the U and V values of the downsampled image. Correspondingly, the second data processing step may not include the above-mentioned downsampling and upsampling steps, and may include, for example, performing bad pixel removal preprocessing on the image to be processed.
[0071] In a second specific embodiment of the present invention, the first data processing step may include: downsampling the U and V values of the image to be processed; filtering the U and V values of the downsampled image; and upsampling the U and V values of the filtered image. Correspondingly, the second data processing step may not include the aforementioned downsampling and upsampling steps, and may, for example, include: filtering the U and V values of the image to be processed; wherein the number of times the U and V values of the image to be processed are filtered is the same as the number of times the U and V values of the downsampled image are filtered.
[0072] As a non-limiting example, the filtering process can be performed only once, which helps reduce the cost of filtering.
[0073] Furthermore, before performing the first data processing and the second data processing on the image to be processed respectively, the method may further include the step of calibrating the noise of the image to be processed based on the brightness value of the image to be processed.
[0074] Reference Figure 2 , Figure 2 This is a schematic diagram of a working scenario for another method of reducing image noise in an embodiment of the present invention.
[0075] like Figure 2As shown, the first data processing module 21 can be used to perform first data processing on the image to be processed, and the second data processing module 22 can be used to perform second data processing on the image to be processed.
[0076] The first data processing module 21 may include: a downsampling unit 211, which can be used to downsample the U and V values of the image to be processed; and to filter the U and V values of the downsampled image; a filtering unit 212, which can be used to filter the U and V values of the downsampled image; and an upsampling unit 213, which can be used to upsample the U and V values of the filtered image.
[0077] In this embodiment of the invention, by first downsampling the U and V values of the image to be processed, then filtering the U and V values of the downsampled image, and then upsampling the U and V values of the filtered image, filtering is added on top of the downsampling and upsampling processing method. This allows for two rounds of filtering to further enhance the noise reduction and improve the uniformity of noise removal.
[0078] The second data processing module 22 may include a filtering unit 222, used to filter the U-values and V-values of the image to be processed. The number of times the U-values and V-values of the image to be processed are filtered is the same as the number of times the U-values and V-values of the downsampled image are filtered.
[0079] As a non-restrictive example, Figure 2 The filtering process shown is performed only once, which helps to reduce the cost of filtering.
[0080] It should be pointed out that, in Figure 2 The filtering unit 212 and the filtering unit 222 are shown in dashed boxes to indicate that they are optional. Specifically, when the first data processing module 21 and the second data processing module 22 include the filtering unit 212 and the filtering unit 222, Figure 2 The technical solution shown corresponds to the first specific embodiment shown above, where the first data processing module 21 and the second data processing module 22 do not include the filtering processing unit 212 and the filtering processing unit 222. Figure 2 The technical solution shown corresponds to the second specific implementation described above.
[0081] Furthermore, the second data processing module 22 may also include a bad pixel removal processing unit 221, which is used to perform bad pixel removal preprocessing on the image to be processed, thereby removing bad pixels in the image to be processed in advance and improving the quality of the processing basis.
[0082] In this embodiment of the invention, before performing the first data processing and the second data processing on the image to be processed respectively, the method may further include: calibrating the noise of the image to be processed based on the brightness value of the image to be processed.
[0083] Specifically, a noise calibration module 23 can be set up to calibrate the noise of the image to be processed, and the calibrated noise can affect the first data processing module 21 and the second data processing module 22.
[0084] In the first specific embodiment, the calibrated noise can affect the filtering unit 212 in the first data processing module 21 and the filtering unit 222 in the second data processing module 22.
[0085] Specifically, before performing the first data processing and the second data processing on the image to be processed, a step of calibrating the noise of the image to be processed based on the brightness value of the image to be processed may be included, wherein the greater the noise of the image to be processed, the coarser the granularity of filtering the U value and V value of the image to be processed.
[0086] In this embodiment of the invention, the noise of the image to be processed is calibrated based on the brightness value of the image to be processed. The greater the noise of the image to be processed, the coarser the granularity of filtering the U value and V value of the image to be processed, thereby further enhancing the effect of reducing image noise.
[0087] In the second specific embodiment, the calibrated noise can affect the downsampling unit 211 and the upsampling unit 213 in the first data processing module 21.
[0088] Specifically, before performing the first data processing and the second data processing on the image to be processed, a step of calibrating the noise of the image to be processed based on the brightness value of the image to be processed may be included, wherein the greater the noise, the greater the sampling multiple in each round of data resampling processing in the first data processing compared to the second data processing.
[0089] Without limitation, if it is determined that the noise of the image to be processed is low, downsampling and upsampling can be performed using a first sampling factor (e.g., 3 times), and if it is determined that the noise of the image to be processed is high, downsampling and upsampling can be performed using a second sampling factor (e.g., 5 times), wherein the first sampling factor is less than the second sampling factor.
[0090] In this embodiment of the invention, the noise of the image to be processed is calibrated based on the brightness value of the image to be processed. The greater the noise, the greater the sampling multiple in each round of data resampling processing in the first data processing compared to the second data processing. This allows for a more powerful downsampling and upsampling process, thereby further enhancing the reduction of image noise.
[0091] In the third specific embodiment, the calibrated noise can affect the bad pixel removal processing unit 221 in the second data processing module 22.
[0092] Specifically, before performing the first data processing and the second data processing on the image to be processed, a step of calibrating the noise of the image to be processed based on the brightness value of the image to be processed may be included, wherein the greater the noise, the more bad pixels are removed in the bad pixel removal preprocessing.
[0093] In this embodiment of the invention, the noise of the image to be processed is calibrated based on the brightness value of the image to be processed. The greater the noise, the more bad pixels are removed in the bad pixel removal preprocessing. Thus, by setting stronger removal conditions, more bad pixels can be removed, thereby further enhancing the effect of reducing image noise.
[0094] Furthermore, in this embodiment of the invention, the noise of the image to be processed can be calibrated based on the brightness value of the image to be processed, according to a preset fitting relationship between the brightness value and the noise.
[0095] In the first specific implementation, based on historical data or empirical values, the relationship between brightness and noise can be pre-fitted using color / gray charts under different noise / gain conditions. For example, a relationship correspondence table can be determined or a fitting curve can be constructed to generate a brightness-noise fitting relationship for each gain. In the image to be processed, the brightness-noise fitting relationship for each pixel's brightness value is searched (e.g., using the lookup() function to implement the search function) to obtain the noise corresponding to the brightness value.
[0096] It should be noted that the degree of noise can be calibrated, for example, by pre-dividing a finite number of noise levels, and determining the noise of the image to be processed based on the noise value obtained, so as to reduce the computational load of subsequent data processing.
[0097] In the second specific implementation, the modulation coefficient can also be determined by manually adjusting the relationship between noise level and brightness information through online manual modulation. Then, the modulation coefficient can be used as a fitting parameter to construct a fitting curve, thereby realizing the determination of the noise corresponding to the brightness value based on the fitting curve.
[0098] Without limitation, the fitted curve can be represented by the following formula:
[0099] Noise=curve(lum,lum_x,noise_y)
[0100] Here, Noise represents noise, curve() represents a preset fitting function, lum represents the brightness value, lum_x represents the optional range of the brightness value, for example, 0 to 255, and noisy_y represents the noise of the Y channel.
[0101] In this embodiment of the invention, the noise of the Y channel can be determined based on the brightness value. Then, when processing the data of the U and V channels, the noise level of the Y channel can be referenced to perform an appropriate degree of noise reduction, which can effectively improve the noise reduction effect and avoid color distortion caused by excessive noise reduction.
[0102] Continue to refer to Figure 1 In the specific implementation of step S12, the fusion weight value of each pixel can be determined based on the first image and the second image.
[0103] Specifically, since the first image is obtained through data resampling, it has a better noise filtering effect, while the second image has a slightly lower noise filtering effect but retains more true colors. Therefore, by determining the fusion weight value of each pixel, a balance can be sought between removing chromatic noise and reducing color loss for each pixel.
[0104] Reference Figure 3 , Figure 3 yes Figure 1 A flowchart of a specific implementation of step S12 is provided. The step of determining the fusion weight value of each pixel based on the first image and the second image may include steps S31 to S33, which are described below.
[0105] In step S31, the pixel difference weight of each pixel is determined based on the difference between the U value and the difference between the V value of each pixel in the first image and the second image.
[0106] Further, the step of determining the pixel difference weight of each pixel based on the U-value difference and V-value difference of each pixel in the first image and the second image may include: determining the U-value difference and V-value difference of each pixel in the first image and the second image; determining the pixel difference value of the pixel based on the comparison relationship between the U-value difference and V-value difference of each pixel; and determining the pixel difference weight of each pixel based on a preset fitting relationship between the pixel difference value and the weight value.
[0107] It is understood that both the first image and the second image are obtained by data processing of the image to be processed, and each pixel has a one-to-one correspondence. Therefore, the U-value difference and V-value difference between the first image and the second image can be calculated for each pixel.
[0108] Furthermore, the pixel difference value for each pixel can be determined using the following formula:
[0109] diff=max(abs(U1-U2),abs(V1-V2))
[0110] Where, diff is used to represent pixel difference values, max() is used to represent the maximum value function, abs() is used to represent the absolute value function, U1 and U2 are used to represent the U value of the same pixel in the first image and the second image respectively, and V1 and V2 are used to represent the V value of the same pixel in the first image and the second image respectively.
[0111] It should be noted that, in another specific embodiment of the present invention, other methods can be used to determine the pixel difference value of each pixel, such as using the mean function instead of the maximum value function.
[0112] Furthermore, the pixel difference weight for each pixel can be determined using the following formula:
[0113] alphaDiff=curve(diff,diff_lut_x,alpha_lut_y)
[0114] alphaDiff is used to represent the pixel difference weight, diff_lut_x is used to represent the selectable range of pixel difference values, alpha_lut_y is used to represent the weight value, and 0≤alpha_lut_y≤1. curve() is used to represent the preset fitting relationship function. curve(diff,diff_lut_x,alpha_lut_y) is used to represent the preset fitting relationship between pixel difference values and weight values when the pixel difference values are within the selectable range of pixel difference values.
[0115] In step S32, the pixel texture weight of each pixel is determined based on the U value and V value of each pixel in the image to be processed or the second image.
[0116] Further, the step of determining the pixel texture degree weight of each pixel based on the U value and V value of each pixel in the image to be processed or the second image may include: determining the absolute value of the difference between the U value of each pixel in the image to be processed or the second image and the mean U value, wherein the mean U value is the average of the U values of multiple pixels within a preset range centered on that pixel; determining the absolute value of the difference between the V value of each pixel in the image to be processed or the second image and the mean V value, wherein the mean V value is the average of the V values of multiple pixels within a preset range centered on that pixel; determining the pixel texture degree of the pixel based on the comparison relationship between the absolute values of the U value difference and the absolute values of the V value difference of each pixel; and determining the pixel texture degree weight of each pixel based on a preset fitting relationship between the pixel texture degree and the weight value.
[0117] In this process, the size of the pixel array can be pre-selected as the preset range, such as a 3×3 pixel array or a 5×5 pixel array, with each pixel as the center. Then, the average U value in the pixel array is determined as the average U value of the pixel. Similarly, the average V value in the pixel array is determined as the average V value of the pixel.
[0118] It should be noted that the greater the difference between the U value of a pixel and the mean U value, and / or the greater the difference between the V value of a pixel and the mean V value, the greater the pixel texture in the vicinity of that pixel, and the higher the color complexity of the image.
[0119] Furthermore, the pixel texture level of each pixel can be determined using the following formula:
[0120] sadU = abs(U0 - mean(U0))
[0121] sadV = abs(V0 - mean(V0))
[0122] Sad = max(sadU, sadV)
[0123] Wherein, sadU represents the difference between the U value of a single pixel in the image to be processed or the second image and the mean U value; abs() represents the absolute value function; U0 represents the U value of a single pixel in the image to be processed or the second image; mean(U0) represents the mean U value of a single pixel in the image to be processed or the second image; sadV represents the difference between the V value of a single pixel in the image to be processed or the second image and the mean V value; V0 represents the V value of a single pixel in the image to be processed or the second image; mean(V0) represents the mean V value of a single pixel in the image to be processed or the second image; Sad represents the pixel texture level; and max() represents the maximum value function.
[0124] It should be noted that, in another specific embodiment of the present invention, other methods can be used to determine the pixel texture degree of each pixel, such as using the mean function instead of the maximum value function.
[0125] Furthermore, the pixel texture weight of each pixel can be determined using the following formula:
[0126] alphaSad=curve(sad,sad_lut_x,alpha_lut_y)
[0127] alphaSad is used to represent the pixel texture level weight, sad_lut_x is used to represent the selectable range of the pixel texture level weight, alpha_lut_y is used to represent the weight value, and 0≤alpha_lut_y≤1. curve() is used to represent the preset fitting relationship function. curve(sad,sad_lut_x,alpha_lut_y) is used to represent the preset fitting relationship between the pixel texture level and the weight value when the pixel texture level is within the selectable range of the pixel texture level.
[0128] In step S33, for each pixel, the fusion weight value is determined based on the product of the pixel difference weight and the pixel texture degree weight.
[0129] Specifically, the product of the pixel difference weight and the pixel texture degree weight can be used as the fusion weight value, or the result of the calculation of the product and the preset correction coefficient can be used as the fusion weight value.
[0130] In this embodiment of the invention, a pixel difference weight is determined based on the difference between the U and V values of each pixel in the first and second images; a pixel texture weight is determined based on the U and V values of each pixel in the image to be processed or the second image; for each pixel, a fusion weight value is determined based on the product of the pixel difference weight and the pixel texture weight. Thus, the fusion ratio of the first and second images can be determined based on both pixel difference and pixel texture factors. Based on the determination of pixel difference, the influence of pixel texture is considered. For example, a large pixel difference is not entirely due to noise, but may also include pixel differences caused by complex pixel texture. Therefore, by combining the two factors of pixel difference and pixel texture, a more accurate and reasonable fusion ratio can be determined.
[0131] In the specific implementation of step S13, the fusion weight value can be used to perform pixel-level fusion processing on the first image and the second image to obtain the fused image.
[0132] Step S13 can be adopted Figure 2 The fusion processing module 24 in the middle is executed.
[0133] Further, the step of performing pixel-level fusion processing on the first image and the second image using the fusion weight value to obtain the fused image may include: determining the weight of one of the first image and the second image according to the fusion weight value, determining the weight of the other of the first image and the second image according to the difference obtained by subtracting the fusion weight value from 1; for each pixel, using a weighted summation operation to determine the fusion U value and fusion V value of the pixel, so as to serve as the U value and V value of the pixel in the fused image.
[0134] Without limitation, the fusion weight values can be used as the weights of the first image, and the fusion U value and fusion V value can be expressed by the following formula:
[0135] UV_out=UVF1×alpha+(1-alpha)×UVF2
[0136] Where UV_out represents the fusion U value or fusion V value, alpha represents the fusion weight value, UVF1 represents the first image, and UVF2 represents the second image.
[0137] In this embodiment of the invention, two processing methods are used to process the same image to be processed. The first data processing adds at least one round of data resampling processing compared to the second data processing. Through data resampling processing, a first image with better noise filtering effect and a second image with slightly lower noise filtering effect but more real colors are retained. Thus, after pixel-level fusion processing of the first image and the second image, the colors of real objects in the image can be retained while removing chromatic noise, reducing color loss.
[0138] Furthermore, Figure 2 The noise calibrated by the calibration noise module 23 shown can affect the results of the fusion processing module 24.
[0139] Specifically, the weight of the first image may be determined based on the fusion weight value; before performing the first data processing and the second data processing on the images to be processed respectively, the method may further include: calibrating the noise of the image to be processed based on the brightness value of the image to be processed; the greater the noise of the image to be processed, the greater the sampling multiple in each round of data resampling processing in the first data processing compared to the second data processing, and the smaller the weight of the first image based on the fusion weight value.
[0140] In this embodiment of the invention, the noise of the image to be processed is calibrated based on the brightness value of the image to be processed. The greater the noise of the image to be processed, the smaller the weight of the first image is based on the fusion weight value. Thus, when the noise is high, the sampling multiple in each round of data resampling processing of the first data processing is set to be larger than that of the second data processing, so as to enhance the reduction of image noise as much as possible. Furthermore, by making the weight of the first image smaller based on the fusion weight value, more colors of real objects in the image are preserved as much as possible, and color loss is reduced. This further achieves a better balance between reducing image noise and reducing color loss.
[0141] In this embodiment of the invention, by using the noise obtained by the calibration noise module 23 to affect each module, the noise of the image to be processed can be comprehensively considered during the process of reducing image noise, and each noise reduction scheme can be dynamically adjusted, thereby achieving a better balance between reducing image noise and reducing color loss.
[0142] Reference Figure 4 , Figure 4 This is a schematic diagram of a device for reducing image noise according to an embodiment of the present invention. The device for reducing image noise may include:
[0143] Image processing module 41 is used to perform first data processing and second data processing on the image to be processed to obtain a first image and a second image, wherein the first data processing adds at least one round of data resampling processing compared to the second data processing.
[0144] The fusion weight value determination module 42 is used to determine the fusion weight value of each pixel based on the first image and the second image;
[0145] The pixel-level fusion module 43 is used to perform pixel-level fusion processing on the first image and the second image using the fusion weight value to obtain the fused image.
[0146] For more information on the working principle, working method, and beneficial effects of the image noise reduction device in the embodiments of this application, please refer to the relevant description of the image noise reduction method above, which will not be repeated here.
[0147] In practice, Figure 4 The illustrated device for reducing image noise may correspond to a chip in a terminal that has image data processing capabilities; or to a terminal that includes a chip or chip module with image data processing capabilities; or to a terminal in general.
[0148] This application also provides a computer-readable storage medium storing a computer program thereon. When the computer program is run by a processor, the above-described method is executed. The storage medium may include ROM, RAM, a magnetic disk, or an optical disk, etc. The storage medium may also include non-volatile memory or non-transitory memory, etc.
[0149] This invention also provides a terminal, including a memory and a processor. The memory stores a computer program that can run on the processor. When the processor runs the computer program, it performs the steps of the above-described method. The terminal includes, but is not limited to, terminal devices such as mobile phones, computers, tablets, servers, and cloud platforms.
[0150] It should be understood that in the embodiments of this application, the processor can be a central processing unit (CPU), or it can be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.
[0151] It should also be understood that the memory in the embodiments of this application can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of random access memory (RAM) are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced synchronous DRAM (ESDRAM), synchronous linked DRAM (SLDRAM), and direct rambus RAM (DR RAM).
[0152] The above embodiments can be implemented, in whole or in part, by software, hardware, firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer program are loaded or executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer program can be stored in a computer-readable storage medium or transferred from one computer-readable storage medium to another. For example, the computer program can be transferred from one website, computer, server, or data center to another website, computer, server, or data center via wired or wireless means.
[0153] It should be understood that in the various embodiments of this application, the order of the above-mentioned processes does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0154] In the several embodiments provided in this application, it should be understood that the disclosed methods, apparatuses, and systems can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for example, the division of units is merely a logical functional division, and other division methods may exist in actual implementation; for example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0155] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0156] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can be physically included separately, or two or more units can be integrated into one unit. The integrated units described above can be implemented in hardware or in a combination of hardware and software functional units. For example, for various devices or products applied to or integrated into a chip, each module / unit can be implemented using hardware such as circuits, or at least some modules / units can be implemented using software programs running on a processor integrated within the chip, while the remaining (if any) modules / units can be implemented using hardware such as circuits; for various devices or products applied to or integrated into a chip module, each module / unit can be implemented using hardware such as circuits, and different modules / units can be located in the same component (e.g., chip, circuit module, etc.) or different components of the chip module, or at least some modules / units can be implemented using hardware such as circuits. The components can be implemented using software programs that run on the processor integrated within the chip module. The remaining (if any) modules / units can be implemented using hardware methods such as circuits. For various devices and products applied to or integrated into the terminal, each of its components / units can be implemented using hardware methods such as circuits. Different modules / units can be located in the same component (e.g., chip, circuit module, etc.) or in different components within the terminal. Alternatively, at least some modules / units can be implemented using software programs that run on the processor integrated within the terminal, while the remaining (if any) modules / units can be implemented using hardware methods such as circuits.
[0157] The integrated units implemented as software functional units described above can be stored in a computer-readable storage medium. These software functional units, stored in a storage medium, include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute some steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0158] It should be understood that the term "and / or" in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this article indicates that the preceding and following related objects have an "or" relationship.
[0159] In the embodiments of this application, "multiple" refers to two or more.
[0160] The descriptions of "first," "second," etc., appearing in the embodiments of this application are for illustrative purposes and to distinguish the objects being described. They have no order and do not indicate any special limitation on the number of devices in the embodiments of this application, nor do they constitute any limitation on the embodiments of this application.
[0161] While the present invention has been disclosed above, it is not limited thereto. Any person skilled in the art can make various modifications and alterations without departing from the spirit and scope of the invention; therefore, the scope of protection of the present invention should be determined by the scope defined in the claims.
Claims
1. A method for reducing image noise, characterized in that, include: The images to be processed are subjected to first data processing and second data processing respectively to obtain a first image and a second image, wherein the first data processing adds at least one round of data resampling processing compared to the second data processing; Determining the fusion weight value of each pixel based on the first image and the second image includes: determining the pixel difference weight of each pixel based on the difference between the U value and the difference between the V value of each pixel in the first image and the second image; determining the pixel texture weight of each pixel based on the U value and the V value of each pixel in the image to be processed or the second image; and determining the fusion weight value for each pixel based on the product of the pixel difference weight and the pixel texture weight. Using the fusion weight value, the first image and the second image are fused at the pixel level to obtain the fused image.
2. The method for reducing image noise according to claim 1, characterized in that, The additional data resampling process per round in the first data processing compared to the second data processing includes: The U and V values of the image to be processed are downsampled; Upsample the U and V values of the downsampled image; In each round of data resampling, the sampling factor of the downsampling process is the same as that of the upsampling process.
3. The method for reducing image noise according to claim 2, characterized in that, The first data processing includes: The U and V values of the image to be processed are downsampled; The U and V values of the downsampled image are filtered. Upsample the U and V values of the filtered image.
4. The method for reducing image noise according to claim 3, characterized in that, The second data processing includes: The U and V values of the image to be processed are filtered. The number of times the U and V values of the image to be processed are filtered is the same as the number of times the U and V values of the downsampled image are filtered.
5. The method for reducing image noise according to claim 4, characterized in that, Before performing the first data processing and the second data processing on the image to be processed, the method further includes: The noise of the image to be processed is calibrated based on the brightness value of the image to be processed; The greater the noise in the image to be processed, the coarser the granularity of the filtering of the U and V values of the image to be processed.
6. The method for reducing image noise according to claim 1, characterized in that, Before performing the first data processing and the second data processing on the image to be processed, the method further includes: The noise of the image to be processed is calibrated based on the brightness value of the image to be processed; The greater the noise, the greater the sampling multiple in each round of data resampling processing that the first data processing adds compared to the second data processing.
7. The method for reducing image noise according to claim 1 or 4, characterized in that, The second data processing includes: The image to be processed is preprocessed to remove bad pixels.
8. The method for reducing image noise according to claim 7, characterized in that, Before performing the first data processing and the second data processing on the image to be processed, the method further includes: The noise of the image to be processed is calibrated based on the brightness value of the image to be processed; The greater the noise, the more bad pixels are removed in the bad pixel removal preprocessing.
9. The method for reducing image noise according to claim 1, characterized in that, Based on the U-value difference and V-value difference of each pixel in the first image and the second image, the pixel difference weight of each pixel is determined, including: Determine the difference in U-value and the difference in V-value of each pixel in the first image and the second image; The pixel difference value is determined by comparing the U-value difference and V-value difference of each pixel. The pixel difference weight of each pixel is determined based on the preset fitting relationship between the pixel difference value and the weight value.
10. The method for reducing image noise according to claim 9, characterized in that, The pixel difference value for each pixel is determined using the following formula: ; Where, diff is used to represent pixel difference values, max() is used to represent the maximum value function, abs() is used to represent the absolute value function, U1 and U2 are used to represent the U value of the same pixel in the first image and the second image respectively, and V1 and V2 are used to represent the V value of the same pixel in the first image and the second image respectively.
11. The method for reducing image noise according to claim 10, characterized in that, The pixel difference weight for each pixel is determined using the following formula: ; In this context, alphaDiff represents the pixel difference weight, diff_lut_x represents the selectable range of pixel difference values, alpha_lut_y represents the weight value, and 0≤alpha_lut_y≤1. curve() represents the preset fitting relationship function, and curve(diff, diff_lut_x, alpha_lut_y) represents the preset fitting relationship between pixel difference values and weight values when the pixel difference values are within the selectable range of pixel difference values.
12. The method for reducing image noise according to claim 1, characterized in that, Based on the U and V values of each pixel in the image to be processed or the second image, determine the pixel texture weight of each pixel, including: Determine the absolute value of the difference between the U value of each pixel in the image to be processed or the second image and the mean U value, wherein the mean U value is the average of the U values of multiple pixels within a preset range centered on that pixel; Determine the absolute value of the difference between the V value of each pixel in the image to be processed or the second image and the mean V value, wherein the mean V value is the average of the V values of multiple pixels within a preset range centered on that pixel; The pixel texture level of a pixel is determined by comparing the absolute values of the differences between the U and V values of each pixel. The pixel texture weight of each pixel is determined based on a preset fitting relationship between pixel texture degree and weight value.
13. The method for reducing image noise according to claim 12, characterized in that, The pixel texture level of each pixel is determined using the following formula: ; ; ; Wherein, sadU is used to represent the difference between the U value of a single pixel in the image to be processed or the second image and the mean U value, abs() is used to represent the absolute value function, U0 is used to represent the U value of a single pixel in the image to be processed or the second image, and mean(U0) is used to represent the mean U value of a single pixel in the image to be processed or the second image. sadV is used to represent the difference in V value between the V value of a single pixel in the image to be processed or the second image and the mean V value; V0 is used to represent the V value of a single pixel in the image to be processed or the second image; mean(V0) is used to represent the mean V value of a single pixel in the image to be processed or the second image. Sad is used to represent the pixel texture level, and max() is used to represent the maximum value function.
14. The method for reducing image noise according to claim 13, characterized in that, The pixel texture weights for each pixel are determined using the following formula: ; Wherein, alphaSad is used to represent the pixel texture level weight, sad_lut_x is used to represent the selectable range of the pixel texture level weight, alpha_lut_y is used to represent the weight value, and 0≤alpha_lut_y≤1, curve() is used to represent the preset fitting relationship function, and curve(sad, sad_lut_x, alpha_lut_y) is used to represent the preset fitting relationship between the pixel texture level and the weight value when the pixel texture level is within the selectable range of the pixel texture level.
15. The method for reducing image noise according to claim 1, characterized in that, Using the fusion weight value, pixel-level fusion processing is performed on the first image and the second image to obtain the fused image, including: The weight of one of the first image and the second image is determined based on the fusion weight value, and the weight of the other of the first image and the second image is determined based on the difference obtained by subtracting the fusion weight value from 1. For each pixel, a weighted summation operation is used to determine the fused U value and fused V value of that pixel, which are then used as the U value and V value of that pixel in the fused image.
16. The method for reducing image noise according to claim 15, characterized in that, The weight of the first image is determined based on the fusion weight value; Before performing the first data processing and the second data processing on the image to be processed, the method further includes: The noise of the image to be processed is calibrated based on the brightness value of the image to be processed; The greater the noise in the image to be processed, the greater the sampling multiple in each round of data resampling processing that the first data processing adds compared to the second data processing, and the smaller the weight of the first image based on the fusion weight value.
17. An apparatus for reducing image noise, characterized in that, include: An image processing module is used to perform first data processing and second data processing on the image to be processed to obtain a first image and a second image, wherein the first data processing adds at least one round of data resampling processing compared to the second data processing. The fusion weight value determination module is used to determine the fusion weight value of each pixel based on the first image and the second image, including: determining the pixel difference value weight of each pixel based on the difference between the U value and the difference between the V value of each pixel in the first image and the second image; determining the pixel texture degree weight of each pixel based on the U value and the V value of each pixel in the image to be processed or the second image; and determining the fusion weight value for each pixel based on the product of the pixel difference value weight and the pixel texture degree weight. A pixel-level fusion module is used to perform pixel-level fusion processing on the first image and the second image using the fusion weight value to obtain a fused image.
18. A computer-readable storage medium having a computer program stored thereon, characterized in that, The computer program, when run by a processor, performs the steps of the method for reducing image noise as described in any one of claims 1 to 16.
19. A terminal comprising a memory and a processor, wherein the memory stores a computer program capable of running on the processor, characterized in that, When the processor runs the computer program, it performs the steps of the method for reducing image noise according to any one of claims 1 to 16.