198:443 Digital Imaging and Multimedia
Spring 2008
Assignment 2
Due Date – in class: Thursday March 6th
Submission instruction:
1- Report: You need to prepare a report containing all your answers,
results, images, plots, and codes in one document. For example, you can use MS
Word or any similar software to create a document and copy and paste the
resulting images into it. Print the report and submit a hard copy of it as well
as email it to the TA.
2- Code: You also need to submit an electronic copy of your code.
Zip all your code in one file and email it to the TA.
3- You can use ImageJ or Matlab for your implementation.
- Late submission policy: 20% off the grade for each day
late.
The images for this assignment are available at
ftp://ftp.cs.rutgers.edu/pub/elgammal/CS443/HW2
[Part I: Theoretical questions - 10pts each]
Solve problems Pr 6.1, 6.2, 6.6, 6.9, 7.1
[Part II:]
[Q II-1 – 40pts] Read section 5.8
Point operations on two images can be used to detect moving
objects by subtracting consecutive images in an image sequence. In this problem
we will use a sequence of operations to detect soccer player in a field from
two frames. Use the images soccer1, soccer2 for this problem. In general we
call them images I1, I2. Use ImageJ to implement the
following steps:
1- Given two
images I1, I2, use ImageJ point operation to obtain the
absolute difference image d=abs(I1-I2).
2- Plot the
histogram for the absolute difference image d.
3- Visualize the
absolute difference image d. To get a good visualization, you need to stretch
the range of values in d to be from 0-255. Use a point operation to achieve
this stretching. Show the result.
4- Threshold the
difference image d by using a suitable threshold ath [Eq 5.5] to obtain a binary image
(mask) where the moving pixels is set to a value 1 and the stationary pixels is
set to 0. Choose a threshold such that p% of the pixels are above the threshold.
Try with p=2%, 1%, 0.1%, 0.01%. In each case show the resulting mask. The mask
should show the moving objects in the scene. Which p gives you the best results
qualitatively?
5- We can obtain
better results by using morphological close operation. Use ImageJ close
operation with suitable window size.
You can try two different options here
I.
Use binary morphological ÔcloseÕ on the mask m.
II.
Alternatively, use gray-level morphological ÔcloseÕ on the
difference image d before thresholding to obtain a better mask
Which of the above methods give you better results? You donÕt need
to show results with different thresholds here. Just show the results with
suitable threshold.
6- Use the
obtained mask to visualize the moving pixels. Let m be the binary
mask obtained in step 4. We need to obtain image Im such that:
Im(u,v)= I2(u,v) if
m(u,v) =1
0 if m(u,v)
=0;
Show the image Im showing the
best result you get using the different options and thresholds from part 4 and
5.
- The same approach can be used in surveillance to detect moving
people and vehicles. Re-run your code on images lot1, lot2 to detect the people
in the parking lot scenes. Show the final result.
[Q II-2 - 25pts]
Point operations on multiple images can be used to add the effect
of motion blur given a sequence of images. In this problem we will use alpha
blending (page 83) on an image sequence to obtain a motion blur effect. Let I1,I2,
É., IT be a sequence of images. We can recursively blend the images into
one image B as follows
Initialize B:
B= I1
Recursive blending:
B = alpha B + (1-alpha) It , t=1,É,T
Use ImageJ to implement the above blending of multiple images. Use
the image sequence 100.tif,É, 110.tif to test your code. Try with different
alpha values= 0.1, 0.2, 0.5, 0.8. Show the resulting image in each case.
[Q3 – 15pts] Solve Exercise 6.10. Use ImageJ to implement
the horizontal blur filter and test your code on the image 100.tif