Professional Documents
Culture Documents
Enhancement
•Enhancement mostly subjective process
Image Restoration I to enhance image w.r.t. human visual system
empirical
Noise .e.g. contrast stretching
MIRS MIRS
Introduction II Introduction II
•Restorationrecover original image from degradations •Restoration reconstruct or recover the original image
where degradations were incurred while • modeling the degradation
the digital image was being obtained. • inverse process : formulate a criterion of goodness for
optimal estimate of the original image.
•Two types of Degradations :
1. Blurring effect from optical systems, image motion.. restoration
2. Noise from electronic and photometric sources •Other degradations: sensor, digitizer, and display
degradations.
MIRS MIRS
1
Introduction III Degradation model I
•Spatial domain vs. frequency domain ?
g H{ f } n
•Restoration Know or model H and n, then apply the inverse
process to recover the original image f from g.
MIRS MIRS
2
Additive Noise Only Degradation
• Now let’s consider H is the identity operator (H=I)
g H{ f } n
Noise Models
g f n
MIRS MIRS
-1 -1 -1
0 50 100 150 0 50 100 150 0 50 100 150
MIRS MIRS
3
Noise Model III g Hf n Noise Model III g Hf n
•the noise models n can be characterized by a probability •Examples of the noise models (pdf’s) n :
density function:
• characterized by its mean and variance 2
• intensity fluctuation (variance) around a fixed value •Gaussian noise
(mean) 3
noisy reault; g=f+n •Rayleigh noise
2
•Erlang (Gamma) noise
• histogram •Exponential noise
1
•Uniform noise
0
• probability density function •Impulse noise (Salt-and-pepper)
-1
0.16 0 50 100 150
0.14
0.12
0.1
0.08
0.06
0.04
0.02
0
-1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1
MIRS MIRS
a b / 4
0.14
0.12 n=randn(1,10)*sigma
0.1
0.08
b( 4 )
70% in the range of
[ , ]
2
0.06
0.04
0.02 95% in 4
0
-1 -0.5 0 0.5 1
[ 2 , 2 ]
MIRS MIRS
4
Other Noise Models Other Noise Models
a zb b 1
•Erlang (Gamma) noise
e az z0
•Exponential noise ae az z0
p ( z ) (b 1)! p( z )
0 z0
0 z0
•Where a >0, and b is positive. •Where a >0.
b 1
3
exponential pdf
a 2.5
2
a
b 1
2 2
1.5
2
1
a 0.5 a2
0
0 1 2 3 4 5
MIRS MIRS
2
(b a ) 2
2
12
a b MIRS MIRS
5
Other Noise Models Examples of Noise Models
MIRS MIRS
Function g=Gaussnoise(f,sigma)
If nargin<2, sigma = 0.05; %define std
g = randn(size(f))*sigma+f;
Gaussian noise
MIRS MIRS
6
Salt Pepper Noise generator Parameter estimation
•Salt and pepper noise generator •Use data for pdf parameter estimation: select subimage S
0.16
0.12
0.1
0.04
0.02
x = rand(size(f));
̂ zi p ( zi )
0
-1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1
•How about salt or pepper only noise? •Parameter estimation use ̂ and ̂ 2 to solve for
parameters a and b for various pdf (pdf ‘s shape
MIRS MIRS
from histogram).
•Substraction of noise n from g is usually difficult • s xy is the mask window; A and B are the sizes of the window
noise is unknown
•Smoothing out the local noise in an image blurring
1
•Geometric mean filter: AB
•Noise-reduction spatial filters
fˆ ( x,y ) g (m, n)
( m ,n )S xy
•Similar to those in image enhancement
•Comparable to the arithmetic mean filter but lose less detail
MIRS MIRS
7
Mean filters II Adaptive, local noise reduction filter
•Harmonic mean filter: •Suppose we know the overall variance of an image n2
•(What if we do not know?)
AB
fˆ ( x,y ) •Now an adaptive filter is designed as:
1
2
fˆ ( x,y ) g ( x, y ) n2 g ( x, y ) ˆ L
g ( m ,n )
( m , n )S xy
•Good for Gaussian noise ˆ L
•Contraharmonic mean filter: •Where: ̂ L and ˆ L2 are the local mean and variance
g ( m, n )
( m , n )S xy
Q 1 of the local image (window) s xy
fˆ ( x,y ) n 2 =0, fˆ ( x,y ) g ( x, y ) f ( x, y )
g (m, n)
( m , n )S xy
Q •If
•Q: order of the filter
•Q= 0 arithmetic mean filter •If n 2 L 2 , fˆ ( x,y ) g ( x, y )
•Q=-1 harmonic mean filter
• if , f ( x,y ) ̂
MIRS
2 2 ˆ MIRS
n L L
8
Order-
Order-Statistics filters Examples
•Rank the pixels and choose a specific ordered pixel t
min median max •Original image •Gaussian noisy image
•Median filter:
fˆ ( x,y ) median{g (m, n)}
( m , n )S xy
1
•Midpoint: fˆ ( x,y ) [ max {g (m, n)} min {g (m, n)}]
2 ( m ,n )S xy ( m , n )S xy •3x3 geometric
•3x3 arithmetic mean mean filtered image
•Alpha-trimmed mean filter: filtered image
•use only AB-C number of pixels for arithmetic mean
•Remove C/2 lowest and C/2 highest pixels in s xy MIRS MIRS
Examples Examples
t t
•(a) Pepper and salt noise •(b) median filtered once
•(a) Pepper noise (p=0.1) •(b) Salt noise (p=0.1) (pp=ps=0.1)
•Contraharmonic filter •Contraharmonic filter •Median filtered twice •Median filtered 3 times
With Q=1.5 on (a) With Q=-1.5 on (b) MIRS MIRS
9
Adaptive Median Filter I Adaptive Median Filter II
• zmin min gray level value in S xy •Level A: A1 zmed z min
A2 zmed z max
• zmax max gray level value in S xy
•If A1>0 and A2<0, Go to Level B
• zmed median gray level value in S xy •Else increase the window size
•If window size S maxthen repeat level A
• z xy gray level value at coordinates (x,y) •Else output z xy
Periodic
noise Fourier Transform
MIRS MIRS
10
Periodic Noise: Example Periodic Noise Component
• Rescaled Fourier Spectrum • Periodic noise: pairs of conjugate impulses
MIRS MIRS
D0 MIRS MIRS
11
Butterworth Band-reject filter Gaussian Band-reject filter
H (u, v) 1 2
1 D 2 ( u ,v ) D0
2n 2
D(u, v)W
1 2 2 2 D ( u ,v )W
D (u , v) D0 H (u , v) 1 e
MIRS MIRS
MIRS MIRS
12
BandPass and Notch filters
•Bandpass = 1 – bandreject
MIRS
13