Method and system for three-dimensional noise reduction and contrast enhancement of images

Information

  • Patent Grant
  • 12094092
  • Patent Number
    12,094,092
  • Date Filed
    Thursday, September 14, 2023
    a year ago
  • Date Issued
    Tuesday, September 17, 2024
    3 months ago
Abstract
Embodiments of the present invention disclose a system and method for reducing noise in a digital image. The method comprises calculating a spatial weight for each pixel s in a current frame, wherein said spatial weight is computed based on a summation of diffused values associated with the pixel s; and selectively filtering an intensity I of the pixel s spatially using said spatial weight.
Description
FIELD

Embodiments of the present invention relate generally to image processing, more specifically to noise reduction and contrast enhancement of images.


BACKGROUND


FIG. 1 of the drawings shows a high-level block diagram of a camera 10 in accordance with the prior art. As will be seen, the camera 10 comprises a lens 12 for focusing rays of light onto an image sensor 14. The image sensor 14 may be a charge-coupled device (CCD) or an active-pixel (CMOS) sensor capable of converting the incoming light into pixels which are fed into a downstream image signal processing pipeline 16. Typically, the signal processing pipeline performs operations such as demosaicing, noise reduction, auto exposure, autofocus, auto white balance and image sharpening on pixels, prior to output.


SUMMARY

According to the first aspect of the invention, these provided a method for producing noise in a digital image A method for reducing noise in a digital image, comprising:

    • calculating a spatial weight for each pixel s in a current frame, wherein said spatial weight is computed based on a summation of diffused values associated with the pixel s; and
    • selectively filtering an intensity I of the pixel s spatially using said spatial weight.


According to a second aspect of the invention is provided the system for implementing the above method.


Other aspects of the invention will be apparent from the written description below.





BRIEF DESCRIPTION OF THE DRAWINGS


FIG. 1 shows a high-level block diagram of a prior art camera.



FIG. 2 shows a high-level block diagram of a camera with a modified image processing pipeline for 3D noise reduction and contrast enhancement, in accordance with one embodiment of the invention.



FIG. 3 shows a flowchart of operations performed in order to spatially the pixels, in accordance with one embodiment of the invention.



FIG. 4 shows a schematic representation of a current and previous frame.



FIG. 5 shows a representation of a Laplacian operator used for edge detection, in accordance with one embodiment of the invention.



FIG. 6 shows a representation of a Sobel operator used for edge detection in accordance with one embodiment of the invention.





DETAILED DESCRIPTION

In the following description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the invention.


Reference in this specification to “one embodiment” or “an embodiment” means that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the invention. The appearances of the phrase “in one embodiment” in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Moreover, various features are described which may be exhibited by some embodiments and not by others. Similarly, various requirements are described which may be requirements for some embodiments but not others.


Moreover, although the following description contains many specifics for the purposes of illustration, anyone skilled in the art will appreciate that many variations and/or alterations to said details are within the scope of the present invention. Similarly, although many of the features of the present invention are described in terms of each other, or in conjunction with each other, one skilled in the art will appreciate that many of these features can be provided independently of other features. Accordingly, this description of the invention is set forth without any loss of generality to, and without imposing limitations upon, the invention.


Camera Pipeline with Three-Dimensional Noise Reduction and Contrast Enhancement


In accordance with one embodiment of the invention, and referring to FIG. 2 of the drawings, a camera pipeline comprises a lens 12, and an image sensor 14 which are components similar to what has already been described with respect to the prior art camera pipeline 10 of FIG. 1. Thus, the same reference numerals have been used to indicate these components. However, unlike the prior art camera pipeline 10, the output of the image sensor 14 is fed to a modified image processing pipeline 22 which includes a three-dimensional noise reduction block 24, and a contrast enhancement block 26.


As will be described, the three-dimensional noise reduction block 24 performs spatial filtering in two dimensions, and temporal filtering in one dimension, hence the noise reduction techniques are performed by the block 24 is referred to herein as three-dimensional noise reduction.


Two-Dimensional Spatial Filtering


