Академический Документы
Профессиональный Документы
Культура Документы
1.1) (15 pts.) Compute the DFT for the following two vectors with length N=4:
1 1
1 0
x1 = , x2 = .
1 1
1 0
1.2) (15 pts.) Compute the two-dimensional DFT with size M=N=4 for the following 4x4 stripe
.5 .5 .5 .5
0 0 0 0
image x3 = , as shown in (a).
.5 .5 .5 .5
0 0 0 0
1.3) (20 pts.) Generate a 4x4 checker board pattern from the stripe image above by letting
0.5
0.4
0.3
0.2
0.1
N=4 N=4
(a) (b)
Solution:
3
1.1) DFT [ x1 ] = [1 / 4 ∑1 • e
u =0
− j 2πuk / 4
, k = 0,1,2,3] = [2 0 0 0]T
DFT [ x2 ] = [1 0 1 0]
note: all credits are given for correct calculation but different normalizing factors (e.g. 1/N instead
of 1/sqrt(N)), same applies below.
1.2) First perform DFT for each row: using DFT [ x1 ] we get [2 0 0 0] in the first and third row
and zero elsewhere. Then perform DFT for each column, using DFT [ x2 ] we get
1 0 0 0
0 0 0 0
.
1 0 0 0
0 0 0 0
1.1 0 0.8 0
0 0 0 0
DFT 2[ x4 ] = DFT [0.6 x3 .^ 2 + 0.8 x3 ] =
T
0.3 0 0 0
0 0 0 0
2.1) (10 pts) An observed image is affected by convolution with a Point Spread
Function h(x, y), plus random additive noise n(x, y), so that g(x, y) = f(x, y) * h(x, y) +
n(x, y). Describe how the image is restored using the Inverse Filtering method. Give a
mathematical expression for the noise n'(x,y) in the restored image f'(x,y). i.e. f'(x,y) =
f(x,y) + n'(x,y).
The distorted image g(x, y) shown below is affected by constant speed motion plus
noise. Hence h(x, y) is a square impulse function in x. Below right is shown the
transfer function H(u, v) which is the Fourier transform of h(x, y), also shown is a
slice through this transfer function the first local minimum of this function is -0.217
and the first local maximum has value 0.128).
To restore the image the Pseudo-Inverse method is used with two different values of
the minimum amplitude of H, e= 0.25 and e= 0.15. Copy the H(u, 0) slice and draw
on the restoring filter slices R(u, 0) for both values of e.
2.2) (15 pts) After applying the Pseudo-Inverse filter for e=0.25 the restored image
equals the true image convolved by a residual PSF plus noise. Give a drawing of the
residual PSF.
2.3) (15 pts) After applying the Pseudo-Inverse filter for e=0.15 what is the shape of
the residual transfer function? Give a drawing of the residual PSF with which the
restored image is convolved.
2.4) (10 pts) Compare the residual random noise in the three restorations in (a-c)
above in terms of total noise power and justify your ranking.
Solution:
2.2)
so
f ' (u , v)
( f (u , v) H (u , v) + n(u , v)) / H (u , v), when | H (u , v) |> e
=
0, otherwise
( f (u , v) + n(u , v) / H (u , v), when | H (u , v) |> e
=
0, otherwise
We can rewrite it as:
1, if | H (u , v) |> e
R(u, v) =
0, otherwise
Note e = 0.25 . And roughly estimated from the figure of H (u ,0) , we find:
So R (u , v) should be:
1, when | u |< 20
R(u, v) =
0, otherwise
Hence
R(u,0) r(x,0)
2.3)
| H (u, v) |> 0.15 ,when − 55 < u < −45 or − 25 < u < 25 or 45 < u < 55 ,
So R (u , v) should be:
2.4)
If only considering the power of the second part ( n(u , v) / H (u , v)) R (u , v) , it is:
However, for the first part: f (u , v)( R (u , v) − 1) , the noise power is:
(In fact, we can consider two extreme cases, e = 0 and e = 1. When e = 1, R (u , v) is always
equal to 0, so the second part ( n(u , v) / H (u , v)) R (u , v) is zero, but the first part
f (u , v)( R(u, v) − 1) would be large; When e = 0, R (u, v) is always equal to 1, hence the first
part f (u , v)( R (u , v) − 1) is zero, but the second part ( n(u , v) / H (u , v)) R (u , v) would be large.
So in practice, the threshold e in pseudo inverse method should be neither too small nor too large,
but carefully chosen with an appropriate value. )
In this homework, we want to analyze the energy distributions of different types of images. A zip
pack of the four images used for experiments can be downloaded here.
3.1) [20%] First, convert the input M-by-N color image to the grayscale format. Plot the 2-D log
magnitude of the 2D DFT and DCT of the grayscale image, with center shifted. Visually compare
and comment on the similarity/differences among the images using the two transforms.
3.2) [20%] Apply the truncation windows discussed in the class to keep 25% and 6.25% (1/4 and
1/16) of the DFT and DCT coefficients, i.e. two different ratios for each transform. This truncation
is done by keeping the coefficients of the lowest frequencies (those within a centered smaller
rectangle of (M/2)x(N/2) and (M/4)x(N/4) on the shifted FFT, respectively). Apply the 2D inverse
DFT to reconstruct the image for each of the truncated spectra. Compute the
Signal-to-Noise-Ratio (SNR) value for each of the reconstructed images. Plot the reconstructed
images visually examine and comment on the effects of truncation.
3.3) [10% bonus] Discuss the differences between these two types of images, optionally extend or
validate what you've observed here with new images of your own, i.e., natural photos vs.
diagrams.
banboon monkeyking**
sunflower* hexagon
DCT
We can see clear pattern in both FFT and DCT of the hex image. The fft and DCT of Baboon is
most close to a uniform distribution, because it contains much texture so that the high frequency
part is also quite bright.
3.2)
SNR = 20.9681
SNR = 20.1723 SNR = 26.3310
SNR = 16.4037
DCT
6.25%
3.3)
Usually, natural photos contain much richer texture than diagrams, hence the high frequency part
of natural objects would be brighter (larger) than that of diagrams. Moreover, natural photos are
more complex, i.e., seldom contain objects with perfect symmetry, so usually we can not see
obvious pattern in its fft or dct. But we can find some perfect pattern in fft or dct of the diagrams
sometimes because of their simple structure.