Sei sulla pagina 1di 10

Objectives of Image Restoration

` To improve an image in some predefined sense


` Image enhancement is largely a subjective process
` Restoration is an objective process (most part)
` To recover an image that has been degraded by using a
priori knowledge of the degradation process
` Model the degradation process
Image Restoration ` Apply the inverse process to recover the image

DIGITAL IMAGE PROCESSING

2
2/2553 J.PANYAVARAPORN@GMAIL.COM

Outline Degradation/Restoration Process


` Image Degradation/Restoration Process
` Restoration in the presence of noise only
` Noise Models
` Periodic noise reduction
` Linear, pposition-invariant degradations
g
f ( x, y ) : an input
i t image
i
` Estimation of the degradation process
g ( x, y ) : a degraded image
` Filter design
h( x, y ) : the
h degradatio
d d i n function
f i
` Geometric Transforms
η ( x, y ) : the additive noise
` Remove ggeometric aberrations/distortions
fˆ ( x, y ) : estimate of the original
The more we know about h(x,y)
( ,y) and n(x,y)
( ,y) the close r is the estimate

3 4
Degradation/Restoration Process Noise Models
` If H is linear, position-invariant process, then ` Principal source of noise in digital image is due to:
g ( x, y ) = h ( x, y ) ∗ f ( x, y ) + η ( x, y ) ` Image acquisition (quantization)
G (u, v ) = H (u , v )F (u , v ) + N (u , v ) ` Transmission
` If we assume H is the identity operator, we deal only with ` Noise Models
degradation
g due to noise ` Spatially independent and uncorrelated
` Spatial processing is applicable when the only degradation is ` Spatially periodic noise
additive noise ` Spatially dependent and correlated noise (complex)
` Degradation such as image blur are approached in the
frequency domain, with filters based on various criteria of
optimality
ti lit

5 6

Gaussian Noise Rayleigh Noise


` Gaussian noise or normal ⎧2 −( z − a )
2

⎪ ( z − a )e b for z ≥ a
` Most common model of noise p(z ) = ⎨ b
` The PDF of the Gaussian random ⎪⎩ 0 for z < a
variable z is given by: μ = a + πb 4
b(4 − π )
p(z ) =
1
e −( z − μ ) / 2σ σ2 =
2 2

2π σ 4

z : gray level
l l ` The basic shape of the PDF is skewed to the right
μ : mean of z ` The Rayleigh density is useful for approximating skewed
σ : standard deviation histograms
σ 2: variance of z
7 8
Erlang Noise Exponential Noise
⎧ a b z b −1 − az
⎪ for z ≥ 0 ⎧ae − az for z ≤ 0
p( z ) = ⎨ (b − 1)! p(z ) = ⎨
e
⎪⎩ 0 for z < 0 ⎩ 0 for z > 0
where a and b are positive integers ` Where a > 0
b b
μ = ; σ2 = 1
μ = ;σ 2 =
1
a a2 a a2

` When the denominator is the gamma function Γ(b), its ` Special case of the Erlang PDF with b = 1
called the gamma density

9 10

Uniform Noise Impulse Noise (Salt & Pepper)

⎧ 1

p(z ) = ⎨ b − a
if a ≤ z ≤ b ⎧ Pa for z = a

⎪⎩ 0 otherwise p(z ) = ⎨ Pb for z = b
⎪0 otherwise
a + b 2 (b − a )
2 ⎩
μ= ;σ =
2 12

If either Pa or Pb = 0 Æ unipolar noise

If Pa = Pb (≠ 0) Æ salt and pepper (or shot and spike)

11 12
Noise Models Noise Models
` Noise impulse can be negative ` Noise models provide useful tools to model a broad
or positive range of noise corruption
` Scaling is part of the digitizing ` Gaussian noise: electric circuit noise, sensor noise due to poor
process ill i i and
illumination d hi
highh temperature
` Rayleigh noise: characterizes noise phenomena in range imaging
` Impulse
p noise is usuallyy
` E
Exponential
ti l and
d Gamma
G noise:
i applications
li ti in
i laser
l imaging
i i
large compared with the
` Impulse noise: quick transients (such as faulty switching) take
image signal place during imaging
` Pure black (pepper) or white ` Uniform noise: basis for random number generation in
((salt)) is equal
q to the minimum simulations
and maximum allowed values
g
in the digitized image
g

