CS194-26: Image Manipulation and Computational Photography Project 3

Fun with Frequencies and Gradients!

By Alex Kassil (cs194-26-aam)

Part 1: Frequency Domain

By playing around with images and image frequencies, I was able to sharpen images, lay higher frequencies over lower frequencies combine two images in one, and blend two images into a seamless one.

Part 1.1 Sharpening

Here's the 5x5 Guassian Kernel.

And here's Lenna.

So here we have blurred Lenna.

And here we have Lenna minus Blurred Lenna.

You can clearly see how the edges are highlighted around the face, hair, sholder, hat, etc. So now we will add back 1, 2, 3, 4, 5, and 6 of this difference back to Lenna to sharpen our image.

By comparing the original to the add 6 sharpened one you can see the difference clearly.

Next we will see a picture of DDay, and the edge after subtracting an even blurrier photo from DDay.

Now time to sharpen! Here again I add 1 to 6 of the edge back to the original.

By comparing the original to the add 6 sharpened one you can see the difference clearly.

Both the water and soldiers is drastically sharpened because of this technique.

Lastly, I decided to sharpen a photo I took with my pinhole camera! Here's me, me blurred by the 5x5 guassian, and the difference between the two!

Now time to sharpen! Here again I add 1 to 6 of the edge back to the original.

By comparing the original to the add 6 sharpened one you can see the difference clearly.

Here's a funny failure case when I tried to just sharpen with no colors

I had a lot of fun becoming friends with every pixel! I had so many images on my Desktop as I tinkered away!

Part 1.2: Hybrid Images

By blending together high frequencies of one image and low frequencies of another, I could have one photo contain two! And depending on if you look at it close up or far away (high res or low res), you see one image versus the other.

Here's Derek, nutmeg, dull Derek, sharp nutmeg, the FFT of dull Derek, the FFT of sharp nutmeg, and the hybrid photo.

Here's sharp Derek, dull nutmeg, the FFT of sharp Derek, the FFT of dull nutmeg, and the hybrid photo.

Up next is Superman and Clark Kent. Clark Kent is low frequencies and Superman is high frequencies.

Here was my favorite example, where I mixed charmander's higher frequencies with charizard's lower frequencies.

Here's a pretty funny failure, mainly due to resizing.

This part was super fun! I really enjoyed providing my own photos and combining photos in a fun way.

Part 1.3: Guassian and Laplacian Stacks

Why can we have two images combined into one by taking higher and lower frequencies? Let's look at bands of frequencies, or a Guassian Stack, and build a Laplacian Stack to understand why!

Starting with Lenna, here are both the black and white and colored Stacks!

Up next, we have the painting of Lincoln and Gala.

Up next, we have the painting of the Mona Lisa.

Finally, we have charmander, charizard, superman, and clark kent!

Here you can clearly see where the lower/higher frequencies come from for the above hybrid photos! This part was super fun, and I really enjoyed generating so many images!

Part 1.4: Multiresolution Blending

Here we see the orange, the apple

Here I just do the alpha (1-alpha) blend and have the blended region be increasing percents: 5%, 10%, 25%, 50%, 75%, and 100%

Here I show the laplacian stack with different blurs at different levels, and the final orapple

Now we try to combine charmander and pikachu!

Here's chuirtle and squirmander! As well as their laplacian stacks

Here's a failure case with pikachu!

Making these combined photos was a blast! And they turned out not half bad.

Part 2: Gradient Domain Fushion

Part 2.1 Toy Problem

I was able to recover the toy problem based on the gradients and one pixel!

Orignal

DX

DY

Edges

Recovered