Chapter 4 Part 1-Digital Image Processing-Solution Manual, Exercises of Digital Image Processing

This solution manual is for problems related Digital Image processing course. This was recommended by Prof. Anwar Malik at Bengal Engineering and Science University. It includes: Filter, Transfer, Function, Fourier, Transform, Equation, Variable, Integral, Gaussian, Probability

Typology: Exercises

2011/2012
On special offer
30 Points
Discount

Limited-time offer


Uploaded on 07/23/2012

ganpati
ganpati 🇮🇳

4.1

(30)

56 documents

1 / 15

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
35
is the filter transfer function in the frequency domain.
(b) To see that this is a lowpass filter, it helps to express the preceding equation
in the form of our familiar centered functions:
H(u,v)= 1
2[cos(2π[uM/2])/M)+cos(2π[vN/2]/N)].
Consider one variable for convenience. As uranges from 0 to M1, the value
of cos(2π[uM/2]/M)starts at 1, peaks at 1 when u=M/2 (the center of
the filter) and then decreases to 1againwhenu=M. Thus, we see that the
amplitude of the filter decreases as a function of distance from the origin of the
centered filter, which is the characteristic of a lowpass filter. A similar argument
is easily carried out when considering both variables simultaneously.
Problem 4.30
The answer is no. The Fourier transform is a linear process, while the square
and square roots involved in computing the gradient are nonlinear operations.
The Fourier transform could be used to compute the derivatives as differences
(as in Problem 4.28), but the squares, square root, or absolute values must be
computed directly in the spatial domain.
Problem 4.31
We want to show that
1Ae(μ2+ν2)/2σ2=A2πσ2e2π2σ2(t2+z2).
The explanation will be clearer if we start with one variable. We want to show
that, if
H(μ)=eμ2/2σ2
then
h(t)=1H(μ)
=
−∞
eμ2/2σ2ej2tμtdμ
=2πσ2π2σ2t2.
We can express the integral in the preceding equations as
h(t)=
−∞
e1
2σ2[μ2j4πσ2μt]dμ.
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
Discount

On special offer

Partial preview of the text

Download Chapter 4 Part 1-Digital Image Processing-Solution Manual and more Exercises Digital Image Processing in PDF only on Docsity!

is the filter transfer function in the frequency domain.

(b) To see that this is a lowpass filter, it helps to express the preceding equation in the form of our familiar centered functions:

H (u , v ) =

[cos( 2 π [u − M / 2 ]) / M ) + cos( 2 π [v − N / 2 ] / N )].

Consider one variable for convenience. As u ranges from 0 to M − 1, the value of cos( 2 π [u − M / 2 ] / M ) starts at −1, peaks at 1 when u = M / 2 (the center of the filter) and then decreases to −1 again when u = M. Thus, we see that the amplitude of the filter decreases as a function of distance from the origin of the centered filter, which is the characteristic of a lowpass filter. A similar argument is easily carried out when considering both variables simultaneously.

Problem 4.

The answer is no. The Fourier transform is a linear process, while the square and square roots involved in computing the gradient are nonlinear operations. The Fourier transform could be used to compute the derivatives as differences (as in Problem 4.28), but the squares, square root, or absolute values must be computed directly in the spatial domain.

Problem 4.

We want to show that

ℑ −^1 Ae −( μ^2 + ν^^2 ) /^2 σ^2 = A 2 πσ^2 e −^2 π^2 σ^2 (t^2 +z^2 ).

The explanation will be clearer if we start with one variable. We want to show that, if H ( μ ) = e − μ (^2) / 2 σ 2

then

h(t ) = ℑ −^1

H ( μ )

=

−∞

e − μ (^2) / 2 σ 2 e j^2 t^ μ t^ d μ

= 2 πσ −^2 π (^2) σ (^2) t 2 .

We can express the integral in the preceding equations as

h(t ) =

−∞

e −^

1 2 σ^2 [ μ^2 −j^4 πσ^2 μ t^ ]d μ.

36 CHAPTER 4. PROBLEM SOLUTIONS

Making use of the identity

e −^

( 2 π )^2 σ^2 t 2 (^2) e ( 2 π )^2 σ^2 t 2 (^2) = 1

in the preceding integral yields

h(t ) = e −^

( 2 π )^22 σ^2 t 2

−∞

e −^

