chapter_5

advertisement
Chapter 5
Image Restoration
國立雲林科技大學 電子工程系
張傳育(Chuan-Yu Chang ) 博士
Office: ES 709
TEL: 05-5342601 ext. 4337
E-mail: chuanyu@yuntech.edu.tw
Chapter 5 Image Restoration

Image Degradation/Restoration Process


The objective of restoration is to obtain an
estimate fˆ ( x, y) of the original image.
fˆ ( x, y) will be close to f(x,y).
Restoration的目的在於獲得原始影像的
估計影像,此估計影像應儘可能的接近
原始影像。
2
Image Degradation/Restoration Process

The degraded image is given in the spatial domain
by
Degradation function
g ( x, y)  h( x, y) * f ( x, y)   ( x, y)
(5.1-1)
noise

The degraded image is given in the frequency
domain by
G(u, v)  H (u, v) F (u, v)  N (u, v)
(5.1-2)
3
Noise Models: Some Important Probability
Density Functions

The principal sources of noise





Image acquisition
transmission
Gaussian noise (normal noise)
1
1( z   ) 2 / 2 2
p( z ) 
e
2 
Rayleigh noise
2
2
 ( z  a )e  ( z  a ) / b
p( z )   b
0

Erlang (Gamma)
  a  b / 4
b( 4   )
2 
noise 4
for z  a
for z  a
 a b z b 1  az
e

p( z )   (b  1)!

0


for z  0
for z  0
b
a
2 
b
a2
4
Noise Models

Exponential noise
 1

if a  z  b
p( z )   b  a
 0
otherwise
ab

2
(b  a) 2
2
 
12

Uniform noise

Impulse (salt and pepper) noise
 Pa for z  a

p ( z )   Pb for z  b
0 otherwise

ae az
p( z )  
 0
1

a
1
2  2
a
for z  0
for z  0
5
Some important probability density function
偏離原點的位移,
向右傾斜
6
Example 5.1
Sample noisy images and their histograms

下圖為原始影像,將在此圖中加入不同的
雜訊。
7
Example 5.1 (cont.)
Sample noisy images and their histograms
8
Example 5.1 (cont.)
Sample noisy images and their histograms
9
Periodic Noise

Periodic Noise



Arises typically from electrical or electromechanical
interference during image acquisition.
It can be reduced via frequency domain filtering.
Estimation of Noise Parameters




Estimated by inspection of the Fourier spectrum of the
image.
Periodic noise tends to produce frequency spikes that often
can be detected by visual analysis.
From small patches of reasonably constant gray level.
The heights of histogram are different but the shapes are
similar.
10
Example
影像遭受
sinusoidal
noise的破壞
有規則性的亮點
影像的
spectrum
11
Fig 5.4(a-c)中的某小塊影像的histogram
Histogram的形狀幾乎和Fig4(d,e,k)的形狀一樣但高度不同。
12
Periodic Noise

The simplest way to use the data from the image
strips is for calculating the mean and variance of the
gray levels.

 zi pzi 
(5.2-15)
zi S
2 
 zi   2 pzi 
(5.2-16)
zi S

The shape of the histogram identifies the closest
PDF match.
13
Restoration in the presence of noise
only-spatial filtering

Degradation present in an image is noise
g ( x, y)  f ( x, y)   ( x, y)
G(u, v)  F (u, v)  N (u, v)


The noise terms ((x,y), N(u,v)) are unknown, so subtracting
them from g(x,y)or G(u,v)is not a realistic option.
In periodic noise,it is possible to estimate N(u,v) from the
spectrum of G(u,v).
14

Mean Filter

Arithmetic mean filter


Let Sxy represent the set of coordinates in a rectangular
subimage windows of size mxn, centered at point (x,y).
The arithmetic mean filtering process computes the average
value of the corrupted image g(x,y) in the area defined by Sxy.
ˆf ( x, y)  1
g ( s, t )

m n ( s ,t )S xy


This operation can be implemented using a convolution mask
in which all coefficients have value 1/mn.
Noise is reduced as a result of blurring
15
Mean Filter (cont.)

Geometric mean filter

Each restored pixel is given by the product of the pixels in
the subimage window, raised to the power 1/mn.


