CS 194-26: Image Manipulation and Computational Photography

Project Three - Fun with Frequencies!

Giulio Zhou

Part Zero - Unsharp Mask

For the first part of the project, I blurred images and subtracted them from the original image to create an unsharp mask. This was then used to sharpen images as follows.

Original Image

Blurred Image, sigma = 3

Unsharp Mask
Here are the results of adding this mask to the original image using different weights.

alpha = 0

alpha = 0.2

alpha = 0.5

alpha = 1

alpha = 2

alpha = 5

alpha = 10

alpha = 50
As we can see, adding back in the high frequencies help sharpen the image, but leads to loss of detail in the regions of lower frequency.

Part One - Hybrid Images

In the next part of the project, I created hybrid images by combining a low-pass filtered version of one image with a high-pass filtered version of another.

Derek

Blurred Derek

Derek's Spectrum

Nutmeg

High-pass Filtered Nutmeg

Nutmeg's Spectrum

Blended Image

Blended Image Spectrum
Up close, we can see an image of Nutmeg but from afar, Derek's face becomes more prominent. From the Fourier transform, we notice that Derek's blurred image had the majority of its signals clustered around the center (with some artifacts due to the horizontal line in the image). Additionally, Nutmeg's high-pass filtered image contained many signals far from the center. Averaging the two, we get our final result.

Prius

Ferrari

If you pretend hard enough, you just might find yourself driving a Ferrari
Generally speaking, it helped to align images of animals/people by their eyes and choose images with similar lighting conditions. Here's a failure case. The backgrounds of the two images were too different and Kanye's white jacket contrasted too much with Beethoven's attire.

Kanye

Beethoven

Attempted Kanyethoven

Part Two - Gaussian and Laplacian Stacks

In Part Two, our goal was to develop Gaussian and Laplacian stacks to use for visualization of the high and low frequencies of images. A stack functions similarly to a pyramid, with the difference being that the image size does not change with each level. Instead, our images are convolved with filters of increasing size. As an example, I began by running this method on the Dali painting we covered in class.

sigma = 1

sigma = 2

sigma = 4

sigma = 8

sigma = 16

sigma = 32
Notice how the image of Abraham Lincoln becomes more and more visible as we removed the lower frequencies. Conversely, the image of Gala becomes more prominent as we remove the higher frequencies.

sigma = 1

sigma = 2

sigma = 4

sigma = 8

sigma = 16

sigma = 32
Let's now try applying our Gaussian and Laplacian stacks to our previously generated hybrid images.

sigma = 1

sigma = 2

sigma = 4

sigma = 8

sigma = 16

sigma = 32

sigma = 1

sigma = 2

sigma = 4

sigma = 8

sigma = 16

sigma = 32

Part Three - Multiresolution Blending

In Part Three, I got the chance to use my Gaussian and Laplacian pyramids to perform multiresolution blending. I first tried out the orange and apple example that we were provided and got the following results.

sigma = 8

sigma = 16

sigma = 32
As we can see, the two images blend together fairly well, likely because their backgrounds are identical. Shown below are the Laplacian stacks of the apple and orange, and the Gaussian stack of the mask used to blend them.

sigma = 1

sigma = 2

sigma = 4

sigma = 8

sigma = 16

sigma = 32

sigma = 1

sigma = 2

sigma = 4

sigma = 8

sigma = 16

sigma = 32

sigma = 1

sigma = 2

sigma = 4

sigma = 8

sigma = 16

sigma = 32

sigma = 1

sigma = 2

sigma = 4

sigma = 8

sigma = 16

sigma = 32

sigma = 1

sigma = 2

sigma = 4

sigma = 8

sigma = 16

sigma = 32

sigma = 1

sigma = 2

sigma = 4

sigma = 8

sigma = 16

sigma = 32

sigma = 1

sigma = 2

sigma = 4

sigma = 8

sigma = 16

sigma = 32

sigma = 1

sigma = 2

sigma = 4

sigma = 8

sigma = 16

sigma = 32

sigma = 1

sigma = 2

sigma = 4

sigma = 8

sigma = 16

sigma = 32
While my image blends all turned out decently well, I noticed they had a few things in common. All of my images had a similar sense of perspective as well as similar backgrounds. If I were to start blending images with high contrast backgrounds or imperfect subject alignment, I would expect to start seeing some bizarre results.

Bells and Whistles

I did all of my parts in color from the beginning since I felt it looked much better.

What I Learned

This homework really helped me understand the idea of band-pass filters on 2-dimensional images. I had a lot of fun playing around with effects and always find the it fascinating how much signal processing influences our daily lives.