Fun with Frequencies and Gradients

CS194-26, Project 3

Inan Husain



Part 1 Overview

This part of the project has some fun using low and high pass filters to create hybrid and blended images.

Part 1.1: Warmup

This part of the project simply involved adding the result of a high pass to the original image in order to make it appear sharper as shown in the picture of the campanile below.

Original image
Sharpened image with alpha=6

Part 1.2: Hybrid Images

This part of the project was accomplished by taking the low pass of one image and adding it to the high pass of another image. Below you can see an example of me mixing photos of Einstein and Marilyn Monroe, Derek and his cat Nutmeg, and a failed hybrid of Clinton and Trump.

Nutmeg and Derek + FFT Analysis

Derek
Nutmeg
Dernut
Fourier Transform of Nutmeg
Fourier Transform of Derek
Fourier Transform of filtered Nutmeg (high pass)
Fourier Transform of filtered Derek (low pass)
Fourier Transform of Hybrid image

The cool part about the hybrid image is that contains the structure of both the high and low pass images of the two different objects

Albert Einstein + Marilyn Monroe

Hillary Clinton + Donald Trump (Failure case)

I think this one fails because the subjects have too many structural similarities, resulting in much of Trump's face to become not apparent

Part 1.3: Gaussian and Laplacian Stacks

I have no idea why the laplacian looks like this for the hybrid image, but at least the Gaussian stack looks okay? I think this is because I am doing everything in color, but I'm not sure. The structure is more easily visibile in the Dali painting, where the Laplacian shows the harder borders, and the Gaussian reflects the Lincoln presence.

Hybrid Image

All white for unknown reasons
All white
All white
All white
All white

Dali Painting

Part 1.4: Multiresolution Blending (With Color!)

Below are my examples for blending. I have an example using the orange+apple with their gaussian masked input and their laplacian stacks. Again the laplacian stacks don't look that great, but I suspect this is due to the use of color. After that I have my own examples using Hilary and Trump as well as

The oraple!

The masked gaussian input
Laplacian stack added to the gaussian input

Boccer ball

Trumpton (using an irregular mask)

The mask

Part 2: Gradient domain fusion

So this part of the project got me involved in using the gradient domain to solve various objective functions via least squares optimization and various sparse matrix math in order to paste source images into target locations and successfully blend them in. The first part was a simple test to see if our optimization process worked on a sample image to see if we could use the same source and target image to ensure that the result is the same as our input.
The next part was then using a Laplacian mask to build a matrix which we could then solve to blend the image in.

Part 2.1: Toy problem

Some weird pixelation, but overall good results from the input to the output

Part 2.2: Poisson blending

Below is the example given to us with the penguin and ice background

Skyshark!

My favorite is sky + shark, first showing the shark (source), then sky (target), the shark directly pasted on without blending, and then the final result.

Rubber ducky onto a bath tub

Beached whale (failure case)

Pretty sure this doesn't work because I'm taking an image of the whale surrounded by blue onto a very sandy colored beach, and it turns into a very awesome color.

Comparison to previous blend

Here I've blended Hilary Clinton and Donald Trump again, using the same mask as I did before, and the results look a lot better this team. The hard seams are gone, and we've got a much smoother result. I think this is simply because it looks more natural when the poisson blending smoothes out the color for human faces. I think Laplacian stack blending works better for when we want a hard transition, like we saw with the oraple.

Most important thing I learned was I need to start projects earlier...