Você está na página 1de 23

The Fourier Transform in

Image Processing
And a little
Digital Signal Processing
The Basics
• Image as a function
– f(m,n) = grey level
• Alternative transforms
– make certain types of image manipulation easier
• The Fourier Transform
– Image processing
– Image restoration
– Image filtering
– Image analysis
m =+ ∞ n=+ ∞
F (ω 1 , ω 2 ) = ∑ ∑
m =− ∞ n=− ∞
f ( m, n)e − jω 1 m − j ω 2 n
e

• This is the 2-D Fourier transform:


– ω 1 and ω 2 are frequencies (-π=< ω =< π
radians)
– F(ω 1,ω 2) is the frequency domain
representation of the image
– F(0,0) is the sum of all frequencies
Inverse Fourier Transform

π π
1
∫ ∫
jω 1m jω 2 n
f ( m, n) = F (ω ω ) e e dω 1 dω 2
2π ω 1 = − π ω 2 =− π
1 2
Examples
Examples
Examples
MatLab Code
• r2=imread('d:\images\2rect.jpg');
• r2f=fft2(r2);
• imshow(log(abs(r2f)),[3 10]); colormap(jet); colorbar
Discrete Fourier Transform
• Digital sampling of FT
• Fast Fourier Transform
• f(m,n) defined over 0 =< m,n =< M-1,N-1
• DFT
M − 1N− 1  2π   2π 
− j   pm − j  qn
F ( p, q ) = ∑ ∑ f ( m, n)e M 
e N 

p=0 n=0
First 56 periodic basis patterns in the DFT
Inverse DFT

1 M − 1N − 1
(
j 2π )pm j (2π N )qn
f ( m, n) =
MN
∑ ∑ F ( p, q ) e
p =0 q =0
M
e
Why use Fourier?
• Fast convolution
– Convolution in image domain is multiplication in
Fourier domain
• Linear filter convolution
– Filters designed according to frequency response
• Locating features (template match)
– Rotate filter by 180 degrees
– Convolve with test image
– Peaks indicate matches
Phase and Amplitude
• In Fourier space an image has two
pieces of information jϕ a
ra e
– Amplitude (real)
• Strength of the wave front
• Information on the frequencies in the the image
– Phase (complex)
• Position within the wave front
• Information in the structure within the image
Amplitude Phase Amplitude
RANDOM SIGNALS
• A Random Process
– A model for a digital signal
• A signal is a probabilistic combination of
multiple random signals (c.f. Fourier)
• Given a signal we need to estimate its
underlying Probability law.
Correlation and Power Spectra
• We often want to analyse images according
to their statistical content
• Signal Noise can be produced by
– Signal Processing with finite length buffers
– Systems with stochastic outputs
• Noise cannot be modelled by a function
• Images represented in terms statistical
combination of discrete time signals
– These do not have a Fourier Transform
– Some properties can be modelled…
• Autocorrelation
Q− 1 Q − 1
R ff (m, n; m′ )=∑
, n′ ∑ f q f q′p(q, q′
; m, n;m′
, n′
)
q = 0 q′
=0

– Probability of measuring grey value q at (m,n) and


q’at (m’,n’)

• Autocovariance
M− 1N− 1
1
C ff ( m, n) =
MN
∑ ∑ (F
m′
= 0 n′
=0
m′
n′ − Fm′n′)( Fm′+ m, n′+ n − Fm′+ m, n′+ n )

– Remove the average of the signal and then


calculate correlation
• We can get Fourier transform of
Autocovariance
– Describes the distribution of power across
the frequency range
– Effect of linear filters on stochastic signals
can be described in terms of the effect on
the autocovariance function
• Digital Signal Processing
– Design and analysis of filters for signals
and systems.
Discrete Cosine Transform

Inverse Discrete Cosine Transform


• DCT
– Image seen as the combination of MxN
functions
– If we perform the DCT in 8*8 function
windows the Bpq are the weights applied to
the 64 “basis functions”
– Used in JPEG
– Image broken into 8*8
– DCT
– Coded Coefficients sent
– Inverse DCT
– Try “dctdemo” in matlab
Radon Transform
• Compute Projections of objects in
images
• Similar to the Hough transform – find
lines and shapes
Radon Transform for any θ

Rθ ( x′
)= ∫f ( x′cosθ −
−∞
y′
sin θ , x′
sin θ + y′
cosθ )dy′

Where:

x′  cosθ sin θ x 


 = − sin θ cosθ y 
y ′
    
Find straight lines
• Edge detect image
• Perform radon transform for all angles
• Peaks in Radon Transform represent
straight lines
• Matlab function “radon(Image, angle)”

Você também pode gostar