ˆf ( x, y )  
g ( s, t ) 

( s ,t )S xy


1
mn
A geometric mean filter achieves smoothing comparable to
the arithmetic mean filter, but it tends to lose less image
detail in the process.
16
Example 5.2
Illustration of mean filters
被平均值0,變異數
400的加成性高斯雜訊
破壞的結果
17
Restoration in the presence of noise
only-spatial filtering

Harmonic mean filter
fˆ ( x, y ) 
mn

( s ,t )S xy

1
g ( s, t )
可濾除salt noise,
但對pepper noise則失敗
Contra-harmonic mean filter
 g ( s, t )
Q 1
ˆf ( x, y )  ( s ,t )S xy
Q
g
(
s
,
t
)

若 Q>0 可濾除pepper noise,
若 Q<0 可濾除salt noise,
若 Q=0 為算數平均
若 Q=-1為Harmonic mean
( s ,t )S xy
18
被機率0.1的pepper雜
訊破壞的結果
Chapter 5
Image Restoration
The positive-order filter did a
better job of cleaning the
background.
In general, the arithmetic and
geometric mean filters are well
suited for random noise.
The contraharmonic filter is well
suited for impulse noise
被機率0.1的salt雜訊
破壞的結果
19
Results of selecting the wrong sign in
contra-harmonic filtering
The disadvantage of contraharmonic filter is that it must
be known whether the noise is dark or light in order to
select the proper sign for Q.
The result of choosing the wrong sign for Q can be
disastrous.
在contra-harmonic filter中選取錯誤正負號所導致的結果
20
Order-Statistics Filters


The response of the order-statistics filters is based
on ordering (ranking) the pixels contained in the
image area encompassed by the filter.
Median filter

Replaces the value of a pixel by the median of the gray
levels in the neighborhood of that pixel.
fˆ ( x, y)  mediang s, t 
(5.3-7)
( s ,t )S xy


Medial filter provide excellent noise-reduction capabilities,
with considerably less blurring than linear smoothing filters
of similar size.
Median filters are particularly effective in the presence of
both bipolar and unipolar impulse noise.
21
Order-Statistics Filters (cont.)

Max filter


This filter is useful for finding the brightest points in an
image.
可濾除pepper noise
It reduces pepper noise
fˆ ( x, y)  max g s, t 
( s ,t )S xy

(5.3-8)
Min filter

This filter is useful for finding the darkest points in an image

It reduces salt noise.
fˆ ( x, y)  min g s, t 
( s ,t )S xy
(5.3-9)
可濾除salt noise
22
Order-Statistics Filters (cont.)

Midpoint filter


This filter works best for randomly distributed noise, such as
Gaussian or uniform noise.
1
(5.3-10)
fˆ ( x, y)   max g s, t  min g s, t 
( s ,t )S xy
2 ( s ,t )S xy

Alpha-trimmed mean filter

We delete the d/2 lowest and the d/2 higest gray-level values
of g(s,t) in the neighborhood Sxy.
fˆ ( x, y) 
1
g r (s, t )

mn d ( s ,t )S xy
(5.3-11)
先刪除0.5d最大與最小的灰階值,再求剩下的灰階平均值
當d=0,則為mean filter
當d=(mn-1)/2時,為median filter
23
Example 5.3
Illustration of order-statistics filters
Result of one pass with a median filter of size
3x3, several noise points are still visible.
Image corrupted by salt
and pepper noise with
probabilities Pa=Pb=0.1
Result of processing (b)
with median filter again
Result of processing (c)
with median filter again
24
Example 5.3
Illustration of order-statistics filters
Result of filtering with
a max filtering
Result of filtering with
a min filtering
25
Example 5.3 Illustration of order-statistics filters
Result of filtering with
a arithmetic mean
filter
Result of filtering with
a median filter
Result of filtering with
a geometric mean
filter
Result of filtering with
a alpha-trimmed
mean filter
26
Adaptive Filter

Adaptive Filter



The behavior changes based on statistical characteristics
of the image inside the filter region defined by the m x n
rectangular windows Sxy.
The price paid for improved filtering power is an increase in
filter complexity.
Adaptive, local noise reduction filter



