Arthur Alaniz, Tina Mantaring: Difference between revisions

From Psych 221 Image Systems Engineering
Jump to navigation Jump to search
imported>Cmgmant
imported>Cmgmant
Line 15: Line 15:
[[File:fig_LPAcombined.png|500px]]
[[File:fig_LPAcombined.png|500px]]


If we let <math>g_{m,s,\theta}^{(k)}</math> denote a directional 1D convolution kernel, where <math>m</math> is the polynomial order, <math>s</math> is the scale or size of the kernel (kernel width), <math>k</math> is the order of the derivative, and <math>\theta</math> is the direction, then we can write the interpolation kernels <math>\bar{g}_{s,\theta}</math> and the denoising kernels <math>\tilde{g}_{s,\theta}</math> as follows:
Letting <math>g_{m,s,\theta}^{(k)}</math> denote a directional 1D convolution kernel, where <math>m</math> is the polynomial order, <math>s</math> is the scale or size of the kernel (kernel width), <math>k</math> is the order of the derivative, and <math>\theta</math> is the direction, then the interpolation kernels <math>\bar{g}_{s,\theta}</math> and the denoising kernels <math>\tilde{g}_{s,\theta}</math> can be written as follows:
: <math>\bar{g}_{s,\theta} = (1 - \alpha) g_{0,s,\theta}^{(0)} + \alpha g_{1,s,\theta}^{(0)} + \beta g_{1,s,\theta}^{(1)}</math>
: <math>\bar{g}_{s,\theta} = (1 - \alpha) g_{0,s,\theta}^{(0)} + \alpha g_{1,s,\theta}^{(0)} + \beta g_{1,s,\theta}^{(1)}</math>
: <math>\tilde{g}_{s,\theta} = (1 - \alpha) g_{0,s,\theta}^{(0)} + \alpha g_{1,s,\theta}^{(0)} + \beta g_{1,s,\theta}^{(1)}</math>
: <math>\tilde{g}_{s,\theta} = (1 - \alpha) g_{0,s,\theta}^{(0)} + \alpha g_{1,s,\theta}^{(0)} + \beta g_{1,s,\theta}^{(1)}</math>


Note that there are 4 possible directions for the interpolation filters, while the denoising filters use 8 directions. Aside from this, the structures for the interpolation and denoising kernels are very similar. Indeed, the primary difference between them is that their component filters operate on different support channels. This is shown in the figure below.
The paper used 4 possible directions for the interpolation filters and 8 directions from the denoising kernels. Aside from this, the structures for the interpolation and denoising kernels were very similar. Indeed, the primary difference between them was that their component filters operated on different support channels. This is shown in the figure below.


[[File:fig_LPAexamples.png|600px]]
[[File:fig_LPAexamples.png|600px]]
Line 30: Line 30:


=== Intersection of Confidence Intervals ===
=== Intersection of Confidence Intervals ===
We created the interpolation and denoising filters <math>\bar{g}_{s,\theta}</math> and <math>\tilde{g}_{s,\theta}</math> for different scales <math>s</math>. The goal of ICI is to choose the largest scale for which the local polynomial approximation is still valid. This is done as follows:
The interpolation and denoising filters <math>\bar{g}_{s,\theta}</math> and <math>\tilde{g}_{s,\theta}</math> were created for different scales <math>s</math>. The goal of ICI was to choose the largest scale for which the local polynomial approximation is still valid. This was done as follows:


First, we find the standard deviations of our interpolation and denoising estimates using some estimate of the standard deviation of the noise. This is done as follows:
First, the standard deviations of the interpolation and denoising estimates were found using some estimate of the standard deviation of the noise. This was done as follows:


: <math>\sigma_{\bar{y}_{s,\theta}}(x) = \sqrt{(\bar{g}_{s,\theta}^2 * \sigma^2)(x)}</math>
: <math>\sigma_{\bar{y}_{s,\theta}}(x) = \sqrt{(\bar{g}_{s,\theta}^2 * \sigma^2)(x)}</math>
: <math>\sigma_{\tilde{y}_{s,\theta}}(x) = \sqrt{(\tilde{g}_{s,\theta}^2 * \sigma^2)(x)}</math>
: <math>\sigma_{\tilde{y}_{s,\theta}}(x) = \sqrt{(\tilde{g}_{s,\theta}^2 * \sigma^2)(x)}</math>


