This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Just like separable 2D transform (filtering) that can be implemented by two sequential 1D transforms (filters) along row and column direction respectively, 2D interpolation can be decomposed into two sequential 1D interpolations.
The ordering does not matter (row-column = column-row)
Such separable implementation is not optimal but enjoys low computational complexity
EE465: Introduction to Digital Image Processing
14
Graphical InterpretationGraphical Interpretationof Interpolation at Half-pelof Interpolation at Half-pel
Basic PrincipleBasic Principle• (x,y) (x’,y’) is a geometric
transformation• We are given pixel values at (x,y)
and want to interpolate the unknown values at (x’,y’)
• Usually (x’,y’) are not integers and therefore we can use linear interpolation to guess their valuesMATLAB implementation: z’=interp2(x,y,z,x’,y’,method);
EE465: Introduction to Digital Image Processing
31
RotationRotation
y
x
y
x
cossin
sincos
'
'
x
y
x’
y’
θ
EE465: Introduction to Digital Image Processing
32
MATLAB ExampleMATLAB Example
% original coordinates[x,y]=meshgrid(1:256,1:256);
z=imread('cameraman.tif');
% new coordinatesa=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');
EE465: Introduction to Digital Image Processing
33
Rotation ExampleRotation Example
θ=3o
EE465: Introduction to Digital Image Processing
34
ScaleScale
y
x
a
a
y
x
/10
0
'
'
a=1/2
EE465: Introduction to Digital Image Processing
35
Affine TransformAffine Transform
y
x
d
d
y
x
aa
aa
y
x
2221
1211
'
'
square parallelogram
EE465: Introduction to Digital Image Processing
36
Affine Transform ExampleAffine Transform Example
1
0
25.
15.
'
'
y
x
y
x
EE465: Introduction to Digital Image Processing
37
ShearShear
y
x
d
d
y
x
sy
x
1
01
'
'
square parallelogram
EE465: Introduction to Digital Image Processing
38
Shear ExampleShear Example
1
0
15.
01
'
'
y
x
y
x
EE465: Introduction to Digital Image Processing
39
Projective TransformProjective Transform
1'
87
321
yaxa
ayaxax
1'
87
654
yaxa
ayaxay
quadrilateralsquare
A B
CD
A’
B’
C’
D’
EE465: Introduction to Digital Image Processing
40
Projective Transform ExampleProjective Transform Example
[ 0 0; 1 0; 1 1; 0 1] [-4 2; -8 -3; -3 -5; 6 3]
EE465: Introduction to Digital Image Processing
41
Polar TransformPolar Transform
22 yxr
x
y1tan
EE465: Introduction to Digital Image Processing
42
Iris Image UnwrappingIris Image Unwrapping
r
EE465: Introduction to Digital Image Processing
43
Use Your ImaginationUse Your Imaginationr -> sqrt(r)