Upload
others
View
29
Download
0
Embed Size (px)
Citation preview
1
• Low Pass Filter
• High Pass Filter
• Band pass Filter
• Blurring
• Sharpening
Image Processing
Image Operations in the Frequency Domain
Frequency Bands
Percentage of image power enclosed in circles(small to large) :
90, 95, 98, 99, 99.5, 99.9
Image Fourier Spectrum
Blurring - Ideal Low pass Filter
90% 95%
98% 99%
99.5% 99.9%
2
The Convolution Theorem
g = f * h g = f h
implies implies
G = F H G = F * H
Convolution in one domain is a multiplication in the other and vice
versa
Image Operation in the Frequency Domain
FilteredImage
Image Transform
Filtered
FFT
FFT-1NewImage
3
Low pass Filter
f(x,y) F(u,v)
g(x,y) G(u,v)
G(u,v) = F(u,v) • H(u,v)
spatial domain frequency domain
filter
•
f(x,y) F(u,v)
H(u,v)g(x,y)
H(u,v) - Ideal Low Pass Filter
u
v
H(u,v)
0 D0
1
D(u,v)
H(u,v)
H(u,v) = 1 D(u,v) ≤ D0
0 D(u,v) > D0
D(u,v) = √ u2 + v2
D0 = cut off frequency
Blurring - Ideal Low pass Filter
98.65%
99.37%
99.7%
Blurring - Ideal Low pass Filter
98.0%
99.4%
99.6% 99.7%
99.0%
96.6%
4
The Ringing Problem
G(u,v) = F(u,v) • H(u,v)
g(x,y) = f(x,y) * h(x,y)
Convolution Theorem
sinc(x)
h(x,y)H(u,v)
↑ D0 ↓ Ringing radius + ↓ blur
IFFT
The Ringing Problem
0 50 100 150 200 2500
50
100
150
200
250
Freq. domain
Spatial domain
H(u,v) - Gaussian Filter
D(u,v)0 D0
1
H(u,v)
uv
H(u,v)
D(u,v) = √ u2 + v2
H(u,v) = e-D2(u,v)/(2D20)
Softer Blurring + no Ringing
e/1
Blurring - Gaussain Lowpass Filter
96.44%
98.74%
99.11%
5
The Gaussian Lowpass Filter
Freq. domain
Spatial domain
0 50 100 150 200 250 3000
50
100
150
200
250
300
H(u,v) - Butterworth Filter
D(u,v)0 D0
1
H(u,v)
0.5
uv
H(u,v)
D(u,v) = √ u2 + v2
H(u,v) = 1 + (D(u,v)/D0)2n
1
Blurring - Butterworth Lowpass Filter
93.70%
95.95%
97.48%
The Butterworth Lowpass Filter
Freq. domain
Spatial domain
0 5 0 1 0 0 1 5 0 2 0 0 2 5 00
5 0
1 0 0
1 5 0
2 0 0
2 5 0
6
D0=1D0=2D0=3
Ideal Butterworth Gaussian
Low Pass Filters - Comparison Blurring in the Spatial Domain:
Averaging = convolution with 1 11 1
= point multiplication of the transform with sinc:
0 50 1000
0.05
0.1
0.15
-50 0 500
0.2
0.4
0.6
0.8
1
Gaussian Averaging = convolution with 1 2 12 4 21 2 1
= point multiplication of the transform with a gaussian.
Image Domain Frequency Domain
Original - 4 levelQuantized Image
OriginalNoisy Image
Smoothed Image
Smoothed Image
Low Pass Filtering - Image SmoothingImage Sharpening - High Pass Filter
H(u,v) - Ideal Filter
H(u,v) = 0 D(u,v) ≤ D0
1 D(u,v) > D0
D(u,v) = √ u2 + v2
D0 = cut off frequency
0 D0
1
D(u,v)
H(u,v)
u
v
H(u,v)
7
H(u,v)
D(u,v)0 D0
1
D(u,v) = √ u2 + v2
High Pass Gaussian Filter
u
v
H(u,v)
H(u,v) = 1 - e-D2(u,v)/(2D20)
e/11−
H(u,v)
D(u,v)0 D0
1
0.5
D(u,v) = √ u2 + v2
H(u,v) = 1 + (D0/D(u,v))2n
1
High Pass Butterworth Filter
u
v
H(u,v)
1 -
Ideal
Butterworth
Gaussian
High Pass Filters - ComparisonHigh Pass Filtering
Original High Pass Filtered
8
High Frequency Emphasis
Original High Pass Filtered
+
High Frequency Emphasis
Emphasize High Frequency.Maintain Low frequencies and Mean.
(Typically K0 =1)
H'(u,v) = K0 + H(u,v)
0 D0
1
D(u,v)
H'(u,v)
High Frequency Emphasis - Example
Original High Frequency Emphasis
Original High Frequency Emphasis
High Pass Filtering - Examples
Original High pass Butterworth Filter
High Frequency Emphasis
High Frequency Emphasis +
Histogram Equalization
9
Band Pass Filtering
H(u,v) = 1 D0- ≤ D(u,v) ≤ D0 +0 D(u,v) > D0 +
D(u,v) = √ u2 + v2
D0 = cut off frequency
u
v
H(u,v)
0
1D(u,v)
H(u,v)
D0- w2
D0+w2
D0
0 D(u,v) ≤ D0 -w2
w2
w2
w2
w = band width
H(u,v) = 1 D1(u,v) ≤ D0 or D2(u,v) ≤ D0
0 otherwise
D1(u,v) = √ (u-u0)2 + (v-v0)2
D0 = local frequency radius
Local Frequency Filtering
u
v
H(u,v)
0 D0
1
D(u,v)
H(u,v)
-u0,-v0 u0,v0
D2(u,v) = √ (u+u0)2 + (v+v0)2
u0,v0 = local frequency coordinates
H(u,v) = 0 D1(u,v) ≤ D0 or D2(u,v) ≤ D0
1 otherwise
D1(u,v) = √ (u-u0)2 + (v-v0)2
D0 = local frequency radius
Band Rejection Filtering
0 D0
1
D(u,v)
H(u,v)
-u0,-v0 u0,v0
D2(u,v) = √ (u+u0)2 + (v+v0)2
u0,v0 = local frequency coordinates
u
v
H(u,v)
+
+ =
=
Additive Noise Filtering
10
Local Reject Filter - Example
Original Noisy image Fourier Spectrum
Band Reject Filter
Local Reject Filter - Example
Original Noisy image Fourier Spectrum
Local Reject Filter
Homomorphic Filtering (multiplicative Noise Filtering)
Noise Model:
Original Image
Noise
Actual Image
i(x,y)
n(x,y)
f(x,y) = i(x,y) • n(x,y)
Goal: Clean multiplicative noise
( ) ( )( ) ( )( ) ( )( )yxnFyxiFyxnyxiF ,~,~,,~ ⋅≠⋅
Perform:
z(x,y) = log(f(x,y))
I(u,v) + N(u,v)
Apply filter H(u,v)
S(u,v) = H(u,v)•Z(u,v)-1
i'(x,y) + n'(x,y)
g(x,y) = exp(s(x,y))
Homomorphic Filtering:
log FFT-1FFT H(u,v) expimage image
log(i(x,y) • n(x,y)) = log(i(x,y)) + log(n(x,y))
=
Z(u,v) =
H(u,v)•I(u,v) + H(u,v)•N(u,v)=
s(x,y) =
exp(i'(x,y)) • exp(n'(x,y))=
11
Surface Reflectance r(x,y)
Illumination i(x,y)
Homomorphic Filtering - Example
Reflectance Model:
Brightness f(x,y) = r(x,y) • i(x,y)
Assumptions:
Illumination changes "slowly" across sceneIllumination ≈ low frequencies.
Surface reflections change "sharply" across scenereflectance ≈ high frequencies.
Illumination Reflectance Brightness
Homomorphic Filtering
Original Filtered
from: Jashmin K. Shah
More ExamplesPattern Matching in the
Freq. Domain
• Pattern Matching:– Finding occurrences of a particular
pattern in an image.
• Pattern:– Typically a 2D image fragment.– Much smaller than the image.
12
Image Similarity Measures
• Image Similarity Measure:– A function that assigns a nonnegative
real value to two given images.– Small measure high similarity– Preferable to be a metric distance
(non-negative, identity, symmetric, trianglebinequality)
– Can be combined with thresholding:
d( - ) ≥ 0
1 ( , )( , )
0d P Q threshold
f P Qotherwise
<⎧ ⎫= ⎨ ⎬⎩ ⎭
The Matching Approach
• Scan the entire image, pixel by pixel.• For each pixel, evaluate the similarity
between its local neighborhood and the pattern.
The Euclidean Distance as a Similarity Measure
• Given:– k×k pattern P– n×n image I– kxk window of image I located at x,y - Ix,y
• For each pixel (x,y), we compute the distance:
• Complexity: 2 2( )O n k
( )
( ) ( )( )[ ]∑−
=
−++=
=−=
1
0,
22
2
,2,2
,,1
1,
k
ji
yxyxE
jiPjyixIk
PIk
PId
Improvement: FFT
Fixed 2( * )I P
• Convolution can be applied rapidly using FFT.
• Complexity: 2( log )O n n
( )2 * mask of 1'sI k k×
( ) 2
,2,2 1, PI
kPId yxyxE −=
( ) ( ) ( ) ( )jiPjyixIjiPjyixIk
ji,,2,, 2
1
0,
2 ++−+++= ∑−
=
13
Naïve and FFT Approaches: Performance
3.5 Sec.31.30 Sec.Run time for 64×643.5 Sec.4.86 Sec.Run time for 32×323.5 Sec.1.33 Sec.Run time for 16×16
NoYesInteger ArithmeticSpace Time Complexity
FFTNaïve2( log )O n n2 2( )O n k
2n2n
Performance table for a 1024×1024 image, on a 1.8 GHz PC:
0
0.5
1
1.5
2
x 107
Normalized Gray-scale Correlation
• NGC:– A similarity measure, based on a
normalized cross-correlation function.– Maps two given images to [0,1] (absolute
value).– Invariant to intensity scale and offset.
( ) ( ) ( )1111
,,
,, PPII
PPIIPId
yx
yxyxNC −−
−⋅−=
( ) ( ) ( )=
−−
−⋅−=
1111
,,,
,,, PPII
PPIIPId
yxyx
yxyxyxNC
( )( )22,
22,,
,2
,
PkPPIkII
PIkPI
yxyxyx
yxyx
−⋅−⋅
⋅−⋅=
( ) ( ) YXnYXYYXX −⋅=−⋅− 11Note that:
The above expression can be implemented efficiently using 3 convolutions.
and thus:
14
0
0.5
1
1.5
0
0.5
1
1.5
2
x 107
Euclidean distance similarity measure
1-NGC similarity measure
Euclidean distance similarity measure
1-NGC similarity measure
10 20 30 40 50 60 70
10
20
30
40
50
60
0.2
0.4
0.6
0.8
1
1.2
10 20 30 40 50 60 70
10
20
30
40
50
60
1
2
3
4
5
6
7
8
9
10
11
x 106
Computer Tomographyusing FFT
CT Scanners• In 1901 W.C. Roentgen won the Nobel
Prize (1st in physics) for his discovery of X-rays.
• In 1979 Hounsfield & Cormack, won the Nobel Prize for developing the computer tomography.
• The invention revolutionized medical imaging.
1st prototype of CT scanner
15
Allan M. Cormack Godfrey N. Hounsfield
Wilhelm Conrad Röntgen
Computerized Tomography
Reconstruction from projections
f(x,y)
θ1
θ2
Projection & Sinogram
Sinogramt
θ
Sinogram: All projections
P(θ,t)
f(x,y)
t
θ
y
x
X-rays
Projection: All ray-sums in a direction
π
CT Image & Its Sinogram
K. Thomenius & B. Roysam
16
The Slice Theorem
f(x,y)
θ1
x
y
θ1
u
v
spatial domain frequency domainf(x,y) = objectg(x) = projection of f(x,y) parallel to the y-axis.
g(x) = ∫f(x,y)dy
F(u,v) = ∫ ∫ f(x,y) e -2πi(ux+vy) dxdyFourier Transform of f(x,y):
Fourier Transform at v=0 :F(u,0) = ∫ ∫ f(x,y) e -2πiuxdxdy
= ∫ [ ∫ f(x,y)dy] e -2πiuxdx
= ∫ g(x) e -2πiuxdx = G(u)
The 1D Fourier Transform of g(x)
Fourier Transform
u
vF(u,v)
Interpolations Method:Interpolate (linear, quadratic etc) in the frequency space to obtain all values in F(u,v).Perform Inverse Fourier Transform to obtain the image f(x,y).
Reconstruction from Projections - Example
Original simulated density image
8 projections-Frequency Domain
120 projections-Frequency Domain
8 projections-Reconstruction
120 projections-Reconstruction
Back Projection Reconstruction
g(x) is Back Projected along the line of projection.The value of g(x) is added to the existing values ateach point which were obtained from other back projections.
Note: a blurred version of the original is obtained.(for example consider a single point object is backprojected into a blurred delta).
17
Back Projection Reconstruction - Example
1 view 8 views
32 views 180 views
Filtered Back Projection - Example
1 view 2 views 4 views
8 view 16 views 32 views
180 views
FrequencySpatial
Filter
THE END