13 14

Noise Histograms
g Noise Histogram

` Diffi lt tto differentiate


Difficult diff ti t visually
i ll
15 16
Periodic Noise Examples of Periodic Noise
` Statistically dependent
` Typical from electrical or electromagnetic interferences Image corrupted by
during image acquisition “sinusoidal noise” of
` Can be reduced by various frequencies
` Inspection of the Fourier spectrum
` Create the necessary filter in the frequency domain

FFourier
i ttransform
f off a
pure sinusoid is a pair of
conjugate impulses

17 18

Estimation of Noise Parameters Estimation of Noise Parameters


` Two approached
` Visual analysis
` Automatic analysis
` Noise spikes are exceptionally pronounced
` Some knowledge is available
` If the
h image
i system is
i available
il bl
` Capture a set of images on a “flat” environment
` If only
l the
h images are available
l bl
` Estimate noise parameters from small patches of reasonably ` Vertical strips were cropped from the noisy images
constant
t t gray level
l l
` The shape of the histogram closely resembles the noise PDF

19 20
Estimation of Noise Parameters Noise Only Model
Noise-Only
` Simplest way to use the data from the image strip is for ` When the only degradation present in the image is noise
calculating the mean and variance of the gray levels
g ( x, y ) = f ( x, y ) + η ( x, y )
` If S is a strip (subimage)
μ = ∑ zi p ( zi ) G (u , v ) = F (u , v ) + N (u , v )
zi ∈S
` If η(x,y) is periodic
σ = ∑ ( zi − μ )2 p( zi )
2
` Estimate N(u,v)
( , ) from G(u,v)
( , )
zi ∈S
zi : the gray - level value of the pixels in S ` Subtract N(u,v) from G(u,v) to obtain an estimate of F(u,v)
p ( zi ) : the corresponding normalized histogram values ` If η(x,y) is not periodic
` The shape of the histogram identifies the closest PDF ` Spatial filtering is the preferred method of choice when the
match only additive noise is present.
` If the shape is gaussian then the mean and variance
completely
co p ete y specifies
spec es the
t e PDF of
o the
t e noise
o se
21 22

Spatial Filters Arithmetic Mean Filters


` Mean Filters ` Sxyy: is the set of coordinates in a rectangular subimage
` Arithmetic
A ih i MMean window of size m x n, centered at point (x,y)
` Geometric Mean
` Harmonic Mean
` The arithmetic mean filtering process computes the
` Contra-Harmonic mean filter average value of the corrupted image g(x,y) in the image
` Order-Statistic Filters Sxy
` Median filter
fˆ (x, y ) = ∑ g (s, t )
` Max and Min filter
1
` Midpoint filter mn ( s ,t )∈S xy
` Alpha-trimmed mean filter
` Adaptive Filters ` Noise is reduced as a result of blurringg
` Adaptive local noise reduction filter
` Adaptive median filter

23 24
Geometric Mean Filter Harmonic Filter
` A geometric mean filter achieves smoothing comparable ` Works well for salt noise, but fails for pepper noise.
to the arithmetic mean filter, but it tends to lose less image ` Performs well also with other types of noise like Gaussian
detail in the process noise.

fˆ ( x, y ) =
1 mn
⎡ ⎤ mn
fˆ ( x, y ) = ⎢ ∑ g (s, t )⎥
1
⎢⎣( s ,t )∈S xy ⎥⎦
∑ g (s, t )
( )
s ,t ∈S xy

25 26

Contra Harmonic Mean Filter


