SlideShare una empresa de Scribd logo
1 de 30
Chapter 3
FrequencyTransform
s
&
Im processing in the FrequencyDom
age
ain
Introduction
 The spatial domain refers to the representation of an
image as the array of gray-level intensity.
 The electromagnetic spectrum consist of sinusoidel
waves of different wavelengths (frequencies).
 The frequency content of an image refers to the rate at
which the gray levels change in the image
 Rapidly changing brightness values correspond to
high frequency terms, slowly changing brightness
values correspond to low frequency terms
 The Fourier transform is a mathematical tool that
analyses a signal (e.g. images) into its spectral
components depending on its wavelength (i.e.
frequency) content.
Fourier Transforms
 In 1822, Jean B. Fourier has shown that any function f(x) that
have bounded area with the x-axis can be expressed as a linear
combination of sine and/or cosine waves of different
frequencies.
 This is also applicable functions of 2 variables, e.g. images.
+

+

=

+

Q. Can we recover the different
frequencies of this signal?
Fourier Transforms
 Fourier transform converts a signal from time (or space) domain
to frequency domain
Illustration of Fourier Theory for images

Every row is Sine wave of
frequncy 1

Sine wave with frequncy 2

Combined waves frequncy 1+2+3

Sine wave with frequncy 3

Mixed waves with frequncy 5, 2 &1
MATLAB generated images
 MATLAB can be used to generate images with patterns of and
desired rate of change of brightness.
 For this we need to use trigonometric functions of 2 variables as
indicated by the following example code:
clear all;
A=zeros(256,256);
B=A;
for i=1:1:256
for j=1:1:256
A(i,j)=a1*sin(pi*(a2*i+a3*j)/m);
B(i,j)=b1cos(pi*(b2*i+b3*j)/n); //m and n are to be powers of 2.
end
end
C=A+B;
imshow(C);
imwrite(C, 'SinoPattern2.bmp')
Images generated from Sinoside function
Fourier Transform - Definition

 The Discrete Fourier Transform (DFT) of f(x) is defined as:

1
F(u) = 
M

M −1

∑
x =0

2π u x
f ( x) cos(
)
M

− 1 M −1
2π u x 
∑ f ( x) sin( M )
M x =0


And the inverse DFT (IDFT) is defined as:

2π u x M −1
2π u x
f(x) = ∑ R (u ) cos(
) − ∑ I (u ) sin(
)
M
M
u =0
u =0
M −1

 The u values u = 0, 1, ..., M-1) is the frequency domain of f(x).
 One can use Excel to implement Fourier tranforms.
Fourier Transform - continued
 Unlike f(x), F(u) is a complex valued function, i.e. is a pair of
functions involving trigonometric functions:
1
R(u) =
M
I(u) = −

1
M

M −1

∑ f ( x) cos(2πux / M ),

called the real part, and

x =0
M −1

∑ f ( x) sin(2πux / M ),

called the imaginary part.

x =0

i.e. F(u) ≡ [ R(u ) I (u )].

 F is represented by its MAGNITUDE and PHASE rather that its
REAL and IMAGINARY parts,
 where: MAGNITUDE(u) = SQRT( R(u)^2+IMAGINARY(u)^2 )
 The phase angle of the transform is:

I (u )
φ (u ) = tan (
).
R(u )
−1

PHASE(u) = ATAN( IMAGINARY(u)/REAL(u) )
The 2-dimensional DFT
 The DFT of a digitised function f(x,y) (i.e. an image) is defined as:

 1
F(u, v) = 
 MN

M −1 N −1