In the above formulas, <math>\sigma</math> is the estimated standard deviation of the noise. The paper gives two examples of signal-dependent noise models, and their corresponding standard deviation estimates:
In the above formulas, <math>\sigma</math> is the estimated standard deviation of the noise. The paper gave two examples of signal-dependent noise models, and their corresponding standard deviation estimates:
:* Poisson noise: <math>\hat{\sigma} = \sqrt{ z / \chi}</math>, and <math>\chi = 0.5447</math>
:* Poisson noise: <math>\hat{\sigma} = \sqrt{ z / \chi}</math>, and <math>\chi = 0.5447</math>
:* Nonstationary Gaussian noise with signal-dependent standard deviation: <math>\hat{\sigma} = |k_0 + k_1 z|</math>, and <math>k_0 = 10, k_1 = 0.1</math>
:* Nonstationary Gaussian noise with signal-dependent standard deviation: <math>\hat{\sigma} = |k_0 + k_1 z|</math>, and <math>k_0 = 10, k_1 = 0.1</math>


Next, for our sets of estimates <math> \{ \bar{y}_{s,\theta} : s\ \epsilon\ \{s_1, s_2, ... s_n\} \} </math> and <math> \{ \tilde{y}_{s,\theta} : s\ \epsilon\ \{s_1, s_2, ... s_n\} \}</math>, we can obtain sets of confidence intervals as follows:
Next, for the sets of estimates <math> \{ \bar{y}_{s,\theta} : s\ \epsilon\ \{s_1, s_2, ... s_n\} \} </math> and <math> \{ \tilde{y}_{s,\theta} : s\ \epsilon\ \{s_1, s_2, ... s_n\} \}</math>, they obtained sets of confidence intervals as follows:
: <math>\bar{D}_i = [\bar{y}_{s,\theta}(x) - \bar{\Gamma} \sigma_{\bar{y}_{s,\theta}}(x),\  \bar{y}_{s,\theta}(x) + \bar{\Gamma} \sigma_{\bar{y}_{s,\theta}}(x)]</math>
: <math>\bar{D}_i = [\bar{y}_{s,\theta}(x) - \bar{\Gamma} \sigma_{\bar{y}_{s,\theta}}(x),\  \bar{y}_{s,\theta}(x) + \bar{\Gamma} \sigma_{\bar{y}_{s,\theta}}(x)]</math>
: <math>\tilde{D}_i = [\tilde{y}_{s,\theta}(x) - \tilde{\Gamma} \sigma_{\tilde{y}_{s,\theta}}(x),\  \tilde{y}_{s,\theta}(x) + \tilde{\Gamma} \sigma_{\tilde{y}_{s,\theta}}(x)]</math>
: <math>\tilde{D}_i = [\tilde{y}_{s,\theta}(x) - \tilde{\Gamma} \sigma_{\tilde{y}_{s,\theta}}(x),\  \tilde{y}_{s,\theta}(x) + \tilde{\Gamma} \sigma_{\tilde{y}_{s,\theta}}(x)]</math>
Line 47: Line 47:
where <math>i</math> denotes the index of the scale that was used. Note that the threshold parameters are design parameters.
where <math>i</math> denotes the index of the scale that was used. Note that the threshold parameters are design parameters.


