Image Restoration
Image Restoration
IE PŁ IE PŁ P. Strumiłło
Image restoration vs. image enhancement
IE PŁ P. Strumiłło
Image degradation model
Source Degraded
image image
degradation η(x,y)
g ( x , y ) = H [ f ( x , y )] + η ( x , y )
IE PŁ P. Strumiłło
Image degradation model
∞
g (x , y ) = ∫ ∫ f (α , β ) h(x − α , y − β ) dα dβ + η (x , y )
−∞
G (u , v ) = H (u , v ) ⋅ F (u , v ) + N (u , v )
IE PŁ P. Strumiłło
Estimating the degradation function
IE PŁ P. Strumiłło
Degradation estimation example
Assume f(x,y) is linearly shifted during exposure and
x0(t), y0(t) are coordinates of motion. The degraded
image is given by:
T
g (x, y ) = ∫ f (x − x0 (t ), y − y0 (t ) )dt
0
H (u , v )
IE PŁ P. Strumiłło
Image restoration example
IE PŁ P. Strumiłło
Image restoration example
|H(u,v)| 1
0.9
0.6
0.5
0.4
0.3
0
0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5
u
f(x,y) g(x,y)
Degradation
IE PŁ P. Strumiłło
Inverse filtering
G (u , v ) = H (u , v ) ⋅ F (u , v ) + N (u , v )
1 1
Fˆ (u , v ) = ⋅ G (u , v ) = F (u , v ) + ⋅ N (u , v )
H (u , v ) H (u , v )
Inverse filter
F (u , v ) =
ˆ H *
(u, v )
⋅ G (u , v ) = W (u , v ) ⋅ G (u , v )
2 Sη (u , v )
H (u , v ) + γ
S f (u , v )
2
H (u , v ) = H * (u , v ) ⋅ H (u , v )
IE PŁ P. Strumiłło
The Wiener filter
The parametric Wiener filter:
2
1 H (u , v )
Fˆ (u , v ) = ⋅ ⋅ G (u , v )
H (u , v ) 2 Sη (u , v )
H (u , v ) + γ =K
S f (u , v )
• γ adjustable factor,
• for Sη(u,v)≈0 or K→0 the Wiener filter is an inverse
filter,
• for K→∝ the Wiener filter becomes a low-pass filter.
IE PŁ P. Strumiłło
The Wiener filter
2
1 H (u , v )
Fˆ (u , v ) = ⋅ ⋅ G (u , v )
H (u , v ) H (u , v ) + K
2
where K∈R+.
u
|H(u,v)|2
u
|W(u,v)|
1
u
0 Inverse filter Low-pass filter
IE PŁ P. Strumiłło
Image restoration examples
SNR=1
SNR=10
SNR=100
Addison-Wesley
The filter
Degraded image and
and its
its spectrum
spectrum
(7x7)
IE PŁ P. Strumiłło
Image restoration examples
Inverse filter
Wiener filter
Degraded image
(blur+noise)
IE PŁ P. Strumiłło
x=imread('text.tif'); %load image MATLAB
figure(1),imshow(x); %show image
N=256;
M=7; % filter order
hg=fspecial('average',M);
hhg=zeros(N,N);
hhg(N/2-(M-1)/2:N/2+(M-1)/2, N/2-(M-1)/2:N/2+(M-1)/2)=hg; %filter mask image
y=filter2(hg,x); %low-pass filtering
y=y+0.001*randn(256,256);
figure(2),imshow(y);
IE PŁ P. Strumiłło
Example of interactive image restoration
FFT
IFFT
IE PŁ P. Strumiłło
Geometric image distortions
x ' = r ( x, y )
y ' = s ( x, y )
eg. for r(x,y) =x/2 and
s(x,y)=y/2 image size is
reduced by a factor of 2.
IE PŁ P. Strumiłło
Correction of geometric image distortions
f ( x, y ) g ( x' , y ' )
IE PŁ P. Strumiłło
Correction of geometric image distortions
s ( xk , y k )
r ( xk , y k ) k = 1,K,16
IE PŁ P. Strumiłło
Correction of geometric image distortions
r ' ( x, y ) = a0 + a1 x + a2 y + a3 x 2 + a4 xy + a5 y 2
s ' ( x, y ) = b0 + b1 x + b2 y + b3 x 2 + b4 xy + b5 y 2
IE PŁ P. Strumiłło
Correction of geometric image distortions
K
ε r = ∑ (r ' ( x, y ) − r ( xk , yk ) )
2
k =1
K
ε = (s ' ( x, y ) − s ( x , y ) )2
s ∑ k =1
k k
IE PŁ P. Strumiłło
Correction of geometric image distortions
− s ( xk , y k )
IE PŁ P. Strumiłło
Correction of geometric image distortions
IE PŁ P. Strumiłło
Examples of geometric distortions
IE PŁ P. Strumiłło
Correction of geometric distortions - examples
IE PŁ P. Strumiłło