3. Introduction to forward and inverse transform
Forward and inverse transform
Discrete Fourier transform (DFT) is a special class of transformation.
General forward transformation can be expressed as
T(u, v) =
N−1
x=0
N−1
y=0
f (x, y)g(x, y, u, v) (1)
In case of DFT, g(x, y, u, v) = 1
N e−j 2π
N
(ux+vy)
Inverse transformation
f (x, y) =
N−1
u=0
N−1
v=0
T(u, v)h(x, y, u, v) (2)
In case of I-DFT, h(x, y, u, v) = 1
N ej 2π
N
(ux+vy)
Subject: Image Procesing & Computer Vision Dr. Varun Kumar (IIIT Surat)Lecture 15 3 / 14
4. Continued–
g(x, y, u, v) = g1(x, u)g2(y, v) General expression
= g1(x, u)g1(y, v) Symmetric form
(3)
In case of DFT,
g(x, y, u, v) =
1
N
e−j 2π
N
(ux+vy)
=
1
√
N
e−j 2π
N
ux
g1(x,u)
1
√
N
e−j 2π
N
vy
g1(y,v)
(4)
Note:
Symmetric and separable forward transformation.
Similarly, symmetric and separable inverse transformation.
Subject: Image Procesing & Computer Vision Dr. Varun Kumar (IIIT Surat)Lecture 15 4 / 14
5. Discrete cosine transform (DCT)
g(x, y, u, v) = α(u)α(v) cos
(2x + 1)uπ
2N
cos
(2y + 1)vπ
2N
(5)
g(x, y, u, v) → Forward transformation kernel.
α(u) =
1
√
N
, when u = 0
=
2
N
∀ u = 1, 2, ...N − 1
(6)
Hence forward transformation for DCT
C(u, v) = α(u)α(v)
N−1
x=0
N−1
y=0
f (x, y) cos
(2x + 1)uπ
2N
cos
(2y + 1)vπ
2N
(7)
Subject: Image Procesing & Computer Vision Dr. Varun Kumar (IIIT Surat)Lecture 15 5 / 14
6. Inverse DCT
f (x, y) =
N−1
u=0
N−1
v=0
α(u)α(v)C(u, v) cos
(2x + 1)uπ
2N
cos
(2y + 1)vπ
2N
(8)
Note:
⇒ Periodicity of DCT (2N) does not remain same as the periodicity of
DFT (N).
⇒ The major application of DCT is for the data compression and energy
contraction.
Subject: Image Procesing & Computer Vision Dr. Varun Kumar (IIIT Surat)Lecture 15 6 / 14
7. Walsh transform
1D kernel and forward transformation
g(x, u) =
1
N
n−1
i=0
(−1)bi (x)bn−1−i (u)
(9)
⇒ N → Total number of samples
⇒ n → Number of bits x/u
⇒ bk(z) → kth bit in digital/binary representation of z.
Forward transformation
W (u) =
1
N
N−1
x=0
f (x)
n−1
i=0
(−1)bi (x)bn−1−i (x)
(10)
Inverse transformation kernel
h(x, u) =
n−1
i=0
(−1)bi (x)bn−1−i (u)
(11)
Subject: Image Procesing & Computer Vision Dr. Varun Kumar (IIIT Surat)Lecture 15 7 / 14
8. Continued–
f (x) =
N−1
u=0
W (u)
n−1
i=0
(−1)bi (x)bn−1−i (u)
(12)
In case of 2D signal (forward transformation kernel)
g(x, y, u, v) =
1
N
n−1
i=0
(−1)bi (x)bn−1−i (u)+bi (y)bn−1−i (v)
(13)
(Inverse transformation kernel)
h(x, y, u, v) =
1
N
n−1
i=0
(−1)bi (x)bn−1−i (u)+bi (y)bn−1−i (v)
(14)
Subject: Image Procesing & Computer Vision Dr. Varun Kumar (IIIT Surat)Lecture 15 8 / 14
9. Walsh transform for 2D signal
Forward and inverse transform
Forward transform
W (u, v) =
1
N
N−1
x=0
N−1
y=0
f (x, y)
n−1
i=0
(−1)bi (x)bn−1−i (u)+bi (y)bn−1−i (v)
(15)
Inverse transform
f (x, y) =
1
N
N−1
u=0
N−1
v=0
W (u, v)
n−1
i=0
(−1)bi (x)bn−1−i (u)+bi (y)bn−1−i (v)
(16)
Note
1 Walsh transformation is separable and symmetric.
2 It is faster 2D signal transformation compare to DFT.
Subject: Image Procesing & Computer Vision Dr. Varun Kumar (IIIT Surat)Lecture 15 9 / 14
10. Fast Walsh transform
Computational observation
1D signal
W (u) =
1
2
Weven(u) + Wodd (u) (17)
or
W (u + M) =
1
2
Weven(u) − Wodd (u) (18)
⇒ u = 0, 1, ...(N/2 − 1)
⇒ M = N/2
Note:
This is a recursive operation and like FFT, fast Walsh transform can
also be done.
Subject: Image Procesing & Computer Vision Dr. Varun Kumar (IIIT Surat)Lecture 15 10 / 14
11. Hadamard transformation
1D signal
g(x, u) =
1
N
(−1)
n−1
i=0 bi (x)bi (u)
(19)
and
H(u) =
1
N
N−1
x=0
f (x)(−1)
n−1
i=0 bi (x)bi (u)
(20)
Note:
⇒ Forward and inverse kernel both are identical like Walsh transform.
h(x, u) =
1
N
(−1)
n−1
i=0 bi (x)bi (u)
(21)
and
f (x) =
1
N
N−1
u=0
H(u)(−1)
n−1
i=0 bi (x)bi (u)
(22)
Subject: Image Procesing & Computer Vision Dr. Varun Kumar (IIIT Surat)Lecture 15 11 / 14
12. Continued–
For 2D signal
g(x, y, u, v) =
1
N
(−1)
n−1
i=0 bi (x)bi (u)+bi (y)bi (v)
(23)
and
h(x, y, u, v) =
1
N
(−1)
n−1
i=0 bi (x)bi (u)+bi (y)bi (v)
(24)
Forward and inverse kernel are identical.
Hadamard matrix
H =
1 1
1 − 1
at N = 2 and H2N =
HN HN
HN − HN
(25)
Subject: Image Procesing & Computer Vision Dr. Varun Kumar (IIIT Surat)Lecture 15 12 / 14
14. References
M. Sonka, V. Hlavac, and R. Boyle, Image processing, analysis, and machine vision.
Cengage Learning, 2014.
D. A. Forsyth and J. Ponce, “A modern approach,” Computer vision: a modern
approach, vol. 17, pp. 21–48, 2003.
L. Shapiro and G. Stockman, “Computer vision prentice hall,” Inc., New Jersey,
2001.
R. C. Gonzalez, R. E. Woods, and S. L. Eddins, Digital image processing using
MATLAB. Pearson Education India, 2004.
Subject: Image Procesing & Computer Vision Dr. Varun Kumar (IIIT Surat)Lecture 15 14 / 14