33
Image Processing - Lesson 7 Low Pass Filter High Pass Filter Band pass Filter Blurring Sharpening Image Enhancement - Frequency Domain

Image Enhancement - Frequency Domaincs.haifa.ac.il/~dkeren/ip/lecture7.pdf · 2002-11-18 · Back Projection Reconstruction g(x) is Back Projected along the line of projection. The

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Image Enhancement - Frequency Domaincs.haifa.ac.il/~dkeren/ip/lecture7.pdf · 2002-11-18 · Back Projection Reconstruction g(x) is Back Projected along the line of projection. The

Image Processing - Lesson 7

• Low Pass Filter

• High Pass Filter

• Band pass Filter

• Blurring

• Sharpening

Image Enhancement - Frequency Domain

Page 2: Image Enhancement - Frequency Domaincs.haifa.ac.il/~dkeren/ip/lecture7.pdf · 2002-11-18 · Back Projection Reconstruction g(x) is Back Projected along the line of projection. The

FilteredImageImage Transform

FilteredTransform

filter

FFT FFT-1

Fourier Image

high frequencies

low frequencies

enhanced

Blurred Image

SharpImage

SharperImage

Spatial Image

Page 3: Image Enhancement - Frequency Domaincs.haifa.ac.il/~dkeren/ip/lecture7.pdf · 2002-11-18 · Back Projection Reconstruction g(x) is Back Projected along the line of projection. The

ImageImage Image

Transform Transform Transform

FFT FFT FFT-1

*

=

=

Convolution Theorem

*

ImageImage Image

Transform Transform Transform

FFT FFT FFT-1

• =

=

F(I1) * F(I2) = F(I1 • I2)

F(I1) • F(I2) = F(I1 * I2)

Page 4: Image Enhancement - Frequency Domaincs.haifa.ac.il/~dkeren/ip/lecture7.pdf · 2002-11-18 · Back Projection Reconstruction g(x) is Back Projected along the line of projection. The

Frequency Bands

Percentage of image power enclosed in circles(small to large) :

90, 95, 98, 99, 99.5, 99.9

Image Fourier Spectrum

Page 5: Image Enhancement - Frequency Domaincs.haifa.ac.il/~dkeren/ip/lecture7.pdf · 2002-11-18 · Back Projection Reconstruction g(x) is Back Projected along the line of projection. The

Blurring - Ideal Low pass Filter

Page 6: Image Enhancement - Frequency Domaincs.haifa.ac.il/~dkeren/ip/lecture7.pdf · 2002-11-18 · Back Projection Reconstruction g(x) is Back Projected along the line of projection. The

Low pass Filter

f(x,y) F(u,v)

g(x,y) G(u,v)

G(u,v) = F(u,v) • H(u,v)

H(u,v) - Ideal Filter

spatial domain frequency domain

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

filter

Page 7: Image Enhancement - Frequency Domaincs.haifa.ac.il/~dkeren/ip/lecture7.pdf · 2002-11-18 · Back Projection Reconstruction g(x) is Back Projected along the line of projection. The

The Ringing Problem

G(u,v) = F(u,v) • H(u,v)

g(x,y) = f(x,y) * h(x,y)

Convolution Theorm

sinc(x)

h(x,y)H(u,v)

-1

D0 Ringing radius + blur

Page 8: Image Enhancement - Frequency Domaincs.haifa.ac.il/~dkeren/ip/lecture7.pdf · 2002-11-18 · Back Projection Reconstruction g(x) is Back Projected along the line of projection. The

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

Softer Blurring + no Ringing

Page 9: Image Enhancement - Frequency Domaincs.haifa.ac.il/~dkeren/ip/lecture7.pdf · 2002-11-18 · Back Projection Reconstruction g(x) is Back Projected along the line of projection. The

Blurring - Butterworth Lowpass Filter