Contra-Harmonic-Mean Examples
∑ g (s , t )
Q +1 (a) X-Ray image
( ) (b) Gaussian noise,
fˆ ( x, y ) =
s ,t ∈S xy
zero mean, variance
∑ g (s, t )
Q
=400
( s,t )∈S xy (c) Arithmetic mean
filter size 3x3
` Q: order of the filter (d) Geometric mean
` Well suited for reducing or virtually eliminating the filter size 3x3
effects of salt-and-pepper noise Geometric mean filter
did not blur the
` Positive
P i i value
l off Q Æ eliminate
li i pepper noise
i
image as much as
` Negative value of Q Æ eliminates salt noise arithmetic mean
` Cannot do both simultaneously
` If Q = 0, Æ arithmetic mean filter
` If Q = -1 Æ harmonic mean filter

27 28
Examples Examples
(a) Pepper noise with
pprobabilityy of 0.1 ` The arithmetic and geometric mean filters are well suited
(b) Salt noise with probability for random noise like Gaussian or uniform noise.
of 0.1
(c) Filtering (a) using contra
contra- ` The contra-harmonic filter is well suited for impulse noise
harmonic filter (Q=1.5) ` Must be known whether the noise is light or dark to choose
(d) Filtering (b) using Q = -1.5 the proper sigh of Q
Positive order filter did a better ` Result of selecting the wrong Q
job of cleaning the
g
background, , at the expense
p
of blurring the dark areas.
The opposite effect is true
for negative-order contra-
harmonic filters

29 30

Median Filter Max and Min Filter


` Order-statistic filter are spatial filters whose response is ` Max filter:
based on ordering (ranking)the pixels contained in the fˆ ( x, y ) = max {g (s, t )}
( s ,t )∈S xy
image area encompassed by the filter ` Useful for finding the brightest points in the image
` Median Filter: replaces the value of a pixel by the median ` Because pepper noise have very low values, they are reduced by
of the gray-level in the neighborhood of that pixel this filter
fˆ ( x, y ) = median{g (s, t )}
( s ,t )∈S xy ` Min Filter fˆ ( x, y ) = min {g (s, t )}
( s ,t )∈S xy
` For certain types of noise, they provide excellent noise
reduction capabilities with considerable less blurring than ` Useful for finding the darkest points in an image
linear smoothing filters of similar size ` Reduces salt noise

31 32
Midpoint Filter Alpha Trimmed Mean Filter
Alpha-Trimmed
` Computes the midpoint between the maximum and the ` Delete the d/2 lowest and d/2 highest gray-level values of g(s,t)
minimum values in the area in the neighborhood Sxy
` gr(s,t) represents the remaining (mn-d) pixels
fˆ ( x, y ) = ⎡⎢ max {g (s, t )}+ min {g (s, t )}⎤⎥
1 ` A filter formed by averaging these remaining pixels is called
2 ⎣( s ,t )∈S xy ( s ,t )∈S xy alpha-trimmed mean filter

fˆ ( x, y ) = ∑ g (s, t )
1
` This filter combines order statistics and averaging mn − d
r
( s ,t )∈S xy
` Works best for randomly distributed noise,
noise like Gaussian
noise or uniform noise. ` d can range from 0 to mn-1
` d=0 Æ arithmetic mean filter
` d ( 1) Æ median
d=(mn-1) d ffilter
l
` Other values of d Æ useful in situations with multiple kinds of noise,
i.e. combination of salt-and-pepper
p pp and Gaussian

33 34

Examples Examples
(a) Image corrupted by salt
and pepper noise
` (a) Applying the max filter to the pepper noise image
(b) One pass with the ` Also removed some dark pixels
median filter. (several ` (b) Applying the min filter to the salt noise image
noise points are still
visible) ` Did a better job than max filter
(c) Second pass with ` Removed some white points around the border of light objects
median filter
(d) Third pass

Repeated pass of a median


filter tend to blur the
image
It is desirable to keep the
number of passes as low
as possible
p

35 36
Examples
(a) Uniform noise (variance 800, zero
mean)
(b) Addition of salt-and-pepper noise
(Pa=Pb=0.1)
( ) Arithmetic mean filter (5x5)
(c)
(d) Geometric mean filter (5x5)
Q
Question
i ?
((e)) Median Filter ((5x5))
(f) Alpha-trimmed mean (5x5,d=5)

The arithmetic and geometric


e metric mean
filter do not do well because of the
presence of impulse noise
Th alpha
The l h trimmed
i d fil
filter gives
i slightly
li h l
better noise reduction than median
filter

37

Potrebbero piacerti anche