Referring to FIG. 3, in one embodiment, the 3D noise reduction block 24 may comprise a spatial filtering block 30 configured to receive input frames 28, whereupon a spatial filtering technique is applied on a frame-by-frame basis, as will now be described. The technique begins by receiving the current frame at block 32, a copy of which is immediately saved at block 34 to a temporal buffer. The saved copy of the current frame is used in a temporal filtering block which will be described later. Next, for each pixel in the current frame, differences between the current pixel and its neighbors are calculated. The calculation of the differences between the current pixel and its neighbors is performed at block 36. To illustrate how the differences are calculated, consider the current frame numeral 46 depicted in in FIG. 4 of the drawings. For illustrative purposes the current frame shows only nine pixels P(x,y). In reality, one of ordinary skill in the art would understand that the current frame may comprise more pixels based on the resolution of the image. Consider the pixel P(1,1) which is located at the center of the frame. The arrows leading from the pixel P(1,1) indicate each of its neighboring pixels. Calculating the differences between the occurrence pixel and its neighbors in this case simply means calculating the following differences:

    • P(1,1)−P(0,0)
    • P(1,1)−P(1,0)
    • P(1,1)−P(2,0)
    • P(1,1)−P(0,1)
    • P(1,1)−P(2,1)
    • P(1,1)−P(0,3)
    • P(1,1)−P(1,3)
    • P(1,1)−P(2,3).


If the current pixel has no neighbors, such as is the case for the pixel P(0,0), then padding of pixels may be performed. In one embodiment, the particular padding technique used comprises simply taking the value of the current pixel as the value of the padded pixels.


Referring again to FIG. 3 of the drawings, at block 38 the sum of the differences calculated in the previous step is computed. This sum of the computed differences is used in block 40 to selectively apply spatial filtering to the current pixel as follows:


If the sum is greater than a threshold then the current pixel is not changed, in other words no spatial filtering is applied to the current pixel. However, if the sum is less than threshold, then the current pixel is replaced with a value corresponding to the sum of the computed differences calculated at block numeral 38.


In the technique described above, the spatial filtering block numeral 30 calculates for each pixel “s” in frame time t, a new pixel value is in the spatial domain where the pixel's neighbors are included in the summation of diffused values. In the example described, all the current pixel's neighbors (A, B, C, D, E, F, and G—see frame 40) are used in the calculation. In some embodiments, not all the pixel's neighbors is used in the calculation. For example, only the four pixels B, D, E, and F may be used.


To achieve the filtering, firstly the current pixel is filtered with the surrounding pixels in the same frame as follows:

T_weight_spatial=Σψ(I(t,p)−I(t,s));

where I represents pixel intensity; and (t,s) is the current pixel in the current frame. Thus, the above calculation sums the “differences” over all ‘p’s—the surrounding pixels in the same frame as discussed above. ‘s’ is the center pixel P(1,1), and ‘p’s are the neighboring pixels;


The spatially-filtered sample is output in accordance with the following equation:

Spatial_fltered_sample=I(t,s)+λ*T_weight_spatial;

where the “Spatial_fltered_sample” is the output of spatial filtering on the current pixel.


in some embodiments, λ may be 0.603.


As noted above, the spatial filtering is selective in that the current pixel value is only altered in certain cases. In one embodiment, spatial filtering of the current pixel only occurs if the sum of differences is below a threshold rho as follows:

    • For a constant “rho”, proportional to the variance of the noise:

      ψ(x)=(1−(x/rho){circumflex over ( )}2){circumflex over ( )}2; if |x|<=rho;
      ψ(x)=0; if |x|>rho;


In one embodiment, rho may be set to be 3 or 4. The above calculations are performed for each channel within the color space separately. For example, for the RGB color space, the above calculations are performed separately for each of the R, G, and B pixels.


In accordance with the above spatial filtering, if the sum of the differences is greater than rho then the current pixel is left unchanged (ψ(x)=0), otherwise and adapted diffusion is applied to the current pixel in terms of the formula ψ(x)=(1−(x/rho){circumflex over ( )}2){circumflex over ( )}2.


Temporal Filtering


Referring again to FIG. 3 of the drawings, temporal filtering is applied at block 42. In one embodiment, for temporal filtering, each pixel in a new current frame is (t) received at block 32 is compared to the corresponding co-sited pixel from the previous frame (t−1) that was saved in the temporal buffer at block numeral 34. In particular, I(t, s), the intensity of each pixel of the current frame is compared to the intensity of the co-sited pixel I(t−1, s) of the previous frame time (t−1). For example, referring to FIG. 4, the current frame is represented by reference numeral 46, whereas the previous frame is represented by reference numeral 44; and the co-sited pixels the same have the same (x,y) coordinates. Temporal filtering may then be performed in accordance with the following formula:

T_weight_temporal=ψ(I(t−1,s)−I(t,s)).


The output of the temporal filtering is a temporally filtered pixel calculated in accordance with the following formula:

Temporal_filtered_sample=spatial_filtered_sample+λ*T_weight_temporal.


This new pixel “s” and co-sited past frame pixel “p” are used in above spatial-temporal calculation. The result of the calculation is stored in the past frame storage (temporal buffer). It serves as the input for the following spatial contrast enhancement and may be sent out as the output of the spatial-temporal filter if contrast enhancement is not required.


Contrast Enhancement


