EE5176 Programming Assignment-2: Motion deblurring

$30.00

Category: Tags: , , , , You will Instantly receive a download link for .zip solution file upon Payment || To Order Original Work Click Custom Order?

Description

5/5 - (4 votes)

1 Motion deblurring with conventional camera
You are given a clean image of a scene having M rows and N columns (fish.png). We capture
the scene using a static conventional camera with the aperture kept open for the full exposure
time. ‘e exposure time is 52 seconds. For simplicity, consider that the camera captures the
scene at times t = 0, . . . , 51 (i.e. at 52 instants). At time t = 0, the image has zero translation.
‘en, the whole image as seen by the camera moves at 1 pixel per second to the right (horizontal
translation).
a) Generate the blurred image having M rows and N + 51 columns captured by the camera.
Generate translated versions of the image for t = 0, . . . , 51, and average them. Add Gaussian noise of mean 0 and standard deviation 1 (with respect to the maximum intensity of
255) from gaussNoise.mat. Display the blurred image. [5 marks]
b) Form the blur matrix A of size (N + 51) × N corresponding to the horizontal translation
described above. Note that this matrix will be a Toeplitz matrix. Display A using imshow
command. [5 marks]
c) Use A to deblur the blurred image using least squares. ‘e size of the deblurred image
should be M × N for each colour channel. (Note: Since the blurring is horizontal, you
have to operate A on each row of the blurred image.) Display the deblurred image. Determine the RMSEs between the given clean image and the deblurred image. Use the formula
RMSE(x, y) = sX
i
(xi − yi)
2
length(x)
. [5 marks]
2 Motion deblurring with ƒutter shutter
With the same setup as in previous section, we use a ƒuˆer shuˆer camera with code
1010000111000001010000110011110111010111001001100111
where each bit represents one second of the exposure time. ‘e code is given in codeSeq.mat.
a) Generate the blurred image with noise (same as in Problem-1) for the exposure code given
above. [3 marks]
b) Form the blur matrix A of size (N + 51) × N. [3 marks]
2
c) Plot the DFTs of the conventional and ƒu‹er shu‹er codes. Use the €rst column of the
respective A matrices. Plot the magnitude in decibels. Comment. [2 marks]
d) Let the noise be absent in both problems (1) and (2). Compare and comment on the deblurred
outputs. [2 marks]
3 Deblurring with motion-invariant photography
You are given images of the top view of a road scene (background.png) and a foreground
moving object (redcar.png).
a) Assuming static camera and the velocity of the car as 1 pixel per second to the right (horizontal translation) relative to a static camera, generate the blurred image captured for an
exposure time of 52 seconds. (Hint: First create individual frames for each second, i.e. 52
frames. To create each frame, apply translation corresponding to that frame on the foreground object and merge it with background. Merging: For all pixels with a non-zero values
in the foreground image, assign foreground pixel values. or else use background pixel values.) [3 marks]
b) Consider the same scenario captured using motion invariant photography (i.e. the camera also moves during the exposure). ‘e translational values of the static background due
to camera motion at each second are given in CameraT.mat. Generate the blurred image captured in this case with both camera and object motions for an exposure time of 52
seconds. [6 marks]
– Create individual frames for each second: Apply camera translations to the background image and the relative translations to the moving object separately. ‘en,
merge them to obtain a frame. ‘e relative translations of the moving object with respect to the moving camera can be obtained by relative translation = static background
translation due to camera – object translation
– Average all the 52 frames to obtain the blurred image.
c) Compare and comment on the outputs of (a) and (b). [2 marks]
d) Generate blurred images for object velocities: 2 pixel/s and 3 pixel/s. Compare and comment
on the results. [2 marks]
3
e) Find and plot the PSF of the blurred image in (b). If x is the camera translation then PSF
weight at x is 1

ax
. Choose x as [0.1, 1, 2, . . . , 51] and a =
1
13
. Normalize the PSF a‰er
assigning these values. [2 marks]
f) Deblur the blurred image in (b) using least squares. Use the PSF obtained in (e) to form the
blur matrix A. [3 marks]
4