Fun with Frequencies and Gradients!

Olivia Koshy

cs194-26-afs

In this project, we play around with two different transformations of images for a variety of different ends.

Part 1: Frequency Domain

For this project we used tricks with frequency domain to apply different effects to our images. We first created an image that was sharpened, then knowing our filter used, we can use this to create a hybrid image by combining our different filters on two images. Our last part was creating Gaussian and Laplacian stacks which we then used for blending an image.

1.1 Warmup: Image Sharpening

Original Image (Greyscale)
Image Sharpened
Original image vs sharpened image.

1.2 Hybrid Images

Hybrid images are a development by Olivia et. al. where we can see how to use different frequency components to blend two images together.

Pup or Dog?

Pup
Dog
Puppy&&&Dog

Wolf and Pupper

Wolf
Puppy
Wolfyyyy

Man or Cartoon?

Man
Cartoon
Mantooooonnn

Fourier Analysis of our Mantooooonnn

Derek and Nutmeg

And we also have our catmannnnnnn

1.3

Gaussian and Laplacian Stacks

Mona Lisa

Gaussian 1

Gaussian 2

Lap 1

Gaussian 3

Lap 2

Gaussian 4

Lap 3

Gaussian 5

Lap 4

Lincoln

Gaussian 1

Gaussian 2

Lap 1

Gaussian 3

Lap 2

Gaussian 4

Lap 3

Gaussian 5

Lap 4

Multiresolution Blending

Couldn't get this one working :(

Part 2: Gradient Domain

Toy Problem

As a test of this idea, first we run a toy implementation where we calculate the gradients of each pixel with respect to the pixel then we use this to get coefficients and set this up as a least squares problem.
Toy Image
Reconstructed

Poisson Blending

In this part we use the ideas from part 1 except extend it. Now there are a number of other gradients to take into account, namely each pixels neighbors. We also have special constraints at the border where we want the pixel to be as close as possible to the target image to "blend" nicely. We set up these constraints as coefficients and solve.

2.2

Poisson Blending

Source

Target

Blended Image

Copied Image

Target

Target

Blended: Here we applied the same idea as before by forming this into a least squares question where we had the coefficients for the matrix from our problem statment setup. Unfortunately I had a bug with my colored version :( )