You are on page 1of 12

A Mathematical Working - How to generate Wav

A Mathematical Working - How to


Fourier Transforms Transform generate Wavelet Transform
• Fourier transform is applied to non –periodic
signals. Images are non-periodic signals
• Fourier transform is used to convert the
intensities of the image into frequency Understanding Wavelets
distribution. =110/2 114/2 268/2 320/2
• An inverse transform is used to convert back
the frequency domain information into pixel
values in spatial domain

A Mathematical Working - How to generate


A Mathematical Working - How to generate
Wavelet Transform Wavelet Decomposition of Coin Image Fourier Transforms
Wavelet Transform
Get the average:
= 55 57 134 160 Level-1 Haar Wavelet Decomposition • Approximation coefficients • Fourier transform is applied to non –periodic
– Scaling function signals. Images are non-periodic signals
Subtract each average from the first entry of the pair to get the – input to next level of decomposition • Fourier transform is used to convert the
numbers
• Detail coefficients intensities of the image into frequency
42-55 44-57 126-134 160-160 – wavelet functions distribution.
= -13 -13 -8 0 – noisy edge information • An inverse transform is used to convert back
the frequency domain information into pixel
values in spatial domain
Apprx coeff (low) detail coeff (high)
Fourier Transform Discrete Fourier Transform Discrete Fourier Transform Discrete Fourier Transform

• Used to decompose an image into its sine and • As images are having finite number of • The number of frequencies corresponds to the
cosine components intensities, Discrete Fourier Transform is used number of pixels in the spatial domain image
• The output of the transformation represents to transform it to frequency domain • Image in spatial and Fourier domain are of
the image in the Fourier or frequency domain • DFT is a sampled Fourier transform same size
• In Fourier domain image, each point represents • So it does not contain all frequencies forming • Fourier transform includes
a particular frequency contained in the spatial an image – Spatial frequency – brightness of the image
domain image • But only a set of samples which is large enough – Magnitude – relates the contrast
to fully describe the spatial domain image – Phase – contains color information

Discrete Fourier Transform Discrete Fourier Transform Centering the DFT Spectrum Centering the DFT Spectrum

• F(0,0) is at the top left corner


• To have DC component at center, swap four
quadrants of Fourier transform
High pass and low pass frequency
Discrete Fourier Transform Frequency Domain Low pass filter
components
• Spatial Domain DFT Inverse DFT • High pass – denotes edges • To keep frequencies below frequency
• Low pass – denotes smooth regions a certain
• Low pass filtering causes blurring
• After DFT, DC components and low
frequency components are towards center
• Cutoff frequency must be specified

Low pass filter Low pass filter Low pass filter High pass filtering

• Multiply image fourier transform by filter


0 0 0
• Having 1 as the central pixel
matrix m 0 1 0 and 0 as the surrounding
pixels in the filter produces a
0 0 0
blurred image
• The increase in weight of the
central pixel, increases the
blur content and reduces the
edge information
• Resulting in smoothing
operation
High pass filter Selective filtering Discrete Fourier Transform Discrete Fourier Transform
1 1 1
• Having 0 as the central pixel and • To reject specific band • Apply DFT to the following image and prove that
1 0 1 1 as the surrounding pixels in • To accept specific band DFT works
the filter produces the edges in
1 1 1
an image
• Increases the edge
information

Spatial Domain to Frequency Domain Spatial Domain to Frequency Domain Spatial Domain to Frequency Domain Spatial Domain to Frequency Domain
using Discrete Fourier Transform using Discrete Fourier Transform using Discrete Fourier Transform using Discrete Fourier Transform

F(U,V) = kernel * f(x,y) *transpose(kernel)


Frequency Domain to Spatial Domain Frequency Domain to Spatial Domain Frequency Domain to Spatial Domain using Frequency Domain to Spatial Domain
using inverse Discrete Fourier Transform using inverse Discrete Fourier Transform inverse Discrete Fourier Transform using inverse Discrete Fourier Transform

Frequency Domain to Spatial Domain Frequency Domain to Spatial Domain


Fourier Transform Discrete Fourier Transform
using inverse Discrete Fourier Transform using inverse Discrete Fourier Transform
• Used to decompose an image into its sine and • As images are having finite number of
cosine components intensities, Discrete Fourier Transform is used
• The output of the transformation represents to transform it to frequency domain
the image in the Fourier or frequency domain • DFT is a sampled Fourier transform
• In Fourier domain image, each point represents • So it does not contain all frequencies forming
a particular frequency contained in the spatial an image
domain image • But only a set of samples which is large enough
to fully describe the spatial domain image
Frequency domain to spatial domain is achieved.
We got back the original image in its spatial
representation
Discrete Fourier Transform Discrete Fourier Transform Discrete Fourier Transform Discrete Fourier Transform

• The number of frequencies corresponds to the


number of pixels in the spatial domain image
• Image in spatial and Fourier domain are of
same size
• Fourier transform includes
– Spatial frequency – brightness of the image
– Magnitude – relates the contrast
– Phase – contains color information

Centering the DFT Spectrum Centering the DFT Spectrum Discrete Fourier Transform Frequency Domain

• F(0,0) is at the top left corner • Spatial Domain DFT Inverse DFT
• To have DC component at center, swap four
quadrants of Fourier transform
High pass and low pass frequency
Low pass filter Low pass filter Low pass filter
components
• High pass – denotes edges • To keep frequencies below frequency • Multiply image fourier transform by filter
• Low pass – denotes smooth regions a certain matrix m
• Low pass filtering causes blurring
• After DFT, DC components and low
frequency components are towards center
• Cutoff frequency must be specified

High pass filtering with cutoff


