CS 7321 Winter 1998

PS#3 Solutions by Rob Orr

Multiresolution Images and Splining



Index


How I solved it

  1. First I read in the images and created the Gaussian pyramids. Creating the Gaussian pyramids requires:
    1. create a temporary images that is padded by two extra rows of pixels all around
    2. center the original image in teh expanded template
    3. fill extra rows in by using formula on the paper (g(-1) = 2*g(0) - g(1), g(-2) = 2*g(0)-g(2))
    4. convolve expanded image by 5x5 filter; this can be done seperably in the x and y directions by convolving in each direction with the 1x5 filter [ 0.05 0.25 0.40 0.25 0.05].
    5. delete even numbered rows and columns and return the resulting image
    6. This process is repeated until the resulting image is 1x1. It is also repeated for all 3 color channels and for both original images.
  2. Then I created the Laplacian pyramids which requires:
    1. for each level of the pyramid, subtract the expanded Gaussian image from the next level "up" the pyramid from the current level Gaussian; the resulting image is the Laplacian
    2. expand() simply interpolates between pixels by running the seperable 5x5 filter over the image after it has been expanded by adding zero-filled rows and columns between the existing pixels
    3. Again, this process is repeated until the resulting image is 1x1; also repeated for all color channels and both original images.
  3. To create the splined image, I simply glued the Laplacian images together at each level, and summed them.
    1. At each level of the pyramid (and for each color channel), one half of each Laplacian image (one-half left hand, one-half right hand) and joined and a new images is created. At the seam, the pixels are averaged from each image.
    2. Start at the highest level of the pyramid (1x1 image). This image is expanded and is added to the spliced Laplacian from the next lower level in the pyramid. Repeat until you reach the lowest level.
    3. I combined all the color channels together in one image and scaled the image so that there were no out-of-bounds values.

to TOP


Assumptions and Weaknesses

I made the following assumptions

  1. The original images would be of size ((2^N)+1) X ((2^N)+1)
  2. The seam where the images should be joined would occur at exactly halfway across the original images
  3. The seam should be vertical and should extend from the top of the images to the bottom
  4. The textures of the images would not vary greatly and averaging only on the seam would be satisfactory

I think the major weakness of my solutions are:

  1. It does not accomodate arbitrary size images
  2. It does not allow for arbitrarily joining the images (at any place and along any curve)
  3. It does not do averaging over more than one seam pixel; larger texture differences are not dealt with very well

to TOP


Improvements and Possible Future Work

I think that this can be improved by doing the following

to TOP


Results

lefthand

Figure 1a: This is the first image. It's my left hand.

Image 2

Figure 1b: This is my second image. It's my right hand.

Figure 2a: Viola! All fingers!

Figure 2b: And of course, all thumbs.

Figure 3a-j: The Gaussian pyramid for the left hand images.

Figure 4a-j: The thresholded Laplacian pyramid for the left hand images:

to TOP


What I Learned from This Assignment

to TOP


Source Code