SlideShare a Scribd company logo
Digital Image Processing
Day 4 : 25/6/2020
Agenda :
Two Dimensional Mathematical Preliminaries
2D transforms
1) DFT- Discrete Fourier Transform
2) DCT - Discrete Cosine Transform
Two Dimensional
Mathematical Preliminaries
Image Transforms
Many times, image processing tasks are best performed in a domain other than
the spatial domain.
Key steps:
(1) Transform the image
(2)Carry the task(s) in the transformed domain.
(3)Apply inverse transform to return to the spatial domain
First Video
Fourier Series Theorem
 Anyperiodic function f(t) can beexpressed as aweighted sum (infinite) of sine
and cosine functions of varying frequency
is called the “fundamentalfrequency
Discrete Fourier Transform
(DFT)
Discrete Cosine Transform
 A discrete cosine transform (DCT) expresses a finite sequence of
data
points in terms of a sum of cosine functions oscillating at different frequencies.
 DCT is a Fourier-related transform similar to the discrete Fourier transform
(DFT), but using only real numbers. DCTs are equivalent to DFTs of roughly
twice the length, operating on real data with even symmetry. Types of DCT
listed below with 11 samples.
Step Function
The unit step function, is a discontinuous function whose value
is zero for negative argument and one for positive argument.
A-A

t  0
0
t  0
H(t) 
0
Rectangle Function
The unit step function, is a discontinuous function whose value
is zero for negative argument and one for positive argument. 0 t  A
 A t  A
Rect(t)  
1
A-A
 t A0
Impulse Function
The Dirac delta function, or δ function, is zero for all values of
the parameter except when the parameter is zero, and its integral
over the parameter from −∞ to ∞ is equal to one

0
t 0
t 0
(t) 

(t)dt 1

© 1992–2008 R. C. Gonzalez & R. E. Woods
Fourier Transform
For a give function g(x) of a real variable x, the
Fourier transformation of g(x) which is denoted
as

 j2ux
-
{g(x)} G(u) g(x)e dx


-
1
{g(x)} G(u) g(x)e dxj2ux
Second Video
Since
e j2t
 sin(2t) jcos(2t)
For that reason the Fourier transform F(u)
F(u) = R(u) + jI(u)
Which often appear as
F(u) | F(u) | e j(u)
| F(u) | R(u)2
 I (u)2
R(u)
© 1992–2008 R. C. Gonzalez & R. E. Woods
tan( (u)) 
I(u)
.
Spatial Domain Frequency Domain
2D Fourier Transform
For a give function g(x) of a real variable x, the
Fourier transformation of g(x) which is denoted
as

{g(x, y)}  G(u, v)    g(x, y)e j 2 (uxvy )
dxdy
and

1
{G(u,v)}  g(x, y)  G(u,v)ej2 (uxvy)
dudv

© 1992–2008 R. C. Gonzalez & R. E. Woods
 


AA
X
0
 1]
  0 
vY
Discrete Fourier Transform
•Let us discretize a continuous function f(x) into the N uniform
samples that generate the sequence
f(x0), f(x0+Δx), f(x0+2Δx), f(x0+3Δx), …, f(x0+[N-1]Δx)
•Hence f(x) = f(x0+i Δx)
•We could denote the samples as f(0), f(1), f(2), …,f(N-1).
x0
and
0,1,2,..., N 1
N 1
1
 f(x)e j 2ux / N
;u
N
• The Fourier Transform is
F (u)
N1
Third Video - Examples
f (x)  F(u)e j2ux/ N
u0
NM
2D Discrete Fourier Transform
1 M 1N 1
F(u,v)   f (x, y)e j2 (ux/ M vy / N )
x0 y 0
u  0,1,2,...,M 1;v  0,1,2,...,N 1
and
M 1N1
1 1
f (x, y)   F(u,v)ej2 (ux/ M vy / N )
u 0 v0
Mx Ny
u  ; v
.
Examples
Properties of 2D FourierTransform
• Spatial and Frequency Domain
f(t, z) sampled from f(x, y) using the separation between samples as T and Z
NZ
v 
MT
1
u 
1
• Translation and Rotation
Multiplying f(x,y) by the exponential shifts the original of DFT to (u0,v0).
Multiplying F(u,v) by the exponential shifts the original of f(x, y) to (x0,y0);
f (x  x , y  y )  F (u, v)e j 2 ( x0u / M  y0v / N )
0 0
F (u  u , v v )  f (x, y)e j 2 (u0 x / M v0 y / N )
0 0
Properties of 2D Fourier Transform
Periodicity
The Fourier transform and inverse are
infinitely periodic on the u and v directions.
(k1 and k2 are integers).
F (u, v)  F (u  k1M , v)  F (u, v  k2 N )
 F (u  k1M , v  k2 N )
f (x, y)  f (x  k1M , y)  f (x, y  k2 N )
 f (x  k1M , y  k2 N )