The mean gives a measure of average gray level in the
region.
The variance gives a measure of average contrast in that
region.
The response of the filter at any point (x,y) on which the
region is centered is to be based on four quantities:




g(x,y): the value of the noisy image.
The variance of the noise corrupting f(x,y) to form g(x,y)
mL, the local mean of the pixels in Sxy.
The local variance of the pixels in Sxy.
27
Adaptive local noise reduction filter

The behavior of the filter to be as follows:




If the variance of g(x,y) is zero, the filter should return simply
the value of g(x,y).
If the local variance is high relative to the variance of g(x,y) ,
the filter should return a value close to g(x,y).
If the two variances are equal, return the arithmetic mean
value of the pixels in Sxy.
An adaptive expression for obtaining estimated f(x,y) based
on these assumptions may be written as
ˆf ( x, y )  g ( x, y )    g x, y   m 
L
2
2
L
The only quantity that
Needs to be known
(5.3-12)
28
Example 5.4 Illustration of adaptive, local
Arithmetic mean
noise-reduction filtering
7*7
Gaussian noise
geometic mean
7*7
Adaptive filter
29
Adaptive median filter



Adaptive median filtering can handle impulse noise,
it seeks to preserve detail while smoothing
nonimpulse noise.
The adaptive median filter changes the size of Sxy
during filter operation, depending on certain
conditions.
Consider the following notation:





Zmin: minimum gray level value in Sxy.
Zmax: maximum gray level value in Sxy.
Zmed: median of gray levels in Sxy.
Zxy: gray level at coordinates (x,y).
Smax: maximum allowed size of Sxy.
30
Adaptive median filter (cont.)



The adaptive median filtering algorithm
Level A:
A1=zmed-zmin
A2=zmed-zmax
if A1>0 and A2<0, goto level B
判斷zmed是否為
else increase the window size
impulse noise
if window size <=Smax, repeat level A
else output zxy
Level B:
B1=zxy-zmin
B2=zxy-zmax
if B1>0 and B2 <0, output zxy
else output zmed
31
Adaptive median filter (cont.)

The objectives of the adaptive median filter




Remove the slat-and-pepper noise
Preserve detail while smoothing nonimpulse noise
Reduce distortion
The purpose of level A is to determine in the
median filter output, zmed is an impulse or not.
32
Example 5.5 Illustration of adaptive median
filtering
Corrupted by saltand pepper noise
with probabilities
Pa=Pb=0.25
Result of filtering with a
7x7 median filter
The noise was effectively removed, the filter
caused significant loss of detail in the image
Result of adaptive median
filtering with Smax=7
Preserved sharpness
and detail
33
Periodic Noise Reduction by Frequency Domain
Filtering

Bandreject Filter

Remove a band of frequencies about the origin of the
Fourier transform.
W

Ideal Bandreject filter
1

H (u , v)  0

1

if D(u , v)  D0 
(5.4-1)
W
W
 D(u , v)  D0 
2
2
W
f D(u , v)  D0 
2
if D0 
N order Butterworth filter H (u, v) 
Gaussian Bandreject filter
2
1
 D(u, v)W 
1  2
2
D
(
u
,
v
)

D
0 

H (u, v)  1  e
1  D 2 ( u ,v )  D02 
 

2  D ( u ,v )W 
2n
(5.4-2)
2
(5.4-3)
34
Periodic Noise Reduction by Frequency Domain
Filtering (cont.)
35
Periodic Noise Reduction by Frequency Domain
Filtering (cont.)
Image corrupted
by sinusoidal
noise
Butterworth
bandreject filter
of order 4
36
Periodic Noise Reduction by Frequency Domain
Filtering (cont.)

Bandpass Filters


A bandpass filter performs the opposite operation of a
bandreject filter.
The transfer function Hbp(u,v) of a bandpass filter is
obtained from a corresponding bandreject filter with
transfer function Hbr(u,v) by
Hbp (u, v)  1 Hbr (u, v)
(5.4-4)
37
Periodic Noise Reduction by Frequency Domain
Filtering (cont.)

