Lecture 8
Lecture 8
Spring 2020
2 / 40
What We Learned So Far ...
3 / 40
What We Learned So Far ...
4 / 40
What We Learned So Far ...
●
Image degradation is modeled as an operator ℋ together with an additive
noise term for an input image f(x,y), to generate the degraded image g(x,y).
●
Given g(x,y), some knowledge about ℋ and some knowledge about the
additive noise term, the objective of restoration is to obtain an estimate of the
original image.
6 / 40
Image Degradation/Restoration Model
●
We will show later that if the operator ℋ is linear and position-invariant,
then the degraded image is given in the spatial domain by:
G(u , v)=H (u , v) F (u , v )+ N (u , v)
with the terms in capital letters as the Fourier transform of the corresponding
terms.
● Let’s focus on noise-only degradation for now!
7 / 40
Noise Models
● Sources of noise in digital images arise mainly during image acquisition and/
or transmission.
● For example in CCD cameras, light levels and sensor temperature are major
factors in the amount of noise.
● During transmission, images are affected by interference in the transmission
channel.
● For example in wireless transmission, lightning or other atmospheric
disturbances cause noise.
8 / 40
Spatial and Frequency Properties of Noise
9 / 40
Noise Probability Distribution Functions (PDF)
– Salt-and-pepper noise
● Salt-and-pepper noise is applied differently.
10 / 40
Important Noise PDFs: Gaussian Noise
11 / 40
Important Noise PDFs: Rayleigh Noise
2
{
2
−(z−a) / b
( z−a)e z≥a
p ( z)= b
0 z<a
z̄=a+ √ π b /4
b(4− π )
2
σ=
4
● Note the displacement from the origin, and the right-skewed shape of the
PDF.
12 / 40
Important Noise PDFs: Erlang (Gamma) Noise
● The PDF of Erlang noise is given by, with a>b, b is a positive integer, and
“!” indicating factorial:
b b−1
a z
{
p ( z)= (b−1)!
0
e
−az
z≥0
z<0
● The mean and variance of z are:
b
z̄=
a
2 b
σ= 2
a
13 / 40
Important Noise PDFs: Exponential Noise
ae−az z≥0
p ( z)= {
0 z<0
where a>0.
● The mean and variance of z are:
1
z̄=
a
1
σ 2= 2
a
● This is a special case of Erlang PDF with b=1.
14 / 40
Important Noise PDFs: Uniform Noise
1
{
p ( z)= b−a
0
a≤ z≤b
otherwise
15 / 40
Important Noise PDFs: Salt-and-Pepper Noise
{
p ( z)= P p for z=0
1−( P s + P p ) for z=V
where k is the number of bits used to represent the intensity values and V is
any integer value in the range 0<V<2k-1.
● For example if Ps=0.02 and Pp=0.01, then P=0.03 meaning that 2% of pixels
are corrupted by salt noise, 1% of pixels are corrupted by pepper noise, in
total, 3% of pixels are corrupted by salt-and-pepper noise.
● The mean and variance are defined as:
17 / 40
Important Noise PDFs: Examples
18 / 40
Important Noise PDFs: Examples
19 / 40
Periodic Noise
20 / 40
Noise Parameter Estimation
21 / 40
Noise Parameter Estimation
● Consider the strip S, and let pS(zi), for i=0,1,2,…,L-1, denote the probability
estimates (normalized histogram values) of the intensities of the pixels in S,
and L the number of possible intensities (for an 8-bit image, L=256).
● The mean and variance of pixel values in S can be computed by:
L−1
z̄= ∑ zi pS ( zi )
i=0
L−1
σ 2= ∑ ( zi − z̄)2 p S ( zi )
i=0
● If the shape of histogram is Gaussian, mean and variance are all we need.
● For other cases, except salt-and-pepper, we use mean and variance to
calculate parameters a and b.
● For salt-and-pepper, we need to calculate the actual probabilities of salt and
pepper occurrence, by counting them and dividing the numbers by the total
number of pixels in the strip.
22 / 40
Restoration for Noise-Only Degradation – Spatial
Filtering
● When the image is only degraded with additive noise, we have the following
in the spatial and frequency domains:
g ( x , y )=f ( x , y )+n( x , y )
G(u , v )=F (u , v )+ N (u , v )
● If the noise component is known, you can simply subtract it from the
degraded image.
● For periodic noise, you can estimate the N(u,v) from the spectrum of G(u,v).
● In general, we don’t know the noise component.
● One way to estimate f(x,y) from its degraded version g(x,y), or in another
word denoising, is spatial filtering.
● We have seen several spatial filters before in Chapter 3.
23 / 40
Restoration for Noise-Only Degradation – Spatial
Filtering
● Mean Filters:
– Arithmetic Mean Filter
– Geometric Mean Filter
– Harmonic Mean Filter
– Contra-Harmonic Mean Filter
● Order-Statistic Filters:
– Median Filter
– Min/Max Filter
– Midpoint Filter
– Alpha-Trimmed Mean Filter
● Adaptive Filters:
– Adaptive, Local Noise Reduction Filter
– Adaptive Median Filter
24 / 40
Spatial Filtering: Mean Filters
● 8-bit X-ray image, with additive Gaussian noise of zero mean and variance of
400.
26 / 40
Spatial Filtering: Mean Filters - Examples
● 8-bit X-ray image, with salt and pepper noise with probability of 0.1.
27 / 40
Spatial Filtering: Mean Filters - Examples
● In general, arithmetic and geometric mean filters are useful for random noise
like Gaussian or uniform noise.
● The contra-harmonic filter is useful for impulse noise, but it must be known
whether the noise is dark or light, in order to select the proper sign for Q.
28 / 40
Spatial Filtering: Order-Statistic Filters
30 / 40
Spatial Filtering: Order-Statistic Filters - Examples
● 8-bit X-ray image, with salt and pepper noise with probability of 0.1.
31 / 40
Spatial Filtering: Order-Statistic Filters - Examples
● 8-bit X-ray image, with additive uniform noise of zero mean and variance
800, plus salt-and-pepper noise with probabilities of Ps=Pp=0.1.
32 / 40
Spatial Filtering: Adaptive Filters
33 / 40
Adaptive Filters: Adaptive, Local Noise Reduction
Filter
σ 2S xy
: local variance of intentensities of the pixels in S xy
● The filter behaves as follows:
– If noise variance is zero (no noise), then f(x,y)=g(x,y);
– If local variance is high relative to noise variance (near edges), the filter
should return a value close to g(x,y);
– If the two variances are equal (local area has the same property as the
overall image), perform averaging to reduce noise.
2
σ
f^ ( x , y )=g( x , y)− 2n [ g( x , y)− z̄ S ] xy
σS xy
34 / 40
Adaptive Filters: Adaptive, Local Noise Reduction
Filter - Example
● 8-bit X-ray image, corrupted by additive Gaussian noise of zero mean and
variance of 1000.
35 / 40
Adaptive Filters: Adaptive Median Filter
37 / 40
Adaptive Filters: Adaptive Median Filter - Example
38 / 40
What is Next?
39 / 40
Questions?
[email protected]
40 / 40