Professional Documents
Culture Documents
UNIT-2
IMAGE TRANSFORMS
by
Paresh Kamble
Introduction
Transform
Inverse Transform
Coefficient Matrix
Introduction
Preprocessing
- Filtering
- Enhancement, etc
Data Compression
Feature Extraction
- Edge Detection
- Corner detection, etc
Introduction
^ N-1
x(t) = Σ cn an(t) finite series expansion
n=0
For transformation:
We pre-multiply this matrix u by unitary matrix of dimension
NxN.
v= A.u
Where, v -> transformed vector
A -> Transformed matrix
Introduction
After expansion:
N-1
v(k) = Σ a(k, n) u(n) ; k = 0, 1, ……..N-1
n=0
So pre-multiplying v by A-1
u = A-1v = A*Tv
N-1
v(k, l) = Σ ak, l(m, n) u(m, n) 0 ≤ k, l ≤ N-1
m, n = 0
U = A*TVA*
They are 2D separable transformations.
Introduction
V = AUAT
VT = A[AU]T
A* = a* a*T
k, l k l
We can have
N-1
u(m, n) = ΣΣ v(k,l) a*k,l(m, n)
k, l =0
Basis Images
In matrix form, N-1
U = ΣΣ v(k,l) A*k,l
k, l =0
DCT Basis
images
Basis Images
Basis images
Basis Images
Ex. 1) A = (1/√2)*1 1+ U = *1 2+
[1 -1] [3 4]
Where,
|F(u, v)| = [R2(u, v) + I2(u, v)]1/2 is Fourier spectrum of f(x, y);
f(x, y)
A
X
x
Y
y
Discrete Fourier Transform
∞
F(u, v) = ∫ ∫ f(x, y) e-j2π(ux + vy) dx dy
-∞
X Y
=A ∫e-j2πux dx . ∫ e-j2πvy dy
0 0
X Y
= A [(e-j2πux)/(-j2πu)]. [(e-j2πvy)/(-j2πv)]
0 0
M-1 N-1
F(u, v) = (1/MN) Σ Σ f(x, y) e-j2π((ux/M)+(vy/N)) --------(1)
x=y=0
for, u = 0, 1, 2, ……M-1
v = 0, 1, 2, ……N-1
for, x = 0, 1, ………M-1
y = 0, 1, ………N-1
Discrete Fourier Transform
Discrete Fourier Transform
Properties of Fourier Transform:
1) Separability:
N-1
F(u, v) = (1/N) Σ Σ f(x, y) e-j(2π/N)(ux+vy) --------(1)
x=y=0
N-1 N-1
= (1/N) Σ e-j(2πux/N) .N.(1/N) Σ f(x, y) e-j(2πvy/N)
x=0 y=0
N-1
= (1/N) Σ e-j(2πux/N) .N.F(x, v)
x=0
(0,0) N-1 y
f(x, y)
N-1
x
(0, 0) N-1 v
xN
Row Transformation
F(x, v)
N-1
(0, 0) N-1 v
x
F(u, v)
Column Transformation
N-1
u
Discrete Fourier Transform
For Inverse DFT
N-1
f(x, y) =(1/N) Σ Σ F(u, v) ej(2π/N)(ux+vy)
u=v=0
N-1 N-1
= (1/N) Σ ej(2πux/N) N. (1/N) Σ F(u, v) ej(2πvy/N)
u=0 v=0
N-1
= (1/N) Σ N f(u, y) ej(2πux/N)
u=0
Row Transformation
Column Transformation
Discrete Fourier Transform
2) Translation Property:
For any image f(x, y) if translated by (x0, y0)becomes f(x-x0, y-y0)
(v) As we move further away from origin, the higher frequency begin
to correspond to faster & faster gray level changes in image. These
are the edges of objects & other components of the images
characterized by abrupt changes in gray levels (noise).
Pre Post
DFT H(u,v) IDFT
processing Processing
N-1
F(u+N, v+N) = (1/N) Σ Σ f(x, y) e-j(2π/N)(ux+vy+Nx+Ny)
x=y=0
N-1
= (1/N) Σ Σ f(x, y) e-j(2π/N)(ux+vy) e-j(2π)(x+y)
x=y=0
= F(u, v)
Discrete Fourier Transform
Conjugate:
f(x, y) is real
x = r cos θ ; y = r sin θ ;
u = ω cos ø ; y = ω sin ø ;
Distributivity:
F{f1(x, y) + f2(x, y)} = F{f1(x, y)} + F{f2(x, y)}
_
ƒ(x, y) = (1/N) F(0, 0)
Discrete Fourier Transform
6) Convolution:
7) Correlation:
8) It is symmetric.
9) It is a fast Transform.
Reverse DCT:
N-1
f(x, y) = ΣΣ {α(u).α(v) C(u, v) cos[(2x+1)uπ/2N]. cos[(2y+1)vπ/2N]}
u, v = 0
(5) It can be used for designing transform code & wiener filter.
C(k, n) = 1/√N;
k = 0;
0 ≤ n ≤ N-1
= √(2/N).cos((π(2n+1)k)/2N);
1 ≤ k ≤ N-1;
0 ≤ n ≤ N-1
Sol: C = k\n 0 1 2 3
0 0.5 0.5 0.5 0.5
1 0.65 0.27 -0.27 -0.65
2 0.5 -0.5 -0.5 0.5
3 0.27 -0.65 0.65 -0.27
Properties:
(1) It is symmetrical, real & orthogonal.
ψ = ψT, ψ = ψ*, ψT = ψ-1.
n 0 1 2 3
Ψ= k
2D signals:
N–1 N-1
W(u, v) = (1/N) ΣΣ f(x, y) ∏ (-1) {bi(x) bn-1-i(u) + bi(y) bn-1-i(v)}
x, y= 0 i=0
N–1 N-1
f(x, y) = (1/N) ΣΣ W(u, v) ∏ (-1) {bi(x) bn-1-i(u) + bi(y) bn-1-i(v)}
u, v= 0 i=0
G = (1/N) 0 1 2 3 4 5 6 7 Seq
+ + + + + + + + 0
+ + + + - - - - 1
+ + - - + + - - 3
+ + - - - - + + 2
+ - + - + - + - 7
+ - + - - + + - 6
+ - - + + - - + 4
+ - - + - + + - 5
WalshTransform
Prob. 2) Find the Walsh Transformation kernel G and then find
output for the given image.
1 2 3 4
F= 4 1 2 3
1 4 2 3
1 2 4 3
For N = 4
+ + + +
G = (1/4) + + - -
+ - + -
+ - - +
Hadamard Transform
1D Forward Transformation kernel is given by:
n -1
g(x, u) = (1/N) (-1) Σ bi(x) bi(u)
i=0
N-1 n-1
H(u) = (1/N) Σ f(x) (-1) Σ bi(x) bi(u)
x=0 i=0
N -1 n-1
f(x) = Σ H(u) (-1) Σ bi(x) bi(u)
u=0 i=0
Hadamard Transform
2D Forward Transformation kernel is given by:
n -1
g(x, y, u, v) = (1/N) (-1) Σ {bi(x) bi(u) + bi(y) bi(v)}
i=0
H2 = [1 1]
[1 -1]
Thus, a Hadamard matrix of order 2N can be obtained from a
HM of order N by:
H2N = [HN HN]
[HN H-N]
G=1 2 3 4
9 7 8 6
4 5 6 7
7 6 5 4 N=4 Thus n = Nlog2N
Comparision
Haar Transform
k = 2p + q -1