$30
ECE4580 Homework #9
Problem 1. (25 pts) Consider the template matching problem from earlier, but rather than perform gradient descent
of the nonlinear energy, utilize the quadratic approximation. The quadratic approximation leads to an iterative optimization problem, meaning that multiple iterations are needed much like gradient descent, however the path taken
does not necessarily match that of gradient descent. If possible, consider the same questions as before with this same
algorithm, and compare how the linear version fares. In particular, how quickly/slowly does it converge? Is the basin
of attraction as big, or is it smaller? Use the same zip-file as before.
The gradient function has been provided to you as gradTempMatchQA.m so all you have to do is work out the
gradient descent optimization. Turn in the program so that it works for one of the cases. It is OK to have output to
figures since the output is part of the original code stub (but do not open anything else beyond what the code stub
already does). Turn in two example scripts as before findTemplateQA.m and loseTemplateQA.m, the first of
which works and the second of which doesn’t work but you thought it should.
Problem 2. (35 pts) Implement the Laplacian smoothing (partial) differential equation derived in class. This partial differential equation is also called the isotropic diffusion equation or the heat equation (so many names!). The
homework stub is called isodiffuse.m and should be in the zip-file.
1. Apply the algorithm to the image to diffuse, and to some of the other images in the homework Matlab file. Once
you are confident that it works, you’re done. I’ll run the function on my own test data and compare.
2. Now, the heat equation is supposed to look like Gaussian smoothing due to the link between the motion of
particles and Gaussian motion. In particular, the relationship between the amount of time an image is smoothed
and the equivalent standard deviation of Gaussian smoothing is σ =
√
2t. Show that if you smooth for a total
time of t = k · ∆t, then the image resembles a Gaussian smoothing image with σ =
√
2t.
To do this, use the blurme image from the previous homework and apply the heat equation to it for times
0.25, 0.5, 0.75, 1, 1.5, 2 and show that it gets closer to σ = 2 as time progresses. Hopefully it does so! A good
way to test how close the images are is to take the difference between the heat smoothed and the Gaussian
smoothed image then use the sumsqr, which computes the sum of squared values of the argument and returns
a scalar. The function sumsqr is a great way to compute the error energy that we’ve been using in class. The
error should get smaller as the diffusion gets closer in time to 2. Much luck.
3. In class, we also discussed how the image would tend to the average image value. Compute the average value,
and show that this value remains roughly constant as the smoothing progresses (plot the average values versus
the number of iterations). If you run it for a long time, you should see the image slowly becoming one uniform
blob, so it does tend to the average value (it probably takes longer than you really care if you have an image that
starts of non-smooth).
Problem 3. (30 pts) Each group has another baby step to perform for the following Thursday. If you would like to
incorporate it into the presentation, that’s fine.
As usual, your homework is to complete that baby step and report on it. You should roughly reiterate the baby
step, discuss how it was accomplished, demonstrate through images (if possible) functionality, then briefly note any
observations (including cases where it may not work so faithfully, or what is needed to work very well). If your
project involves video and cannot be demonstrated with still images, then upload to Facebook or present it to your
group contact by Friday.
Problem 4. (50 pts) For the past couple of weeks, you’ve all been exploring some simple algorithms that might, or
in the end might not, have utility to your group’s challenge project. It’s time to let the class know about your defined
project, what you’ve learned so far, and where you want to take the project. Naturally, then this homework problem is
about the presentation you will cobble together to let the class know these things.
Prepare a 10 minute (roughly) presentation on your challenge project. What I would like to see in the presentation
are the following:
1
1. A problem statement. Let the class know what you are working on. Define any special processes that might be
needed to collect video or imagery.
2. If you have an idea of the procedure or algorithm flow that will be needed to accomplish the task, please present.
Maybe a block diagram with each block being a procedure or algorithm. Basically the processing pipeline.
3. What steps in that processing pipeline have been explored. Given a short description of what was computed and
what it did. Anything else you want to communicate about the project that you’ve learned or been learning. If
you have some nice results, you can present these.
4. What are some major things you think you need to accomplish to finish up.
To reiterate, you are presenting to the class just to get them to know your project and what you’ve been learning to
make it happen. I, and the group project contacts, have been trying to move you all in a positive direction. For some
groups it is easier than others based on me and my students’ expertise. It’s a learning process for us all.
Please make sure to keep the presentation to about 10 minutes. The best way is to limit yourself to about 6-7
slides and focus on communicating their contents effectively. It is usually tough to have everyone go up and prep their
presentations on their own computers, so the procedure will be as follows: (a) whatever method you use to create the
presentation, export your document to a pdf, (b) upload it to the t-square homeworks sections for one student, and (c)
any videos should be uploaded and placed on facebook. We will use the in class computer (hopefully it is working!)
for the presentations and harness the internet access for the videos.
I will assess your progress in terms of the baby steps up to this homework, taking into account what I and the group
contact have been asking for, as well as what is in the presentation. If you feel that the collection of your contributed
baby steps does not fully communicate what you have done, you are welcome to submit a summary document that
you feel reflects your group efforts to date. Please submit the labor division in the document so that I can fairly assess
each individual’s contribution. Make sure to title is GroupXX Midterm Summary or something like that.
2