Chapter4 IPPR
Chapter4 IPPR
Introduction
Image Restoration is the operation of taking a corrupt/noisy image and estimating the clean,
original image. Corruption may come in many forms such as motion blur, noise and camera mis-
focus. Image restoration is performed by reversing the process that blurred the image and such is
performed by imaging a point source and use the point source image, which is called the Point
Spread Function (PSF) to restore the image information lost to the blurring process.
g(x,y)=h(x,y)*f(x,y)+η(x,y)
G(u,v)=H(u,v)F(u,v)+N(u,v)
Noise and Images
The sources of noise in digital images arise during image acquisition (digitization) and
transmission
Noise models
• Source of noise
– Image transmission
– Fourier spectrum
• If we can estimate the noise model we can figure out how to restore the image
– Gaussian
– Rayleigh
– Erlang (Gamma)
– Exponential
– Uniform
– Impulse
1
p( z ) e ( z ) / 2
2 2
a) Gaussian Noise
2
2
( z a )e ( z a ) / b for z a
2
b) p( z ) b Rayleigh Noise
0 for z a
a b z b 1 z
e for z 0
c) p ( z ) (b 1)! Gamma Noise
0 for z 0
ae az for z 0
d) p( z ) Exponential Noise
0 for z 0
1
for a z b
e) p ( z ) b a Uniform Noise
0 otherwise
Pa for z a
f ) p ( z ) Pb for z b Salt Pepper Noise
0
otherwise
Gaussian noise
• Math. tractability in spatial and frequency domain
• Electronic circuit noise and sensor noise caused by poor illumination and transmission.
• Probability Density Function (PDF) equal to normal distribution.
• Here, z is gray level.
1
p( z ) e ( z ) / 2
2 2
2
Mean Variance
Note: p( z )dz 1
Uniform noise
The test pattern to the right is ideal for demonstrating the addition of noise
The following slides will show the result of adding noise based on various models to this image
This test pattern is well-suited for illustrating the noise models, because it is composed of simple,
constant areas that span the grey scale from black to white in only three increments. This
facilitates visual analysis of the characteristics of the various noise components added to the
image.
Filtering to Remove Noise
We can use spatial filters of different kinds to remove different kinds of noise
The arithmetic mean filter is a very simple one and is calculated as follows:
1
fˆ ( x, y ) g ( s, t )
mn ( s ,t )S xy
1 1 1
/9 /9 /9
1 1 1
/9 /9 /9
1 1 1
/9 /9 /9
– Achieves similar smoothing to the arithmetic mean, but tends to lose less image detail.
1
mn
fˆ ( x, y ) g ( s, t )
( s ,t )S xy
Harmonic Mean:
mn
fˆ ( x, y )
1
( s ,t )S xy g ( s, t )
Works well for salt noise, but fails for pepper noise.
Also does well for other kinds of noise such as Gaussian noise
Contraharmonic Mean:
g ( s, t )
( s ,t )S xy
Q 1
fˆ ( x, y )
g ( s, t )
( s ,t )S xy
Q
Spatial filters based on ordering the pixel values that make up the neighbourhood defined by the
filter support.
Useful spatial filters include
– Median filter
– Max and min filter
– Midpoint filter
– Alpha trimmed mean filter
Median Filter
fˆ ( x, y) median{g ( s, t )}
( s ,t )S xy
Excellent at noise removal, without the smoothing effects that can occur with other smoothing
filters . Particularly good when salt and pepper noise is present.
Max Filter:
fˆ ( x, y) max {g ( s, t )}
( s ,t )S xy
Min Filter:
fˆ ( x, y) min {g ( s, t )}
( s ,t )S xy
Max filter is good for pepper noise and Min filter is good for salt noise.
Midpoint Filter:
We can delete the d/2 lowest and d/2 highest grey levels.So gr(s, t) represents the remaining mn –
d pixels.
• For other values of d, the alpha- trimmed filter is useful in situations involving multiple
types of noise such as a combination of salt-and-pepper and Gaussian noise.
Adaptive Filters
The filters discussed so far are applied to an entire image without any regard for how image
characteristics vary from one point to another. The behaviour of adaptive filters changes
depending on the statistical characteristics of the image inside the filter region. Improved
filtering power but increasing complexity . We will take a look at the adaptive median filter.
The median filter performs relatively well on impulse noise as long as the spatial density of the
impulse noise is not large. The adaptive median filter can handle much more spatially dense
impulse noise, and also performs some smoothing for non-impulse noise.
The key to understanding the algorithm is to remember that the adaptive median filter has three
purposes:
– Remove impulse noise
– Provide smoothing of other noise
– Reduce distortion (excessive thinning or thickening of object boundaries).
In the adaptive median filter, the filter size changes depending on the characteristics of the
image.
Notation:
– Sxy = the support of the filter centerd at (x, y)
– zmin = minimum grey level in Sxy
– zmax = maximum grey level in Sxy
– zmed = median of grey levels in Sxy
– zxy = grey level at coordinates (x, y)
– Smax =maximum allowed size of Sxy
A2 = zmed – zmax
Stage A determines if the output of the median filter zmed is an impulse or not (black or white).
If it is not an impulse, we go to stage B.If it is an impulse the window size is increased until it
reaches Smax or zmed is not an impulse.Note that there is no guarantee that zmed will not be an
impulse. The smaller the the density of the noise is, and, the larger the support Smax, we expect
not to have an impulse.
B2 = zxy – zmax
Stage B determines if the pixel value at (x, y), that is zxy, is an impulse or not (black or white).
If it is not an impulse, the algorithm outputs the unchanged pixel value zxy .
Periodic Noise
Typically arises due to electrical or electromagnetic interference. Gives rise to regular noise
patterns in an image. Frequency domain techniques in the Fourier domain are most effective at
removing periodic noise.
Band Reject Filters
Removing periodic noise form an image involves removing a particular range of frequencies
from that image.
Band reject filters can be used for this purpose
An ideal band reject filter is given as follows:
W
1 if D(u , v) D0 2
W W
H (u , v) 0 if D0 D (u , v) D0
2 2
1 if D(u , v) D0 W
2
The ideal band reject filter is shown below, along with Butterworth and Gaussian versions of the
filter.
1) BandReject Filters
if Du , v D0
1-1) Ideal : W
1 2
H u , v 0 Du, v D0
W W
if D0
2 2
if Du , v D0
1 W
2
1 2 2
D u , v D0
1-3) Gaussian :
2
1 D 2 u ,v D0
2
2 D u ,v W
H u, v 1 e
2) Bandpass Filters Hbp(u,v)=1-Hbr(u,v)
D1 u , v u
M N
u0 v v0
2 2
1
2
2 2
D1 u , v u
M N
u0 v v0
2 2
The center of the frequency rectangle has been shifted to the point (M/2,N/2)
H u , v
1
3-2) Butterworth of order n n
D0
2
1
D1 u , v D2 u, v
3-3) Gaussian
1 D u ,v D2 u ,v
1
H u, v 1 e
2 D0 2