To show the origin of F(u,v) at the center we
shift the data by M/2 and N/2
f (x, y)(1)x y
 F (u  M / 2, v  N / 2)
Properties of 2D Fourier Transform Symmetry
Any real or complex function can be expressed as the sum of even and odd part
w(x, y)  we (x, y)  wo (x, y)
2
w(x, y)  w(x,y)
ew (x, y)

2
e
w(x, y)  w(x,y)
w (x, y) 

Which shows that even functions are symmetric and odd functions are
antisymmetric
we (x, y)  we (x, y)
wo (x, y)  wo (x, y)
Properties of 2D Fourier Transform
Symmetry
The Fourier transform of a real function f(x,y) is conjugate symmetric
F*
(u,v)  F(u,v)
The Fourier transform of a imaginary function f(x,y) is conjugate anti-symmetric
F*
(u,v)  F(u,v)
1 
*
x0 y 0NM 

F*
(u,v)  
M 1N1
 f (x, y)e j2 (ux / M vy/ N )
Proof
NM x0 y 0
1 N1

1 M
 f *
(x, y)ej2 (ux/ M vy/ N )
1 N1

1 M
 f (x, y)e j2 ([u]x/ M [v]y / N )
NM
 F(u,v)
x0 y 0
Digital Image Processing, 3rd ed.
© 1992–2008 R. C.
Gonzalez & R. E. Woods
Digital Image Processing, 3rd ed.
© 1992–2008 R. C.
Gonzalez & R. E. Woods
Digital Image Processing, 3rd ed.
© 1992–2008 R. C.
Gonzalez & R. E. Woods
Sampling and Fourier Transform
1.Converting continuous function/signal into a discrete one.
2.The sampling is uniform at T intervals The sampled function
and the value of each Sample are :
~
f (t)f (t)  f (t)s (t)  

(t  nT)T
n

fk   f (t) (t  kT )dt  f (kT)

Sampling Theorem
Band limited-A function f(t) whose Fourier transform is zero out
of the interval [-max , max] is called band limited
~
We can recover a function f(t) from its sampled
representation if we can isolate a copy of F() from
the periodic sequence of copies.
Extracting from F() a single period that represents
F() is possible in the separation between copies is
sufficient , which is guaranteed if ½T > max
max 2
1
T
Which is call the Nyquist Rate
© 1992–2008 R. C. Gonzalez & R. E. Woods
Digital Image Processing, 3rd ed.
© 1992–2008 R. C.
Gonzalez & R. E. Woods
.
Application of Filters H(U,V)
Digital Image Processing, 3rd ed.
© 1992–2008 R. C.
Gonzalez & R. E. Woods
Zero Paddding
Digital Image Processing, 3rd ed.
© 1992–2008 R. C.
Gonzalez & R. E. Woods
Digital Image Processing, 3rd ed.
© 1992–2008 R. C.
Gonzalez & R. E. Woods
Digital Image Processing, 3rd ed.
© 1992–2008 R. C.
Gonzalez & R. E. Woods
Laplacian Filter
Digital Image Processing, 3rd ed.
© 1992–2008 R. C.
Gonzalez & R. E. Woods
Gaussian Filter
Discrete Fourier Transform
2
• we have studied the DFT
• due to its computational efficiency the DFT is very
popular
• however, it has strong disadvantages for some
applications
– it is complex
– it has poor energy compaction
• energy compaction
– is the ability to pack the energy of the spatial sequence into as
few frequency coefficients as possible
– this is very important for image compression
– we represent the signal in the frequency domain
– if compaction is high, we only have to transmit a few coefficients
– instead of the whole set of pixels
Discrete Cosine Transform
• A much better transform,
from this point of view, is the DCT
– in this example we see the
amplitude spectra of the image above
– under the DFT and DCT
– note the much more concentrated
histogram obtained with the DCT
• why is energy compaction
important?
– the main reason is image
compression
– turns out to be beneficial in other
applications
3
Image compression
• An image compression system has three main blocks
– a transform (usually DCT on 8x8 blocks)
– a quantizer
– a lossless (entropy) coder
• each tries to throw away information which is
not essential to understand the image, but
costs bits
• The transform throws away correlations
– if you make a plot of the value of a pixel as a function of one of its
neighbors
– you will see that the pixels are highly correlated (i.e. most of the
time they are very similar)
– this is just a consequence of the fact that surfaces are smooth
Image compression
Image compression
• a second advantage of working in the
frequency domain
– is that our visual system is less sensitive
to distortion around edges
– the transition associated with the edge
masks our ability to perceive the noise
– e.g. if you blow up a compressed picture,
it is likely to look like this
– in general, the compression errors are
more annoying in the smooth image
regions
4
6
Image compression
• three JPEG examples
36KB 5.7KB 1.7KB
– note that the blockiness is more visible in the torso
Image compression
• important point:
– does not save any bits
– does not introduce any distortion
• both of these happen when we throw away information
• this is called “lossy compression” and implemented by
the quantizer
• what is a quantizer?
– think of the round() function, that rounds to the nearest integer
– round(1) = 1; round(0.55543) = 1; round (0.0000005) = 0
– instead of an infinite range between 0 and 1 (infinite number of
bits to transmit)
– the output is zero or one (1 bit)
– we threw away all the stuff in between, but saved a lot of bits
– a quantizer does this less drastically
Quantizer
• it is a function of this type
– inputs in a given range are mapped
to the same output
• to implement this, we
– 1) define a quantizer step size Q
– 2) apply a rounding function
 x