In one embodiment, for each pixel s in the temporal buffer, an adaptive diffusion in the spatial domain is calculated as follows:

T_weight(s)=Σψ(I(t,p)−I(t,s));
I(t+1,s)=I(t,s)+λ*T_weight(s); if |T_weight(s)|>0; This means we filtered the current sample; and
I(t+1,s)=I(t,s)+k*H(s); if |T_weight(s)| equals 0; This means this sample is sitting on an edge;

where H(s) is the contrast enhancement function described below and it is weighted by a constant k.


Contrast Enhancement Function


In one embodiment, the contrast enhancement function may utilize edge detectors, in the form of Laplacian and Sobel operators. The Laplacian is a second order derivative operator so that it is very sensitive to random noise. For this reason, it is better to modulate the output of the Laplacian operator by a more structured first order Sobel operator. The Laplacian operator also provides the sign of the contrast enhancement.


The Sobel is defined as the sum of absolute values of the horizontal and vertical gradient operator:

Sobel=abs(Gx(s))+abs(Gy(s));


In one embodiment, small Sobel values may be set to zero and large Sobel values may be claimed as follows:

If(Sobel<c1) Sobel=0; where c1 is a constant; and
If(Sobel>c2) Sobel=c2; where c2 is a constant.


In some embodiments, c1 may be 32 and c2 any be 128.


The contrast enhancement value H(s) may then be calculated as follows:

H(s)=Laplacian(s)*Sobel(s).


The contrast enhancement techniques described above is performed by the contrast announcement block 26 shown in FIG. 1 of the drawings.



FIGS. 5 and 6 show representations of a Laplacian and Sobel operator, respectively used for edge detection in accordance with one embodiment of the invention.


As will be appreciated by one skilled in the art, the aspects of the present invention may be embodied as a system, method or computer program product. Accordingly, aspects of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment (including firmware, resident software, micro-code, etc.), or an embodiment combining software and hardware aspects that may all generally be referred to herein as a “circuit,” “module,” or “system.” Furthermore, aspects of the present invention may take the form of a computer program product embodied in one or more computer readable medium(s) having computer readable program code embodied thereon.


The title, background, brief description of the drawings, abstract, and drawings are hereby incorporated into the disclosure and are provided as illustrative examples of the disclosure, not as restrictive descriptions. It is submitted with the understanding that they will not be used to limit the scope or meaning of the claims. In addition, in the detailed description, it can be seen that the description provides illustrative examples and the various features are grouped together in various implementations for the purpose of streamlining the disclosure. The method of disclosure is not to be interpreted as reflecting an intention that the claimed subject matter requires more features than are expressly recited in each claim. Rather, as the claims reflect, inventive subject matter lies in less than all features of a single disclosed configuration or operation. The claims are hereby incorporated into the detailed description, with each claim standing on its own as a separately claimed subject matter.


The claims are not intended to be limited to the aspects described herein but are to be accorded the full scope consistent with the language claims and to encompass all legal equivalents. Notwithstanding, none of the claims are intended to embrace subject matter that fails to satisfy the requirements of the applicable patent law, nor should they be interpreted in such a way.