1 2 σ^2 [ μ^2 −j^4 πσ^2 μ t^ −(^2 π )^2 σ^4 t^2 ]d μ.

= e −^

( 2 π )^2 σ^2 t 2 2

−∞

e −^

1 2 σ^2 [ μ −j^2 πσ^2 t^ ]^2 d μ.

Next, we make the change of variables r = μ − j 2 πσ^2 t. Then, d r = d μ and the preceding integral becomes

h(t ) = e −^

( 2 π )^2 σ^2 t 2 2

−∞

e −^

r 2 2 σ^2 d r.

Finally, we multiply and divide the right side of this equation by 2 πσ and ob- tain

h(t ) = 2 πσ e −^

( 2 π )^2 σ^2 t 2 2

2 πσ

−∞

e −^

r 2 2 σ^2 d r

The expression inside the brackets is recognized as the Gaussian probability density function whose value from -∞ to ∞ is 1. Therefore,

h(t ) = 2 πσ e −^2 π (^2) σ (^2) t 2 .

With the preceding results as background, we are now ready to show that

h(t , z ) = ℑ −^1 Ae −( μ (^2) + ν (^2) ) / 2 σ 2

= A 2 πσ^2 e −^2 π (^2) σ (^2) (t 2 +z 2 ) .

By substituting directly into the definition of the inverse Fourier transform we have:

h(t , z ) =

−∞

−∞

Ae −( μ (^2) + ν (^2) ) / 2 σ 2 e j^2 π ( μ t^ + ν^ z^ )d μ d ν

−∞

−∞

Ae

 − 2 μσ^22 +j 2 πμ t

 d μ

⎦ (^) e

 − 2 νσ^^22 +j 2 πν z

 d ν.

38 CHAPTER 4. PROBLEM SOLUTIONS

Problem 4.

Because M = 2 n^ , we can write Eqs. (4.11-16) and (4.11-17) as

m (n) =

M n

and a (n) = M n. Proof by induction begins by showing that both equations hold for n = 1:

m ( 1 ) =

( 2 )( 1 ) = 1 and a ( 1 ) = ( 2 )( 1 ) = 2.

We know these results to be correct from the discussion in Section 4.11.3. Next, we assume that the equations hold for n. Then, we are required to prove that they also are true for n + 1. From Eq. (4.11-14),

m (n + 1 ) = 2 m (n) + 2 n^.

Substituting m (n) from above,

m (n + 1 ) = 2

M n

  • 2 n

2 n^ n

  • 2 n

= 2 n^ (n + 1 )

2 n^ +^1

(n + 1 ).

Therefore, Eq. (4.11-16) is valid for all n. From Eq. (4.11-17), a (n + 1 ) = 2 a (n) + 2 n^ +^1. Substituting the above expression for a (n) yields

a (n + 1 ) = 2 M n + 2 n^ +^1 = 2 ( 2 n^ n) + 2 n^ +^1 = 2 n^ +^1 (n + 1 )

which completes the proof.

Chapter 5

Problem Solutions

Problem 5.

The solutions are shown in Fig. P5.1, from left to right.

Figure P5.

Problem 5.

The solutions are shown in Fig. P5.3, from left to right.

Figure P5.

Problem 5.

(a) The key to this problem is that the geometric mean is zero whenever any pixel is zero. Draw a profile of an ideal edge with a few points valued 0 and a few points valued 1. The geometric mean will give only values of 0 and 1, whereas the arithmetic mean will give intermediate values (blur).

Problem 5.

A bandpass filter is obtained by subtracting the corresponding bandreject filter from 1:

HBP(u , v ) = 1 − HBR(u , v ).

Then:

(a) Ideal bandpass filter:

HIBP(u , v ) =

0 if D(u , v ) < D 0 − W 2 1 if D 0 − W 2 ≤ D(u , v ) ≤ D 0 + W 2. 0 D(u , v ) > D 0 + W 2

(b) Butterworth bandpass filter:

HBBP(u , v ) = 1 −

1 + (^) DD (^2) ((uu ,^ ,vv )^ )−WD 2 0

! 2 n

D(u ,v )W D^2 (u ,v )−D^20

! 2 n

1 + (^) DD (^2) ((uu ,^ ,vv )^ )−WD 2 0

! 2 n.

(c) Gaussian bandpass filter:

HGBP(u , v ) = 1 −

⎣^1 −^ e^