Q
x  roundq
– the larger the Q, the less reconstruction levels we have
– more compression at the cost of larger distortion
– e.g. for x in [0,255], we need 8 bits and have 256 color values
– 4 levels and only need 2 bits
Quantizer
• note that we can quantize some frequency coefficients
more heavily than others by simply increasing Q
• this leads to the idea of a quantization matrix
• we start with an image block (e.g. 8x8 pixels)
Quantizer
• next we apply a transform (e.g. 8x8 DCT)
DCT
Quantizer
• and quantize with a varying Q
DCT
Q mtx
Quantizer
• note that higher frequencies are quantized more heavily
Q mtx
increasing frequency
– in result, many high frequency coefficients are simply wiped out
DCT quantized DCT
Quantizer
• this saves a lot of bits, but we no longer have an exact
replica of original image block
DCT quantized DCT
inverse DCT original pixels

Quantizer
• note, however, that visually the blocks are not very
different
original decompressed
– we have saved lots of bits without much “perceptual” loss
– this is the reason why JPEG and MPEG work
Image compression
• three JPEG examples
36KB 5.7KB 1.7KB
– note that the two images on the left look identical
– JPEG requires 6x less bits
Energy compaction
• The two extensions are
DFT DCT
– note that in the DFT case the extension introduces
discontinuities
– this does not happen for the DCT, due to the symmetry of y[n]
– the elimination of this artificial discontinuity, which contains a lot
of high frequencies,
– is the reason why the DCT is much more efficient
2D-DCT
n2n2
1D-DCT
• 1) create
intermediate
sequence by
computing
1D-DCT of
rows
• 2) compute
k1
f [ k1 , n 2 ]
n1
x[ n1 , n 2 ]
1D-DCT of
columns
n2
k2
1D-DCT
k1
f [ k 1 , n 2 ]
5
8
k1
C x [ k 1 , k 2 ]
• the extension to 2D is trivial
• the procedure is the same

More Related Content

What's hot

Image Enhancement using Frequency Domain Filters
Image Enhancement using Frequency Domain FiltersImage Enhancement using Frequency Domain Filters
Image Enhancement using Frequency Domain Filters
Karthika Ramachandran
 
08 frequency domain filtering DIP
08 frequency domain filtering DIP08 frequency domain filtering DIP
08 frequency domain filtering DIP
babak danyal
 
Wiener Filter
Wiener FilterWiener Filter
Wiener Filter
Akshat Ratanpal
 
Digital image processing
Digital image processingDigital image processing
Digital image processing
ABIRAMI M
 
Image trnsformations
Image trnsformationsImage trnsformations
Image trnsformationsJohn Williams
 
03 digital image fundamentals DIP
03 digital image fundamentals DIP03 digital image fundamentals DIP
03 digital image fundamentals DIP
babak danyal
 
Digital Image Processing
Digital Image ProcessingDigital Image Processing
Digital Image Processing
lalithambiga kamaraj
 
03 image transform
03 image transform03 image transform
03 image transform
Rumah Belajar
 
Image Processing: Spatial filters
Image Processing: Spatial filtersImage Processing: Spatial filters
Image Processing: Spatial filters
A B Shinde
 
Frequency domain methods
Frequency domain methods Frequency domain methods
Frequency domain methods
thanhhoang2012
 
Image segmentation
Image segmentation Image segmentation
Enhancement in frequency domain
Enhancement in frequency domainEnhancement in frequency domain
Enhancement in frequency domainAshish Kumar
 
Sharpening using frequency Domain Filter
Sharpening using frequency Domain FilterSharpening using frequency Domain Filter
Sharpening using frequency Domain Filter
arulraj121
 
Image segmentation
Image segmentationImage segmentation
Image segmentation
Md Shabir Alam
 
Digital Image Processing - Image Compression
Digital Image Processing - Image CompressionDigital Image Processing - Image Compression
Digital Image Processing - Image Compression
Mathankumar S
 
Chapter10 image segmentation
Chapter10 image segmentationChapter10 image segmentation
Chapter10 image segmentation
asodariyabhavesh
 
Sharpening spatial filters
Sharpening spatial filtersSharpening spatial filters

What's hot (20)

