Due: Tuesday night, Nov 1, 2011 (before 9am, Wednesday MORNING)
This assignment will provide hands on experience using convolution for image filtering. We will experiment with making images blurry and detecting edges at different scales.
Grad students will also learn a trick to speed up convolution when the filter is "separable".
You can do this assignment in any language you like, with either Matlab or C/C++ together with the vision lab support code being the two recommended choices. Python might be up to the task also, but you will have to sort out numerical library support on your own (or as a group). Regardless of the language you choose, please head the "works out of the box" requirement as described in "what to hand in."
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 6 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 hand in. You can assume that the grader will run the program in your turnin directory.
To keep things simple, we will focus on black and white (gray level) images 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 display.
The input image for this assignment is /cs/www/classes/cs477/fall11/ua_cs_only/assignments/climber.tiff .
You can use builtin or library routine(s) for convolution in C or Matlab. Or you may prefer to implement convolution yourself to help make sure you really understand it. (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.
Matlab users: This is just a
matter of calling conv2 with different parameters.
KJB library users: See
x_convolve_matrix and y_convolve_matrix.
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). (+) Put your answers into your README.txt file.
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 part, you will have to turn in additional material in your README file.
If you are working in C/C++ or any other compiled language: You should provide a Makefile that builds a program named hw5, as well as the code. The grader will type:
make ./hw5You can also hand in hw5-pre-compiled which is an executable pre-built version that can be consulted if there are problems with make. However, note that the grader has limited time to figure out what is broken with your build.
If you are working in any other interpreted/scripting language: Hand in a script named hw5 and any supporting files. The grader will type:
./hw5