Due: Thursday night, March 27, 2008.
It is probably a bit easier in Matlab, but doing some of the assignments in C may prove to be a useful exercise. If you think that vision research or programming may be in your future, you might want to consider doing some of the assignments in C/C++. If you are stretched for time, and like Matlab, you may want to stick to Matlab. Your choice!
Information for those working in C/C++.     (Updated for this assignment).
Those working in Matlab may want to look at the function: conv2
This assignment has 7 parts, of which 5 are required for undergrads.
To simplify grading, you should hard code the file names in the version of your program that you give to the TA. You can assume that the TA will run the program in your turnin directory. Please give the TA sufficient information in the README to reproduce your results.
To keep things simple, we will focus on black and white (gray level) images (except the last question which is required for grads only). This means that an image is basically a matrix. Thus both in Matlab and in C it likely easiest to get the image into a matrix, work on the matrix, and then convert the matrix back to an image for IO.
The input image for this assignment is /cs/www/classes/cs477/spring08/ua_cs_only/assignments/climber.tiff .
You can use provided routine(s) for convolution in C or Matlab. Or you may prefer to implement convolution yourself. (A naive implementation in Matlab will run much slower than the built in function--you should understand why).
A function is said to be separable (in x and y), if f(x,y)=g(x)h(y), If this is the case, then convolution with f(x,y) can be implemented as a 1D convolution by g(x) followed by a 1D convolution by h(y). Re-implement the smoothing in (3) using this approach. Verify for yourself that this gives roughly the same result as before.
Do you expect any speed difference? Why? Do you see any speed difference? (You may want to put the convolution in a loop, or use a bigger sigma and image to test for time differences).
Matlab users: This is just a
matter of calling conv2 with different parameters.
KJB library users: See
x_convolve_matrix and y_convolve_matrix.
Consider the case that you have two color images of the exact same scene taken under different illuminants. Suppose that you want to find the best diagonal transformation between them in the least squares sense. Derive a formula for that transformation.
To hand in the above, use the turnin program available on lectura (turnin key is cs477_hw5). You may want to hand in a single program that displays the images for the first five parts. For the last two (grad) parts, you will have to turn in additional material. PDF is likely the best choice. Don't forget to give the TA a guide to your submission in the README.