Bandpass filtering is quit useful in isolating the
effect on an image of selected frequency bands.
以帶通濾波器所獲得
的圖5.16(a)影像的雜
訊圖樣
This image was generated by
(1) Using Eq(5.4-4) to obtain
the bandpass filter.
(2) Taking the inverse
transform of the bandpassfiltered transform
38
Periodic Noise Reduction by Frequency Domain Filtering
(cont.)
因為對稱性的關係

Notch Filters

Rejects frequencies in predefined neighborhoods about a
center frequency.
0 if D1 (u, v)  D0 or D2 (u, v)  D0
H (u, v)  
otherwise
1


D (u, v)  u  M / 2  u   v  N / 2  v  
2
1
2 2
2
1
2 2
D1 (u, v)  u  M / 2  u0   v  N / 2  v0 
2

0
0
(5.4-5)
(5.4-6)
(5.4-7)
Due to the symmetry of the Fourier transform, notch
filters must appear in symmetric pairs about the origin
39
Periodic Noise Reduction by Frequency Domain
Filtering (cont.)

order n Butterworth notch filter
H (u, v) 

1


D02
1 

 D1 (u, v) D2 (u, v) 
(5.4-8)
Gaussian notch reject filter
H (u, v)  1  e

n
1  D ( u ,v ) D2 ( u ,v ) 
  1

2 
D02

(5.4-9)
These three filters become highpass filters if u0=v0=0.
40
Periodic Noise Reduction by Frequency Domain
Filtering (cont.)
Ideal notch
order 2
Butterworth
notch filter
Gaussian
notch filter
若u0=v0=0,上述三種濾波器,則退化成高通濾波器
41
Periodic Noise Reduction by Frequency Domain
Filtering (cont.)

Notch pass filters


We can obtain notch pass filters that pass the frequencies
contained in the notch areas.
Exactly the opposite function as the notch reject filters.
H np u, v  1  H nr u, v

(5.4-10)
Notch pass filters become lowpass filters when u0=v0=0.
42
Periodic Noise Reduction by Frequency Domain
Filtering (cont.)
Spectrum
image
佛羅里達州和墨西哥灣的衛
星影像
(存在水平掃描線)
Notch filter
空間域的雜
訊影像
43
Periodic Noise Reduction by Frequency Domain
Filtering (cont.)

Optimal Notch filtering



Clearly defined interference patterns are not
common.
Images obtained from electro-optical scanner are
corrupted by coupling and amplification of lowlevel signals in the scanners’ electronic circuitry.
The resulting images tend to contain significant,
2D periodic structures superimposed on the scene
data.
44
Periodic Noise Reduction by Frequency Domain
Filtering (cont.)




Image of the Martian terrain taken by the Mariner 6 spacecraft.
The interference pattern is hard to detect.
The star-like components were caused by the interference, and
several pairs of components are present.
The interference components generally are not single-frequency
bursts. They tend to have broad skirts that carry information
about the interference pattern.
45
Periodic Noise Reduction by Frequency Domain
Filtering (cont.)


Optimal Notch filtering minimizes local
variances of the restored estimate image.
The procedure contains three steps:


Extract the principal frequency components of the
interference pattern.
Subtracting a variable, weighted portion of the
pattern from corrupted image.
46
Periodic Noise Reduction by Frequency Domain
Filtering (cont.)

The first step is to extract the principal
frequency component of the interference
pattern


Done by placing a notch pass filter, H(u,v) at the
location of each spike.
The Fourier transform of the interference noise
pattern is given by the expression
N u, v   H u, v Gu, v 
where G(u,v) denotes the Fourier transform of the
corrupted image.
47
Periodic Noise Reduction by Frequency Domain
Filtering (cont.)

Formation of H(u,v) requires considerable
judgment about what is or is not an interference
spike.


The notch pass filter generally is constructed
interactively by observing the spectrum of G(u,v) on a
display.
After a particular filter has been selected, the
corresponding pattern in the spatial domain is obtained
from the expression
 x, y   1H u, vGu, v
48
Periodic Noise Reduction by Frequency Domain
Filtering (cont.)

Because the corrupted image is assumed to be formed by the
addition of the uncorrupted image f(x,y) and the interference, if
(x,y) were know completely, subtracting the pattern from g(x,y)
to obtain f(x,y) would be a simple matter.
 This filtering procedure usually yields only an approximation of