Finally, we find our adaptive scale for interpolation <math>i^+</math> by finding the largest <math>i</math> such that the intersection of confidence intervals <math>I_i = \bigcap_{j=1}^i \bar{D}_i</math> is nonempty. Using this scale <math>i^+</math>, our interpolation estimate will then be <math>\bar{y}_{s_{i^+}, \theta}</math>. Similarly, we find our adaptive scale for denoising <math>i^+</math> by finding the largest <math>i</math> such that the intersection of confidence intervals <math>I_i = \bigcap_{j=1}^i \tilde{D}_i</math> is nonempty. This will give us our denoising estimate of <math>\tilde{y}_{s_{i^+}, \theta}</math>.
Finally, the adaptive scale for interpolation <math>i^+</math> was found by finding the largest <math>i</math> such that the intersection of confidence intervals <math>I_i = \bigcap_{j=1}^i \bar{D}_i</math> is nonempty. Using this scale <math>i^+</math>, the interpolation estimate would then be <math>\bar{y}_{s_{i^+}, \theta}</math>. Similarly, the adaptive scale for denoising <math>i^+</math> was found by finding the largest <math>i</math> such that the intersection of confidence intervals <math>I_i = \bigcap_{j=1}^i \tilde{D}_i</math> is nonempty. This results in the denoising estimate of <math>\tilde{y}_{s_{i^+}, \theta}</math>.


=== Anisotropic Denoising and Interpolation ===
=== Anisotropic Denoising and Interpolation ===
Line 55: Line 55:




