Upload
geraldine-mcdowell
View
258
Download
4
Tags:
Embed Size (px)
Citation preview
Part I: Image Transforms
DIGITAL IMAGE PROCESSING
}10 ),({ Nxxf
1
0)(),()(
N
xxfxuTug
1-D SIGNAL TRANSFORMGENERAL FORM
10 Nu
fTg
• Scalar form
• Matrix form
}10 ),({ Nxxf
1
0)(),()(
N
xxfxuTug
1-D SIGNAL TRANSFORM cont.REMEMBER THE 1-D DFT!!!
• General form
10 Nu
1
0
2
)(1
)(N
x
N
xuj
xfeN
ug
• DFT
1-D INVERSE SIGNAL TRANSFORMGENERAL FORM
• Scalar form
1
0)(),()(
N
uuguxIxf
• Matrix form
gTf 1
}10 ),({ Nxxf
1-D INVERSE SIGNAL TRANSFORM cont.REMEMBER THE 1-D DFT!!!
• General form
1
0
2
)()(N
x
N
xuj
ugexf
10 Nu
• DFT
1
0)(),()(
N
uuguxIxf
1-D UNITARY TRANSFORM
fTg
• Matrix form
TTT 1
SIGNAL RECONSTRUCTION
1
0)(),()(
N
u
TugxuTxfgTf
TTT 1
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.
2-D (IMAGE) TRANSFORMGENERAL FORM
1
0
1
0),(),,,(),(
N
x
N
yyxfyxvuTvug
1
0
1
0),(),,,(),(
N
u
N
vvugvuyxIyxf
2-D IMAGE TRANSFORMSPECIFIC FORMS
• Separable
• Symmetric
),(),(),,,( 21 yvTxuTyxvuT
),(),(),,,( 11 yvTxuTyxvuT
• Separable and Symmetric
• Separable, Symmetric and Unitary
TTfTg 11
11 TgTfT
ENERGY PRESERVATION
• 1-D
• 2-D
1
0
1
0
21
0
1
0
2),(),(
M
u
N
v
M
x
N
yvugyxf
22fg
ENERGY COMPACTION
Most of the energy of the original data concentrated in only a few of the significant transform coefficients; remaining coefficients are near zero.
Why is Fourier Transform Useful?
• Easier to remove undesirable frequencies.
• Faster to perform certain operations in the frequency domain than in the spatial domain.
• The transform is independent of the signal.
ExampleRemoving undesirable frequencies
remove highfrequencies
reconstructedsignal
frequenciesnoisy signal
zero! to tscoeeficien
ingcorrespond
their set s,frequencie
certain remove To
)(uF
How do frequencies show up in an image?
• Low frequencies correspond to slowly varying information (e.g., continuous surface).
• High frequencies correspond to quickly varying information (e.g., edges)
Original Image Low-passed
2-D DISCRETE FOURIER TRANSFORM
1
0
1
0
)//(2),(),(M
x
N
y
NvyMuxjeyxfvuF
1
0
1
0
)//(2),(1
),(M
u
N
v
NvyMuxjevuFMN
yxf
Visualizing DFT
• Typically, we visualize
• The dynamic range of is typically very large
• Apply stretching:
( is constant)
before scaling after scalingoriginal image
),( vuF),( vuF
]),(1log[),( vuFcvuD c
Amplitude and Log of the Amplitude
Amplitude and Log of the Amplitude
Original and Amplitude
Rewrite as follows:
If we set:
Then:
1
0
/2
1
0
/2
1
0
1
0
/2/2
),(),(
),(),(
),(),(
M
x
Muxj
N
y
Nvyj
M
x
N
y
NvyjMuxj
vxGevuF
eyxfvxG
eyxfevuF
DFT PROPERTIES: SEPARABILITY
),( vuF
• How can we compute ?
• How can we compute ?
).( of rows of DFT
),(1
),(),(
1
0
/2
1
0
/2
yxfN
eyxfN
N
eyxfvxG
N
y
Nvyj
N
y
Nvyj
DFT PROPERTIES: SEPARABILITY),( vxG
),( vuF
),( of columns of DFT
),(1
),(1
0
/2
vxGM
evxGM
MvuFM
x
Muxj
DFT PROPERTIES: SEPARABILITY
DFT PROPERTIES: PERIODICITY
The DFT and its inverse are periodic with period N
),(),(
),(),(
NvMuFNvuF
vMuFvuF
DFT PROPERTIES: SYMMETRY
If is real, then),( vuF
odd andimaginary odd and real
even and real even and real
),(),(
),(),(
),(),(),(),( *
vuFyxf
vuFyxf
vuFvuFvuFvuF
• Translation in spatial domain:
• Translation in frequency domain:
DFT PROPERTIES: TRANSLATION
),(),( 00)//(2 00 vvuuFeyxf NyvMxuj
)//(200
00),(),( NyvMxujevuFyyxxf
Warning: to show a full period, we need to translate the origin of the transform at
DFT PROPERTIES: TRANSLATION
2/Nu )2/,2/(),( NMvu
)(uF
)2
(N
uF
DFT PROPERTIES: TRANSLATION
)2/,2/()1)(,(
),(),(
)1(
2/2/
)2/,2/(),(
)(
00)//(2
)()()//(2
00
00
00
nvMuFyxf
vvuuFeyxf
ee
NvMu
NMvuF
yx
NyvMxuj
yxyxjNyvMxuj
Using
case that In
and take
at move To
DFT PROPERTIES: TRANSLATION
no translation after translation
)2/,2/()1)(,( )( nvMuFyxf yx
DFT PROPERTIES: ROTATION
by rotates by rotating ),,(),( vuFyxf
DFT PROPERTIESADDITION-MULTIPLICATION
transform Fourier the is ][ where
)],([)],([)],(),([
)],([)],([)],(),([
yxgyxfyxgyxf
yxgyxfyxgyxf
DFT PROPERTIES: SCALE
transform Fourier the is ][ where
)],([)],([)],(),([
)],([)],([)],(),([
yxgyxfyxgyxf
yxgyxfyxgyxf
DFT PROPERTIES: AVERAGE
)0,0(1
),(
),()0,0(
),(1
),(
1
0
1
0
1
0
1
0
FMN
yxf
yxfF
yxfMN
yxf
M
x
N
y
M
x
N
y
:image the of value Average
Original Image Fourier Amplitude Fourier Phase
Magnitude and Phase of DFT
• What is more important?
• Hint: use inverse DFT to reconstruct the image using magnitude or phase only information
magnitude phase
Magnitude and Phase of DFT
Reconstructed image using
magnitude only
(i.e., magnitude determines the
contribution of each component!)
Reconstructed image using
phase only
(i.e., phase determines
which components are present!)
Magnitude and Phase of DFT
Original Image-Fourier AmplitudeKeep Part of the Amplitude Around the Origin and Reconstruct Original
Image (LOW PASS filtering)
Keep Part of the Amplitude Far from the Origin and Reconstruct Original Image (HIGH PASS filtering)
Reconstruction from
phase of one image and amplitude of the other
Reconstruction from
phase of one image and amplitude of the other