the true pattern.
 The effect of components not present in the estimate of (x,y) can
be minimized instead by subtracting from g(x,y) a weighted
portion of (x,y) to obtain an estimate of f(x,y).
fˆ x, y   g x, y   wx, y  x, y 


(5.4-13)
The function w(x,y) is to be determined, which is called as
weighting or modulation function.
The objective of the procedure is to select this function so that the
result is optimized in some meaningful way.
49
Periodic Noise Reduction by Frequency Domain
Filtering (cont.)


To select w(x,y) so that the variance of the estimate f(x,y) is
minimized over a specified neighborhood of every point (x,y).
Consider a neighborhood of size (2a+1) by (2b+1) about a
point (x,y), the local variance can be estimated as
2
a
b
1


  x, y  
fˆ x  s, y  t   fˆ x, y 



2a  12b  1 s a t b 
2
(5.4-14)
where
fˆ x, y  
a
b
1
fˆ x  s, y  t 


2a  12b  1 s  a t b
(5.4-15)
50
Periodic Noise Reduction by Frequency Domain
Filtering (cont.)
Substituting Eq(5.4-13) into Eq(5.4-14) yield



a
b
1
  x, y  
 g x  s, y  t  wx  s, y  t  x  s, y  t   g ( x, y)  wx, y  x, y 
2a  12b  1 s
  a t  b
2

(5.4-16)
Assuming that w(x,y) remains essentially constant
over the neighborhood gives the approximation
wx  s, y  t   w( x, y )

2
(5.4-17)
This assumption also results in the expression
wx, y  x, y   wx, y  x, y 
(5.4-18)
in the neighborhood.
51
Periodic Noise Reduction by Frequency Domain
Filtering (cont.)

With these approximations Eq5.4-160 becomes


a
b
1
  x, y  
 g x  s, y  t  wx  s, y  t  x  s, y  t   g ( x, y)  wx, y  x, y 
2a  12b  1 s
  a t  b
2

To minimize variance, we solve
for w(x,y)

 2 x, y 
0
wx, y 
The result is
wx, y  
(5.4-19)
(5.4-20)
g x, y  ( x, y)  g x, y  ( x, y)
2
 ( x, y)  ( x, y)
2
2
(5.4-21)
52
Periodic Noise Reduction by Frequency Domain
Filtering (cont.)
圖5-20(a)的傅立
葉頻譜
53
Periodic Noise Reduction by Frequency Domain
Filtering (cont.)
N(u,v)的傅立葉頻
譜
對應的雜訊圖樣
54
Periodic Noise Reduction by Frequency Domain
Filtering (cont.)
處理後的影像
55
Linear, Position-Invariant Degradations
Additivity
If H is a linear operator, the response to a sum of two inputs is equal to
the sum of the two response
g ( x, y )  H [ f ( x, y )]   ( x, y )
assum ethat  ( x, y )  0
(5.5-1)
g ( x, y )  H [ f ( x, y )]
H is linearif
H [af1 ( x, y )  bf2 ( x, y )]  aH[ f1 ( x, y )]  bH[ f 2 ( x, y )]
(5.5-2)
If a  b  1
H [ f1 ( x, y )  f 2 ( x, y )]  H [ f1 ( x, y )]  H [ f 2 ( x, y )]
(5.5-3)
56
Linear, Position-Invariant Degradations

Homogeneity

The response to a constant multiple of any input is equal
to the response to that input multiplied by the same
constant.
with f 2 ( x, y)  0, Eq.(5.5.2) becom es
H af1 ( x, y)  aH f1 ( x, y)
(5.5-4)
57
Linear, Position-Invariant Degradations

Position (space) invariance

The response at any point in the image depends only on the
value of the input at that point, not on its position.
H  f ( x   , y   )  g ( x   , y   )

(5.5-5)
f(x,y)可用連續脈衝函數表示成
f x, y   


 f  ,   x   , y   dd
假設(x,y)=0,則將Eq(5.5-6)代入Eq(5.5-1)可得
(5.5-6)
 

 
g  x, y   H  f  x, y   H    f  ,    x   , y   dd 
  


