SlideShare a Scribd company logo
1 of 14
Download to read offline
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

What's hot

Image trnsformations
Image trnsformationsImage trnsformations
Image trnsformations
John Williams
 
Frequency Domain Image Enhancement Techniques
Frequency Domain Image Enhancement TechniquesFrequency Domain Image Enhancement Techniques
Frequency Domain Image Enhancement Techniques
Diwaker Pant
 
Butterworth filter design
Butterworth filter designButterworth filter design
Butterworth filter design
Sushant Shankar
 

What's hot (20)

Wiener Filter
Wiener FilterWiener Filter
Wiener Filter
 
Histogram Equalization
Histogram EqualizationHistogram Equalization
Histogram Equalization
 
Image trnsformations
Image trnsformationsImage trnsformations
Image trnsformations
 
Frequency Domain Image Enhancement Techniques
Frequency Domain Image Enhancement TechniquesFrequency Domain Image Enhancement Techniques
Frequency Domain Image Enhancement Techniques
 
Image Filtering in the Frequency Domain
Image Filtering in the Frequency DomainImage Filtering in the Frequency Domain
Image Filtering in the Frequency Domain
 
Discrete Fourier Transform
Discrete Fourier TransformDiscrete Fourier Transform
Discrete Fourier Transform
 
Lecture 16 KL Transform in Image Processing
Lecture 16 KL Transform in Image ProcessingLecture 16 KL Transform in Image Processing
Lecture 16 KL Transform in Image Processing
 
Image Processing: Spatial filters
Image Processing: Spatial filtersImage Processing: Spatial filters
Image Processing: Spatial filters
 
Sharpening using frequency Domain Filter
Sharpening using frequency Domain FilterSharpening using frequency Domain Filter
Sharpening using frequency Domain Filter
 
Image sampling and quantization
Image sampling and quantizationImage sampling and quantization
Image sampling and quantization
 
Digital Image Fundamentals
Digital Image FundamentalsDigital Image Fundamentals
Digital Image Fundamentals
 
image compression ppt
image compression pptimage compression ppt
image compression ppt
 
Region based segmentation
Region based segmentationRegion based segmentation
Region based segmentation
 
Image enhancement sharpening
Image enhancement  sharpeningImage enhancement  sharpening
Image enhancement sharpening
 
Point processing
Point processingPoint processing
Point processing
 
Wavelet transform in image compression
Wavelet transform in image compressionWavelet transform in image compression
Wavelet transform in image compression
 
SPATIAL FILTERING IN IMAGE PROCESSING
SPATIAL FILTERING IN IMAGE PROCESSINGSPATIAL FILTERING IN IMAGE PROCESSING
SPATIAL FILTERING IN IMAGE PROCESSING
 
Butterworth filter design
Butterworth filter designButterworth filter design
Butterworth filter design
 
Lecture 14 Properties of Fourier Transform for 2D Signal
Lecture 14 Properties of Fourier Transform for 2D SignalLecture 14 Properties of Fourier Transform for 2D Signal
Lecture 14 Properties of Fourier Transform for 2D Signal
 
Image Enhancement using Frequency Domain Filters
Image Enhancement using Frequency Domain FiltersImage Enhancement using Frequency Domain Filters
Image Enhancement using Frequency Domain Filters
 

Similar to Lecture 15 DCT, Walsh and Hadamard Transform

FourierTransform detailed power point presentation
FourierTransform detailed power point presentationFourierTransform detailed power point presentation
FourierTransform detailed power point presentation
ssuseracb8ba
 
Digital Image Processing_ ch3 enhancement freq-domain
Digital Image Processing_ ch3 enhancement freq-domainDigital Image Processing_ ch3 enhancement freq-domain
Digital Image Processing_ ch3 enhancement freq-domain
Malik obeisat
 
Fourier transforms & fft algorithm (paul heckbert, 1998) by tantanoid
Fourier transforms & fft algorithm (paul heckbert, 1998) by tantanoidFourier transforms & fft algorithm (paul heckbert, 1998) by tantanoid
Fourier transforms & fft algorithm (paul heckbert, 1998) by tantanoid
Xavier Davias
 

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

Lecture 13 (Usage of Fourier transform in image processing)
Lecture 13 (Usage of Fourier transform in image processing)Lecture 13 (Usage of Fourier transform in image processing)
Lecture 13 (Usage of Fourier transform in image processing)
 
Image Restoration (Digital Image Processing)
Image Restoration (Digital Image Processing)Image Restoration (Digital Image Processing)
Image Restoration (Digital Image Processing)
 
