CS 194 Project 3: Fun with Frequencies and Gradients

Author: Ani Surumpudi

Overview

This project has two parts. The first is to combine two images together, by filtering the images into their low and high frequency components. The second part is to blend one image into the other, and using linear regression solver to make the transition as seamless as possible.

Part 1.1: Warmup

For this part we were supposed to pick our favorite blurry image and sharpen it using the unsharp masking technique. I picked an image of a random blurry girl and sharpend her.

Blurry Image

Sharpened Image

Part 1.2: Hybrid Images

For this part we had to combine two images by taking the high frequencies of one image and the low frequencies of the other and combining the results. If you look at the combination at a close distance, you see the image which was passed through the high pass filter. If you look at the combination from a far distance, you see the image which was passed through the low pass filter. Below are my personal images, and the corresponding analysis!

Trevor Noah

Stephen Colbert

Hybrid Image

Trevor Noah FFT

Trevor Noah Filtered FFT

Stephen Colbert FFT

Stephen Colbert Filtered FFT

Hybrid FFT

Part 1.3: Gaussian and Laplacian Stacks

For this part we were supposed to develop Guassian and Laplacian stacks for our hybrid image as well as the salvador dali picture. Below are those images...

Hybrid Gaussian Stack 1

Hybrid Gaussian Stack 2

Hybrid Gaussian Stack 3

Hybrid Gaussian Stack 4

Hybrid Gaussian Stack 5

Hybrid Laplacian Stack 1

Hybrid Laplacian Stack 2

Hybrid Laplacian Stack 3

Hybrid Laplacian Stack 4

Hybrid Laplacian Stack 5

Salvador Dali Gaussian Stack 1

Salvador Dali Gaussian Stack 2

Salvador Dali Gaussian Stack 3

Salvador Dali Gaussian Stack 4

Salvador Dali Gaussian Stack 5

Salvador Dali Laplacian Stack 1

Salvador Dali Laplacian Stack 2

Salvador Dali Laplacian Stack 3

Salvador Dali Laplacian Stack 4

Salvador Dali Laplacian Stack 5

Part 1.4: Multiresolution Blending

For this part, I blended a picture of an apple and orange. I also blended a picture of a lion and a male model. You can also see the corresponding gaussian and laplacian stacks.

Apple

Orange

Orapple

Lion

Male Model

Lion Model

Hybrid Gaussian Stack 1

Hybrid Gaussian Stack 2

Hybrid Gaussian Stack 3

Hybrid Gaussian Stack 4

Hybrid Gaussian Stack 5

Hybrid Laplacian Stack 1

Hybrid Laplacian Stack 2

Hybrid Laplacian Stack 3

Hybrid Laplacian Stack 4

Hybrid Laplacian Stack 5

Part 2

In part 2, I learned how to blend one part of an image onto another image. To make the transition seamless from one image to the other, we had to implement poisson blending. To do this, I created a mask around the source image. Then, I created a minimization problem to set the gradients from pixel to pixel of the new image to be as close to the source image. As a result we have our clean blended image!

Part 2.1: Toy Problem

For this part, I reconstructed the toy story image by anchoring the top left pixel from the source image to the new image. The new image should exactly match the source image.

Toy input image

Toy output image

Part 2.2: Multiresolution

In this part of the project I basically had to implement a multiresolution blending algorithm. I blended the penguin into the mountain background as well as a dessert background. As you can see, the penguin changes color in the dessert background to blend in better.

Mountain background

Penguin

Blended Image

Dessert background

Penguin

Blended Image 2