Image Enhancement using Frequency Domain Filters
Image Enhancement using Frequency Domain FiltersImage Enhancement using Frequency Domain Filters
Image Enhancement using Frequency Domain Filters
 
08 frequency domain filtering DIP
08 frequency domain filtering DIP08 frequency domain filtering DIP
08 frequency domain filtering DIP
 
Wiener Filter
Wiener FilterWiener Filter
Wiener Filter
 
Digital image processing
Digital image processingDigital image processing
Digital image processing
 
Image trnsformations
Image trnsformationsImage trnsformations
Image trnsformations
 
03 digital image fundamentals DIP
03 digital image fundamentals DIP03 digital image fundamentals DIP
03 digital image fundamentals DIP
 
Digital Image Processing
Digital Image ProcessingDigital Image Processing
Digital Image Processing
 
Unit ii
Unit iiUnit ii
Unit ii
 
03 image transform
03 image transform03 image transform
03 image transform
 
Image Processing: Spatial filters
Image Processing: Spatial filtersImage Processing: Spatial filters
Image Processing: Spatial filters
 
Frequency domain methods
Frequency domain methods Frequency domain methods
Frequency domain methods
 
Run length encoding
Run length encodingRun length encoding
Run length encoding
 
Image segmentation
Image segmentation Image segmentation
Image segmentation
 
Enhancement in frequency domain
Enhancement in frequency domainEnhancement in frequency domain
Enhancement in frequency domain
 
Sharpening using frequency Domain Filter
Sharpening using frequency Domain FilterSharpening using frequency Domain Filter
Sharpening using frequency Domain Filter
 
Image segmentation
Image segmentationImage segmentation
Image segmentation
 
Digital Image Processing - Image Compression
Digital Image Processing - Image CompressionDigital Image Processing - Image Compression
Digital Image Processing - Image Compression
 
Presentation on Image Compression
Presentation on Image Compression Presentation on Image Compression
Presentation on Image Compression
 
Chapter10 image segmentation
Chapter10 image segmentationChapter10 image segmentation
Chapter10 image segmentation
 
Sharpening spatial filters
Sharpening spatial filtersSharpening spatial filters
Sharpening spatial filters
 

Similar to DIGITAL IMAGE PROCESSING - Day 4 Image Transform

Basics of edge detection and forier transform
Basics of edge detection and forier transformBasics of edge detection and forier transform
Basics of edge detection and forier transform
Simranjit Singh
 
FourierTransform detailed power point presentation
FourierTransform detailed power point presentationFourierTransform detailed power point presentation
FourierTransform detailed power point presentation
ssuseracb8ba
 
Lecture 9
Lecture 9Lecture 9
Lecture 9
Wael Sharba
 
07 frequency domain DIP
07 frequency domain DIP07 frequency domain DIP
07 frequency domain DIP
babak danyal
 
Fourier slide
Fourier slideFourier slide
Fourier slide
ssuser65bfce
 
Optics Fourier Transform Ii
Optics Fourier Transform IiOptics Fourier Transform Ii
Optics Fourier Transform Iidiarmseven
 
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-domainMalik obeisat
 
imagetransforms1-210417050321.pptx
imagetransforms1-210417050321.pptximagetransforms1-210417050321.pptx
imagetransforms1-210417050321.pptx
MrsSDivyaBME
 
Discrete Time Fourier Transform
Discrete Time Fourier TransformDiscrete Time Fourier Transform
Discrete Time Fourier Transform
Waqas Afzal
 
Filtering in frequency domain
Filtering in frequency domainFiltering in frequency domain
Filtering in frequency domain
GowriLatha1
 
Eece 301 note set 14 fourier transform
Eece 301 note set 14 fourier transformEece 301 note set 14 fourier transform
Eece 301 note set 14 fourier transform
Sandilya Sridhara
 
Fpw chapter 4 - digital ctrl of dynamic systems
Fpw chapter 4 - digital ctrl of dynamic systemsFpw chapter 4 - digital ctrl of dynamic systems
Fpw chapter 4 - digital ctrl of dynamic systems
Aleksandar Micic
 
Image processing 2
Image processing 2Image processing 2
Image processing 2
Taymoor Nazmy
 
Color image analyses using four deferent transformations
Color image analyses using four deferent transformationsColor image analyses using four deferent transformations
Color image analyses using four deferent transformationsAlexander Decker
 

Similar to DIGITAL IMAGE PROCESSING - Day 4 Image Transform (20)

Basics of edge detection and forier transform
Basics of edge detection and forier transformBasics of edge detection and forier transform
Basics of edge detection and forier transform
 
FourierTransform detailed power point presentation
FourierTransform detailed power point presentationFourierTransform detailed power point presentation
FourierTransform detailed power point presentation
 
Lecture 9
Lecture 9Lecture 9
Lecture 9
 
07 frequency domain DIP
07 frequency domain DIP07 frequency domain DIP
07 frequency domain DIP
 