Ch13
Ch13Ch13
Ch13
 
Image Restoration 2 (Digital Image Processing)
Image Restoration 2 (Digital Image Processing)Image Restoration 2 (Digital Image Processing)
Image Restoration 2 (Digital Image Processing)
 
Lecture 2 Introduction to digital image
Lecture 2 Introduction to digital imageLecture 2 Introduction to digital image
Lecture 2 Introduction to digital image
 
DIGITAL IMAGE PROCESSING - Day 4 Image Transform
DIGITAL IMAGE PROCESSING - Day 4 Image TransformDIGITAL IMAGE PROCESSING - Day 4 Image Transform
DIGITAL IMAGE PROCESSING - Day 4 Image Transform
 
Computing f-Divergences and Distances of\\ High-Dimensional Probability Densi...
Computing f-Divergences and Distances of\\ High-Dimensional Probability Densi...Computing f-Divergences and Distances of\\ High-Dimensional Probability Densi...
Computing f-Divergences and Distances of\\ High-Dimensional Probability Densi...
 
Litvinenko_RWTH_UQ_Seminar_talk.pdf
Litvinenko_RWTH_UQ_Seminar_talk.pdfLitvinenko_RWTH_UQ_Seminar_talk.pdf
Litvinenko_RWTH_UQ_Seminar_talk.pdf
 
Low rank tensor approximation of probability density and characteristic funct...
Low rank tensor approximation of probability density and characteristic funct...Low rank tensor approximation of probability density and characteristic funct...
Low rank tensor approximation of probability density and characteristic funct...
 
Popular image restoration technique
Popular image restoration techniquePopular image restoration technique
Popular image restoration technique
 
FourierTransform detailed power point presentation
FourierTransform detailed power point presentationFourierTransform detailed power point presentation
FourierTransform detailed power point presentation
 
Lect5 v2
Lect5 v2Lect5 v2
Lect5 v2
 
QMC Program: Trends and Advances in Monte Carlo Sampling Algorithms Workshop,...
QMC Program: Trends and Advances in Monte Carlo Sampling Algorithms Workshop,...QMC Program: Trends and Advances in Monte Carlo Sampling Algorithms Workshop,...
QMC Program: Trends and Advances in Monte Carlo Sampling Algorithms Workshop,...
 
Frequency Domain FIltering.pdf
Frequency Domain FIltering.pdfFrequency Domain FIltering.pdf
Frequency Domain FIltering.pdf
 
Fourier transform
Fourier transformFourier transform
Fourier transform
 
25 johnarry tonye ngoji 250-263
25 johnarry tonye ngoji 250-26325 johnarry tonye ngoji 250-263
25 johnarry tonye ngoji 250-263
 
Digital Image Processing_ ch3 enhancement freq-domain
Digital Image Processing_ ch3 enhancement freq-domainDigital Image Processing_ ch3 enhancement freq-domain
Digital Image Processing_ ch3 enhancement freq-domain
 
Fourier transforms & fft algorithm (paul heckbert, 1998) by tantanoid
Fourier transforms & fft algorithm (paul heckbert, 1998) by tantanoidFourier transforms & fft algorithm (paul heckbert, 1998) by tantanoid
Fourier transforms & fft algorithm (paul heckbert, 1998) by tantanoid
 
Electromagnetic fields
Electromagnetic fieldsElectromagnetic fields
Electromagnetic fields
 
Gaussian process in machine learning
Gaussian process in machine learningGaussian process in machine learning
Gaussian process in machine learning
 

More from VARUN KUMAR

More from VARUN KUMAR (20)

Distributed rc Model
Distributed rc ModelDistributed rc Model
Distributed rc Model
 
Electrical Wire Model
Electrical Wire ModelElectrical Wire Model
Electrical Wire Model
 
Interconnect Parameter in Digital VLSI Design
Interconnect Parameter in Digital VLSI DesignInterconnect Parameter in Digital VLSI Design
Interconnect Parameter in Digital VLSI Design
 
Introduction to Digital VLSI Design
Introduction to Digital VLSI DesignIntroduction to Digital VLSI Design
Introduction to Digital VLSI Design
 
Challenges of Massive MIMO System
Challenges of Massive MIMO SystemChallenges of Massive MIMO System
Challenges of Massive MIMO System
 
E-democracy or Digital Democracy
E-democracy or Digital DemocracyE-democracy or Digital Democracy
E-democracy or Digital Democracy
 
