Starting from:

$35

E9241-Assignment 03 Solved

Q1. Frequency Domain Filtering:

(a)    Generate a M × N sinusoidal image sin(2πu0m/M + 2πv0n/N) for M = N = 1001,u0 = 100,v0 = 200 and compute its DFT. To visualize the DFT of an image take logarithm of the magnitude spectrum.

Note: Fast Fourier Transform (FFT) is an algorithm which is used for efficient computation of DFT of discrete signals. You can use matlab (or python) built in function for computing the FFT.

(b)    Filter the image characters.tif in the frequency domain using an ideal low pass filter (ILPF). The expression for the ILPF is

 D(u,v) ≤ D0

(1)

D(u,v) > D0

where D0 is a positive constant referred to as the cut-off frequency and D(u,v) is the distance between a point (u,v) in the frequency domain and the center of the frequency rectangle, i.e.,

 D(u,v) = p(u − P/2)2 + (v − Q/2)2, where P and Q are the number of rows and columns in the image. What artefacts do you notice in the image obtained by computing the inverse DFT of the filtered image?

Note: The filter given above is centred in frequency domain. To use such centred filters, you will either need to shift the filter to (0,0) (by using fftshift in matlab or corresponding function in python) or center the DFT of the image. To center the DFT of the image, you can either shift the DFT of the image, or scale each image pixel I(x,y) by −1x+y before computing its DFT. If you center the DFT of the image, then you will need to compensate for it by multiplying the image obtained from inverse DFT of the filtered image by −1x+y. (c) Filter the image characters.tif in the frequency domain using the Gaussian low pass filter given by

                                                                                )                                                       (2)

where all the terms are as explained in part b. For D0 = 100, compare the result with that of the ILPF.

(10+10+10=30M)

Q2. Image Deblurring: Deblur the images Blurred_LowNoise.png (White Noise Standard Deviation (σ)= 1) and Blurred_HighNoise.png (σ = 10) which have been blurred by the kernel BlurKernel. mat using

(a)    Inverse filtering: Simple inverse filtering may lead to amplification of noise (why?). To mitigateamplification of high frequency noise, set the inverse filter fft values to 0 wherever blur filter fft values are below a threshold t. Set t = 0.1.

Note: The blur kernel given is centered at (10,25) in matlab convention and (9,24) in python convention. In other words, the maximum value 0.02 corresponds to (0,0) of the filter. So, before computing DFT, you need to shift the filter such that (10,25) moves to (1,1), (10,24) moves to (1,N), (9,25) moves to (M,1) and (9,24) moves to (M,N) and so on in matlab convention. In python convention (9,24) moves to (0,0), (9,23) moves to (0,N − 1), (8,24) moves to (M − 1,0) and (8,23) moves to (M − 1,N − 1) and so on. M,N are the height and width of the blurred image respectively.

(b)    Wiener filter: You can assume the PSD of the white noise is equal to σ specified. For signal PSD, use power law

                                                                                          .                                                                 (3)

Use k = 105.

Note: Recall that Sf(u,v) is periodic and Sf(−u,−v) = Sf(M − u,N − v) where M,N are height and width of the blurred image respectively .

Note: BlurKernel.mat is a matlab workspace variable file. You can load this file using

‘load(BlurKernel.mat)’ in matlab provided that the file is stored in your working directory. For python, see https://stackoverflow.com/a/874488/3337089. (10+10=20M)

Q3. Image Denoising:

(a)    Denoise the image noisy_book1.png corrupted by the impulsive noise by a mean and Median filter with same spatial neighborhood size and compare the results.

(b)    Use the bilateral filter to denoise the image noisy_book2.png which has been corrupted by the Gaussian noise with zero mean and standard deviation of 5. Compare the results with the Gaussian smoothing.

(10+20=30M)

Q4. Bonus Question:

(a)    Consider the 5 × 5 discrete Laplacian filter given by:

                                                                                             0    0       1       0    0

0 1 2 1 0 g = 1 2 −16 2 1

                                                                                             0    1       2       1   0



                                                                                                0    0       1       0    0

Suppose we design the Laplacian in frequency domain as H(u,v) = K ∗ (u2 + v2) for u,v =

{−2,−1,0,1,2}. Let h(m,n) be the IDFT of H(u,v). Find K that minimizes

 

.

(b)    Consider another 5 × 5 discrete Laplacian filter given by:

0

1 g = 1 1



0
1

1

2

1

1
1

2

−24

2

1
1

1

2

1

1
0

1

1

1

0
Compute the value of K in this case. Comment on the value of K that you obtained in (a) and (b).

(20M)

More products