Lect5 v2
Lect5 v2Lect5 v2
Lect5 v2
 
Fourier transform
Fourier transformFourier transform
Fourier transform
 
Fourier slide
Fourier slideFourier slide
Fourier slide
 
Fourier transform
Fourier transformFourier transform
Fourier transform
 
Optics Fourier Transform Ii
Optics Fourier Transform IiOptics Fourier Transform Ii
Optics Fourier Transform Ii
 
Image transforms
Image transformsImage transforms
Image transforms
 
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
 
imagetransforms1-210417050321.pptx
imagetransforms1-210417050321.pptximagetransforms1-210417050321.pptx
imagetransforms1-210417050321.pptx
 
Discrete Time Fourier Transform
Discrete Time Fourier TransformDiscrete Time Fourier Transform
Discrete Time Fourier Transform
 
Filtering in frequency domain
Filtering in frequency domainFiltering in frequency domain
Filtering in frequency domain
 
Eece 301 note set 14 fourier transform
Eece 301 note set 14 fourier transformEece 301 note set 14 fourier transform
Eece 301 note set 14 fourier transform
 
Ch15 transforms
Ch15 transformsCh15 transforms
Ch15 transforms
 
Fpw chapter 4 - digital ctrl of dynamic systems
Fpw chapter 4 - digital ctrl of dynamic systemsFpw chapter 4 - digital ctrl of dynamic systems
Fpw chapter 4 - digital ctrl of dynamic systems
 
Nabaa
NabaaNabaa
Nabaa
 
Image processing 2
Image processing 2Image processing 2
Image processing 2
 
Color image analyses using four deferent transformations
Color image analyses using four deferent transformationsColor image analyses using four deferent transformations
Color image analyses using four deferent transformations
 

More from vijayanand Kandaswamy

Convolution linear and circular using z transform day 5
Convolution   linear and circular using z transform day 5Convolution   linear and circular using z transform day 5
Convolution linear and circular using z transform day 5
vijayanand Kandaswamy
 
Difference equation using z transform day 4
Difference equation using z   transform day 4Difference equation using z   transform day 4
Difference equation using z transform day 4
vijayanand Kandaswamy
 
Inverse z tranform day 3
Inverse z tranform day 3Inverse z tranform day 3
Inverse z tranform day 3
vijayanand Kandaswamy
 
Properties of z transform day 2
Properties of z transform day 2Properties of z transform day 2
Properties of z transform day 2
vijayanand Kandaswamy
 
Z transform Day 1
Z transform Day 1Z transform Day 1
Z transform Day 1
vijayanand Kandaswamy
 
DIGITAL IMAGE PROCESSING - Day 5 Applications of DIP
DIGITAL IMAGE PROCESSING - Day 5 Applications of DIPDIGITAL IMAGE PROCESSING - Day 5 Applications of DIP
DIGITAL IMAGE PROCESSING - Day 5 Applications of DIP
vijayanand Kandaswamy
 
DIGITAL SIGNAL PROCESSING - Day 3 colour Image processing
DIGITAL SIGNAL PROCESSING - Day 3 colour Image processingDIGITAL SIGNAL PROCESSING - Day 3 colour Image processing
DIGITAL SIGNAL PROCESSING - Day 3 colour Image processing
vijayanand Kandaswamy
 
Introduction to DIGITAL IMAGE PROCESSING - DAY 1
Introduction to DIGITAL IMAGE PROCESSING - DAY 1Introduction to DIGITAL IMAGE PROCESSING - DAY 1
Introduction to DIGITAL IMAGE PROCESSING - DAY 1
vijayanand Kandaswamy
 
DIGITAL IMAGE PROCESSING - Visual perception - DAY 2
DIGITAL IMAGE PROCESSING - Visual perception - DAY 2DIGITAL IMAGE PROCESSING - Visual perception - DAY 2
DIGITAL IMAGE PROCESSING - Visual perception - DAY 2
vijayanand Kandaswamy
 
5 s TQM
5 s   TQM5 s   TQM
Changing world of work
Changing world of workChanging world of work
Changing world of work
vijayanand Kandaswamy
 

More from vijayanand Kandaswamy (11)

Convolution linear and circular using z transform day 5
Convolution   linear and circular using z transform day 5Convolution   linear and circular using z transform day 5
Convolution linear and circular using z transform day 5
 
Difference equation using z transform day 4
Difference equation using z   transform day 4Difference equation using z   transform day 4
Difference equation using z transform day 4
 
Inverse z tranform day 3
Inverse z tranform day 3Inverse z tranform day 3
Inverse z tranform day 3
 
Properties of z transform day 2
Properties of z transform day 2Properties of z transform day 2
Properties of z transform day 2
 
Z transform Day 1
Z transform Day 1Z transform Day 1
Z transform Day 1
 