Ethics of Parasitic Computing
Ethics of Parasitic ComputingEthics of Parasitic Computing
Ethics of Parasitic Computing
 
Action Lines of Geneva Plan of Action
Action Lines of Geneva Plan of ActionAction Lines of Geneva Plan of Action
Action Lines of Geneva Plan of Action
 
Geneva Plan of Action
Geneva Plan of ActionGeneva Plan of Action
Geneva Plan of Action
 
Fair Use in the Electronic Age
Fair Use in the Electronic AgeFair Use in the Electronic Age
Fair Use in the Electronic Age
 
Software as a Property
Software as a PropertySoftware as a Property
Software as a Property
 
Orthogonal Polynomial
Orthogonal PolynomialOrthogonal Polynomial
Orthogonal Polynomial
 
Patent Protection
Patent ProtectionPatent Protection
Patent Protection
 
Copyright Vs Patent and Trade Secrecy Law
Copyright Vs Patent and Trade Secrecy LawCopyright Vs Patent and Trade Secrecy Law
Copyright Vs Patent and Trade Secrecy Law
 
Property Right and Software
Property Right and SoftwareProperty Right and Software
Property Right and Software
 
Investigating Data Trials
Investigating Data TrialsInvestigating Data Trials
Investigating Data Trials
 
Gaussian Numerical Integration
Gaussian Numerical IntegrationGaussian Numerical Integration
Gaussian Numerical Integration
 
Censorship and Controversy
Censorship and ControversyCensorship and Controversy
Censorship and Controversy
 
Romberg's Integration
Romberg's IntegrationRomberg's Integration
Romberg's Integration
 
Introduction to Censorship
Introduction to Censorship Introduction to Censorship
Introduction to Censorship
 

Recently uploaded

Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
Neometrix_Engineering_Pvt_Ltd
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Kandungan 087776558899
 
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
HenryBriggs2
 
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
AldoGarca30
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
mphochane1998
 

Recently uploaded (20)

Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdf
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
 
8086 Microprocessor Architecture: 16-bit microprocessor
8086 Microprocessor Architecture: 16-bit microprocessor8086 Microprocessor Architecture: 16-bit microprocessor
8086 Microprocessor Architecture: 16-bit microprocessor
 
Memory Interfacing of 8086 with DMA 8257
Memory Interfacing of 8086 with DMA 8257Memory Interfacing of 8086 with DMA 8257
Memory Interfacing of 8086 with DMA 8257
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 
Theory of Time 2024 (Universal Theory for Everything)
Theory of Time 2024 (Universal Theory for Everything)Theory of Time 2024 (Universal Theory for Everything)
Theory of Time 2024 (Universal Theory for Everything)
 
Max. shear stress theory-Maximum Shear Stress Theory ​ Maximum Distortional ...
Max. shear stress theory-Maximum Shear Stress Theory ​  Maximum Distortional ...Max. shear stress theory-Maximum Shear Stress Theory ​  Maximum Distortional ...
Max. shear stress theory-Maximum Shear Stress Theory ​ Maximum Distortional ...
 
PE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and propertiesPE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and properties
 
Introduction to Artificial Intelligence ( AI)
Introduction to Artificial Intelligence ( AI)Introduction to Artificial Intelligence ( AI)
Introduction to Artificial Intelligence ( AI)
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdf
 
8th International Conference on Soft Computing, Mathematics and Control (SMC ...
8th International Conference on Soft Computing, Mathematics and Control (SMC ...8th International Conference on Soft Computing, Mathematics and Control (SMC ...
8th International Conference on Soft Computing, Mathematics and Control (SMC ...
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 
Computer Graphics Introduction To Curves
Computer Graphics Introduction To CurvesComputer Graphics Introduction To Curves
Computer Graphics Introduction To Curves
 
Signal Processing and Linear System Analysis
Signal Processing and Linear System AnalysisSignal Processing and Linear System Analysis
Signal Processing and Linear System Analysis
 
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
 
Convergence of Robotics and Gen AI offers excellent opportunities for Entrepr...
Convergence of Robotics and Gen AI offers excellent opportunities for Entrepr...Convergence of Robotics and Gen AI offers excellent opportunities for Entrepr...
Convergence of Robotics and Gen AI offers excellent opportunities for Entrepr...
 
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
 
Introduction to Geographic Information Systems
Introduction to Geographic Information SystemsIntroduction to Geographic Information Systems
Introduction to Geographic Information Systems
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
 

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