SlideShare a Scribd company logo
11
Most read
12
Most read
14
Most read
Discrete Cosine, Walsh and Hadamard Transform for
2D Signal
Subject: Image Procesing & Computer Vision
Dr. Varun Kumar
Subject: Image Procesing & Computer Vision Dr. Varun Kumar (IIIT Surat)Lecture 15 1 / 14
Outlines
1 Discrete Cosine Transform
2 Walsh Transform
3 Hadamard Transform
4 References
Subject: Image Procesing & Computer Vision Dr. Varun Kumar (IIIT Surat)Lecture 15 2 / 14
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
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
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
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
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
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
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
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
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
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
Modified Hadamard relation
g(x, u) =
1
N
(−1)
n−1
i=0 bi (x)pi (u)
(26)
where,
p0(u) = bn−1(u)
p1(u) = bn−1(u) + bn−2(u)
...
pn−1(u) = b1(u) + b0(u)
Subject: Image Procesing & Computer Vision Dr. Varun Kumar (IIIT Surat)Lecture 15 13 / 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

More Related Content

PDF
Lecture 16 KL Transform in Image Processing
PPT
Discrete cosine transform
PPTX
Image compression in digital image processing
PPT
Image trnsformations
PDF
DIGITAL IMAGE PROCESSING - LECTURE NOTES
PDF
Image Restoration (Digital Image Processing)
PPT
Thresholding.ppt
PPTX
Walsh transform
Lecture 16 KL Transform in Image Processing
Discrete cosine transform
Image compression in digital image processing
Image trnsformations
DIGITAL IMAGE PROCESSING - LECTURE NOTES
Image Restoration (Digital Image Processing)
Thresholding.ppt
Walsh transform

What's hot (20)

PPT
Chapter 5 Image Processing: Fourier Transformation
PPTX
Image transforms
PPTX
Digital Image Processing
PPTX
Smoothing Filters in Spatial Domain
PPT
Enhancement in spatial domain
PPTX
Image restoration and degradation model
PPT
Image enhancement
PPTX
Homomorphic filtering
PPTX
Image Sampling and Quantization.pptx
PDF
Wiener Filter
PPTX
Region based segmentation
PPTX
Point processing
PPTX
Fourier descriptors & moments
PPTX
Smoothing in Digital Image Processing
PPT
Chapter 4 Image Processing: Image Transformation
PPTX
5. gray level transformation
PPTX
Image Filtering in the Frequency Domain
PPTX
Fourier transforms
PPTX
SPATIAL FILTERING IN IMAGE PROCESSING
PPTX
Image Enhancement - Point Processing
Chapter 5 Image Processing: Fourier Transformation
Image transforms
Digital Image Processing
Smoothing Filters in Spatial Domain
Enhancement in spatial domain
Image restoration and degradation model
Image enhancement
Homomorphic filtering
Image Sampling and Quantization.pptx
Wiener Filter
Region based segmentation
Point processing
Fourier descriptors & moments
Smoothing in Digital Image Processing
Chapter 4 Image Processing: Image Transformation
5. gray level transformation
Image Filtering in the Frequency Domain
Fourier transforms
SPATIAL FILTERING IN IMAGE PROCESSING
Image Enhancement - Point Processing
Ad

Similar to Lecture 15 DCT, Walsh and Hadamard Transform (20)

PDF
Lecture 14 Properties of Fourier Transform for 2D Signal
PPTX
sodapdf-converzxXxccccCCCCCCCSsted (1).pptx
PDF
Lecture 13 (Usage of Fourier transform in image processing)
PDF
Image Restoration (Digital Image Processing)
PPT
Unit - i-Image Transformations Gonzalez.ppt
PPT
PDF
Image Restoration 2 (Digital Image Processing)
PDF
Lecture 2 Introduction to digital image
PDF
DIGITAL IMAGE PROCESSING - Day 4 Image Transform
PDF
Computing f-Divergences and Distances of\\ High-Dimensional Probability Densi...
PDF
Litvinenko_RWTH_UQ_Seminar_talk.pdf
PDF
Low rank tensor approximation of probability density and characteristic funct...
PPTX
PDF
Popular image restoration technique
PPT
FourierTransform detailed power point presentation
PDF
QMC Program: Trends and Advances in Monte Carlo Sampling Algorithms Workshop,...
PDF
Frequency Domain FIltering.pdf
PPT
Fourier transform
PDF
25 johnarry tonye ngoji 250-263
Lecture 14 Properties of Fourier Transform for 2D Signal
sodapdf-converzxXxccccCCCCCCCSsted (1).pptx
Lecture 13 (Usage of Fourier transform in image processing)
Image Restoration (Digital Image Processing)
Unit - i-Image Transformations Gonzalez.ppt
Image Restoration 2 (Digital Image Processing)
Lecture 2 Introduction to digital image
DIGITAL IMAGE PROCESSING - Day 4 Image Transform
Computing f-Divergences and Distances of\\ High-Dimensional Probability Densi...
Litvinenko_RWTH_UQ_Seminar_talk.pdf
Low rank tensor approximation of probability density and characteristic funct...
Popular image restoration technique
FourierTransform detailed power point presentation
QMC Program: Trends and Advances in Monte Carlo Sampling Algorithms Workshop,...
Frequency Domain FIltering.pdf
Fourier transform
25 johnarry tonye ngoji 250-263
Ad