DIGITAL IMAGE PROCESSING - Day 5 Applications of DIP
DIGITAL IMAGE PROCESSING - Day 5 Applications of DIPDIGITAL IMAGE PROCESSING - Day 5 Applications of DIP
DIGITAL IMAGE PROCESSING - Day 5 Applications of DIP
 
DIGITAL SIGNAL PROCESSING - Day 3 colour Image processing
DIGITAL SIGNAL PROCESSING - Day 3 colour Image processingDIGITAL SIGNAL PROCESSING - Day 3 colour Image processing
DIGITAL SIGNAL PROCESSING - Day 3 colour Image processing
 
Introduction to DIGITAL IMAGE PROCESSING - DAY 1
Introduction to DIGITAL IMAGE PROCESSING - DAY 1Introduction to DIGITAL IMAGE PROCESSING - DAY 1
Introduction to DIGITAL IMAGE PROCESSING - DAY 1
 
DIGITAL IMAGE PROCESSING - Visual perception - DAY 2
DIGITAL IMAGE PROCESSING - Visual perception - DAY 2DIGITAL IMAGE PROCESSING - Visual perception - DAY 2
DIGITAL IMAGE PROCESSING - Visual perception - DAY 2
 
5 s TQM
5 s   TQM5 s   TQM
5 s TQM
 
Changing world of work
Changing world of workChanging world of work
Changing world of work
 

Recently uploaded

GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
Nguyen Thanh Tu Collection
 