Page 10: Image Enhancement - Frequency Domaincs.haifa.ac.il/~dkeren/ip/lecture7.pdf · 2002-11-18 · Back Projection Reconstruction g(x) is Back Projected along the line of projection. The

Original - 4 levelQuantized Image

OriginalNoisy Image

Smoothed Image

Smoothed Image

Low Pass Filtering - Image Smoothing

Page 11: Image Enhancement - Frequency Domaincs.haifa.ac.il/~dkeren/ip/lecture7.pdf · 2002-11-18 · Back Projection Reconstruction g(x) is Back Projected along the line of projection. The

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

41

161

Page 12: Image Enhancement - Frequency Domaincs.haifa.ac.il/~dkeren/ip/lecture7.pdf · 2002-11-18 · Back Projection Reconstruction g(x) is Back Projected along the line of projection. The

Image 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)

Page 13: Image Enhancement - Frequency Domaincs.haifa.ac.il/~dkeren/ip/lecture7.pdf · 2002-11-18 · Back Projection Reconstruction g(x) is Back Projected along the line of projection. The

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

H(u,v) - Butterworth Filter

u

v

H(u,v)

Page 14: Image Enhancement - Frequency Domaincs.haifa.ac.il/~dkeren/ip/lecture7.pdf · 2002-11-18 · Back Projection Reconstruction g(x) is Back Projected along the line of projection. The

High Pass Filtering

Original High Pass Filtered

Page 15: Image Enhancement - Frequency Domaincs.haifa.ac.il/~dkeren/ip/lecture7.pdf · 2002-11-18 · Back Projection Reconstruction g(x) is Back Projected along the line of projection. The

High Frequency Emphasis

Emphasize High Frequency.Maintain Low frequencies and Mean.

(Typically K0 =1)

H'(u,v) = K0 + H(u,v)

Page 16: Image Enhancement - Frequency Domaincs.haifa.ac.il/~dkeren/ip/lecture7.pdf · 2002-11-18 · Back Projection Reconstruction g(x) is Back Projected along the line of projection. The

High Frequency Emphasis - Example

Original High Frequency Emphasis

Original High Frequency Emphasis

Page 17: Image Enhancement - Frequency Domaincs.haifa.ac.il/~dkeren/ip/lecture7.pdf · 2002-11-18 · Back Projection Reconstruction g(x) is Back Projected along the line of projection. The

High Pass Filtering - Examples

Original High pass Butterworth Filter

High Frequency Emphasis

High Frequency Emphasis +

Histogram Equalization

Page 18: Image Enhancement - Frequency Domaincs.haifa.ac.il/~dkeren/ip/lecture7.pdf · 2002-11-18 · Back Projection Reconstruction g(x) is Back Projected along the line of projection. The

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

1

D(u,v)

H(u,v)

D0-w2

D0+w2

D0

0 D(u,v) ≤ D0 -w2

w2

w2

w2

w = band width

Page 19: Image Enhancement - Frequency Domaincs.haifa.ac.il/~dkeren/ip/lecture7.pdf · 2002-11-18 · Back Projection Reconstruction g(x) is Back Projected along the line of projection. The

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

Page 20: Image Enhancement - Frequency Domaincs.haifa.ac.il/~dkeren/ip/lecture7.pdf · 2002-11-18 · Back Projection Reconstruction g(x) is Back Projected along the line of projection. The

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)

Page 21: Image Enhancement - Frequency Domaincs.haifa.ac.il/~dkeren/ip/lecture7.pdf · 2002-11-18 · Back Projection Reconstruction g(x) is Back Projected along the line of projection. The

Band Reject Filter - Example

Original Noisy image Fourier Spectrum

Band Reject Filter

Page 22: Image Enhancement - Frequency Domaincs.haifa.ac.il/~dkeren/ip/lecture7.pdf · 2002-11-18 · Back Projection Reconstruction g(x) is Back Projected along the line of projection. The

Local Reject Filter - Example