More from VARUN KUMAR (20)

PDF
Distributed rc Model
PDF
Electrical Wire Model
PDF
Interconnect Parameter in Digital VLSI Design
PDF
Introduction to Digital VLSI Design
PDF
Challenges of Massive MIMO System
PDF
E-democracy or Digital Democracy
PDF
Ethics of Parasitic Computing
PDF
Action Lines of Geneva Plan of Action
PDF
Geneva Plan of Action
PDF
Fair Use in the Electronic Age
PDF
Software as a Property
PDF
Orthogonal Polynomial
PDF
Patent Protection
PDF
Copyright Vs Patent and Trade Secrecy Law
PDF
Property Right and Software
PDF
Investigating Data Trials
PDF
Gaussian Numerical Integration
PDF
Censorship and Controversy
PDF
Romberg's Integration
PDF
Introduction to Censorship
Distributed rc Model
Electrical Wire Model
Interconnect Parameter in Digital VLSI Design
Introduction to Digital VLSI Design
Challenges of Massive MIMO System
E-democracy or Digital Democracy
Ethics of Parasitic Computing
Action Lines of Geneva Plan of Action
Geneva Plan of Action
Fair Use in the Electronic Age
Software as a Property
Orthogonal Polynomial
Patent Protection
Copyright Vs Patent and Trade Secrecy Law
Property Right and Software
Investigating Data Trials
Gaussian Numerical Integration
Censorship and Controversy
Romberg's Integration
Introduction to Censorship

Recently uploaded (20)

PPTX
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PPTX
bas. eng. economics group 4 presentation 1.pptx
PPTX
OOP with Java - Java Introduction (Basics)
PDF
PPT on Performance Review to get promotions
DOCX
573137875-Attendance-Management-System-original
PDF
Structs to JSON How Go Powers REST APIs.pdf
PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PDF
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
PPTX
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
PPTX
Internet of Things (IOT) - A guide to understanding
PPTX
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
PPTX
Lecture Notes Electrical Wiring System Components
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
Embodied AI: Ushering in the Next Era of Intelligent Systems
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
bas. eng. economics group 4 presentation 1.pptx
OOP with Java - Java Introduction (Basics)
PPT on Performance Review to get promotions
573137875-Attendance-Management-System-original
Structs to JSON How Go Powers REST APIs.pdf
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
Internet of Things (IOT) - A guide to understanding
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
Lecture Notes Electrical Wiring System Components
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx

Lecture 15 DCT, Walsh and Hadamard Transform

  • 1. Discrete Cosine, Walsh and Hadamard Transform for 2D Signal Subject: Image Procesing & Computer Vision Dr. Varun Kumar Subject: Image Procesing & Computer Vision Dr. Varun Kumar (IIIT Surat)Lecture 15 1 / 14
  • 2. Outlines 1 Discrete Cosine Transform 2 Walsh Transform 3 Hadamard Transform 4 References Subject: Image Procesing & Computer Vision Dr. Varun Kumar (IIIT Surat)Lecture 15 2 / 14
  • 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
  • 13. Modified Hadamard relation g(x, u) = 1 N (−1) n−1 i=0 bi (x)pi (u) (26) where, p0(u) = bn−1(u) p1(u) = bn−1(u) + bn−2(u) ... pn−1(u) = b1(u) + b0(u) Subject: Image Procesing & Computer Vision Dr. Varun Kumar (IIIT Surat)Lecture 15 13 / 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