(5.5-7)
因為H為線性運算子,利用加成性的性質
g x, y   H  f x, y   



 
H  f  ,   x   , y   dd
(5.5-8)
58
Linear, Position-Invariant Degradations (cont.)

又因為f(,)和x,y無關,因此利用Homogeneity可得
g x, y   H  f x, y   

 f  ,  H  x   , y   dd

 
(5.5-9)
其中,H為脈衝響應(impulse response),h(x,,y,)為點
展開函數(point spread function, PSF)
hx,  , y,    H  x   , y   

(5.5-10)
將Eq(5.5-10)代入Eq(5.5-9)可得
g x, y   


 f  ,  hx, , y,  dd
 
(5.5-11)
59
Linear, Position-Invariant Degradations (cont.)

若H為位置不變,則Eq(5.5-5)可知
H  x   , y     hx   , y   
(5.5-12)
則Eq(5.5-11)可變成
g x, y   



 

(5.5-13)
上式為convolution integral(同Eq(4.2-30))
若在有加成性雜訊下, Eq(5.5-11)可表示成
g x, y   



 

f  ,  hx   , y   dd
f  ,  hx,  , y,  dd   x, y 
(5.5-14)
若H是位置不變,則Eq(5.5-14)會變成
g x, y   


 f  ,  hx   , y   dd  x, y 
 
(5.5-15)
60
Linear, Position-Invariant Degradations (cont.)

Summary

因為雜訊項(x,y)是隨機,與位置無關的,可將Eq(5.5-15)改
寫成
g ( x, y)  h( x, y) * f ( x, y)   ( x, y)
G(u, v)  H (u, v) F (u, v)  N (u, v)

(5.5-16)
(5.5-17)
A linear, spatially invariant degradation system with
additive noise can be modeled in the spatially domain as
the convolution of the degradation function with an image,
followed by the addition of noise.
61
Estimating the Degradation Function

There are three principal ways to estimate the
degradation function for use in image
restoration:



Observation
Experimentation
Mathematical modeling
62
Estimating the Degradation Function

Estimation by image observation


When a given degraded image without any knowledge about the
degradation function H.
To gather information from the image itself.





Look at a small section of the image containing simple structures.
Look for areas of strong signal content. Gs(u,v)
Construct an unblurred image as the observed subimage. Fs(u,v)
Assume that the effect of noise is negligible, thus the degradation
function could be estimated by Hs(u,v)=Gs(u,v)/Fs(u,v)
To construct the function H(u,v) by turns out the Hs(u,v) to have the
shape of Butterworth lowpass filter.
63
Estimating the Degradation Function

Estimation by experimentation



A linear, space-invariant system is described completely by
its impulse response.
A impulse is simulated by a bright dot of light
把一個已知的函數加以模糊以便得到近似的H(u,v)
 G(u, v)  H (u, v) F (u, v)
 the Fourier transformof an impulse is a constant( (x, y)  1)
G(u, v)
 H (u, v) 
A
(5.6-2)
64
Estimating the Degradation Function
光脈衝
影像脈衝
65
Estimating the Degradation Function

Estimation by modeling

Degradation model based on the physical characteristics
of atmospheric turbulence:
H (u, v)  e
 k ( u 2 v 2 )5 / 6
66
Estimating the Degradation Function
67
Remove the degradation of planar motion
g ( x, y )   f x  x0 (t ), y  y0 (t )dt
T
0
the Fourier T ransformof Eq.(5.6- 4) is
G (u, v)  



 
g ( x, y )e  j 2 (ux  vy) dxdy
 T f x  x (t ), y  y (t )dt e  j 2 ( ux  vy) dxdy
0
0

    
 0



T
  F (u, v)e  j 2 [ux0 (t )  vy0 ( t )] dt
0
T
 F (u , v)  e  j 2 [ux0 (t )  vy0 (t )] dt
0
T
H (u, v)   e  j 2 [ ux0 (t )  vy0 ( t )]dt
(5.6-8)
(5.6-9)
0
 G (u, v)  H (u , v) F (u , v)
suppose that theimage undergoes uniformlinear motionin thex - directiononly
at a rategiven by
x0 (t )  at / T
T
T
0
0
H (u, v)   e  j 2ux0 (t ) dt   e  j 2uat / T dt 
H (u, v) 
T
sin(ua)e  jua
ua
T
sin[ (ua  vb)]e  j (ua  vb)
 (ua  vb)
