CS 143 Project 1

Hybrid Images

Will Allen (weallen)

Methods


To generate hybrid images, we used the algorithm of Olivia, et al., from their 2006 SIGGRAPH paper with slight modifications. The algorithm takes the high frequencies from one image and the low frequencies from another, up to some cutoff, and then composites the high and low frequencies to produce the final hybrid image. This hybrid image can look like two different things depending on the viewer's distance from the image.

Algorithm

Generally, the hybrid images algorithm works by creating a Gaussian and a Laplacian pyramid for each image, combining the two Laplacian pyramids, and then attempting to reconstruct one of the images using the merged Laplacian pyramid.

For each of the two images we first generated a Gaussian and a Laplacian pyramid of size N.

  1. Blur the source image I with a Gaussian filter to get G(1)
  2. Make the first level of the Laplacian filter L(1) = I - G(1)
  3. For i = 2:N:
    1. Make the ith Gaussian G(i) = Blur(G(i-1)
    2. Make the ith Laplacian L(i) = G(i-1) - G(i)

Unlike a standard Gaussian pyramid, we did not resize the images at each iteration, as this produced better empirical results. This resizing was implemented, but not used for the images below.

Next, to get a frequency cutoff J, we merged the first J levels of the Laplacian pyramid of the image with the high frequencies we want with the N-J levels of the pyramid of the image with the low frequencies we want.

Finally, we use this merged Laplacian pyramid to reconstruct the hybrid image, where G(i) is the ith level of the low-frequency image's pyramid, and L(i) is the ith level of the merged Laplacian pyramid:

  1. Set M(N) = G(N) + L(N)
  2. For i=(N-1):-1:1:
    1. Make the ith merged image M(i) = G(i+1) + L(i)
Taking M(1), the top image of this pyramid, gives us the hybrid image.

Results


The hybrid image algorithm we used appeared to replicate the results of Olivia, et al. fairly well. However, there are many parameters to the algorithm (image alignment, window size and bandwidth of the smoothing Gaussian, number of layers in the pyramid) that it was difficult to replicate their results exactly. Using color appeared to improve the low frequency component (for example, with the rhino). However, the algorithm also worked well in black and white.

Extra image: Keith Richards