Introduction to forward and inverse transform
Forward and inverse transform
Discrete Fourier transform (DFT) is a special class of transformation.
Generalforward transformationcan be expressed as
T(u;v) =
N1
X
x=0
N1
X
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) =
N1
X
u=0
N1
X
v=0
T(u;v)h(x;y;u;v) (2)
In case of I-DFT,h(x;y;u;v) =
1
N
e
j
2
N
(ux+vy)
Subject: Image Procesing & Computer Vision Dr. Varun Kumar(IIIT Surat)Lecture 15 3 / 14
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
p
N
e
j
2
N
ux
|{z}
g1(x;u)
1
p
N
e
j
2
N
vy
|{z}
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
Discrete cosine transform (DCT)
g(x;y;u;v) =(u)(v) cos
h
(2x+ 1)u
2N
i
cos
h
(2y+ 1)v
2N
i
(5)
g(x;y;u;v)!Forward transformation kernel.
(u) =
1
p
N
;whenu= 0
=
r
2
N
8u= 1;2; :::N1
(6)
Hence forward transformation for DCT
C(u;v) =(u)(v)
N1
X
x=0
N1
X
y=0
f(x;y) cos
h
(2x+ 1)u
2N
i
cos
h
(2y+ 1)v
2N
i
(7)
Subject: Image Procesing & Computer Vision Dr. Varun Kumar(IIIT Surat)Lecture 15 5 / 14
Inverse DCT
f(x;y) =
N1
X
u=0
N1
X
v=0
(u)(v)C(u;v) cos
h
(2x+ 1)u
2N
i
cos
h
(2y+ 1)v
2N
i
(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
Walsh transform
1D kernel and forward transformation
g(x;u) =
1
N
n1
Y
i=0
(1)
bi(x)bn1i(u)
(9)
)N!Total number of samples
)n!Number of bitsx=u
)bk(z)!k
th
bit in digital/binary representation ofz.
Forward transformation
W(u) =
1
N
N1
X
x=0
f(x)
n1
Y
i=0
(1)
bi(x)bn1i(x)
(10)
Inverse transformation kernel
h(x;u) =
n1
Y
i=0
(1)
bi(x)bn1i(u)
(11)
Subject: Image Procesing & Computer Vision Dr. Varun Kumar(IIIT Surat)Lecture 15 7 / 14
Continued{
f(x) =
N1
X
u=0
W(u)
n1
Y
i=0
(1)
bi(x)bn1i(u)
(12)
In case of 2D signal (forward transformation kernel)
g(x;y;u;v) =
1
N
n1
Y
i=0
(1)
bi(x)bn1i(u)+bi(y)bn1i(v)
(13)
(Inverse transformation kernel)
h(x;y;u;v) =
1
N
n1
Y
i=0
(1)
bi(x)bn1i(u)+bi(y)bn1i(v)
(14)
Subject: Image Procesing & Computer Vision Dr. Varun Kumar(IIIT Surat)Lecture 15 8 / 14
Walsh transform for 2D signal
Forward and inverse transform
Forward transform
W(u;v) =
1
N
N1
X
x=0
N1
X
y=0
f(x;y)
n1
Y
i=0
(1)
bi(x)bn1i(u)+bi(y)bn1i(v)
(15)
Inverse transform
f(x;y) =
1
N
N1
X
u=0
N1
X
v=0
W(u;v)
n1
Y
i=0
(1)
bi(x)bn1i(u)+bi(y)bn1i(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
Fast Walsh transform
Computational observation
1D signal
W(u) =
1
2
h
Weven(u) +Wodd(u)
i
(17)
or
W(u+M) =
1
2
h
Weven(u)Wodd(u)
i
(18)
)u= 0;1; :::(N=21)
)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
Hadamard transformation
1D signal
g(x;u) =
1
N
(1)
P
n1
i=0
bi(x)bi(u)
(19)
and
H(u) =
1
N
N1
X
x=0
f(x)(1)
P
n1
i=0
bi(x)bi(u)
(20)
Note:
)Forward and inverse kernel both are identical like Walsh transform.
h(x;u) =
1
N
(1)
P
n1
i=0
bi(x)bi(u)
(21)
and
f(x) =
1
N
N1
X
u=0
H(u)(1)
P
n1
i=0
bi(x)bi(u)
(22)
Subject: Image Procesing & Computer Vision Dr. Varun Kumar(IIIT Surat)Lecture 15 11 / 14
Continued{
For 2D signal
g(x;y;u;v) =
1
N
(1)
P
n1
i=0
bi(x)bi(u)+bi(y)bi(v)
(23)
and
h(x;y;u;v) =
1
N
(1)
P
n1
i=0
bi(x)bi(u)+bi(y)bi(v)
(24)
Forward and inverse kernel are identical.
Hadamard matrix
H=
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