Claims
  • 1. A method for a camera, comprising: receiving, by a processor, a current frame;calculating, by the processor, a spatial weight for each pixel s in the current frame, wherein the spatial weight is computed based on a summation of diffused values associated with the pixel s;selectively filtering, by the processor, an intensity I of the pixel s spatially using the spatial weight; andcontrolling, by the processor, a display device to display the current frame based on the selective filtering.
  • 2. The method of claim 1, wherein the diffused values comprise intensity differences between the pixel s and its neighbours in a spatial domain.
  • 3. The method of claim 1, wherein the method further comprises selectively filtering, by the processor, the intensity I of the pixel s based on the summation of diffused values is less than a threshold value.
  • 4. The method of claim 3, wherein the diffused values are calculated according to the formula: T_weight_spatial=Σψ(I(t,p)−I(t,s)); where I represents pixel intensity; and(t,s) specifies each pixel s in the current frame.
  • 5. The method of claim 4, wherein filtering the intensity I of the pixel s spatially is according to the formula: Spatial_filtered_sample=I(t,s)+λ*T_weight_spatial; where λ is a constant.
  • 6. The method of claim 5, wherein selectively filtering the intensity I of the pixel s spatially comprises selecting a constant value rho such that: ψ(x)=(1−(x/rho){circumflex over ( )}2){circumflex over ( )}2; if |x|<=rho; ψ(x)=0; if |x|>rho.
  • 7. The method of claim 6, wherein rho is selected to be proportional to a variance of noise in the current frame image.
  • 8. The method of claim 1, wherein the method further comprises temporally filtering, by the processor, the spatially filtered intensity I of the pixel s based on a temporal weight calculated between the intensity I of the pixel s in the current frame and its value from an immediately preceding frame.
  • 9. The method of claim 8, wherein the temporal weight is calculated according to the formula: T_weight_temporal=ψ(I(t−1,s)−I(t,s));where I(t,s) is the intensity of the pixel s in current frame; andI(t−1, s) is its intensity from the immediately preceding frame (t−1).
  • 10. The method of claim 9, further comprising outputting, by the processor, a temporally filtered pixel calculated in accordance with the following formula: Temporal_filtered_sample−spatial_filtered_sample+λ*T_weight_temporal;where λ is a constant.
  • 11. The method of claim 10, further comprising enhancing, by the processor, contrast in the current frame by applying a contrast enhancement function H(s) to each pixel s with value altered due to the spatial filtering.
  • 12. The method of claim 11, wherein applying the contrast enhancement comprises following formula: T_weight(s)=Σψ(I(t,p)−I(t,s));I(+1,s)=I(t,s)+λ*T_weight(s); if |T_weight(s)|>0;I(t+1,s)=I(t,s)+λ*H(s); if |T_weight(s)|equals0; andwherein k is a constant.
  • 13. The method of claim 11, wherein the contrast enhancement function H(s) comprises an edge detection algorithm.
  • 14. The method of claim 13, wherein the edge detection algorithm is based on at least one of a Sobel operator or a Laplacian operator.
  • 15. The method of claim 11, wherein the contrast enhancement function H(s) is calculated in accordance with the following formula: H(s)=Laplacian(s)*Sobel(s);wherein Laplacian(s) is a Laplacian operator, and Sobel(s) is a Sobel operator.
  • 16. An image processing system, comprising: a processor configured to: receive a current frame;calculate, in a spatial filtering block of an image processing pipeline, a spatial weight for each pixel s in the current frame, wherein the spatial weight is computed based on a summation of diffused values associated with the pixel s;selectively filter, as a step within the image processing pipeline, an intensity I of the pixel s spatially using the spatial weight; andcontrol a display device to display the current frame based on the selective filtering.
  • 17. The image processing system according to claim 16, wherein the diffused values comprise intensity differences between the pixel s and its neighbours in a spatial domain.
  • 18. The image processing system according to claim 16, wherein the processor is further configured to selectively filter the intensity I of the pixel s based on the summation of diffused values is less than a threshold value.
  • 19. The image processing system according to claim 16, wherein the processor is further configured to temporally filter the spatially filtered intensity I of the pixel s based on a temporal weight calculated between the intensity I of the pixel s in the current frame and its value from an immediately preceding frame.
  • 20. The image processing system according to claim 19, wherein the temporal weight is calculated according to the formula: T_weight_temporal=ψ(I(t−1,s)−I(t,s));where I(t,s) is the intensity of the pixel s in current frame; andI(t−1, s) is its intensity from the immediately preceding frame (t−1).
US Referenced Citations (25)
Number Name Date Kind
6014469 Eschbach Jan 2000 A
6148115 Mackinnon et al. Nov 2000 A
9202267 Yang et al. Dec 2015 B1
10269095 Lim et al. Apr 2019 B2
20030161548 Vuylsteke Aug 2003 A1
20050105627 Sun et al. May 2005 A1
20060013503 Kim Jan 2006 A1
20080205785 Geiger et al. Aug 2008 A1
20080231753 Fujiwara et al. Sep 2008 A1
20080285853 Bressan Nov 2008 A1
20090245679 Ohwaki et al. Oct 2009 A1
20100142790 Chang Jun 2010 A1
20110090351 Cote et al. Apr 2011 A1
20110182510 Hong Jul 2011 A1
20120081553 Cote Apr 2012 A1
20120169936 Persson et al. Jul 2012 A1
20130114895 Hong May 2013 A1
20130201401 Hirooka et al. Aug 2013 A1
20140078347 DeBattista Mar 2014 A1
20170061234 Lim et al. Mar 2017 A1
20170278225 Nishimura Sep 2017 A1
20200058105 Liu Feb 2020 A1
20200074717 Story Mar 2020 A1
20210342978 Yu Nov 2021 A1
20220321923 Giladi Oct 2022 A1
Foreign Referenced Citations (1)
Number Date Country
101426610 Aug 2014 KR
Non-Patent Literature Citations (1)
Entry
Extended European Search Report dated Jul. 19, 2022 Application No. 22158444.4-1210.
Related Publications (1)
Number Date Country
20240013346 A1 Jan 2024 US
Continuations (1)
Number Date Country
Parent 17184566 Feb 2021 US
Child 18467604 US