Docsity

Homework 1 Answers - Image Processing | CS 6640, Assignments of Computer Science

Toggle sidebar
bg1
CS6640 Spring 2009
Practice Homework #1 — Answers
1. Prove that the convolution of an even function and an odd function is and odd function.
2. The total energy content of a function (with bounded domain) is the same in both the frequency domain
and the time domain. I.e. Z∞
−∞ |f(t)|2dt =Z∞
−∞
F(s)F∗(s)ds.
This is called Rayleighs Theorem. Prove it.
We have:
Z∞
−∞ |f(t)|2dt =Z∞
−∞
f(t)f(t)e−j2πstdt eval at (s = 0) (1)
= IF[f(t)f(t)] = F(s)⊗F(s) eval at (s = 0) (2)
=Z∞
−∞
F(s)F(u−s)ds eval at (u = 0) (3)
=Z∞
−∞
F(s)F(−s)ds =Z∞
−∞
F(s)F∗(s)ds =Z∞
−∞ |F(s)|2ds (4)
3. Problem 4.12 in the book.
(a) The combination of high-pass Gaussian and low-pass Gaussian gives in the FD:
B(s) = G(s, D0)(1 −G(s, D0)) = G(s, D0)−G(s, D0)G(s, D0) = G(s, D0)−G(s, D0/√2),
where G(s, σ)is e−s2
2σ2. If we graph this we see that it is low at s= 0 and low for slarge and has a
maximum somewhere between D0/√2and D0. This means it is a kind of band-pass filter. The ring
retains it’s brightness because it must have a width which correponds to a frequency where is near the
maximum band of this filter. Notice that the ring has negative lobes on either side and thus the DC
component of the result is, in fact, zero.
(b) No. Order should not matter, because the convolutions are multiplications in the FD, and these
multiplies can be done in any order.
4. Problem 4.20 in the book. If we let H(u, v)be the circularly symmetric Butterworth lowpass filter, then
the homomorphic filter is
h(u, v) = γL+ (γH−γL)(1 −H(u, v))
5. A very useful function for image processing is the “rect” or “box” function, defined below.
rect(x) = 1,|x|<1
2
0,|x|>1
2
(5)
Compute the Fourier transform of rect(x), and make a rough graph of this function (Use L’Hopital’s rule
to figure out how it behaves at the origin).
The result is the sinc function, which has been drawn and discussed in class.
IF[rect(x)] = sinc(u) = sin πu
πu
pf3
pf4

Partial preview of the text

Download Homework 1 Answers - Image Processing | CS 6640 and more Assignments Computer Science in PDF only on Docsity!

CS6640 Spring 2009

Practice Homework #1 — Answers

  1. Prove that the convolution of an even function and an odd function is and odd function.
  2. The total energy content of a function (with bounded domain) is the same in both the frequency domain and the time domain. I.e. (^) ∫ (^) ∞

−∞

|f (t)|^2 dt =

−∞

F (s)F ∗(s)ds.

This is called Rayleighs Theorem. Prove it. We have: ∫ (^) ∞

−∞

|f (t)|^2 dt =

−∞

f (t)f (t)e−j^2 πstdt eval at (s = 0) (1)

= IF[f (t)f (t)] = F (s) ⊗ F (s) eval at (s = 0) (2)

=

−∞

F (s)F (u − s)ds eval at (u = 0) (3)

−∞

F (s)F (−s)ds =

−∞

F (s)F ∗(s)ds =

−∞

|F (s)|^2 ds (4)

  1. Problem 4.12 in the book.

(a) The combination of high-pass Gaussian and low-pass Gaussian gives in the FD:

B(s) = G(s, D 0 )(1 − G(s, D 0 )) = G(s, D 0 ) − G(s, D 0 )G(s, D 0 ) = G(s, D 0 ) − G(s, D 0 /

where G(s, σ) is e−^

s^2 2 σ^2. If we graph this we see that it is low at s = 0 and low for s large and has a maximum somewhere between D 0 /

2 and D 0. This means it is a kind of band-pass filter. The ring retains it’s brightness because it must have a width which correponds to a frequency where is near the maximum band of this filter. Notice that the ring has negative lobes on either side and thus the DC component of the result is, in fact, zero. (b) No. Order should not matter, because the convolutions are multiplications in the FD, and these multiplies can be done in any order.

  1. Problem 4.20 in the book. If we let H(u, v) be the circularly symmetric Butterworth lowpass filter, then the homomorphic filter is h(u, v) = γL + (γH − γL)(1 − H(u, v))
  2. A very useful function for image processing is the “rect” or “box” function, defined below.

rect(x) =

1 , |x| < (^12) 0 , |x| > (^12)

Compute the Fourier transform of rect(x), and make a rough graph of this function (Use L’Hopital’s rule to figure out how it behaves at the origin). The result is the sinc function, which has been drawn and discussed in class.

IF[rect(x)] = sinc(u) =

sin πu πu

Another useful function is the triangle function, which is defined as the box convolved with itself. Give a description (like that of rect above) of the triangle filter and give an equation of its Fourier transform.

tri(x) =

0 , |x| > 1 x + 1 − 1 < x < 0 1 − x 0 < x < 1

also tri(x) = rect(x) ⊗ rect(x), and thus

IF[tri(x)] =

sin^2 πu π^2 u^2

  1. Based on your results from the previous problem given an expression for the Fourier transform of

f (x) =

0 , x < 0 , or x > a 1 , 0 ≤ x ≤ a

Use a scaling (by a) and shift (by a/ 2 ) of the rectangle (box). This is

F (u) = a

sin πau πau ej^2 πua/^2 =

sin πau πu ejπua

  1. Calculate the discrete Fourier transform of f = { 1 , 1 , 1 , 1 }.

Simply run through the frequencies. The only one that gives nonzero is s = 0. This gives F = { 1 , 0 , 0 , 0 }.

  1. For a linear system, the input is

f (t) =

− 12 , t < 0 0 , t = 0

  • 12 , t > 0

and the output is

h(t) =

− 12 , t < − 1 t, − 1 ≤ t ≤ 1

  • 12 , t > 1

Calculate the characteristic function g(t) of this system. Hint, the integral of the delta functional is the step function. The differentiation property of FT gives:

h(t) = f (t) ⊗ g(t) ⇒ h′(t) = f ′(t) ⊗ g(t)

Because f ′(t) = δ(t), we have g(t) = h′(t), which means that

g(t) =

0 t < − 1 1 − 1 ≤ t ≤ 1 0 t > 1

  1. Give the Fourier transform of the following functions (in terms of F ):

(a) df (x)/dx (b) ∂f (x, y)/∂x + ∂f (x, y)/∂y (c) ∂^2 f (x, y)/∂x^2 + ∂^2 f (x, y)/∂y^2 (11)

Use the differentiation property of the FT.

Suppose the power spectrum of the signal is PS (u, v) = e−r/τ^ , where r =

(u^2 + v^2 ), and the signal and noise are uncorrelated. What is the optimal filter in this case? Graph it along the line passing through u 0 , v 0 and the origin and explain (very briefly) why it makes sense.

This gives

H(u, v) =

e−

(u^2 +v^2 )/τ

e−

(u^2 +v^2 )/τ (^) + G σ (u^ −^ u 0 , v^ −^ v 0 ) +^ Gσ (u^ +^ u 0 , v^ +^ v 0 )

Need graph and discussion.