After applying the ICI criterion, we obtained adaptive-scale estimates from each direction <math>\theta</math>. These directional denoised and interpolated estimates can be linearly combined to produce the final pixel value at a location <math>x</math>. The actual formulas used to do this can be found in [[#LPA-ICI-CFAI | [1]]].
After applying the ICI criterion, they obtained adaptive-scale estimates from each direction <math>\theta</math>. These directional denoised and interpolated estimates were then linearly combined to produce the final pixel value at a location <math>x</math>. The actual formulas used to do this can be found in [[#LPA-ICI-CFAI | [1]]].


The block diagram of the joint denoising and demosaicking algorithm is shown below.
The block diagram of the joint denoising and demosaicking algorithm is shown below.
Line 61: Line 61:
[[File:fig_LPA-ICI-diagram.png | 500px]]
[[File:fig_LPA-ICI-diagram.png | 500px]]


We see here that, using our pre-designed filter kernels, the denoising of the CFA values and the interpolation of green pixels at the red and blue locations happens simultaneously. Then, using the denoised Bayer data and the noisy, fully-interpolated green channel, the full-noise free green channel is produced, as well as the interpolated red and blue pixels at the blue and red locations, respectively. Finally, using the noise-free green channel, the red and blue pixels are interpolated at the green locations, producing our final, 3-channel image.
We see here that, using the pre-designed filter kernels, the denoising of the CFA values and the interpolation of green pixels at the red and blue locations happens simultaneously. Then, using the denoised Bayer data and the noisy, fully-interpolated green channel, the full-noise free green channel is produced, as well as the interpolated red and blue pixels at the blue and red locations, respectively. Finally, using the noise-free green channel, the red and blue pixels are interpolated at the green locations, producing the final, 3-channel image.


== Noise Estimation ==
== Noise Estimation ==

Revision as of 23:07, 18 March 2011

Introduction

As the use of digital cameras becomes more and more widespread, the imaging algorithms that go into these cameras have also become more sophisticated. The typical digital camera uses a processing pipeline to convert raw sensor values to a final image, and the different parts of the pipeline may involve correcting for hardware defects, interpolating color filter array values, removing noise, and performing color space transformations. As more and more focus is being given to this field, the pipeline algorithms are also becoming more and more complex. However, one must ask the question: do these complex algorithms really outperform their simpler, more straightforward counterparts?

Methods

Denoising and Demosaicking

For our project, the primary algorithm we chose for our imaging pipeline was the one presented in the paper “Denoising and Interpolation of Noisy Bayer Data with Adaptive Cross-Color Filters”, by D. Paliy, A. Foi, R. Bilcu, and V. Katkovnik. Their technique performs simultaneous denoising and demosaicking using directional adaptive filters that are based on the concepts of local polynomial approximation (LPA) and intersection of confidence intervals (ICI). Their paper is summarized in this section.

Local Polynomial Approximation

Local polynomial approximation, or LPA, works on the assumption that the data in some local region can be fitted to a polynomial function. The cross-color filters used in the algorithm are linear combinations of LPA smoothing and difference filters that operate on complimentary color channels.

The above figure shows an example of an LPA smoothing filter (left) and an LPA difference filter (right). The combined LPA cross-color filter is shown below, where the differing colors illustrate that the smoothing and difference components work on different color channels.

Letting gm,s,θ(k) denote a directional 1D convolution kernel, where m is the polynomial order, s is the scale or size of the kernel (kernel width), k is the order of the derivative, and θ is the direction, then the interpolation kernels g¯s,θ and the denoising kernels g~s,θ can be written as follows:

g¯s,θ=(1α)g0,s,θ(0)+αg1,s,θ(0)+βg1,s,θ(1)
g~s,θ=(1α)g0,s,θ(0)+αg1,s,θ(0)+βg1,s,θ(1)

The paper used 4 possible directions for the interpolation filters and 8 directions from the denoising kernels. Aside from this, the structures for the interpolation and denoising kernels were very similar. Indeed, the primary difference between them was that their component filters operated on different support channels. This is shown in the figure below.

In the figure, (a) illustrates how the green pixel is interpolated at position g(0). The smoothing components of the interpolation filter operate on the green pixels, while the difference component operates on the red pixel. In (b), we see how denoising of the green pixel at g(0) is done. The smoothing components of the denoising filter operate on the green pixels, while the difference component operate on the red pixels. Similarly, when we are denoising a red pixel, as in (c), the smoothing components operate on the red pixels, while the difference component operates on the green pixels. Finally, since the denoising filters have 8 directions, they can operate along diagonals, which is shown in (d). When denoising green pixels along diagonals, we have only green pixels to deal with, and so there is no difference component. However, when we are denoising red or blue pixels, the smoothing component operates on the same channel while the difference component operates on the complimentary color channel.

Since the filters are directional, the origin of the filter is not in the center, but is located to one side. Obtaining the estimate is done by convolving the filter with the input pixels. That is, if z is our noisy CFA data, then for each scale s1<s2<s3<...<sn, we obtain the interpolation and denoising estimates y¯s,θ(x) and y~s,θ(x) at each pixel position x as follows:

y¯s,θ(x)=(g¯s,θ*z)(x)
y~s,θ(x)=(g~s,θ*z)(x)

Intersection of Confidence Intervals

The interpolation and denoising filters g¯s,θ and g~s,θ were created for different scales s. The goal of ICI was to choose the largest scale for which the local polynomial approximation is still valid. This was done as follows:

First, the standard deviations of the interpolation and denoising estimates were found using some estimate of the standard deviation of the noise. This was done as follows:

σy¯s,θ(x)=(g¯s,θ2*σ2)(x)
σy~s,θ(x)=(g~s,θ2*σ2)(x)

In the above formulas, σ is the estimated standard deviation of the noise. The paper gave two examples of signal-dependent noise models, and their corresponding standard deviation estimates:

  • Poisson noise: σ^=z/χ, and χ=0.5447
  • Nonstationary Gaussian noise with signal-dependent standard deviation: σ^=|k0+k1z|, and k0=10,k1=0.1

Next, for the sets of estimates {y¯s,θ:s ϵ {s1,s2,...sn}} and {y~s,θ:s ϵ {s1,s2,...sn}}, they obtained sets of confidence intervals as follows:

D¯i=[y¯s,θ(x)Γ¯σy¯s,θ(x), y¯s,θ(x)+Γ¯σy¯s,θ(x)]
D~i=[y~s,θ(x)Γ~σy~s,θ(x), y~s,θ(x)+Γ~σy~s,θ(x)]

where i denotes the index of the scale that was used. Note that the threshold parameters are design parameters.

Finally, the adaptive scale for interpolation i+ was found by finding the largest i such that the intersection of confidence intervals Ii=j=1iD¯i is nonempty. Using this scale i+, the interpolation estimate would then be y¯si+,θ. Similarly, the adaptive scale for denoising i+ was found by finding the largest i such that the intersection of confidence intervals Ii=j=1iD~i is nonempty. This results in the denoising estimate of y~si+,θ.

Anisotropic Denoising and Interpolation

Combining the adaptive-scale kernels in all directions gives us an idea of the best local space for which the polynomial model fits the data. The figure below shows the combined denoising kernels for the red pixel in the center.


After applying the ICI criterion, they obtained adaptive-scale estimates from each direction θ. These directional denoised and interpolated estimates were then linearly combined to produce the final pixel value at a location x. The actual formulas used to do this can be found in [1].

The block diagram of the joint denoising and demosaicking algorithm is shown below.

We see here that, using the pre-designed filter kernels, the denoising of the CFA values and the interpolation of green pixels at the red and blue locations happens simultaneously. Then, using the denoised Bayer data and the noisy, fully-interpolated green channel, the full-noise free green channel is produced, as well as the interpolated red and blue pixels at the blue and red locations, respectively. Finally, using the noise-free green channel, the red and blue pixels are interpolated at the green locations, producing the final, 3-channel image.

Noise Estimation

In the previous section, an estimate of the standard deviation of the noise was needed to properly perform demosaicking and denoising. Using the noise models that were used in #LPA-ICI-CFAI and mentioned briefly in the previous section gave pretty poor results. Thus, we wanted to use a more accurate noise model.

We used the noise estimation algorithm presented in the paper “Practical Poissonian-Gaussian noise modeling and fitting for single-image raw-data” by A. Foi, M. Trimeche, V. Katkovnik, and K. Egiazarian. This was the same noise-estimation algorithm that was used in #LPA-ICI-CFAI to obtain their results using cameraphone images.

In the paper by Foi et. al, they assume that a noisy pixel observation z at a location x would be of the form

z(x)=y(x)+σ(y(x))ξ(x)

where y(x) is the true noise-free value, ξ(x) is zero-mean independent random noise whose standard deviation is 1, and σ(y(x)) is a function of y that gives the standard deviation of the overall amount of noise.

Furthermore, they assume that the noise term is composed of a Poisson component ηp, which models the photon noise of the sensor, and a Gaussian component ηg, which models noise that is independent of the signal (eg. thermal noise). We write

σ(y(x))ξ(s)=ηp(y(x))+ηg(x)

Using properties of the Poisson and Gaussian distributions, and some elementary algebra (see 3 for the complete derivation), they found that the overall standard deviation of the observed noisy signal would have the form

σ(y(x))=a(y(x))+b

where a and b are parameters of the sensor.

The rest of the paper describes a method for estimating a and b using only a single image. First, they preprocess the data by converting it into the wavelet domain. This allows them to segment the data into non-overlapping regions (level sets), where the value for each set should be smooth. Next, for each of the sets, a (mean, standard deviation) pair is computed. Finally, the maximum-likelihood (ML) approach is used to fit a global model to the set of (mean, standard deviation pairs).

The paper also adjusts the model for the clipped case; that is, when the noise might be causing the sensor values to go below the minimum or maximum values, and would thus be clipped to the minimum or maximum values, respectively. In such a case, clipping would cause the variance of the noise would be lower, something the model needs to account for.

Post-Filtering

Color Correction

Results

Conclusions

References

[1] Paliy, D., A.Foi, R. Bilcu, V. Katkovnik, “Denoising and Interpolation of Noisy Bayer Data with Adaptive Cross-Color Filters”, SPIE-IS&T Electronic Imaging, Visual Communications and Image Processing 2008, vol. 6822, San Jose, CA, January 2008.

[2] Paliy, D., V. Katkovnik, R. Bilcu, S. Alenius, K. Egiazarian, “Spatially Adaptive Color Filter Array Interpolation for Noiseless and Noisy Data”, International Journal of Imaging Systems and Technology (IJISP), Special Issue on Applied Color Image Processing, vol. 17, iss. 3, pp. 105-122, October 2007.

[3] Foi, A., M. Trimeche, V. Katkovnik, and K. Egiazarian, “Practical Poissonian-Gaussian noise modeling and fitting for single-image raw-data”, IEEE Trans. Image Process., vol. 17, no. 10, pp. 1737-1754, October 2008.

[4] Foi, A., S. Alenius, V. Katkovnik, and K. Egiazarian, “Noise measurement for raw data of digital imaging sensors by automatic segmentation of non-uniform targets”, IEEE Sensors Journal, vol. 7, no. 10, pp. 1456-1461, October 2007.

Appendix

Sources and Results

Work Breakdown