Assignments
Here is a PDF file with Assignment 4.
    Face images for the assignment are in this zip file: yaleBfaces.zip.
    Here is some Matlab code to read in the input images: getAmatrix.m. The function getAmatrix accepts exactly two arguments:
- If you call A = getAmatrix(i, j), columns of the output matrix A are the vectorized images of person j in subset i.
- If you call A = getAmatrix(i, []), columns of the output matrix A are the vectorized images of all persons in subset i.
- If you call A = getAmatrix([], j), columns of the output matrix A are the vectorized images of person j across all subsets.
- If you call A = getAmatrix([],[]), columns of the output matrix A are the vectorized images of all persons across all subsets.
If you wish, you can write your own Matlab function to perform this task. In fact, you are encouraged to do so. Also, it is possible to write a much smaller code to achieve the same effect using Matlab's UI building support. Try to write it!
Turn-in: A hard-copy of the solutions, which contains the write-up and all your tables, code and figures. Due Monday, June 12, 6:00 PM.
                 E-mail a zip file (named your_name.zip/tar/tgz/....) of your code and figures to the TA, with the subject line "CSE 152 Assignment 4". Due Sunday, June 11, 6:00 PM.
If you are writing the hardcopy electronically (PDF or Word), you can e-mail it to the TA if you don't want to make the trip to the CSE building and turn it in. Ensure that all the code and figures are included at appropriate places if you choose this option to turn in your "hard-copy".
Here is a PDF file with Assignment 3.
    Test images for the assignment are blocks1.gif , blocks2.gif, desk1.gif, desk2.gif, tsukuba-l.png and tsukuba-r.png.
    Code that you might need to use: clickPoints.m , drawLine.m.
Turn-in: A hard-copy of the solutions, which contains the write-up and all your code and figures. Due Tuesday, May 30, in class.
                 E-mail a zip file (named your_name.zip/tar/tgz/....) of your code and figures to the TA, with the subject line "CSE 152 Assignment 3". Due Tuesday, May 30, 11:00 AM.
Here is a PDF file with Assignment 2.
    Test images for the assignment are figure1.png , hole.png, fingerprint.jpg, components1.png, components2.png and coins.png.
    Avoid loops in Matlab!
Connected Component Labeling: Many of you have had problems with recursion limits. Here are some alternatives:
- Do connected component counting for a much smaller image. Say, an image reduced to one-fourth the size in each dimension. In Matlab, you can do: imresize(image, 0.25, 'bilinear'). But be careful that the morphological operation you perform for separating out the coins must be on the true size image.
- Also, increase the recursion limit in Matlab. Use set(0, 'recursionlimit', limitnumber), where limitnumber is, say, 1000.
Alternatively, use the following code, explore.m for connected component counting. It emulates a stack in Matlab. Use this code only as a last resort as you might lose some credit (say, 2 points) for using this.
What Matlab functions can you use: This should be fairly obvious. You are not expected to use Matlab's in-built erosion function. Follow the description in the question, binarize your images, construct your structuring elements and write code to perform erosion (or other operation) by comparing all pixel's neighborhoods to the structuring element. However, you can (and should) use any filtering operations in Matlab to avoid looping over all the individual pixels. See lecture notes on filtering for inspiration on what Matlab operation is helpful here.
Dealing with "corner cases": If you have caught on with filtering operations in Matlab, probably you do not need this. But in case you do, you can pad your n x n images on all sides with backgound pixels to get, say, an (n+3) x (n+3) image and then apply your morphological operation to this larger image.
Turn-in: A hard-copy of the solutions, with answers to any questions asked, Matlab code and figures. Due Tuesday, May 09, in class.
                 E-mail a zip file (named your_name.zip/tar/tgz/....) of your Matlab code and figures to the TA, with the subject line "CSE 152 Assignment 2". Due Tuesday, May 09, 11:00 AM.
Here is a PDF file with Assignment 1.
    Test images for the assignment are rectangles.jpg , circles.jpg and gradients.jpg.
    Turn-in: A hard-copy of the solutions, with answers to any questions asked, Matlab code and figures. Due Thursday, April 27, in class.
                    E-mail a zip file of your Matlab code and figures to the TA, with the subject line "CSE 152 Assignment 1". Due Thursday, April 27, 11:00 AM.
Solution to Assignment 1. Solution to Question 2 will be included after Assignment 2 is turned in.
Here is a PDF file with Assignment 0, a description of what to turn in and a tutorial introduction to Matlab.
    Test image for the assignment is here.
Last updated May 20, 2006.