− (^12)

 (^) D (^2) (u ,v )−D 2 D(u ,v )W^0

= e

− 21

 (^) D (^2) (u ,v )−D 2 D(u ,v )W^0

 2

42 CHAPTER 5. PROBLEM SOLUTIONS

Problem 5.

We proceed as follows:

F (u , v ) =

−∞

f (x , y )e −j^2 π (u x^ +^ v y^ )d x d y

−∞

A sin(u 0 x + v 0 y )e −j^2 π (u x^ +^ v y^ )d x d y.

Using the exponential definition of the sine function,

sin θ =

2 j

e j^ θ^ − e −j^ θ^

gives us

F (u , v ) =

−j A 2

−∞

e j^ (u^0 x^ +^ v^0 y^ )^ − e −j^ (u^0 x^ +^ v^0 y^ )^ e −j^2 π (u x^ +^ v y^ )d x d y

−j A 2

−∞

e j^2 π (u^0 x^ /^2 π^ +^ v^0 y^ /^2 π )e −j^2 π (u x^ +^ v y^ )d x d y

j A 2

−∞

e −j^2 π (u^0 x^ /^2 π^ +^ v^0 y^ /^2 π )e −j^2 π (u x^ +^ v y^ )d x d y

These are the Fourier transforms of the functions

1 × e j^2 π (u^0 x^ /^2 π^ +^ v^0 y^ /^2 π )

and 1 × e −j^2 π (u^0 x^ /^2 π^ +^ v^0 y^ /^2 π ) respectively. The Fourier transform of the 1 gives an impulse at the origin, and the exponentials shift the origin of the impulse, as discussed in Section 4.6.3 and Table 4.3. Thus,

F (u , v ) =

−j A 2 δ

u −

u 0 2 π , v −

v 0 2 π

δ

u +

u 0 2 π , v +

v 0 2 π

Problem 5.

From Eq. (5.5-13),

g (x , y ) =

−∞

f ( α , β )h(x − α , y − β ) d α d β.

44 CHAPTER 5. PROBLEM SOLUTIONS

Problem 5.

Following the procedure in Section 5.6.3,

H (u , v ) =

∫ T

0

e −j^2 π u x^0 (t^ )d t

∫ T

0

e −j^2 π u^ [(^1 /^2 )a t^

2 ]

d t

∫ T

0

e −j^ π u a t^2 d t

∫ T

0

cos( π u a t 2 ) − j sin( π u a t 2 ) d t

T 2

2 π u a T 2 C ( π u a T ) − j S( π u a T )

where C (z ) =

2 π T

∫ (^) z

0

cos t 2 d t

and S(z ) =

π

∫ (^) z

0

sin t 2 d t.

These are Fresnel cosine and sine integrals. They can be found, for example, the Handbook of Mathematical Functions, by Abramowitz, or other similar ref- erence.

Problem 5.

Measure the average value of the background. Set all pixels in the image, ex- cept the cross hairs, to that intensity value. Denote the Fourier transform of this image by G (u , v ). Because the characteristics of the cross hairs are given with a high degree of accuracy, we can construct an image of the background (of the same size) using the background intensity levels determined previously. We then construct a model of the cross hairs in the correct location (determined from the given image) using the dimensions provided and intensity level of the cross hairs. Denote by F (u , v ) the Fourier transform of this new image. The ratio G (u , v ) / F (u , v ) is an estimate of the blurring function H (u , v ). In the likely event of vanishing values in F (u , v ), we can construct a radially-limited filter us- ing the method discussed in connection with Fig. 5.27. Because we know F (u , v )

and G (u , v ), and an estimate of H (u , v ), we can refine our estimate of the blur- ring function by substituting G and H in Eq. (5.8-3) and adjusting K to get as close as possible to a good result for F (u , v ) (the result can be evaluated visually by taking the inverse Fourier transform). The resulting filter in either case can then be used to deblur the image of the heart, if desired.

Problem 5.

This is a simple plug in problem. Its purpose is to gain familiarity with the vari- ous terms of the Wiener filter. From Eq. (5.8-3),

HW(u , v ) =

H (u , v )

|H (u , v )|^2 |H (u , v )|^2 + K

where

|H (u , v )|^2 = H ∗(u , v )H (u , v ) = H 2 (u , v ) = 64 π^6 σ^4 (u 2 + v 2 )^2 e −^4 π (^2) σ (^2) (u 2 +v 2 ) .