Original Noisy image Fourier Spectrum

Local Reject Filter

Page 23: Image Enhancement - Frequency Domaincs.haifa.ac.il/~dkeren/ip/lecture7.pdf · 2002-11-18 · Back Projection Reconstruction g(x) is Back Projected along the line of projection. The

+

+ =

=

Image Enhancement

Page 24: Image Enhancement - Frequency Domaincs.haifa.ac.il/~dkeren/ip/lecture7.pdf · 2002-11-18 · Back Projection Reconstruction g(x) is Back Projected along the line of projection. The

Homomorphic Filtering

Reflectance Model:

Illumination

Surface Reflectance

Brightness

i(x,y)

r(x,y)

f(x,y) = i(x,y) • r(x,y)

Assumptions:

Illumination changes "slowly" across sceneIllumination ≈ low frequencies.

Surface reflections change "sharply" across scenereflectance ≈ high frequencies.

Illumination Reflectance Brightness

Goal: repress the low frequencies associated with I(x,y).However:

(i(x,y) • r(x,y)) ≠ (i(x,y)) • (r(x,y))

Page 25: Image Enhancement - Frequency Domaincs.haifa.ac.il/~dkeren/ip/lecture7.pdf · 2002-11-18 · Back Projection Reconstruction g(x) is Back Projected along the line of projection. The

Perform:

z(x,y) = log(f(x,y)) = log(i(x,y) • (r(x,y)) = log(i(x,y)) + log(r(x,y))

Homomorphic Filtering:

log FFT-1FFT H(u,v) expimage image

Page 26: Image Enhancement - Frequency Domaincs.haifa.ac.il/~dkeren/ip/lecture7.pdf · 2002-11-18 · Back Projection Reconstruction g(x) is Back Projected along the line of projection. The

Homomorphic Filtering

Original Filtered

Page 27: Image Enhancement - Frequency Domaincs.haifa.ac.il/~dkeren/ip/lecture7.pdf · 2002-11-18 · Back Projection Reconstruction g(x) is Back Projected along the line of projection. The

Computerized Tomography

Reconstruction from projections

f(x,y)

θ1

θ2

Page 28: Image Enhancement - Frequency Domaincs.haifa.ac.il/~dkeren/ip/lecture7.pdf · 2002-11-18 · Back Projection Reconstruction g(x) is Back Projected along the line of projection. The

Reconstruction from Projections

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

Page 29: Image Enhancement - Frequency Domaincs.haifa.ac.il/~dkeren/ip/lecture7.pdf · 2002-11-18 · Back Projection Reconstruction g(x) is Back Projected along the line of projection. The

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).

Page 30: Image Enhancement - Frequency Domaincs.haifa.ac.il/~dkeren/ip/lecture7.pdf · 2002-11-18 · Back Projection Reconstruction g(x) is Back Projected along the line of projection. The

Reconstruction from Projections - Example

Original simulated density image

8 projections-Frequency Domain

120 projections-Frequency Domain

8 projections-Reconstruction

120 projections-Reconstruction

Page 31: Image Enhancement - Frequency Domaincs.haifa.ac.il/~dkeren/ip/lecture7.pdf · 2002-11-18 · Back Projection Reconstruction g(x) is Back Projected along the line of projection. The

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).

Page 32: Image Enhancement - Frequency Domaincs.haifa.ac.il/~dkeren/ip/lecture7.pdf · 2002-11-18 · Back Projection Reconstruction g(x) is Back Projected along the line of projection. The

Back Projection Reconstruction - Example

1 view 8 views

32 views 180 views

Page 33: Image Enhancement - Frequency Domaincs.haifa.ac.il/~dkeren/ip/lecture7.pdf · 2002-11-18 · Back Projection Reconstruction g(x) is Back Projected along the line of projection. The

Filtered Back Projection - Example

1 view 2 views 4 views

8 view 16 views 32 views

180 views

FrequencySpatial

Filter