(5.6-10)
(5.6-11)
68
Chapter 5
Image Restoration
將左圖的Fourier Transform
乘上(5.6-11)的H(u,v)後,
取其反Fourier Transform的
結果。
a=b=0.1, T=1
69
Inverse Filtering

Direct inverse filtering

根據Eq(5.1-2)直接進行反濾波
G (u, v)
ˆ
F (u, v) 
H (u, v)
 G (u, v)  H (u, v) F (u, v)  N (u, v)
N (u, v)
ˆ
 F (u, v)  F (u, v) 
H (u, v)


(5.7-1)
(5.7-2)
即使知道退化函數,也無法完成復原出無退化的影像,因為
N(u,v)為一未知的傅立葉轉換隨機函數
假使退化有零值會是非常小的數值,則N(u,v)/H(u,v)會嚴重影
響F(u,v)
70
直接
G(u,v)/H(u,v)
Cutoff H(u,v) a
radius of 70
Chapter 5
Image Restoration
Cutoff H(u,v) a
radius of 40
Cutoff
H(u,v) a
radius of
85
71
Minimum Mean Square Error (Wiener) Filtering


Incorporated both the degradation function and statistical
characteristics of noise into the restoration process.
The objective is to find an estimate f of the uncorrupted
image f such that the mean square error between them is
2
minimized.
(5.8-1)
e 2  E  f  fˆ 


*


H
(u , v) S f (u, v)
ˆ
G (u , v)
F (u, v)  
2
 S f (u, v) H (u , v)  S (u , v) 


H * (u, v)
G (u , v)

2
 H (u , v)  S (u, v) / S f (u, v) 
2

H (u , v)
通常為未知,因此以 K來估計  1
G (u , v)

2
 H (u, v) H (u , v)  S (u, v) / S f (u, v) 
2
 1

H (u , v)

G (u, v)
2
H
(
u
,
v
)
H (u , v)  K 

(5.8-2)
(5.8-3)
72
Example 5.12
73
Example 5.13
74
Constrained Least Squares Filtering

The difficulty of the Wiener filter:



The power spectra of the undegraded image and noise
must be known
A constant estimate of the ratio of the power spectra is not
always a suitable solution.
Constrained Least Squares Filtering

Only the mean and variance of the noise are needed.
75
Constrained Least Squares Filtering

將Eq(5.5-16)以向量矩陣表示成
g  Hf  η
M 1 N 1
(5.9-1)

C    2 f ( x, y )

2
(5.9-2)
x 0 y 0
subject to theconstraint
2
g  Hfˆ  
2
*


H
(
u
,
v
)
Fˆ (u , v)  
G (u , v)
2
2
 H (u , v)   P (u , v) 
 0 1 0 
p ( x, y )   1 4  1
 0  1 0 
(5.9-3)
(5.9-4)
(5.9-5)
76
Chapter 5
Image Restoration
手動調整r,以獲得最佳視覺效果
77


以遞迴方式計算
定義殘餘向量
r  g  Hfˆ
    r r  r
T
2
r  η a
2
2
78



Step 1:指定的初始值
Step 2:計算||r||2
Step 3:若滿足Eq(5.9-8)即停止,
2
2
r

η
a
若
即增加的值
2
2
r

η
a
若
即減少的值
回到步驟2,使用新的值計算Eq(5.9-4)
79
Chapter 5
Image Restoration
80
Geometric Transformations

Spatial Transformations
x '  r ( x, y )
y '  s ( x, y )
r ( x, y )  c1 x  c2 y  c3 xy  c4
s( x, y )  c5 x  c6 y  c7 xy  c8
x'  c1 x  c2 y  c3 xy  c4
y '  c5 x  c6 y  c7 xy  c8
81
Chapter 5
Image Restoration

Gray-level Interpolation



Zero-order interpolation
Cubic convolution interpolation
Bilinear interpolation
v( x' , y' )  ax'by'cx' y'd
82
Chapter 5
Image Restoration
83
Chapter 5
Image Restoration
84
Download