CS194-26 Fall 2016 Project 3

Fun With Frequencies

Imran Jami

Project Description

In this project we learned to explore the different applications we can take with Gaussian and Laplacian formulas for image processing. There is a lot of cool stuff I did by manipulating the stacks of each image to form hybrid images and blend images together.

In the second part of this project, we learned how to use Poisson Blending to blend a smaller subject into a larger frame by blending the edges of each image at hand. This is really cool, because you can make really interesting images with this technique at hand.

Part 1.1 Image Sharpening

For this part of the project, I implemented an image sharpening algorithm. The basic intuition behind this was to take the original image, and calculate its gaussian = G. Once you have the image's G, we can simply sharpen the image by subtracting the gaussian (multiplied by a scalar) from the original image to obtain sharper version of the image.

Sharper Skyline

cathedral

Parrot

cathedral

Part 1.2 Hybrid Images

My technique behind this part of the project followed the paper we read in class about hybrid images. Basically, we take two images and compute the low pass filter on one and high pass filter on the other. Once we have obtained the two corresponding images, we combine the two in order to create a hybrid image. This hybrid image that results will look like the low pass filtered image from far away, but resemble more of the high pass filtered image up close.

Below is the example from the sample images we were given, along with the FFT of each. (low pass multiplier = 1.0, high pass multiplier = 0.7, low res sigma = 10, high res sigma = 5)

Hybrid Image

High Pass Image

Low Pass Image

Hybrid FFT

High Pass FFT

Low Pass FFT

Here is an interesting example I created by taking two renditions of the Mona Lisa and combining them. From far away mona looks like she's frowning and from close up we can see her smile-- just like the real painting!

Hybrid Image

High Pass Image

Low Pass Image

Hybrid FFT

High Pass FFT

Low Pass FFT

Here is an example of a failed image put together. I think that the features of both people are too different for us to analyze that it is a different person up close.

2 hour shook and Smitty combined

For the bells n whistles part, I decided that taking the color from the burry photo was definitely the way to go when combining the images.

Part 1.3 Gaussian and Laplacian Stacks

For this part I simply took the Gaussain and Laplacian of each image 5 times. Here are some of my results:

Gala Gaussian

Gala Laplacian

Derekcat Gaussian

Gala Laplacian

Part 1.4 Multiresolution Blending

To implement this part of the project, we had to generate laplacian stacks for two images that we wanted to blend, and generate a gaussian stack for a mask of the two images. Then, we use the mask as a multiplier of the two laplacian stacks and combine both stacks into one and take the sum of all of the images in the stack. The result of this is an evenly blended combination of both images along the specified mask. Here are a few results:

Orapple

Apple

Orange

Pradabix

Pramod

Weetabix

Fifi Smile

Fifi

Smit

Part 2.1 Toy Problem

This part of the project had to do with taking a sample image and reconstructing the image from scratch using the image's x and y gradients. This was very interesting to do, and required an understanding of gradient domain processing. To accomplish this, I followed the algorithm described by the project spec to compute the x and y gradients and then use all the gradients + 1 pixel intensity to reconstruct the image.

Below is an example of what resulted from my program, as you can see the image is an exact copy of the input. We solved the optimization as a least squares problem using numpy, and then reshaped the corresponding vector to the original image shape that was passed in to reconstruct the original image.

Original

Reconstucted Image

Website design template from https://inst.eecs.berkeley.edu/~cs194-26/fa16/upload/files/proj1/cs194-26-aao/#impl