Low pass filter High pass filtering High pass filtering
comparison
0 0 0
• Having 1 as the central pixel • It eliminates center low frequency values,
0 1 0 and 0 as the surrounding keeping others
0 0 0
pixels in the filter produces a • High pass filtering causes image sharpening
blurred image • If circle is used as cutoff again, size affects
• The increase in weight of the results
central pixel, increases the • Large cutoff means more information removed
blur content and reduces the
edge information
• Resulting in smoothing
operation
High pass filter Selective filtering Discrete Fourier Transform Discrete Fourier Transform
1 1 1
• Having 0 as the central pixel and • To reject specific band • Apply DFT to the following image and prove that
1 0 1 1 as the surrounding pixels in • To accept specific band DFT works
the filter produces the edges in
1 1 1
an image
• Increases the edge
information

Spatial Domain to Frequency Domain Spatial Domain to Frequency Domain Spatial Domain to Frequency Domain Spatial Domain to Frequency Domain
using Discrete Fourier Transform using Discrete Fourier Transform using Discrete Fourier Transform using Discrete Fourier Transform

F(U,V) = kernel * f(x,y) *transpose(kernel)


Spatial Domain to Frequency Domain Frequency Domain to Spatial Domain Frequency Domain to Spatial Domain Frequency Domain to Spatial Domain using
using Discrete Fourier Transform using inverse Discrete Fourier Transform using inverse Discrete Fourier Transform inverse Discrete Fourier Transform

Frequency Domain to Spatial Domain Frequency Domain to Spatial Domain Frequency Domain to Spatial Domain
using inverse Discrete Fourier Transform using inverse Discrete Fourier Transform using inverse Discrete Fourier Transform

Frequency domain to spatial domain is achieved.


We got back the original image in its spatial
representation
Blur

Image Restoration

From Prof.
Xin Li
out-of-focus blur motion blur

Question 1: How do you know they are blurred?


I’ve not shown you the originals!

1
Question 2: How do I deblur an image?

Image Degradation / Restoration


Process
Blurring Effect Image Restoration: Deblurring/Deconvolution

x(m,n) h(m,n) y(m,n) g(m,n) ^


x(m,n)
Gaussian blur blurring filter deblurring/
deconvolution
filter

• Non-blind deblurring/deconvolution
Given: observation y(m,n) and blurring function h(m,n)
Design: g(m,n), such that the distortion between x(m,n) and ^
x(m,n)
is minimized
motion blur
• Blind deblurring/deconvolution
Given: observation y(m,n)
^
Design: g(m,n), such that the distortion between x(m,n) and x(m,n)
From [Gonzalez & Woods]
is minimized

Deblurring: Inverse Filtering Deblurring: Pseudo-Inverse Filtering

x(m,n) h(m,n) y(m,n) g(m,n) ^


x(m,n) x(m,n) h(m,n) y(m,n) g(m,n) ^
x(m,n)
blurring filter inverse filter blurring filter deblur filter

X(u,v) H(u,v) = Y(u,v) 1 What if at some (u,v), H(u,v)


1 Inverse filter: G(u,v) =
G(u,v) = H(u,v) is 0 (or very close to 0) ?
H(u,v)
Y(u,v) 1
X(u,v) = = Y(u,v) Exact recovery!  1
H(u,v) H(u,v)  | H (u, v) |  small
Pseudo-inverse filter: G(u, v)   H (u, v)

 0 | H (u, v) |  threshold

Inverse and Pseudo-Inverse Filtering Wiener (Least Square) Filtering


1 H * (u, v)
G (u, v)  Wiener filter: G (u, v) 
H (u, v)
| H (u, v) |2  K

 W2 noise power
K
 X2 signal power

• Optimal in the least MSE sense, i.e.


G(u, v) is the best possible linear filter that minimizes
blurred image
 1 error energy  E 
 Xˆ (u, v)  X (u, v) 

2
 | H (u, v) | 
G(u, v)   H (u, v)  

 0 | H (u, v) | 
• Have to estimate signal and noise power
Adapted from Prof. Xin Li  = 0.1
Weiner Filtering Inverse vs. Weiner Filtering
distorted inverse filtering Wiener filtering

Blurred Inverse motion blur


image filtering
+
noise

less noise

Weiner
Radially limited filtering
inverse filtering
R = 70
less noise

From [Gonzalez & Woods] From [Gonzalez & Woods]

Weiner Image Denoising Weiner Image Denoising


w(m,n)
adding noise
x(m,n) h(m,n) + y(m,n) noise var = 400

• What if no blur, but only noise, i.e. h(m,n) is an impulse


or H(u, v) = 1 ?

H * (u, v)  W2
Wiener filter: G (u, v)  where K
| H (u, v) |2  K  X2

for H(u,v) = 1 local Wiener


denoising
Wiener 1 1  X2
denoising filter: G (u, v)   
1  K 1   W2 /  X2  X2   W2
Typically applied locally in space

Summary of Linear Image Restoration Filters Advanced Image Restoration


1
Inverse filter: G(u,v) = • Adaptive Processing
H(u,v)
– Spatial adaptive
 1 – Frequency adaptive
 | H (u, v) | 
Pseudo-inverse G(u, v)   H (u, v)
filter: 
 0 | H (u, v) |  • Nonlinear Processing
– Thresholding, coring …
H * (u, v) – Iterative restoration
Wiener filter: G (u, v)  where 2
| H (u, v) |2  K K  W2 • Advanced Transformation / Modeling
X
– Advanced image transforms, e.g., wavelet …
Wiener  X2 – Statistical image modeling
denoising filter: G (u, v) 
   W2
2
X
• Blind Deblurring / Deconvolution

You might also like