Image Restoration Techniques
Image Restoration Techniques
Image Restoration
Techniques
(Chapter 5 of textbook)
1
Recall…
Key Stages in DIP: Image Restoration
Ima ge
Re s tora tion S e gme nta tion
Ima ge Morphologica l
Enha nce me nt P roce s s ing
h(x,y)
4
Some important Noise PDFs
Consider the following image which contains 3 gray levels.
0.8
0.6
0.4
0.2
0
0 50 100 150 200 250
5
Some important Noise PDFs
Continued…
Noisy Image
Histogram of the
Noisy Image
6
Gaussian Rayleigh Gamma
Some important Noise PDFs
Continued…
Noisy Image
Histogram of the
Noisy Image
8
• Mean filters: There are four main types of noise reduction mean filters that can be
used for image restoration/enhancement.
1. Arithmetic Mean Filter: Let Sxy be the coordinates in a subimage window of size
m x n centered at point (x,y). The value of the restored image at any point (x,y) is
given by:
➢ This operation can be implemented by a convolution mask in which all its components have a value 1/mn.
➢ Local variations in the image is smoothed and noise is reduced as a result of blurring.
9
2. Geometric Mean Filter: Let Sxy be the coordinates in a subimage window of size m x n
centered at point (x,y). The value of the restored image at any point (x,y) is given by:
➢ In this filter, each pixel is given by the product of the pixels in the subimage windows, raised to the
power of 1/mn.
➢ Achieves more smoothing, but looses less image details.
3. Harmonic Mean Filter: Let Sxy be the coordinates in a subimage window of size m x n centered at
point (x,y). The value of the restored image at any point (x,y) is given by:
➢ Harmonic mean filter works well with the salt noise but fails for the pepper noise.
➢ It works well with other types of noise as well, such as Gaussian noise. 10
4. Contra-Harmonic Mean Filter: Let Sxy be the coordinates in a subimage window of
size m x n centered at point (x,y). The value of the restored image at any point (x,y) is
given by:
➢ Q is the order of the filter. This filter is well suited for reducing the effects of salt-and-pepper noise.
➢ For negative values of Q, it eliminates the salt noise and for positive values of Q, it eliminates the
pepper noise.
➢ The filter becomes the arithmetic mean filter for Q=0, and harmonic mean filter for Q= -1.
11
• Mean filters Original Additive
– Arithmetic mean filter Gaussian
– Geometric mean filter noise with
– Harmonic mean filter =0, 2=400.
– Contra-harmonic mean filter
3x3Artithmetic
Mean Filter 3x3 Geometric
Mean Filter
(Sharper details)
Pepper Noise
• Mean filters with Pp=0.1
– Arithmetic mean filter
– Geometric mean filter
Salt Noise
– Harmonic mean filter
with Ps=0.1
– Contra-harmonic mean filter
3x3 3x3
Contraharmonic Contraharmonic
With Q=1.5 With Q=-1.5
(good for Pepper) (good for Salt)
• Order Statistic filters: There are four main types of noise reduction order statictic
filters that can be used for image restoration/enhancement.
➢ The value of a pixel in is replaced by the median of the gray level in the neighborhood
characterized by Sxy subimage.
➢ Median filters are very effective in bipolar or unipolar impulse (Salt & Pepper) noise.
14
2. Max and Min Filters: Let Sxy be the coordinates in a subimage window of size m x n
centered at point (x,y). The value of the restored image at any point (x,y) is given by:
➢ Useful for finding the brightest points in the image. Also, reduces the pepper noise.
➢ Useful for finding the darkest points in the image. Also, reduces the salt noise.
1
fˆ(x,y) max g(s,t) min g(s,t)
2 ( s,t) S xy (s,t) S xy
➢ This filter combines the order statistics and averaging. Works best for Gaussian and uniform noise.
• Order statistics filters
– Median filter Some traces of
pepper noise
– Max and min filters
– Mid-point filter Salt & Pepper 3x3
Noise with Median Filter
Pa=Pb=0.1 (first pass)
Completely
removed
3x3
3x3 Median Filter
Median Filter (third pass)
(second pass)
Some dark border pixels
• Order statistics filters are removed
– Median filter
– Max and min filters
– Mid-point filter
3x3
Salt Noise with Min Filter
Pa=0.1 Good for Salt
Restoration in the presence of Noise
(1) Adaptive Local Noise Reduction Filter:
Mean and variance are the simplest statistical measures of a random noise.
• Mean gives the measure of the average gray level in a local region,
• Variance gives the measure of the average contrast in the region.
• Consider a filter operating in a local region, Sxy, where the response of the filter at any point (x,y)
depends on:
a) g(x,y), the value of the noisy image at (x,y)
b) , the additive noise variance,
c) mL , local mean of pixels in Sxy.
d) L , the local variance in Sxy.
18
(1) Adaptive Local Noise Reduction Filter: Continued…
2. If L >> , the filter should return a value close to g(x,y). High local variance is associated
with edges and should be preserved.
3. If L = , return arithmetic mean of Sxy. This occurs when local noise has the same properties
of the entire image. Averaging simply reduces the noise.
• According to the preceding assumptions the filter response can be modeled as:
• The only unknown parameter in the above adaptive filter model is , The other
parameters can be calculated at the local neighborhood of Sxy.
19
(1) Adaptive Local Noise Reduction Filter: Continued…
Image corrupted
by Gaussian Noise
with 7x7
2
Arithmetic Mean
=1000 Filter
μ= 0
7x7
7x7 Adaptive Filter
Geometric Mean
Filter
20
(2) Adaptive Median Filter:
Adaptive median filter can filter impulse noise with very high probabilities. Additionally
smoothes the nonimpulse noise which is not the feature of a traditional median filter.
• Note that unlike the other filters the size of Sxy increases during the filtering operation.
• Changing size of the filter mask does not change the fact that the output of the filter is still a
single value centering the mask.
21
(2) Adaptive Median Filter: Continued…
• The Adaptive median filtering Algorithm: Two levels exist (Levels A and B)
22
(2) Adaptive Median Filter: Continued…
Undesired
discontinuities
23
(3) Periodic Noise Removal by Frequency Domain Filtering:
• Bandreject, bandpass and notch filters can be used for periodic noise removal.
24
(3) Periodic Noise Removal by Frequency Domain Filtering:
Continued…
❑ Ideal Bandreject filter is given by:
Butterworth Bandreject
Filter (n=4) Filtered Image
26
(3) Periodic Noise Removal by Frequency Domain Filtering:
Continued…
❑ Bandpass filters perform the opposite function of the bandreject filters
and the filter transfer function of a bandpass filter is given by:
H (u,v)bp 1 H (u,v)br
Spectrum of
Image corrupted by corrupted image
sinusoidal noise
27
(3) Periodic Noise Removal by Frequency Domain Filtering:
Continued…
❑ Notch filters rejects/passes frequencies in a predefined neighborhoods about the center freq.
• Notch filters appear in symmetric pairs due to the symmetry of the Fourier transform.
• The transfer function of ideal notch filter of radius of D0 , with centers at (u0,v0) and by symmetry
at (-u0,-v0), is given by:
0 if D1(u,v) D0 or D2 (u,v) D0
H (u,v)
1 otherwise
1/ 2
2 2
D1 (u,v) (u M / 2 u 0 ) (v N / 2 v 0)
1/ 2
2 2
D 2(u,v) (u M / 2 u 0 ) (v N / 2 v0 )
28
(3) Periodic Noise Removal by Frequency Domain Filtering:
Continued…
• The transfer function of Butterworth notch filter of order n and of radius of D0 , with centers at
(u0,v0) and by symmetry at (-u0,-v0), is given by:
• The transfer function of Gaussian notch filter of radius of D0 , with centers at (u0,v0) and by
symmetry at (-u0,-v0), is given by:
29
(3) Periodic Noise Removal by Frequency Domain Filtering:
Continued…
Notch filters transfer function comparison:
Ideal Notch
Filter
Gaussian Notch
Butterworth Notch Filter
Filter (of order 2)
30
(3) Periodic Noise Removal by Frequency Domain Filtering:
Continued…
Notch filters Example:
The degradation function H can be estimated by visually looking into a small section of the image
containing simple structures, with strong signal contents, like part an object and the background.
Given a small sub-image gs(x,y), we can manually (i.e. filtering) remove the degradation in that
region with an estimated subimage fˆ (x,y)and assuming that the additive noise is negligible in such an
area with a strong signals content.
Gs (u,v)
H s (u,v)
Fsˆ(u,v)
Having Hs(u,v) estimated for such a small subimage, the shape of this degradation function can be
used to get an estimation of H(u,v) for the entire image.
32
(2) Estimation by Image Experimentation:
• If we have the acquisition device producing degradation on images, we can use the
same device to obtain an accurate estimation of the degradation.
• This can be achieved by applying an impulse (bright dot) as an input image. The
Fourier transform of an impulse is constant, therefore.
G(u,v)
H (u,v)
A
Where, A is a constant describing the strength of the impulse. Note that the effect of noise on
an impulse is negligible.
33
Estimation by Image Experimentation: Continued…
Simply take the Fourier transform of the degraded image and after normalization by a
constant A, use it as the estimate of the degradation function H(u,v).
34
(3) Estimation by Mathematical Modelling:
❑ Sometimes the environmental conditions that causes the degradation can be modeled
by mathematical formulation. For example the atmospheric turbulence can be modeled
by:
2
k (u v )2 5/6
k is a constant that depends on the nature of the Turbulence
H (u,v) e
• This equation is similar to Gaussian LPF and would produce blurring in the image according to the
values of k . For example if k =0.0025, the model represents severe turbulence, if k =0.001, the
model represents mild turbulence and if k =0.00025, the model represents low turbulence.
• Once a reliable mathematical model is formed the effect of the degradation can be obtained easily.
35
(3) Estimation by Mathematical Modelling: Continued…
Severe turbulenc
Negligible turbulence k=0.0025
Low turbulence
Mild turbulence k=0.00025
k=0.001
36
(3) Estimation by Mathematical Modelling: Continued…
❑ In some applications the mathematical model can be derived by treating that the image is
blurred by uniform linear motion between the image and the sensor during image
acquisition. The motion blur can be modeled as follows:
• Let f(x,y) be subject to motion in x- and y-direction by time varying motion
components x0(t) and y0(t).
• The total exposure is obtained by integrating the instantaneous exposure over the time
interval during the shutter of the imaging device is open.
• If T is the duration of the exposure, then
37
(3) Estimation by Mathematical Modelling: Continued…
By assuming that the linear uniform motion is in x-direction only at a rate of x0(t)=at/T,
the image covers a distance , when t=T.
T T
j 2 ux 0(t) j2 uat/T
H (u,v) e dt e dt
0 0
T j ua
sin( ua)e
ua
T j (ua vb)
H (u,v) sin (ua vb) e
(ua vb)
38
(3) Estimation by Mathematical Modelling: Continued…
39