Assignment 2: Techniques of Image Analysis in CSE 190D (Spring 2013)

Purposes:

Gain familiarity and fluency with key techniques of image analysis.
 

Format:

You may turn in this assignment either electronically or as hardcopy (e.g., after preparing it with pen or pencil on paper). If you submit it electronically (via Catalyst), please prepare a document either in Word or PDF format. One option is to do the problems with pencil on paper, and then scan them to submit them electronically.
 

Due:

Wednesday, May 29 at 2:30 PM.
 

Problems:

  1. (Basic properties of the Fourier transform). By looking at the 2D Fourier transform of an image as another image, one can often discern certain structure in the original image. For example, in Lab 6, the rectangular white spots in the 2DFT of the distorted image of the UW campus corresponded to diagonal stripes of a certain wavelength and at a certain angle. Examine the image of the Mona Lisa's Fourier transform shown in Fig. 10.7b.
    • (a) How would you describe the shape of the light zone in the middle?
    • (b) Would you say that vertical spikes are stronger than the horizontal spikes, or are they about the same?
    • (c) What do these spikes in the 2DFT correspond to in the Mona Lisa image?
    • (d) What spatial frequency seems to be most strongly represented in the image?
    • (e) In Fig. 10.7c, we see a small square representing the portion of the 2DFT of the Mona Lisa that has not been set to zero prior to taking the inverse transform, and Fig. 10.7d shows the results of inverse-transforming this patch of the 2DFT. What would be the result of inverse transforming if, instead of this patch, we took the smallest possible non-zero patch: the pixel at the center of Fig. 10.7c? (Since there are actually 4 pixels at the center, assume we mean the one at (w/2, h/2), which is at the origin, after our translation by (w/2, h/2).) In other words, what would Fig. 10.7d look like in that case?
  2. (Basic properties of the Fourier transform, continued). Using the Python program on pp.242-243, compute the DFT of each of the following vectors. In each case, identify the strongest frequency component, giving its frequency and the square of its modulus. (You do not have to type in the Python program; you will be able to access it in GoPost.)
    [ 1,  1,  1,  1,  1,  1,  1,  1]
    [ 1, -1,  1, -1,  1, -1,  1, -1]
    [-1, -1, -1, -1,  1,  1,  1,  1]
    
  3. (Comparing images). Let's consider two different means of comparing images: the dot product and the Euclidean distance.
    • (a) Compute the dot product of images A and B below.
    • (b) Compute the Euclidean distance d(A, B) below.
    • (c) In what way is the dot product a good indication of the similarity between A and B?
    • (d) In what way might the dot product be a bad indication of the similarity between a pair of images?
    • (e) In what way is the Euclidean distance a good indication of the distance between A and B?
    • (f) In what way might the Euclidean distance be a poor indication of the distance between a pair of images?
    A:                     B:
    2   5   2   1          2   6   2   0
    0   6  -1   2          6  -1   2   0
    1   2   1   0          1   2   1   5
    
      
  4. (The Roberts cross operator for edge detection). Apply the Roberts cross operator (but do not bother with the square-root step) to the following image. Assume that any pixel outside the image area has value 0. Assume that the "origin" of the 2-by-2 patch used by the operator is in its lower-left corner, and that we are working in a Cartesian coordinate system with x increasing left-to-right and y increasing bottom-to-top.
    1   1   1   3
    1   1   3   3
    
  5. (The Sobel operator). Apply the Sobel edget detector to the same 4-by-2 image as in the previous problem. Again, do not bother with the square-root operations. Show the results as another 4-by-2 image.
  6. (Chain codes). Exercises 4, 5, and 6 on p.389.
  7. (Adjacency, Connected components and segmentation). Ex. 11 on p.390. Also, show an example of such an image.
  8. (Adjacency, Connected components and segmentation, continued). Ex. 13 on p.390.
  9. (Adjacency, Connected components and segmentation, continued). Compute a segmentation of the following image into connected regions, where a set of pixels is considered to be uniform provided the minimum and maximum of its pixel values differ by no more than 2. The resulting segmentation should be an image of the same size as the original, in which the pixels of the first region (scanning left-to-right, top-to-bottom) are numbered 0, the second region numbered 1, etc. Assume each region must be 4-connected.
    15  18  19  20  13
    17  15  11  19  14
    17  16  15  16  12
    12  15  12  13  13
    13  13  14  12  17
    
    Hint: The first three elements of the output array are shown here:
     0   1   1 ...
     .
     .
     .
    
  10. (Polar representations of lines and the Hough transform). Ex. 7 on p.389.
  11. (Polar representations of lines and the Hough transform, continued). Ex. 8 on p.389.
  12. (Morphological operations). Ex. 15 on pp.390-391.