Then,

HW(u , v ) = −

⎣ −^8 π

(^3) σ (^2) (u 2 + v 2 )e − 2 π^2 σ^2 (u 2 +v 2 ) 64 π^6 σ^4 (u 2 + v 2 )^2 e −^4 π^2 σ^2 (u^2 +v^2 )^ + K

Problem 5.

(a) It is given that (^)   (^) Fˆ (u , v )

^2 = |R(u , v )|^2 |G (u , v )|^2.

From Problem 5.24 (recall that the image and noise are assumed to be uncorre- lated), (^)   (^) Fˆ (u , v )^2 = |R(u , v )|^2 |H (u , v )|^2 |F (u , v )|^2 + |N (u , v )|^2.

Forcing

 (^) Fˆ (u , v )

^2 to equal |F (u , v )|^2 gives

R(u , v ) =

|F (u , v )|^2 |H (u , v )|^2 |F (u , v )|^2 + |N (u , v )|^2

Problem 5.

The basic idea behind this problem is to use the camera and representative coins to model the degradation process and then utilize the results in an inverse filter operation. The principal steps are as follows:

Figure P5.

Problem 5.

(a) From Eq. (5.11-3),

ℜ f (x , y ) = g ( ρ , θ ) =

−∞

−∞

f (x , y ) δ (x cos θ + y sin θρ )d x d y

−∞

−∞

δ (x , y ) δ (x cos θ + y sin θρ )d x d y

−∞

−∞

1 × δ ( 0 − ρ )d x d y

1 if ρ = 0 0 otherwise.

where the third step follows from the fact that δ (x , y ) is zero if x and/or y are not zero.

Problem 5.

(a) From Section 2.6, we know that an operator, O, is linear if O(a f 1 + b f 2 ) = aO(f 1 ) + bO(f 2 ). From the definition of the Radon transform in Eq. (5.11-3),

O(a f 1 + b f 2 ) =

−∞

−∞

(a f 1 + b f 2 ) δ (x cos θ + y sin θρ )d x d y

= a

−∞

−∞

f 1 δ (x cos θ + y sin θρ )d x d y

+b

−∞

−∞

f 2 δ (x cos θ + y sin θρ )d x d y

= aO(f 1 ) + bO(f 2 )

thus showing that the Radon transform is a linear operation.

48 CHAPTER 5. PROBLEM SOLUTIONS

(c) From Chapter 4 (Problem 4.11), we know that the convolution of two func- tion f and h is defined as

c (x , y ) = f (x , y ) +h(x , y )

−∞

−∞

f ( α , β )h(x − α , y − β )d α d β.

We want to show that ℜ {c } = ℜ f + ℜ {h} ,where ℜ denotes the Radon trans-

form. We do this by substituting the convolution expression into Eq. (5.11-3). That is,

ℜ {c } =

−∞

−∞

−∞

−∞

f ( α , β )h(x − α , y − β )d α d β

× δ (x cos θ + y sin θρ )d x d y

α

β

f ( α , β )

×

x

y

h(x − α , y − β ) δ (x cos θ + y sin θρ )d x d y

⎦ (^) d α d β

where we used the subscripts in the integrals for clarity between the integrals and their variables. All integrals are understood to be between −∞ and ∞. Work- ing with the integrals inside the brackets with x ′^ = x − α and y ′^ = y − β we have ∫ x

y h(x^ −^ α ,^ y^ −^ β^ ) δ (x^ cos^ θ^ +^ y^ sin^ θ^ −^ ρ )d x d y

x ′

y ′^ h(x^

′, y ′) δ (x ′ (^) cos θ + y ′ (^) sin θ − [ ρα cos θβ sin θ ])d x ′d y ′ = ℜ {h} ( ρα cos θβ sin θ , θ ).

We recognize the second integral as the Radon transform of h, but instead of being with respect to ρ and θ , it is a function of ρα cos θβ sin θ and θ. The notation in the last line is used to indicate “the Radon transform of h as a function of ρα cos θβ sin θ and θ .” Then,

ℜ {c } =

α

β

f ( α , β )

×

x

y

h(x − α , y − β ) δ (x cos θ + y sin θρ )d x d y

⎦ (^) d α d β

α

β

f ( α , β )ℜ {h} ( ρρ ′, θ )d α d β