Professional Documents
Culture Documents
Image Interpolation: Francesca Pizzorni Ferrarese
Image Interpolation: Francesca Pizzorni Ferrarese
IMAGE INTERPOLATION
Francesca Pizzorni Ferrarese
Image Interpolation
2
Introduction
What is image interpolation? (D-A conversion)
Why do we need it?
Interpolation Techniques
1D zero-order, first-order, third-order
2D = two sequential 1D (divide-and-conquer)
Directional(Adaptive) interpolation*
Interpolation Applications
Digital
zooming (resolution enhancement)
Image inpainting (error concealment)
Geometric transformations (where your
imagination can fly)
Introduction
3
conversion
Recall the gap between biological vision
Low-Res.
High-Res.
Scenario II: Image Inpainting
7
Non-damaged Damaged
Scenario III: Image Warping
8
Image Interpolation
9
• Introduction
– What is image interpolation?
– Why do we need it?
• Interpolation Techniques
– 1D linear interpolation (elementary algebra)
– 2D = 2 sequential 1D (divide-and-conquer)
– Directional(adaptive) interpolation*
• Interpolation Applications
– Digital zooming (resolution enhancement)
– Image inpainting (error concealment)
– Geometric transformations
Upsampling
This
image
is
too
small
for
this
screen:
How
can
we
make
it
10
9mes
as
big?
Simplest approach:
interpola9on )
Image
interpola9on
d = 1 in this
example
1 2 3 4 5
d = 1 in this
example
1 2 3 4 5
1
d = 1 in this
example
1 2 2.5 3 4 5
Nearest-‐neighbor
interpola9on
Linear interpola9on
Gaussian reconstruc9on
f(n)
n
f(x)
x
1D First-order Interpolation (Linear)
20
f(n)
n
f(x)
x
Linear Interpolation Formula
21
a 1-a
f(n+a)=(1-a)×f(n)+a×f(n+1), 0<a<1
f(n)=[0,120,180,120,0]
Interpolate at 1/2-pixel
f(x)=[0,60,120,150,180,150,120,60,0], x=n/2
Interpolate at 1/3-pixel
f(x)=[0,20,40,60,80,100,120,130,140,150,160,170,180,…], x=n/6
1D Third-order Interpolation (Cubic)*
23
f(n)
f(x)
x
Cubic spline fitting
http://en.wikipedia.org/wiki/Spline_interpolation
From 1D to 2D
24
row column
f(m,n) g(m,n)
Numerical Examples
26
a b
c d
zero-order
first-order
a a b b
a a b b
a (a+b)/2 b
c c d d (a+c)/2 (a+b+c+d)/4 (b+d)/2
c (c+d)/2 d
c c d d
Numerical Examples (Con’t)
27
Col n Col n+1
b
a 1-a
Y
1-b
http://en.wikipedia.org/wiki/Bicubic_interpolation
Limitation with bilinear/bicubic
29
Edge blurring
Jagged artifacts
Jagged artifacts
Edge blurring
X
X Z
Edge-Sensitive Interpolation
30
Step 1: interpolate the missing pixels along the diagonal
a b
Since |a-c|=|b-d|
x
x has equal probability
of being black or white
c d
black or white?
x Since |a-c|>|b-d|
d b
x=(b+d)/2=black
c
Image Interpolation
31
• Introduction
• Interpolation Techniques
– 1D zero-order, first-order, third-order
– 2D zero-order, first-order, third-order
– Directional interpolation*
• Interpolation Applications
– Digital zooming (resolution enhancement)
– Image inpainting (error concealment)
– Geometric transformations (where your
imagination can fly)
Pixel Replication
32
low-resolution
image (100×100)
high-resolution
image (400×400)
Bilinear Interpolation
33
low-resolution
image (100×100)
high-resolution
image (400×400)
Bicubic Interpolation
34
low-resolution
image (100×100)
high-resolution
image (400×400)
Edge-Directed Interpolation
35
(Li&Orchard’2000)
low-resolution
image (100×100)
high-resolution
image (400×400)
Image Demosaicing
(Color-Filter-Array Interpolation)
36
Bayer Pattern
Image Example
37
damaged interpolated
Image Inpainting*
39
Image Mosaicing*
40
Geometric Transformation
41
y
y’
x’
θ
x
z=imread('cameraman.tif');
% original coordinates
[x,y]=meshgrid(1:256,1:256);
% new coordinates
a=2;
for i=1:256;for j=1:256;
x1(i,j)=a*x(i,j);
y1(i,j=y(i,j)/a;
end;end
% Do the interpolation
z1=interp2(x,y,z,x1,y1,'cubic');
Rotation Example
45
θ=3o
Scale
46
a=1/2
⎡ x'⎤ ⎡a 0 ⎤ ⎡ x ⎤
⎢ y '⎥ = ⎢0 1 / a ⎥ ⎢ y ⎥
⎣ ⎦ ⎣ ⎦ ⎣ ⎦
Affine Transform
47
square parallelogram
square parallelogram
B’
A B
A’
C’
D C
D’
square quadrilateral
a1 x + a2 y + a3
x '=
a7 x + a8 y + 1
a4 x + a5 y + a6
y' =
a7 x + a8 y + 1
Projective Transform Example
52
−1y r = x2 + y 2
θ = tan
x
Iris Image Unwrapping
54
r
Use Your Imagination
55
r -> sqrt(r)
http://astronomy.swin.edu.au/~pbourke/projection/imagewarp/
Free Form Deformation
56