CS194-26 Project 3: Fun with Frequencies and Gradients!

Ian Lee

Overview

In this project we manipulated images in the frequency domain in order to create byhrid images and blended images. Thi is based on the fact that humans perceive the change in gradients really well.

1.1

Here we construct a blurry image by applying the gaussian filter to an image. Then we attempt to resharpen this blurry image by first running a high pass filter on the image and add the results to the blurred image.

Blurry Sharpened

1.2

In this part, we try to overlap two images by extrating high frequencies and low frequencies from the two images respectively. At a distance, only the low frequency (smooth) part of the signal can be seen. On the other hand, when inspecting closely, only the high frequency part of the image can be seen.

Statue of Liberty Statue of Mao
Statue of Lmao Statue of Maoberty

Fourier Analysis

We can see that the high pass image is dark in the middle which indicates the abscence of low frequencies. On the other hand, the low passed result shows an opposite effect. We can conclude that the higher frequencies in the hybrid image come from Mao

Mao High Passed Mao Liberty Low Passed Liberty Hybrid

Other Colored hybrids

We can see that the image with lower frequencies has a major effect on the color of the hybrid image. The colored lmao failed because the two statues are of different colors, no matter how close you look, the color of the statue of liberty won't fade away. Tigercat turned out the best.
Cloud Balloon Colored Lmao Tigercat

1.3

Here we just want to compute the gaussians stack and laplacians stack of the painting Lincoln and Gala and my own hybrid images

Lincoln and Gala
Gaussian stack, layer=5, sigma=10
Laplacian stack, layer=5, sigma=10
Gaussian stack, layer=5, sigma=3
Laplacian stack, layer=5, sigma=3
Gaussian stack, layer=5, sigma=3
Laplacian stack, layer=5, sigma=3

1.4

In this part, we want to blend two images seamlessly by multiresolutional blending. We use the laplacians stacks from two images and multiply them by gaussian stacks of two inverted masks respectively at each layer. We sum the results to obtain a blended image.

Apple Orange Oraple Example Mask
naive Aporanple Irregular Mask
Kiwi LV
Kiwi Vuitton Mask

Other images
NYC night evening day
Norway night & day

Ace vs Blackbeard

Since the original image is already splitted. I had to slice it in half and duplicate the other halves. Then with one image of fireball, and one image of black smoke ball, I used the binary mask to achieve a slight gradual change at the spline.

Melon LV

This is a failure case because the two images have dratically different colors. In this case, this method is not appropriate.

2.1

Reconstruct the image. By matching the gradients of the image and optimizing it against the pixel at the top left. This should allow us to recover the original image since it matches perfectly with the optimization conditions, aka loss is 0.

2.2

In this part, we use poisson blending algorithm to blend an object or texture from the source image into the target image. I used a similar method from the previous part. This time we will be optimizing using another formula

The first object tries to match the gradients of the source image, while the second aims to optimize the change in gradients at the edge of the mask between the source image and the target image.

Target Source

The background color of the two images, purple and black are obvious

Naive blend

Poisson blending

THUNDEROUS GAME

Other images
Dancing with Flames

This one kinda fails because of the gap in the middle of the target. Our poisson blending only takes in polyon source images. we can use multiresolutional blending or mixed gradients to fix this later

Sandguin
Snowmel
boat
monster hunter

Bells & Whistles

Both multiresolutional blending and mixed gradients methods work well

New target Source
New result New Mask
New result Using mixed gradients.