Cambridge International AS A Level Biology Coursebook - EBook (MaryFosbery J...
Cambridge International AS  A Level Biology Coursebook - EBook (MaryFosbery J...Cambridge International AS  A Level Biology Coursebook - EBook (MaryFosbery J...
Cambridge International AS A Level Biology Coursebook - EBook (MaryFosbery J...
AzmatAli747758
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
Excellence Foundation for South Sudan
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
Jheel Barad
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
BhavyaRajput3
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)
rosedainty
 
How to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS ModuleHow to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS Module
Celine George
 
PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer Service
PedroFerreira53928
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptxMARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
bennyroshan06
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 

Recently uploaded (20)

GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
 
Cambridge International AS A Level Biology Coursebook - EBook (MaryFosbery J...
Cambridge International AS  A Level Biology Coursebook - EBook (MaryFosbery J...Cambridge International AS  A Level Biology Coursebook - EBook (MaryFosbery J...
Cambridge International AS A Level Biology Coursebook - EBook (MaryFosbery J...
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)
 
How to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS ModuleHow to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS Module
 
PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer Service
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptxMARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 

DIGITAL IMAGE PROCESSING - Day 4 Image Transform

  • 1. Digital Image Processing Day 4 : 25/6/2020 Agenda : Two Dimensional Mathematical Preliminaries 2D transforms 1) DFT- Discrete Fourier Transform 2) DCT - Discrete Cosine Transform
  • 2. Two Dimensional Mathematical Preliminaries Image Transforms Many times, image processing tasks are best performed in a domain other than the spatial domain. Key steps: (1) Transform the image (2)Carry the task(s) in the transformed domain. (3)Apply inverse transform to return to the spatial domain First Video
  • 3. Fourier Series Theorem  Anyperiodic function f(t) can beexpressed as aweighted sum (infinite) of sine and cosine functions of varying frequency is called the “fundamentalfrequency
  • 5. Discrete Cosine Transform  A discrete cosine transform (DCT) expresses a finite sequence of data points in terms of a sum of cosine functions oscillating at different frequencies.  DCT is a Fourier-related transform similar to the discrete Fourier transform (DFT), but using only real numbers. DCTs are equivalent to DFTs of roughly twice the length, operating on real data with even symmetry. Types of DCT listed below with 11 samples.
  • 6.
  • 7. Step Function The unit step function, is a discontinuous function whose value is zero for negative argument and one for positive argument. A-A  t  0 0 t  0 H(t)  0 Rectangle Function The unit step function, is a discontinuous function whose value is zero for negative argument and one for positive argument. 0 t  A  A t  A Rect(t)   1 A-A  t A0 Impulse Function The Dirac delta function, or δ function, is zero for all values of the parameter except when the parameter is zero, and its integral over the parameter from −∞ to ∞ is equal to one  0 t 0 t 0 (t)   (t)dt 1  © 1992–2008 R. C. Gonzalez & R. E. Woods
  • 8. Fourier Transform For a give function g(x) of a real variable x, the Fourier transformation of g(x) which is denoted as   j2ux - {g(x)} G(u) g(x)e dx   - 1 {g(x)} G(u) g(x)e dxj2ux Second Video
  • 9. Since e j2t  sin(2t) jcos(2t) For that reason the Fourier transform F(u) F(u) = R(u) + jI(u) Which often appear as F(u) | F(u) | e j(u) | F(u) | R(u)2  I (u)2 R(u) © 1992–2008 R. C. Gonzalez & R. E. Woods tan( (u))  I(u)
  • 11. 2D Fourier Transform For a give function g(x) of a real variable x, the Fourier transformation of g(x) which is denoted as  {g(x, y)}  G(u, v)    g(x, y)e j 2 (uxvy ) dxdy and  1 {G(u,v)}  g(x, y)  G(u,v)ej2 (uxvy) dudv  © 1992–2008 R. C. Gonzalez & R. E. Woods
  • 13.
  • 14. Discrete Fourier Transform •Let us discretize a continuous function f(x) into the N uniform samples that generate the sequence f(x0), f(x0+Δx), f(x0+2Δx), f(x0+3Δx), …, f(x0+[N-1]Δx) •Hence f(x) = f(x0+i Δx) •We could denote the samples as f(0), f(1), f(2), …,f(N-1). x0 and 0,1,2,..., N 1 N 1 1  f(x)e j 2ux / N ;u N • The Fourier Transform is F (u) N1 Third Video - Examples f (x)  F(u)e j2ux/ N u0
  • 15. NM 2D Discrete Fourier Transform 1 M 1N 1 F(u,v)   f (x, y)e j2 (ux/ M vy / N ) x0 y 0 u  0,1,2,...,M 1;v  0,1,2,...,N 1 and M 1N1 1 1 f (x, y)   F(u,v)ej2 (ux/ M vy / N ) u 0 v0 Mx Ny u  ; v
  • 16. .
  • 17.
  • 19. Properties of 2D FourierTransform • Spatial and Frequency Domain f(t, z) sampled from f(x, y) using the separation between samples as T and Z NZ v  MT 1 u  1 • Translation and Rotation Multiplying f(x,y) by the exponential shifts the original of DFT to (u0,v0). Multiplying F(u,v) by the exponential shifts the original of f(x, y) to (x0,y0); f (x  x , y  y )  F (u, v)e j 2 ( x0u / M  y0v / N ) 0 0 F (u  u , v v )  f (x, y)e j 2 (u0 x / M v0 y / N ) 0 0
  • 20. Properties of 2D Fourier Transform Periodicity The Fourier transform and inverse are infinitely periodic on the u and v directions. (k1 and k2 are integers). F (u, v)  F (u  k1M , v)  F (u, v  k2 N )  F (u  k1M , v  k2 N ) f (x, y)  f (x  k1M , y)  f (x, y  k2 N )  f (x  k1M , y  k2 N ) To show the origin of F(u,v) at the center we shift the data by M/2 and N/2 f (x, y)(1)x y  F (u  M / 2, v  N / 2)
  • 21. Properties of 2D Fourier Transform Symmetry Any real or complex function can be expressed as the sum of even and odd part w(x, y)  we (x, y)  wo (x, y) 2 w(x, y)  w(x,y) ew (x, y)  2 e w(x, y)  w(x,y) w (x, y)   Which shows that even functions are symmetric and odd functions are antisymmetric we (x, y)  we (x, y) wo (x, y)  wo (x, y)
  • 22. Properties of 2D Fourier Transform Symmetry The Fourier transform of a real function f(x,y) is conjugate symmetric F* (u,v)  F(u,v) The Fourier transform of a imaginary function f(x,y) is conjugate anti-symmetric F* (u,v)  F(u,v) 1  * x0 y 0NM   F* (u,v)   M 1N1  f (x, y)e j2 (ux / M vy/ N ) Proof NM x0 y 0 1 N1  1 M  f * (x, y)ej2 (ux/ M vy/ N ) 1 N1  1 M  f (x, y)e j2 ([u]x/ M [v]y / N ) NM  F(u,v) x0 y 0
  • 23. Digital Image Processing, 3rd ed. © 1992–2008 R. C. Gonzalez & R. E. Woods
  • 24.
  • 25. Digital Image Processing, 3rd ed. © 1992–2008 R. C. Gonzalez & R. E. Woods
  • 26.
  • 27. Digital Image Processing, 3rd ed. © 1992–2008 R. C. Gonzalez & R. E. Woods
  • 28. Sampling and Fourier Transform 1.Converting continuous function/signal into a discrete one. 2.The sampling is uniform at T intervals The sampled function and the value of each Sample are : ~ f (t)f (t)  f (t)s (t)    (t  nT)T n  fk   f (t) (t  kT )dt  f (kT) 
  • 29. Sampling Theorem Band limited-A function f(t) whose Fourier transform is zero out of the interval [-max , max] is called band limited ~ We can recover a function f(t) from its sampled representation if we can isolate a copy of F() from the periodic sequence of copies. Extracting from F() a single period that represents F() is possible in the separation between copies is sufficient , which is guaranteed if ½T > max max 2 1 T Which is call the Nyquist Rate © 1992–2008 R. C. Gonzalez & R. E. Woods
  • 30. Digital Image Processing, 3rd ed. © 1992–2008 R. C. Gonzalez & R. E. Woods
  • 32.
  • 33. Digital Image Processing, 3rd ed. © 1992–2008 R. C. Gonzalez & R. E. Woods Zero Paddding
  • 34. Digital Image Processing, 3rd ed. © 1992–2008 R. C. Gonzalez & R. E. Woods
  • 35. Digital Image Processing, 3rd ed. © 1992–2008 R. C. Gonzalez & R. E. Woods
  • 36. Digital Image Processing, 3rd ed. © 1992–2008 R. C. Gonzalez & R. E. Woods Laplacian Filter
  • 37. Digital Image Processing, 3rd ed. © 1992–2008 R. C. Gonzalez & R. E. Woods Gaussian Filter
  • 38.
  • 39. Discrete Fourier Transform 2 • we have studied the DFT • due to its computational efficiency the DFT is very popular • however, it has strong disadvantages for some applications – it is complex – it has poor energy compaction • energy compaction – is the ability to pack the energy of the spatial sequence into as few frequency coefficients as possible – this is very important for image compression – we represent the signal in the frequency domain – if compaction is high, we only have to transmit a few coefficients – instead of the whole set of pixels
  • 40. Discrete Cosine Transform • A much better transform, from this point of view, is the DCT – in this example we see the amplitude spectra of the image above – under the DFT and DCT – note the much more concentrated histogram obtained with the DCT • why is energy compaction important? – the main reason is image compression – turns out to be beneficial in other applications 3
  • 41.
  • 42. Image compression • An image compression system has three main blocks – a transform (usually DCT on 8x8 blocks) – a quantizer – a lossless (entropy) coder • each tries to throw away information which is not essential to understand the image, but costs bits
  • 43.
  • 44.
  • 45. • The transform throws away correlations – if you make a plot of the value of a pixel as a function of one of its neighbors – you will see that the pixels are highly correlated (i.e. most of the time they are very similar) – this is just a consequence of the fact that surfaces are smooth Image compression
  • 46. Image compression • a second advantage of working in the frequency domain – is that our visual system is less sensitive to distortion around edges – the transition associated with the edge masks our ability to perceive the noise – e.g. if you blow up a compressed picture, it is likely to look like this – in general, the compression errors are more annoying in the smooth image regions 4 6
  • 47. Image compression • three JPEG examples 36KB 5.7KB 1.7KB – note that the blockiness is more visible in the torso
  • 48. Image compression • important point: – does not save any bits – does not introduce any distortion • both of these happen when we throw away information • this is called “lossy compression” and implemented by the quantizer • what is a quantizer? – think of the round() function, that rounds to the nearest integer – round(1) = 1; round(0.55543) = 1; round (0.0000005) = 0 – instead of an infinite range between 0 and 1 (infinite number of bits to transmit) – the output is zero or one (1 bit) – we threw away all the stuff in between, but saved a lot of bits – a quantizer does this less drastically
  • 49. Quantizer • it is a function of this type – inputs in a given range are mapped to the same output • to implement this, we – 1) define a quantizer step size Q – 2) apply a rounding function  x    Q x  roundq – the larger the Q, the less reconstruction levels we have – more compression at the cost of larger distortion – e.g. for x in [0,255], we need 8 bits and have 256 color values – 4 levels and only need 2 bits
  • 50. Quantizer • note that we can quantize some frequency coefficients more heavily than others by simply increasing Q • this leads to the idea of a quantization matrix • we start with an image block (e.g. 8x8 pixels)
  • 51. Quantizer • next we apply a transform (e.g. 8x8 DCT) DCT
  • 52. Quantizer • and quantize with a varying Q DCT Q mtx
  • 53. Quantizer • note that higher frequencies are quantized more heavily Q mtx increasing frequency – in result, many high frequency coefficients are simply wiped out DCT quantized DCT
  • 54. Quantizer • this saves a lot of bits, but we no longer have an exact replica of original image block DCT quantized DCT inverse DCT original pixels 
  • 55. Quantizer • note, however, that visually the blocks are not very different original decompressed – we have saved lots of bits without much “perceptual” loss – this is the reason why JPEG and MPEG work
  • 56. Image compression • three JPEG examples 36KB 5.7KB 1.7KB – note that the two images on the left look identical – JPEG requires 6x less bits
  • 57. Energy compaction • The two extensions are DFT DCT – note that in the DFT case the extension introduces discontinuities – this does not happen for the DCT, due to the symmetry of y[n] – the elimination of this artificial discontinuity, which contains a lot of high frequencies, – is the reason why the DCT is much more efficient
  • 58. 2D-DCT n2n2 1D-DCT • 1) create intermediate sequence by computing 1D-DCT of rows • 2) compute k1 f [ k1 , n 2 ] n1 x[ n1 , n 2 ] 1D-DCT of columns n2 k2 1D-DCT k1 f [ k 1 , n 2 ] 5 8 k1 C x [ k 1 , k 2 ] • the extension to 2D is trivial • the procedure is the same