∑∑ f ( x, y) cos(2π (u x / M + v y / N )
x =0 y =0


∑∑ f ( x, y) sin(2π (u x / M + v y / N )
x =0 y =0

and the inverse DFT is defined in a similar manner as before.
1
−
MN

M −1 N −1

f ( x, y) = ∑ ∑ R(u, v) cos(2π (u x / M + v y / N ) −
N −1M −1

u =0 v =0

N −1M −1

∑ ∑ I (u , v) sin( 2π (u x / M + v y / N )

u =0 v =0

 Note that, F(0,0) = the average value of f(x,y) and is refered to as
the DC component of the spectrum.
 It is a common practice to multiply the image f(x,y) by (-1) x+y. In
this case, the DFT of (f(x,y)(-1)x+y) has its origin located at the
centre of the image, i.e. at (u,v)=(M/2,N/2).
The Fourier spectrum – in 2D
The Fourier spectrum – in 2D

• The original image
contains two principal
features: edges run
approximately at ±45ο .
•

The Fourier spectrum
shows important
components in the
same directions.
Fourier Spectrum

Original image

Log enhanced version
of Fourier Spectrum

Inverse Fourier

The FTs also tend to have bright lines that are
perpendicular to lines in the original letter. If the
letter has circular segments, then so does the FT.
Filtering in the Frequency Domain – Scheme
The Notch filter
 A simple filter that forces the average image value to become 0.
 The average value of an image f(x,y) is the DC component of the
DFT spectrum i.e. F(0,0). The Notch filter is defined as follows:

0
H (u, v) = 
1

Original
image

if (u, v) = (M/2, N/2)
otherwise.

Image after
Notch filter
application

 Note that the edges stand out more than before filtering.
 When the average value is 0, some values of the filtered image
are negative, but for display purposes pixel values are shifted.
Low-pass and High-pass filtering
 Low frequencies in the DFT spectrum correspond to image
values over smooth areas, while high frequencies
correspond to detailed features such as edges & noise.
 A filter that suppresses high frequencies but allows low ones
is called Low-pass filter, while a filter that reduces low
frequencies and allows high ones is called High-pass filter.
 Examples of such filters are obtained from circular Gaussian
functions of 2 variables (see next slide)

1
−( u 2 + v 2 ) / 2σ 2
H ( u ,v ) =
e
,
- Lowpass filter,
2
2πσ
1
−( u 2 + v 2 ) / 2σ 2
H ( u ,v ) =
(1 − e
) - Highpass filter .
2
2πσ
Low-pass & High-pass filtering - Example

Low pass filtering

High pass filtering

Low pass filtering results in blurring effects, while High pass
filtering results in sharper edges.
Wavelet Transforms
 Wavelet analysis allows the use of long time intervals for
more precise low-frequency information, and shorter
intervals for high-frequency information.
 A wavelet (i.e. small wave) is a mathematical function
used to analyse a continuous-time signal into different
frequency components at different resolution scale.
 A wavelet transform of a function is a representation of f
wavelets. The wavelets are scaled and translated copies
of a finite-length or fast-decaying oscillating waveform
ψ(t), known as the mother wavelet.
 There are many wavelet filters to choose from. Here we
only discuss the Discrete Wavelet Transform.
Wavelet Transforms -Properties
 The Wavelet transform is a short time anlysis tool
of finite energy quasi-stationary signals at multiresolutions.
 The Discrete wavelet transform (DWT) provide a
compact representation of a signal’s frequency
commponents with strong spatial support.
 DWT decomposes a signal into frequency subbands
at different scales from which it can be perfectly
recontructed.
 2D-signals such as images can be decomposed in
many different ways.
The Haar Wavelet
The Haar wavelet is a
discontinuous, and
resembles a step function.
It is a crude version of the
Truncated cosine.

The Haar wavelet
0.6
0.4
0.2
0
-2

-0.2 0

2

4

6

8

10

-0.4
-0.6

 It can be implemented using a simple filter:
If X={x1,x2,x3,x4 ,x5 ,x6 ,x7 ,x8 } is a time-signal of length 8, then
the Haar wavelet decomposes X into an aproximation
subband containing the Low frequencies and a detail
subband containing the high frequencies:
Low= {x2+x1, x4+x3 , x6+x5 , x8+x7 }/√2

High= {x2-x1, x4-x3 , x6-x5 , x8-x7 }/√2
Haar Wavelet – in MATLAB
Wavelet Decomposition of Images
A Haar wavelet decompose images first on the rows and then on the
columns resulting in 4 subbands, the LL-subband which an approximation of
the original image while the other subbands contain the missing details
The LL-subband output from any stage can be decomposed further.
Original
Image

1 stage Transformation
After 2 stages

…
Different Decomposition Schemes.
 The previous 2 decomposition scheme is known as
the Pyrimad scheme, whereby at successive stages
only the LL subband is wavelet transdormed.
 Other decomposition schemes include:
 The standard scheme – At every stage all the
image is wavelet transformd
 The wavelet packet – After stage 1, a non-LL
subband is transformed only if it satisfied
certain condition.
 The Quincux – During each stage, the columns
decomposition is only applied on the L-subband
Statistical Properties of Wavelet subbands
LL subband

HL subband

700

6000

600

5000

500

4000

400

3000

300

2000

200
100

1000

0

0
1

LH subband

Original pixels distribution of Mandrill
3000
2500
frequency

2000
1500
1000
500
1
20
39
58
77
96
115
134
153
172
191
210
229
248

0
coefficient value

1 25 49 73 97 121 145 169 193 217 241

25 49 73 97 121 145 169 193 217 241

8000
7000
6000
5000
4000
3000
2000
1000
0

HH subband
6000
5000
4000
3000
2000
1000
0

1 25 49 73 97 121 145 169 193 217 241

1 25 49 73 97 121 145 169 193 217 241

The distribution of the LL-subband approximate that of the original but all nonLL subbands have a Laplacian distribution. This remains valid at all depths.
Applications of Wavelet Transforms
 The list of applications is growing fast. These include:
 Image and video Compression
 Feature detection and recognition
 Image denoising
 Face Recognition
 Signal interpulation
 Most applications benefit from the statistical propererty
of the non-LL subbands (The laplacian distribution of
the wavelet coefficients in these subbands).
Wavelet-based Feature detection
 Non-LL subbands of a wavelet decomposed image contains high

frequencies (i.e. image features) which are highlighted. These
significant coefficients are the furthest away from the mean.
 Thresholding reveals the main features.

Horizontal features

σ

Vertical features
Extracting significant coefficients

Best value for sigma is related to the STD

28
Feature enhancement method using wavelet subband segmentation

NSC

-

+

µ≅0

SC
29
End of Chapter 3

Más contenido relacionado

La actualidad más candente

Lec 07 image enhancement in frequency domain i
Lec 07 image enhancement in frequency domain iLec 07 image enhancement in frequency domain i
Lec 07 image enhancement in frequency domain iAli Hassan
 
An introduction to discrete wavelet transforms
An introduction to discrete wavelet transformsAn introduction to discrete wavelet transforms
An introduction to discrete wavelet transformsLily Rose
 
DISTINGUISH BETWEEN WALSH TRANSFORM AND HAAR TRANSFORMDip transforms
DISTINGUISH BETWEEN WALSH TRANSFORM AND HAAR TRANSFORMDip transformsDISTINGUISH BETWEEN WALSH TRANSFORM AND HAAR TRANSFORMDip transforms
DISTINGUISH BETWEEN WALSH TRANSFORM AND HAAR TRANSFORMDip transformsNITHIN KALLE PALLY
 
Frequency domain methods
Frequency domain methods Frequency domain methods
Frequency domain methods thanhhoang2012
 
Image Denoising Using Wavelet Transform
Image Denoising Using Wavelet TransformImage Denoising Using Wavelet Transform
Image Denoising Using Wavelet TransformIJERA Editor
 
Chapter no4 image transform3
Chapter no4 image transform3Chapter no4 image transform3
Chapter no4 image transform3ShardaSalunkhe1
 
Chapter 5 Image Processing: Fourier Transformation
Chapter 5 Image Processing: Fourier TransformationChapter 5 Image Processing: Fourier Transformation
Chapter 5 Image Processing: Fourier TransformationVarun Ojha
 
Enhancement in frequency domain
Enhancement in frequency domainEnhancement in frequency domain
Enhancement in frequency domainAshish Kumar
 
Image transforms 2
Image transforms 2Image transforms 2
Image transforms 2Ali Baig
 
04 1 - frequency domain filtering fundamentals
04 1 - frequency domain filtering fundamentals04 1 - frequency domain filtering fundamentals
04 1 - frequency domain filtering fundamentalscpshah01
 
Fourier transformation
Fourier transformationFourier transformation
Fourier transformationzertux
 
5 pulse compression waveform
5 pulse compression waveform5 pulse compression waveform
5 pulse compression waveformSolo Hermelin
 
Wavelet Applications in Image Denoising Using MATLAB
Wavelet Applications in Image Denoising Using MATLABWavelet Applications in Image Denoising Using MATLAB
Wavelet Applications in Image Denoising Using MATLABajayhakkumar
 
Fourier transforms
Fourier transformsFourier transforms
Fourier transformsIffat Anjum
 
Image processing7 frequencyfiltering
Image processing7 frequencyfilteringImage processing7 frequencyfiltering
Image processing7 frequencyfilteringshabanam tamboli
 

La actualidad más candente (20)

Nabaa
NabaaNabaa
Nabaa
 
Lec 07 image enhancement in frequency domain i
Lec 07 image enhancement in frequency domain iLec 07 image enhancement in frequency domain i
Lec 07 image enhancement in frequency domain i
 
Image denoising
Image denoisingImage denoising
Image denoising
 
An introduction to discrete wavelet transforms
An introduction to discrete wavelet transformsAn introduction to discrete wavelet transforms
An introduction to discrete wavelet transforms
 
DISTINGUISH BETWEEN WALSH TRANSFORM AND HAAR TRANSFORMDip transforms
DISTINGUISH BETWEEN WALSH TRANSFORM AND HAAR TRANSFORMDip transformsDISTINGUISH BETWEEN WALSH TRANSFORM AND HAAR TRANSFORMDip transforms
DISTINGUISH BETWEEN WALSH TRANSFORM AND HAAR TRANSFORMDip transforms
 
Study and Analysis of Multiwavelet Transform with Threshold in Image Denoisin...
Study and Analysis of Multiwavelet Transform with Threshold in Image Denoisin...Study and Analysis of Multiwavelet Transform with Threshold in Image Denoisin...
Study and Analysis of Multiwavelet Transform with Threshold in Image Denoisin...
 
Frequency domain methods
Frequency domain methods Frequency domain methods
Frequency domain methods
 
Image Denoising Using Wavelet Transform
Image Denoising Using Wavelet TransformImage Denoising Using Wavelet Transform
Image Denoising Using Wavelet Transform
 
Image denoising using curvelet transform
Image denoising using curvelet transformImage denoising using curvelet transform
Image denoising using curvelet transform
 
Chapter no4 image transform3
Chapter no4 image transform3Chapter no4 image transform3
Chapter no4 image transform3
 
Chapter 5 Image Processing: Fourier Transformation
Chapter 5 Image Processing: Fourier TransformationChapter 5 Image Processing: Fourier Transformation
Chapter 5 Image Processing: Fourier Transformation
 
Enhancement in frequency domain
Enhancement in frequency domainEnhancement in frequency domain
Enhancement in frequency domain
 
Image transforms 2
Image transforms 2Image transforms 2
Image transforms 2
 
04 1 - frequency domain filtering fundamentals
04 1 - frequency domain filtering fundamentals04 1 - frequency domain filtering fundamentals
04 1 - frequency domain filtering fundamentals
 
Fourier transformation
Fourier transformationFourier transformation
Fourier transformation
 
5 pulse compression waveform
5 pulse compression waveform5 pulse compression waveform
5 pulse compression waveform
 
Wavelet Applications in Image Denoising Using MATLAB
Wavelet Applications in Image Denoising Using MATLABWavelet Applications in Image Denoising Using MATLAB
Wavelet Applications in Image Denoising Using MATLAB
 
Fourier transforms
Fourier transformsFourier transforms
Fourier transforms
 
Image processing 2
Image processing 2Image processing 2
Image processing 2
 
Image processing7 frequencyfiltering
Image processing7 frequencyfilteringImage processing7 frequencyfiltering
Image processing7 frequencyfiltering
 

Similar a Digital Image Processing_ ch3 enhancement freq-domain

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 transformSimranjit Singh
 
Lec_4_Frequency Domain Filtering-I.pdf
Lec_4_Frequency Domain Filtering-I.pdfLec_4_Frequency Domain Filtering-I.pdf
Lec_4_Frequency Domain Filtering-I.pdfnagwaAboElenein
 
A Review on Image Denoising using Wavelet Transform
A Review on Image Denoising using Wavelet TransformA Review on Image Denoising using Wavelet Transform
A Review on Image Denoising using Wavelet Transformijsrd.com
 
Wavelet Based Image Compression Using FPGA
Wavelet Based Image Compression Using FPGAWavelet Based Image Compression Using FPGA
Wavelet Based Image Compression Using FPGADr. Mohieddin Moradi
 
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 Transformvijayanand Kandaswamy
 
FourierTransform detailed power point presentation
FourierTransform detailed power point presentationFourierTransform detailed power point presentation
FourierTransform detailed power point presentationssuseracb8ba
 
Speech signal time frequency representation
Speech signal time frequency representationSpeech signal time frequency representation
Speech signal time frequency representationNikolay Karpov
 
Filtering in frequency domain
Filtering in frequency domainFiltering in frequency domain
Filtering in frequency domainGowriLatha1
 
imagetransforms1-210417050321.pptx
imagetransforms1-210417050321.pptximagetransforms1-210417050321.pptx
imagetransforms1-210417050321.pptxMrsSDivyaBME
 
imageCorrectionLinearDiffusion
imageCorrectionLinearDiffusionimageCorrectionLinearDiffusion
imageCorrectionLinearDiffusionKellen Betts
 
Image Enhancement using Frequency Domain Filters
Image Enhancement using Frequency Domain FiltersImage Enhancement using Frequency Domain Filters
Image Enhancement using Frequency Domain FiltersKarthika Ramachandran
 
3 intensity transformations and spatial filtering slides
3 intensity transformations and spatial filtering slides3 intensity transformations and spatial filtering slides
3 intensity transformations and spatial filtering slidesBHAGYAPRASADBUGGE
 
Dct,gibbs phen,oversampled adc,polyphase decomposition
Dct,gibbs phen,oversampled adc,polyphase decompositionDct,gibbs phen,oversampled adc,polyphase decomposition
Dct,gibbs phen,oversampled adc,polyphase decompositionMuhammad Younas
 
Image and Audio Signal Filtration with Discrete Heap Transforms
Image and Audio Signal Filtration with Discrete Heap TransformsImage and Audio Signal Filtration with Discrete Heap Transforms
Image and Audio Signal Filtration with Discrete Heap Transformsmathsjournal
 

Similar a Digital Image Processing_ ch3 enhancement freq-domain (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
 
Lec_4_Frequency Domain Filtering-I.pdf
Lec_4_Frequency Domain Filtering-I.pdfLec_4_Frequency Domain Filtering-I.pdf
Lec_4_Frequency Domain Filtering-I.pdf
 
A Review on Image Denoising using Wavelet Transform
A Review on Image Denoising using Wavelet TransformA Review on Image Denoising using Wavelet Transform
A Review on Image Denoising using Wavelet Transform
 
Wavelet Based Image Compression Using FPGA
Wavelet Based Image Compression Using FPGAWavelet Based Image Compression Using FPGA
Wavelet Based Image Compression Using FPGA
 
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
 
FourierTransform detailed power point presentation
FourierTransform detailed power point presentationFourierTransform detailed power point presentation
FourierTransform detailed power point presentation
 
Speech signal time frequency representation
Speech signal time frequency representationSpeech signal time frequency representation
Speech signal time frequency representation
 
Lec11.ppt
Lec11.pptLec11.ppt
Lec11.ppt
 
Filtering in frequency domain
Filtering in frequency domainFiltering in frequency domain
Filtering in frequency domain
 
LN s05-machine vision-s2
LN s05-machine vision-s2LN s05-machine vision-s2
LN s05-machine vision-s2
 
imagetransforms1-210417050321.pptx
imagetransforms1-210417050321.pptximagetransforms1-210417050321.pptx
imagetransforms1-210417050321.pptx
 
imageCorrectionLinearDiffusion
imageCorrectionLinearDiffusionimageCorrectionLinearDiffusion
imageCorrectionLinearDiffusion
 
Image Enhancement using Frequency Domain Filters
Image Enhancement using Frequency Domain FiltersImage Enhancement using Frequency Domain Filters
Image Enhancement using Frequency Domain Filters
 
3 intensity transformations and spatial filtering slides
3 intensity transformations and spatial filtering slides3 intensity transformations and spatial filtering slides
3 intensity transformations and spatial filtering slides
 
Doppler radar
Doppler radarDoppler radar
Doppler radar
 
Dct,gibbs phen,oversampled adc,polyphase decomposition
Dct,gibbs phen,oversampled adc,polyphase decompositionDct,gibbs phen,oversampled adc,polyphase decomposition
Dct,gibbs phen,oversampled adc,polyphase decomposition
 
Wave diffraction
Wave diffractionWave diffraction
Wave diffraction
 
Fourier transform
Fourier transformFourier transform
Fourier transform
 
Fourier slide
Fourier slideFourier slide
Fourier slide
 
Image and Audio Signal Filtration with Discrete Heap Transforms
Image and Audio Signal Filtration with Discrete Heap TransformsImage and Audio Signal Filtration with Discrete Heap Transforms
Image and Audio Signal Filtration with Discrete Heap Transforms
 

Último

What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????blackmambaettijean
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 

Último (20)

What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 

Digital Image Processing_ ch3 enhancement freq-domain

  • 2. Introduction  The spatial domain refers to the representation of an image as the array of gray-level intensity.  The electromagnetic spectrum consist of sinusoidel waves of different wavelengths (frequencies).  The frequency content of an image refers to the rate at which the gray levels change in the image  Rapidly changing brightness values correspond to high frequency terms, slowly changing brightness values correspond to low frequency terms  The Fourier transform is a mathematical tool that analyses a signal (e.g. images) into its spectral components depending on its wavelength (i.e. frequency) content.
  • 3. Fourier Transforms  In 1822, Jean B. Fourier has shown that any function f(x) that have bounded area with the x-axis can be expressed as a linear combination of sine and/or cosine waves of different frequencies.  This is also applicable functions of 2 variables, e.g. images. + + = + Q. Can we recover the different frequencies of this signal?
  • 4. Fourier Transforms  Fourier transform converts a signal from time (or space) domain to frequency domain
  • 5. Illustration of Fourier Theory for images Every row is Sine wave of frequncy 1 Sine wave with frequncy 2 Combined waves frequncy 1+2+3 Sine wave with frequncy 3 Mixed waves with frequncy 5, 2 &1
  • 6. MATLAB generated images  MATLAB can be used to generate images with patterns of and desired rate of change of brightness.  For this we need to use trigonometric functions of 2 variables as indicated by the following example code: clear all; A=zeros(256,256); B=A; for i=1:1:256 for j=1:1:256 A(i,j)=a1*sin(pi*(a2*i+a3*j)/m); B(i,j)=b1cos(pi*(b2*i+b3*j)/n); //m and n are to be powers of 2. end end C=A+B; imshow(C); imwrite(C, 'SinoPattern2.bmp')
  • 7. Images generated from Sinoside function
  • 8. Fourier Transform - Definition  The Discrete Fourier Transform (DFT) of f(x) is defined as: 1 F(u) =  M M −1 ∑ x =0 2π u x f ( x) cos( ) M − 1 M −1 2π u x  ∑ f ( x) sin( M ) M x =0  And the inverse DFT (IDFT) is defined as: 2π u x M −1 2π u x f(x) = ∑ R (u ) cos( ) − ∑ I (u ) sin( ) M M u =0 u =0 M −1  The u values u = 0, 1, ..., M-1) is the frequency domain of f(x).  One can use Excel to implement Fourier tranforms.
  • 9. Fourier Transform - continued  Unlike f(x), F(u) is a complex valued function, i.e. is a pair of functions involving trigonometric functions: 1 R(u) = M I(u) = − 1 M M −1 ∑ f ( x) cos(2πux / M ), called the real part, and x =0 M −1 ∑ f ( x) sin(2πux / M ), called the imaginary part. x =0 i.e. F(u) ≡ [ R(u ) I (u )].  F is represented by its MAGNITUDE and PHASE rather that its REAL and IMAGINARY parts,  where: MAGNITUDE(u) = SQRT( R(u)^2+IMAGINARY(u)^2 )  The phase angle of the transform is: I (u ) φ (u ) = tan ( ). R(u ) −1 PHASE(u) = ATAN( IMAGINARY(u)/REAL(u) )
  • 10. The 2-dimensional DFT  The DFT of a digitised function f(x,y) (i.e. an image) is defined as:  1 F(u, v) =   MN M −1 N −1 ∑∑ f ( x, y) cos(2π (u x / M + v y / N ) x =0 y =0  ∑∑ f ( x, y) sin(2π (u x / M + v y / N ) x =0 y =0  and the inverse DFT is defined in a similar manner as before. 1 − MN M −1 N −1 f ( x, y) = ∑ ∑ R(u, v) cos(2π (u x / M + v y / N ) − N −1M −1 u =0 v =0 N −1M −1 ∑ ∑ I (u , v) sin( 2π (u x / M + v y / N ) u =0 v =0  Note that, F(0,0) = the average value of f(x,y) and is refered to as the DC component of the spectrum.  It is a common practice to multiply the image f(x,y) by (-1) x+y. In this case, the DFT of (f(x,y)(-1)x+y) has its origin located at the centre of the image, i.e. at (u,v)=(M/2,N/2).
  • 11. The Fourier spectrum – in 2D
  • 12. The Fourier spectrum – in 2D • The original image contains two principal features: edges run approximately at ±45ο . • The Fourier spectrum shows important components in the same directions.
  • 13. Fourier Spectrum Original image Log enhanced version of Fourier Spectrum Inverse Fourier The FTs also tend to have bright lines that are perpendicular to lines in the original letter. If the letter has circular segments, then so does the FT.
  • 14.
  • 15. Filtering in the Frequency Domain – Scheme
  • 16. The Notch filter  A simple filter that forces the average image value to become 0.  The average value of an image f(x,y) is the DC component of the DFT spectrum i.e. F(0,0). The Notch filter is defined as follows: 0 H (u, v) =  1 Original image if (u, v) = (M/2, N/2) otherwise. Image after Notch filter application  Note that the edges stand out more than before filtering.  When the average value is 0, some values of the filtered image are negative, but for display purposes pixel values are shifted.
  • 17. Low-pass and High-pass filtering  Low frequencies in the DFT spectrum correspond to image values over smooth areas, while high frequencies correspond to detailed features such as edges & noise.  A filter that suppresses high frequencies but allows low ones is called Low-pass filter, while a filter that reduces low frequencies and allows high ones is called High-pass filter.  Examples of such filters are obtained from circular Gaussian functions of 2 variables (see next slide) 1 −( u 2 + v 2 ) / 2σ 2 H ( u ,v ) = e , - Lowpass filter, 2 2πσ 1 −( u 2 + v 2 ) / 2σ 2 H ( u ,v ) = (1 − e ) - Highpass filter . 2 2πσ
  • 18. Low-pass & High-pass filtering - Example Low pass filtering High pass filtering Low pass filtering results in blurring effects, while High pass filtering results in sharper edges.
  • 19. Wavelet Transforms  Wavelet analysis allows the use of long time intervals for more precise low-frequency information, and shorter intervals for high-frequency information.  A wavelet (i.e. small wave) is a mathematical function used to analyse a continuous-time signal into different frequency components at different resolution scale.  A wavelet transform of a function is a representation of f wavelets. The wavelets are scaled and translated copies of a finite-length or fast-decaying oscillating waveform ψ(t), known as the mother wavelet.  There are many wavelet filters to choose from. Here we only discuss the Discrete Wavelet Transform.
  • 20. Wavelet Transforms -Properties  The Wavelet transform is a short time anlysis tool of finite energy quasi-stationary signals at multiresolutions.  The Discrete wavelet transform (DWT) provide a compact representation of a signal’s frequency commponents with strong spatial support.  DWT decomposes a signal into frequency subbands at different scales from which it can be perfectly recontructed.  2D-signals such as images can be decomposed in many different ways.
  • 21. The Haar Wavelet The Haar wavelet is a discontinuous, and resembles a step function. It is a crude version of the Truncated cosine. The Haar wavelet 0.6 0.4 0.2 0 -2 -0.2 0 2 4 6 8 10 -0.4 -0.6  It can be implemented using a simple filter: If X={x1,x2,x3,x4 ,x5 ,x6 ,x7 ,x8 } is a time-signal of length 8, then the Haar wavelet decomposes X into an aproximation subband containing the Low frequencies and a detail subband containing the high frequencies: Low= {x2+x1, x4+x3 , x6+x5 , x8+x7 }/√2 High= {x2-x1, x4-x3 , x6-x5 , x8-x7 }/√2
  • 22. Haar Wavelet – in MATLAB
  • 23. Wavelet Decomposition of Images A Haar wavelet decompose images first on the rows and then on the columns resulting in 4 subbands, the LL-subband which an approximation of the original image while the other subbands contain the missing details The LL-subband output from any stage can be decomposed further. Original Image 1 stage Transformation After 2 stages …
  • 24. Different Decomposition Schemes.  The previous 2 decomposition scheme is known as the Pyrimad scheme, whereby at successive stages only the LL subband is wavelet transdormed.  Other decomposition schemes include:  The standard scheme – At every stage all the image is wavelet transformd  The wavelet packet – After stage 1, a non-LL subband is transformed only if it satisfied certain condition.  The Quincux – During each stage, the columns decomposition is only applied on the L-subband
  • 25. Statistical Properties of Wavelet subbands LL subband HL subband 700 6000 600 5000 500 4000 400 3000 300 2000 200 100 1000 0 0 1 LH subband Original pixels distribution of Mandrill 3000 2500 frequency 2000 1500 1000 500 1 20 39 58 77 96 115 134 153 172 191 210 229 248 0 coefficient value 1 25 49 73 97 121 145 169 193 217 241 25 49 73 97 121 145 169 193 217 241 8000 7000 6000 5000 4000 3000 2000 1000 0 HH subband 6000 5000 4000 3000 2000 1000 0 1 25 49 73 97 121 145 169 193 217 241 1 25 49 73 97 121 145 169 193 217 241 The distribution of the LL-subband approximate that of the original but all nonLL subbands have a Laplacian distribution. This remains valid at all depths.
  • 26. Applications of Wavelet Transforms  The list of applications is growing fast. These include:  Image and video Compression  Feature detection and recognition  Image denoising  Face Recognition  Signal interpulation  Most applications benefit from the statistical propererty of the non-LL subbands (The laplacian distribution of the wavelet coefficients in these subbands).
  • 27. Wavelet-based Feature detection  Non-LL subbands of a wavelet decomposed image contains high frequencies (i.e. image features) which are highlighted. These significant coefficients are the furthest away from the mean.  Thresholding reveals the main features. Horizontal features σ Vertical features
  • 28. Extracting significant coefficients Best value for sigma is related to the STD 28
  • 29. Feature enhancement method using wavelet subband segmentation NSC - + µ≅0 SC 29